0021434: Boolean operations generate a shape with big vertex tolerance.

This commit is contained in:
jfa 2012-02-20 09:30:57 +00:00
parent 3e767d761d
commit a292cd4a4d
49 changed files with 1797 additions and 1252 deletions

View File

@ -52,7 +52,7 @@ is
WarningStatus (me) WarningStatus (me)
returns Integer from Standard; returns Integer from Standard;
ComputeInternalShapes(me : in out; theFlag : Boolean from Standard) ComputeInternalShapes(me : in out; theFlag : Boolean from Standard);
---Purpose: Allows to omit of creation of internal shapes (manifold topology). ---Purpose: Allows to omit of creation of internal shapes (manifold topology).
-- Needed for the SALOME/TRIPOLI module. -- Needed for the SALOME/TRIPOLI module.

View File

@ -18,87 +18,90 @@
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-- --
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: ModGlue_BuilderArea.cdl -- File: ModGlue_BuilderArea.cdl
-- Created: -- Author: Peter KURNEV
-- Author: Peter KURNEV
--
deferred class BuilderArea from GEOMAlgo
inherits Algo from GEOMAlgo
---Purpose: The root class for algorithms to build
-- faces/solids from set of edges/faces
uses deferred class BuilderArea from GEOMAlgo
inherits Algo from GEOMAlgo
---Purpose: The root class for algorithms to build
-- faces/solids from set of edges/faces
uses
Shape from TopoDS, Shape from TopoDS,
ListOfShape from TopTools, ListOfShape from TopTools,
MapOfOrientedShape from TopTools, MapOfOrientedShape from TopTools,
Context from IntTools, Context from IntTools
PContext from IntTools
--raises --raises
is is
Initialize Initialize
---Purpose: Empty constructor ---Purpose: Empty constructor
returns BuilderArea from GEOMAlgo; returns BuilderArea from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();" ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();"
SetContext(me:out;
theContext:Context from IntTools);
---Purpose: Sets cashed geometrical tools
SetShapes(me:out;
theLS:ListOfShape from TopTools);
---Purpose: Sets edges/faces to process
Shapes(me)
---Purpose: Returns edges/faces to process
returns ListOfShape from TopTools;
---C++: return const &
Loops(me)
---Purpose: Returns wires/shells that have been built
returns ListOfShape from TopTools;
---C++: return const &
Areas(me)
---Purpose: Returns faces/solids that have been built
returns ListOfShape from TopTools;
---C++: return const &
PerformShapesToAvoid(me:out)
---Purpose: Collect the edges/faces that
-- a) are internal
-- b) are the same and have different orientation
is virtual protected;
PerformLoops(me:out)
---Purpose: Build draft faces/shells
-- a)myLoops - draft faces/shells that consist of
-- boundary edges/faces
-- b)myLoopsInternal - draft faces/shells that contains
-- inner edges/faces
is virtual protected;
PerformAreas(me:out)
---Purpose: Build draft faces/solids that contains boundary faces
is virtual protected;
PerformInternalShapes(me:out) SetContext(me:out;
---Purpose: Build finalized faces/solids with internal wires/shells theContext:Context from IntTools);
is virtual protected; ---Purpose: Sets cashed geometrical tools
fields Context(me)
myShapes : ListOfShape from TopTools is protected; returns Context from IntTools;
myLoops : ListOfShape from TopTools is protected; ---Purpose: Returns cashed geometrical tools
---C++: return const &
SetShapes(me:out;
theLS:ListOfShape from TopTools);
---Purpose: Sets edges/faces to process
Shapes(me)
---Purpose: Returns edges/faces to process
returns ListOfShape from TopTools;
---C++: return const &
Loops(me)
---Purpose: Returns wires/shells that have been built
returns ListOfShape from TopTools;
---C++: return const &
Areas(me)
---Purpose: Returns faces/solids that have been built
returns ListOfShape from TopTools;
---C++: return const &
Perform(me:out)
is redefined;
PerformShapesToAvoid(me:out)
---Purpose: Collect the edges/faces that
-- a) are internal
-- b) are the same and have different orientation
is virtual protected;
PerformLoops(me:out)
---Purpose: Build draft faces/shells
-- a)myLoops - draft faces/shells that consist of
-- boundary edges/faces
-- b)myLoopsInternal - draft faces/shells that contains
-- inner edges/faces
is virtual protected;
PerformAreas(me:out)
---Purpose: Build draft faces/solids that contains boundary faces
is virtual protected;
PerformInternalShapes(me:out)
---Purpose: Build finalized faces/solids with internal wires/shells
is virtual protected;
fields
myShapes : ListOfShape from TopTools is protected;
myLoops : ListOfShape from TopTools is protected;
myLoopsInternal : ListOfShape from TopTools is protected; myLoopsInternal : ListOfShape from TopTools is protected;
myShapesToAvoid : MapOfOrientedShape from TopTools is protected; myShapesToAvoid : MapOfOrientedShape from TopTools is protected;
myAreas : ListOfShape from TopTools is protected; myAreas : ListOfShape from TopTools is protected;
-- --
myContext : PContext from IntTools is protected; myContext : Context from IntTools is protected;
end BuilderArea;
end BuilderArea;

View File

@ -18,47 +18,81 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_BuilderArea.cxx // File: GEOMAlgo_BuilderArea.cxx
// Created: // Author: Peter KURNEV
// Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderArea.ixx> #include <GEOMAlgo_BuilderArea.ixx>
#include <Basics_OCCTVersion.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <IntTools_Context.hxx>
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea() GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea()
: : GEOMAlgo_Algo()
GEOMAlgo_Algo()
{ {
#if OCC_VERSION_LARGE <= 0x06050200
myContext=NULL; myContext=NULL;
#endif
} }
//======================================================================= //=======================================================================
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_BuilderArea::~GEOMAlgo_BuilderArea() GEOMAlgo_BuilderArea::~GEOMAlgo_BuilderArea()
{ {
} }
//======================================================================= //=======================================================================
//function : SetContext //function : SetContext
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::SetContext(const IntTools_Context& theContext) #if OCC_VERSION_LARGE > 0x06050200
void GEOMAlgo_BuilderArea::SetContext(const Handle(IntTools_Context)& theContext)
#else
void GEOMAlgo_BuilderArea::SetContext(const IntTools_Context& theContext)
#endif
{ {
#if OCC_VERSION_LARGE > 0x06050200
myContext=theContext;
#else
myContext=(IntTools_Context*)&theContext; myContext=(IntTools_Context*)&theContext;
#endif
}
#if OCC_VERSION_LARGE > 0x06050200
//=======================================================================
//function : Context
//purpose :
//=======================================================================
const Handle(IntTools_Context)& GEOMAlgo_BuilderArea::Context()const
{
return myContext;
} }
//======================================================================= //=======================================================================
//function : SetShapes //function : Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF) void GEOMAlgo_BuilderArea::Perform()
{
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
}
#endif
//=======================================================================
//function : SetShapes
//purpose :
//=======================================================================
void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF)
{ {
TopTools_ListIteratorOfListOfShape aIt; TopTools_ListIteratorOfListOfShape aIt;
// //
@ -71,54 +105,53 @@
} }
//======================================================================= //=======================================================================
//function : Shapes //function : Shapes
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const
{ {
return myShapes; return myShapes;
} }
//======================================================================= //=======================================================================
//function : Loops //function : Loops
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Loops()const const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Loops()const
{ {
return myLoops; return myLoops;
} }
//======================================================================= //=======================================================================
//function : Solids //function : Areas
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const
{ {
return myAreas; return myAreas;
} }
//======================================================================= //=======================================================================
//function :PerformShapesToAvoid //function :PerformShapesToAvoid
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::PerformShapesToAvoid() void GEOMAlgo_BuilderArea::PerformShapesToAvoid()
{ {
} }
//======================================================================= //=======================================================================
//function : PerformLoops //function : PerformLoops
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::PerformLoops() void GEOMAlgo_BuilderArea::PerformLoops()
{ {
} }
//======================================================================= //=======================================================================
//function : PerformAreas //function : PerformAreas
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::PerformAreas() void GEOMAlgo_BuilderArea::PerformAreas()
{ {
} }
//======================================================================= //=======================================================================
//function : PerformInternalShapes //function : PerformInternalShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::PerformInternalShapes() void GEOMAlgo_BuilderArea::PerformInternalShapes()
{ {
} }

View File

@ -18,20 +18,25 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMAlgo_BuilderArea_HeaderFile #ifndef _GEOMAlgo_BuilderArea_HeaderFile
#define _GEOMAlgo_BuilderArea_HeaderFile #define _GEOMAlgo_BuilderArea_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _TopTools_ListOfShape_HeaderFile #ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#endif #endif
#ifndef _TopTools_MapOfOrientedShape_HeaderFile #ifndef _TopTools_MapOfOrientedShape_HeaderFile
#include <TopTools_MapOfOrientedShape.hxx> #include <TopTools_MapOfOrientedShape.hxx>
#endif #endif
#ifndef _IntTools_PContext_HeaderFile
#if OCC_VERSION_LARGE > 0x06050200
#include <Handle_IntTools_Context.hxx>
#else
#include <IntTools_PContext.hxx> #include <IntTools_PContext.hxx>
#endif #endif
#ifndef _GEOMAlgo_Algo_HeaderFile #ifndef _GEOMAlgo_Algo_HeaderFile
#include <GEOMAlgo_Algo.hxx> #include <GEOMAlgo_Algo.hxx>
#endif #endif
@ -64,11 +69,18 @@ public:
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
// Methods PUBLIC
//
//! Sets cashed geometrical tools <br> //! Sets cashed geometrical tools <br>
#if OCC_VERSION_LARGE > 0x06050200
Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ;
#else
Standard_EXPORT void SetContext(const IntTools_Context& theContext) ; Standard_EXPORT void SetContext(const IntTools_Context& theContext) ;
#endif
#if OCC_VERSION_LARGE > 0x06050200
//! Returns cashed geometrical tools <br>
Standard_EXPORT const Handle_IntTools_Context& Context() const;
#endif
//! Sets edges/faces to process <br> //! Sets edges/faces to process <br>
Standard_EXPORT void SetShapes(const TopTools_ListOfShape& theLS) ; Standard_EXPORT void SetShapes(const TopTools_ListOfShape& theLS) ;
@ -82,57 +94,44 @@ Standard_EXPORT const TopTools_ListOfShape& Loops() const;
//! Returns faces/solids that have been built <br> //! Returns faces/solids that have been built <br>
Standard_EXPORT const TopTools_ListOfShape& Areas() const; Standard_EXPORT const TopTools_ListOfShape& Areas() const;
#if OCC_VERSION_LARGE > 0x06050200
Standard_EXPORT virtual void Perform() ;
#endif
protected: protected:
// Methods PROTECTED //! Empty constructor <br>
// Standard_EXPORT GEOMAlgo_BuilderArea();
//! Empty constructor <br>
Standard_EXPORT GEOMAlgo_BuilderArea();
Standard_EXPORT virtual ~GEOMAlgo_BuilderArea(); Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();
//! Collect the edges/faces that <br>
//! Collect the edges/faces that <br>
//! a) are internal <br> //! a) are internal <br>
//! b) are the same and have different orientation <br> //! b) are the same and have different orientation <br>
Standard_EXPORT virtual void PerformShapesToAvoid() ; Standard_EXPORT virtual void PerformShapesToAvoid() ;
//! Build draft faces/shells <br>
//! Build draft faces/shells <br>
//! a)myLoops - draft faces/shells that consist of <br> //! a)myLoops - draft faces/shells that consist of <br>
//! boundary edges/faces <br> //! boundary edges/faces <br>
//! b)myLoopsInternal - draft faces/shells that contains <br> //! b)myLoopsInternal - draft faces/shells that contains <br>
//! inner edges/faces <br> //! inner edges/faces <br>
Standard_EXPORT virtual void PerformLoops() ; Standard_EXPORT virtual void PerformLoops() ;
//! Build draft faces/solids that contains boundary faces <br>
//! Build draft faces/solids that contains boundary faces <br> Standard_EXPORT virtual void PerformAreas() ;
Standard_EXPORT virtual void PerformAreas() ; //! Build finalized faces/solids with internal wires/shells <br>
Standard_EXPORT virtual void PerformInternalShapes() ;
//! Build finalized faces/solids with internal wires/shells <br>
Standard_EXPORT virtual void PerformInternalShapes() ;
// Fields PROTECTED
//
TopTools_ListOfShape myShapes; TopTools_ListOfShape myShapes;
TopTools_ListOfShape myLoops; TopTools_ListOfShape myLoops;
TopTools_ListOfShape myLoopsInternal; TopTools_ListOfShape myLoopsInternal;
TopTools_MapOfOrientedShape myShapesToAvoid; TopTools_MapOfOrientedShape myShapesToAvoid;
TopTools_ListOfShape myAreas; TopTools_ListOfShape myAreas;
#if OCC_VERSION_LARGE > 0x06050200
Handle_IntTools_Context myContext;
#else
IntTools_PContext myContext; IntTools_PContext myContext;
#endif
private: private:
// Methods PRIVATE
//
// Fields PRIVATE
//
}; };
@ -141,7 +140,6 @@ private:
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -18,14 +18,23 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_BuilderFace.cxx // File: GEOMAlgo_BuilderFace.cxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderFace.ixx> #include <GEOMAlgo_BuilderFace.ixx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderTools.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_WESCorrector.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <Basics_OCCTVersion.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
@ -71,15 +80,6 @@
#include <BOP_WireEdgeSet.hxx> #include <BOP_WireEdgeSet.hxx>
#include <BOP_WESCorrector.hxx> #include <BOP_WESCorrector.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderTools.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_WESCorrector.hxx>
// //
static static
Standard_Boolean IsGrowthWire(const TopoDS_Shape& , Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
@ -89,7 +89,12 @@ static
static static
Standard_Boolean IsInside(const TopoDS_Shape& , Standard_Boolean IsInside(const TopoDS_Shape& ,
const TopoDS_Shape& , const TopoDS_Shape& ,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& );
#else
IntTools_PContext& ); IntTools_PContext& );
#endif
static static
void MakeInternalWires(const TopTools_MapOfShape& , void MakeInternalWires(const TopTools_MapOfShape& ,
TopTools_ListOfShape& ); TopTools_ListOfShape& );
@ -134,16 +139,23 @@ static
{ {
myErrorStatus=0; myErrorStatus=0;
// //
#if OCC_VERSION_LARGE <= 0x06050200
if (myContext==NULL) { if (myContext==NULL) {
myErrorStatus=11;// Null Context myErrorStatus=11;// Null Context
return; return;
} }
#endif
// //
if (myFace.IsNull()) { if (myFace.IsNull()) {
myErrorStatus=12;// Null face generix myErrorStatus=12;// Null face generix
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_BuilderArea::Perform();
#endif
//
PerformShapesToAvoid(); PerformShapesToAvoid();
if (myErrorStatus) { if (myErrorStatus) {
return; return;
@ -619,7 +631,11 @@ void MakeInternalWires(const TopTools_MapOfShape& theME,
//======================================================================= //=======================================================================
Standard_Boolean IsInside(const TopoDS_Shape& theHole, Standard_Boolean IsInside(const TopoDS_Shape& theHole,
const TopoDS_Shape& theF2, const TopoDS_Shape& theF2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_PContext& theContext) IntTools_PContext& theContext)
#endif
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Real aT, aU, aV; Standard_Real aT, aU, aV;

View File

@ -18,14 +18,21 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_BuilderSolid.cxx // File: GEOMAlgo_BuilderSolid.cxx
// Created: // Author: Peter KURNEV
// Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderSolid.ixx> #include <GEOMAlgo_BuilderSolid.ixx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderTools.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <Basics_OCCTVersion.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
@ -73,24 +80,27 @@
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools3D.hxx> #include <BOPTools_Tools3D.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderTools.hxx>
// //
static static
Standard_Boolean IsGrowthShell(const TopoDS_Shape& , Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
const TopTools_IndexedMapOfShape& ); const TopTools_IndexedMapOfShape& );
static static
Standard_Boolean IsHole(const TopoDS_Shape& , Standard_Boolean IsHole(const TopoDS_Shape& ,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& );
#else
IntTools_PContext& ); IntTools_PContext& );
#endif
static static
Standard_Boolean IsInside(const TopoDS_Shape& , Standard_Boolean IsInside(const TopoDS_Shape& ,
const TopoDS_Shape& , const TopoDS_Shape& ,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& );
#else
IntTools_PContext& ); IntTools_PContext& );
#endif
static static
void MakeInternalShells(const TopTools_MapOfShape& , void MakeInternalShells(const TopTools_MapOfShape& ,
TopTools_ListOfShape& ); TopTools_ListOfShape& );
@ -98,41 +108,43 @@ static
static static
Standard_Boolean IsClosedShell(const TopoDS_Shell& ); Standard_Boolean IsClosedShell(const TopoDS_Shell& );
//modified by NIZNHY-PKV Tue Oct 26 13:30:39 2010f
static static
Standard_Boolean RefineShell(const TopoDS_Shell& , Standard_Boolean RefineShell(const TopoDS_Shell& ,
TopoDS_Shell& ); TopoDS_Shell& );
//modified by NIZNHY-PKV Tue Oct 26 13:30:42 2010t
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_BuilderSolid::GEOMAlgo_BuilderSolid() GEOMAlgo_BuilderSolid::GEOMAlgo_BuilderSolid()
: :
GEOMAlgo_BuilderArea() GEOMAlgo_BuilderArea()
{ {
} }
//======================================================================= //=======================================================================
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_BuilderSolid::~GEOMAlgo_BuilderSolid() GEOMAlgo_BuilderSolid::~GEOMAlgo_BuilderSolid()
{ {
} }
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::Perform() void GEOMAlgo_BuilderSolid::Perform()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_BuilderArea::Perform();
#endif
// //
TopoDS_Compound aC; TopoDS_Compound aC;
BRep_Builder aBB; BRep_Builder aBB;
TopTools_ListIteratorOfListOfShape aIt; TopTools_ListIteratorOfListOfShape aIt;
aBB.MakeCompound(aC); aBB.MakeCompound(aC);
aIt.Initialize(myShapes); aIt.Initialize(myShapes);
for(; aIt.More(); aIt.Next()) { for(; aIt.More(); aIt.Next()) {
@ -140,11 +152,12 @@ static
aBB.Add(aC, aF); aBB.Add(aC, aF);
} }
// //
// #if OCC_VERSION_LARGE <= 0x06050200
if (myContext==NULL) { if (myContext==NULL) {
myErrorStatus=11;// Null Context myErrorStatus=11;// Null Context
return; return;
} }
#endif
// //
PerformShapesToAvoid(); PerformShapesToAvoid();
if (myErrorStatus) { if (myErrorStatus) {
@ -168,9 +181,9 @@ static
} }
//======================================================================= //=======================================================================
//function :PerformShapesToAvoid //function :PerformShapesToAvoid
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformShapesToAvoid() void GEOMAlgo_BuilderSolid::PerformShapesToAvoid()
{ {
Standard_Boolean bFound; Standard_Boolean bFound;
Standard_Integer i, iCnt, aNbE, aNbF; Standard_Integer i, iCnt, aNbE, aNbF;
@ -194,8 +207,8 @@ static
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF); TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
} }
/* /*
else { else {
int a=0; int a=0;
} }
*/ */
} }
@ -241,7 +254,7 @@ static
myShapesToAvoid.Add(aF2); myShapesToAvoid.Add(aF2);
} }
} }
/*//DEB /*//DEB
else { else {
TopTools_ListIteratorOfListOfShape aItLF; TopTools_ListIteratorOfListOfShape aItLF;
// //
@ -258,13 +271,13 @@ static
break; break;
} }
// //
}//while (1) }//while (1)
} }
//======================================================================= //=======================================================================
//function : PerformLoops //function : PerformLoops
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformLoops() void GEOMAlgo_BuilderSolid::PerformLoops()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -323,7 +336,7 @@ static
if (aMEFP.Contains(aE)) { if (aMEFP.Contains(aE)) {
const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE); const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
aNbFP=aLFP.Extent(); aNbFP=aLFP.Extent();
if (aNbFP>1) { if (aNbFP>1) {
continue; continue;
} }
} }
@ -351,14 +364,14 @@ static
NMTTools_ListOfCoupleOfShape aLCSOff; NMTTools_ListOfCoupleOfShape aLCSOff;
// //
aItLF.Initialize(aLF); aItLF.Initialize(aLF);
for (; aItLF.More(); aItLF.Next()) { for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItLF.Value())); const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItLF.Value()));
if (myShapesToAvoid.Contains(aFL)) { if (myShapesToAvoid.Contains(aFL)) {
continue; continue;
} }
if (aF.IsSame(aFL)) { if (aF.IsSame(aFL)) {
continue; continue;
} }
if (AddedFacesMap.Contains(aFL)){ if (AddedFacesMap.Contains(aFL)){
continue; continue;
} }
@ -371,7 +384,7 @@ static
aCSOff.SetShape1(aEL); aCSOff.SetShape1(aEL);
aCSOff.SetShape2(aFL); aCSOff.SetShape2(aFL);
aLCSOff.Append(aCSOff); aLCSOff.Append(aCSOff);
}//for (; aItLF.More(); aItLF.Next()) { }//for (; aItLF.More(); aItLF.Next()) {
// //
aNbOff=aLCSOff.Extent(); aNbOff=aLCSOff.Extent();
if (!aNbOff){ if (!aNbOff){
@ -386,11 +399,11 @@ static
GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF); GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
} }
// //
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) { if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
aBB.Add(aShell, aSelF); aBB.Add(aShell, aSelF);
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP); TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
} }
} // for (; aEdgeExp.More(); aEdgeExp.Next()) { } // for (; aEdgeExp.More(); aEdgeExp.Next()) {
} //for (; aItAddedF.More(); aItAddedF.Next()) { } //for (; aItAddedF.More(); aItAddedF.Next()) {
// //
if (IsClosedShell(aShell)) { if (IsClosedShell(aShell)) {
@ -403,15 +416,15 @@ static
// //
bRefine=RefineShell(aShell, aShx); bRefine=RefineShell(aShell, aShx);
if (bRefine) { if (bRefine) {
myLoops.Append(aShx); myLoops.Append(aShx);
} }
} }
//modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t //modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t
} // for (; aItF.More(); aItF.Next()) { } // for (; aItF.More(); aItF.Next()) {
// //
// Post Treatment // Post Treatment
TopTools_MapOfOrientedShape aMP; TopTools_MapOfOrientedShape aMP;
// //
// a. collect all edges that are in loops // a. collect all edges that are in loops
aIt.Initialize (myLoops); aIt.Initialize (myLoops);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
@ -422,7 +435,7 @@ static
aMP.Add(aF); aMP.Add(aF);
} }
} }
// //
// b. collect all faces that are to avoid // b. collect all faces that are to avoid
aItM.Initialize(myShapesToAvoid); aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) { for (; aItM.More(); aItM.Next()) {
@ -475,7 +488,7 @@ static
const TopoDS_Edge& aE = *((TopoDS_Edge*)(&aEdgeExp.Current())); const TopoDS_Edge& aE = *((TopoDS_Edge*)(&aEdgeExp.Current()));
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE); const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
aItF.Initialize(aLF); aItF.Initialize(aLF);
for (; aItF.More(); aItF.Next()) { for (; aItF.More(); aItF.Next()) {
const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItF.Value())); const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItF.Value()));
if (AddedFacesMap.Add(aFL)){ if (AddedFacesMap.Add(aFL)){
aBB.Add(aShell, aFL); aBB.Add(aShell, aFL);
@ -489,14 +502,14 @@ static
} }
//======================================================================= //=======================================================================
//function : PerformAreas //function : PerformAreas
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformAreas() void GEOMAlgo_BuilderSolid::PerformAreas()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
Standard_Boolean bIsGrowthShell, bIsHole; Standard_Boolean bIsGrowthShell, bIsHole;
TopTools_ListOfShape aNewSolids, aHoleShells; TopTools_ListOfShape aNewSolids, aHoleShells;
TopoDS_Shape anInfinitePointShape; TopoDS_Shape anInfinitePointShape;
TopTools_DataMapOfShapeShape aInOutMap; TopTools_DataMapOfShapeShape aInOutMap;
TopTools_DataMapOfShapeListOfShape aMSH; TopTools_DataMapOfShapeListOfShape aMSH;
@ -599,16 +612,16 @@ static
// //
} }
// //
// These aNewSolids are draft solids that // These aNewSolids are draft solids that
// do not contain any internal shapes // do not contain any internal shapes
// //
myAreas.Append(aNewSolids); myAreas.Append(aNewSolids);
} }
//======================================================================= //=======================================================================
//function : PerformInternalShapes //function : PerformInternalShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformInternalShapes() void GEOMAlgo_BuilderSolid::PerformInternalShapes()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -616,10 +629,10 @@ static
if (!aNbFI) {// nothing to do if (!aNbFI) {// nothing to do
return; return;
} }
// //
BRep_Builder aBB; BRep_Builder aBB;
TopTools_ListIteratorOfListOfShape aShellIt, aSolidIt; TopTools_ListIteratorOfListOfShape aShellIt, aSolidIt;
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
TopTools_MapOfShape aMF, aMFP; TopTools_MapOfShape aMF, aMFP;
TopTools_MapIteratorOfMapOfShape aItMF; TopTools_MapIteratorOfMapOfShape aItMF;
TopTools_IndexedDataMapOfShapeListOfShape aMEF; TopTools_IndexedDataMapOfShapeListOfShape aMEF;
@ -650,7 +663,11 @@ static
aItMF.Initialize(aMF); aItMF.Initialize(aMF);
for (; aItMF.More(); aItMF.Next()) { for (; aItMF.More(); aItMF.Next()) {
const TopoDS_Face& aF=*((TopoDS_Face*)(&aItMF.Key())); const TopoDS_Face& aF=*((TopoDS_Face*)(&aItMF.Key()));
#if OCC_VERSION_LARGE > 0x06050200
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, myContext)) {
#else
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) { if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
#endif
aMFP.Add(aF); aMFP.Add(aF);
} }
} }
@ -682,7 +699,7 @@ static
//======================================================================= //=======================================================================
//function : MakeInternalShells //function : MakeInternalShells
//purpose : //purpose :
//======================================================================= //=======================================================================
void MakeInternalShells(const TopTools_MapOfShape& theMF, void MakeInternalShells(const TopTools_MapOfShape& theMF,
TopTools_ListOfShape& theShells) TopTools_ListOfShape& theShells)
@ -708,7 +725,7 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF,
// //
// make a new shell // make a new shell
TopoDS_Shell aShell; TopoDS_Shell aShell;
aBB.MakeShell(aShell); aBB.MakeShell(aShell);
aFF.Orientation(TopAbs_INTERNAL); aFF.Orientation(TopAbs_INTERNAL);
aBB.Add(aShell, aFF); aBB.Add(aShell, aFF);
// //
@ -721,7 +738,7 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF,
const TopoDS_Shape& aE =aEdgeExp.Current(); const TopoDS_Shape& aE =aEdgeExp.Current();
const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE); const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
aItF.Initialize(aLF); aItF.Initialize(aLF);
for (; aItF.More(); aItF.Next()) { for (; aItF.More(); aItF.Next()) {
TopoDS_Shape aFL=aItF.Value(); TopoDS_Shape aFL=aItF.Value();
if (aAddedFacesMap.Add(aFL)){ if (aAddedFacesMap.Add(aFL)){
aFL.Orientation(TopAbs_INTERNAL); aFL.Orientation(TopAbs_INTERNAL);
@ -735,10 +752,14 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF,
} }
//======================================================================= //=======================================================================
//function : IsHole //function : IsHole
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IsHole(const TopoDS_Shape& theS2, Standard_Boolean IsHole(const TopoDS_Shape& theS2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_PContext& theContext) IntTools_PContext& theContext)
#endif
{ {
TopoDS_Solid *pS2=(TopoDS_Solid *)&theS2; TopoDS_Solid *pS2=(TopoDS_Solid *)&theS2;
BRepClass3d_SolidClassifier& aClsf=theContext->SolidClassifier(*pS2); BRepClass3d_SolidClassifier& aClsf=theContext->SolidClassifier(*pS2);
@ -749,11 +770,15 @@ Standard_Boolean IsHole(const TopoDS_Shape& theS2,
} }
//======================================================================= //=======================================================================
//function : IsInside //function : IsInside
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IsInside(const TopoDS_Shape& theS1, Standard_Boolean IsInside(const TopoDS_Shape& theS1,
const TopoDS_Shape& theS2, const TopoDS_Shape& theS2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_PContext& theContext) IntTools_PContext& theContext)
#endif
{ {
TopExp_Explorer aExp; TopExp_Explorer aExp;
TopAbs_State aState; TopAbs_State aState;
@ -769,20 +794,24 @@ Standard_Boolean IsInside(const TopoDS_Shape& theS1,
else { else {
TopTools_IndexedMapOfShape aBounds; TopTools_IndexedMapOfShape aBounds;
const TopoDS_Face& aF = TopoDS::Face(aExp.Current()); const TopoDS_Face& aF = TopoDS::Face(aExp.Current());
#if OCC_VERSION_LARGE > 0x06050200
aState=GEOMAlgo_Tools3D::ComputeState(aF, *pS2, 1.e-14, aBounds, theContext);
#else
aState=GEOMAlgo_Tools3D::ComputeState(aF, *pS2, 1.e-14, aBounds, *theContext); aState=GEOMAlgo_Tools3D::ComputeState(aF, *pS2, 1.e-14, aBounds, *theContext);
#endif
} }
return (aState==TopAbs_IN); return (aState==TopAbs_IN);
} }
//======================================================================= //=======================================================================
//function : IsGrowthShell //function : IsGrowthShell
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell, Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell,
const TopTools_IndexedMapOfShape& theMHF) const TopTools_IndexedMapOfShape& theMHF)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
// //
bRet=Standard_False; bRet=Standard_False;
if (theMHF.Extent()) { if (theMHF.Extent()) {
aIt.Initialize(theShell); aIt.Initialize(theShell);
@ -797,7 +826,7 @@ Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell,
} }
//======================================================================= //=======================================================================
//function : IsClosedShell //function : IsClosedShell
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
{ {
@ -806,7 +835,7 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
TopExp_Explorer aExp; TopExp_Explorer aExp;
TopTools_MapOfShape aM; TopTools_MapOfShape aM;
// //
bRet=Standard_False; bRet=Standard_False;
aIt.Initialize(theShell); aIt.Initialize(theShell);
for(; aIt.More(); aIt.Next()) { for(; aIt.More(); aIt.Next()) {
@ -834,21 +863,20 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
} }
return bRet; return bRet;
} }
//modified by NIZNHY-PKV Tue Oct 26 13:30:23 2010f
//======================================================================= //=======================================================================
//function : RefineShell //function : RefineShell
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean RefineShell(const TopoDS_Shell& aShell, Standard_Boolean RefineShell (const TopoDS_Shell& aShell,
TopoDS_Shell& aShx) TopoDS_Shell& aShx)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer i, aNbE, aNbF; Standard_Integer i, aNbE, aNbF;
TopAbs_Orientation aOrE; TopAbs_Orientation aOrE;
TopTools_IndexedDataMapOfShapeListOfShape aMEF; TopTools_IndexedDataMapOfShapeListOfShape aMEF;
TopTools_MapOfOrientedShape aMFx; TopTools_MapOfOrientedShape aMFx;
// //
bRet=Standard_False; bRet=Standard_False;
// //
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF); TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
@ -871,7 +899,7 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First())); const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
if (aNbF==1) { if (aNbF==1) {
if (aOrE==TopAbs_INTERNAL) { if (aOrE==TopAbs_INTERNAL) {
continue; continue;
} }
aMFx.Add(aF1); aMFx.Add(aF1);
} }
@ -879,14 +907,14 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
else if (aNbF==2) { else if (aNbF==2) {
const TopoDS_Face& aF2=*((TopoDS_Face*)(&aLF.Last())); const TopoDS_Face& aF2=*((TopoDS_Face*)(&aLF.Last()));
if (aF2.IsSame(aF1)) { if (aF2.IsSame(aF1)) {
if (BRep_Tool::IsClosed(aE, aF1)) { if (BRep_Tool::IsClosed(aE, aF1)) {
continue; continue;
} }
if (aOrE==TopAbs_INTERNAL) { if (aOrE==TopAbs_INTERNAL) {
continue; continue;
} }
aMFx.Add(aF1); aMFx.Add(aF1);
aMFx.Add(aF2); aMFx.Add(aF2);
} }
} }
} }
@ -894,7 +922,7 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
aNbF=aMFx.Extent(); aNbF=aMFx.Extent();
if (!aNbF) { if (!aNbF) {
return bRet; return bRet;
} }
// //
BRep_Builder aBB; BRep_Builder aBB;
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
@ -916,7 +944,6 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
// //
return bRet; return bRet;
} }
//modified by NIZNHY-PKV Tue Oct 26 13:30:26 2010t
//
// ErrorStatus : // ErrorStatus :
// 11 - Null Context // 11 - Null Context

View File

@ -18,38 +18,16 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Builder_1.cxx // File: GEOMAlgo_Builder_1.cxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.hxx>
//
#include <TColStd_ListOfInteger.hxx>
#include <TopoDS.hxx> #include <GEOMAlgo_Builder.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx> #include <Basics_OCCTVersion.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx> #include <GEOMAlgo_Tools3D.hxx>
#include <TopoDS_Iterator.hxx>
//
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
//
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
//
#include <IntTools_Context.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
//
#include <NMTDS_ShapesDataStructure.hxx>
//
#include <NMTTools_PaveFiller.hxx> #include <NMTTools_PaveFiller.hxx>
#include <NMTTools_CommonBlockPool.hxx> #include <NMTTools_CommonBlockPool.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx> #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
@ -57,10 +35,32 @@
#include <NMTTools_CommonBlockPool.hxx> #include <NMTTools_CommonBlockPool.hxx>
#include <NMTTools_ListOfCommonBlock.hxx> #include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx> #include <NMTTools_CommonBlockAPI.hxx>
//
#include <GEOMAlgo_Tools3D.hxx> #include <NMTDS_ShapesDataStructure.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx> #include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <IntTools_Context.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
static static
@ -112,8 +112,11 @@ static
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool(); const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
/* NMTTools_CommonBlockPool& aCBP=*/pPF->ChangeCommonBlockPool(); #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext(); IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
Standard_Boolean bToReverse; Standard_Boolean bToReverse;
Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB, aNbLB; Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB, aNbLB;
@ -227,7 +230,11 @@ static
// //
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext(); IntTools_Context& aCtx= pPF->ChangeContext();
#endif
// //
aNbS=aDS.NumberOfShapesOfTheObject(); aNbS=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) { for (i=1; i<=aNbS; ++i) {

View File

@ -24,8 +24,27 @@
#include <GEOMAlgo_Builder.hxx> #include <GEOMAlgo_Builder.hxx>
#include <TColStd_IndexedMapOfInteger.hxx> #include <Basics_OCCTVersion.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_BuilderFace.hxx>
#include <GEOMAlgo_ShapeSet.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlock.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTDS_BoxBndTree.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_InterfPool.hxx>
#include <TopAbs_Orientation.hxx> #include <TopAbs_Orientation.hxx>
@ -39,6 +58,8 @@
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx> #include <TopTools_MapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
@ -51,8 +72,13 @@
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <IntTools_FClass2d.hxx> #include <IntTools_FClass2d.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <BooleanOperations_OnceExplorer.hxx> #include <BooleanOperations_OnceExplorer.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx> #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_ListOfPaveBlock.hxx> #include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx> #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx> #include <BOPTools_CArray1OfSSInterference.hxx>
@ -67,34 +93,11 @@
#include <BOPTools_ESInterference.hxx> #include <BOPTools_ESInterference.hxx>
#include <BOPTools_CArray1OfESInterference.hxx> #include <BOPTools_CArray1OfESInterference.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlock.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
//
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_BuilderFace.hxx>
#include <GEOMAlgo_ShapeSet.hxx>
//
#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx> #include <NCollection_UBTreeFiller.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <TColStd_ListOfInteger.hxx> #include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx> #include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
static static
void UpdateCandidates(const Standard_Integer , void UpdateCandidates(const Standard_Integer ,
@ -208,7 +211,11 @@ void GEOMAlgo_Builder::BuildSplitFaces()
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP(); NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences(); BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext(); IntTools_Context& aCtx= pPF->ChangeContext();
#endif
// //
Standard_Boolean bToReverse, bIsClosed, bIsDegenerated; Standard_Boolean bToReverse, bIsClosed, bIsDegenerated;
Standard_Integer i, aNb, aNbF, nF; Standard_Integer i, aNb, aNbF, nF;
@ -420,7 +427,11 @@ void GEOMAlgo_Builder::FillSameDomainFaces()
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP(); NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences(); BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
IntTools_Context& aCtx= pPF->ChangeContext(); #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
// //
//mySameDomainShapes.Clear(); //mySameDomainShapes.Clear();
@ -707,7 +718,11 @@ void GEOMAlgo_Builder::FillInternalVertices()
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP(); NMTDS_InterfPool* pIP=pPF->IP();
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext(); IntTools_Context& aCtx= pPF->ChangeContext();
#endif
// //
BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences(); BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences();
BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences(); BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences();
@ -880,10 +895,18 @@ void GEOMAlgo_Builder::FillInternalVertices()
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
TopoDS_Face aFx=TopoDS::Face(aIt.Value()); TopoDS_Face aFx=TopoDS::Face(aIt.Value());
// update classifier // update classifier
#if OCC_VERSION_LARGE > 0x06050200
IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx);
#else
IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx); IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
#endif
aClsf.Init(aFx, aTol); aClsf.Init(aFx, aTol);
// //
#if OCC_VERSION_LARGE > 0x06050200
iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2);
#else
iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2); iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
#endif
if (!iFlag) { if (!iFlag) {
aBB.Add(aFx, aV); aBB.Add(aFx, aV);
break; break;
@ -893,10 +916,18 @@ void GEOMAlgo_Builder::FillInternalVertices()
else { else {
const TopoDS_Face& aFx=TopoDS::Face(aF); const TopoDS_Face& aFx=TopoDS::Face(aF);
// update classifier // update classifier
#if OCC_VERSION_LARGE > 0x06050200
IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx);
#else
IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx); IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
#endif
aClsf.Init(aFx, aTol); aClsf.Init(aFx, aTol);
// //
#if OCC_VERSION_LARGE > 0x06050200
iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2);
#else
iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2); iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
#endif
if (!iFlag) { if (!iFlag) {
TopoDS_Face aFz; TopoDS_Face aFz;
// //

View File

@ -18,13 +18,24 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMAlgo_Builder_3.cxx // File : GEOMAlgo_Builder_3.cxx
// Created :
// Author : Peter KURNEV // Author : Peter KURNEV
#include <GEOMAlgo_Builder.hxx> #include <GEOMAlgo_Builder.hxx>
#include <Basics_OCCTVersion.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderSolid.hxx>
#include <GEOMAlgo_ShapeSet.hxx>
#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <TopAbs_State.hxx> #include <TopAbs_State.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
@ -57,16 +68,6 @@
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderSolid.hxx>
#include <GEOMAlgo_ShapeSet.hxx>
#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
static static
void OwnInternalShapes(const TopoDS_Shape& , void OwnInternalShapes(const TopoDS_Shape& ,
@ -94,9 +95,12 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid,
{ {
myErrorStatus=0; myErrorStatus=0;
// //
/*const NMTDS_ShapesDataStructure& aDS=**/myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext(); #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
Standard_Boolean bToReverse; Standard_Boolean bToReverse;
Standard_Integer iFlag; Standard_Integer iFlag;
@ -189,7 +193,11 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid,
// //
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext(); #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
Standard_Boolean bIsIN, bHasImage; Standard_Boolean bIsIN, bHasImage;
Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF; Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;
@ -422,7 +430,11 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid,
// //
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext(); #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
Standard_Integer i, aNbS, iErr; Standard_Integer i, aNbS, iErr;
TopExp_Explorer aExp; TopExp_Explorer aExp;
@ -521,6 +533,9 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid,
//modified by NIZNHY-PKV Wed Oct 27 09:53:18 2010t //modified by NIZNHY-PKV Wed Oct 27 09:53:18 2010t
// //
// 1.3 Build new solids // 1.3 Build new solids
#if OCC_VERSION_LARGE > 0x06050200
aSB.SetContext(aCtx);
#endif
aSB.SetShapes(aSFS1); aSB.SetShapes(aSFS1);
aSB.Perform(); aSB.Perform();
iErr=aSB.ErrorStatus(); iErr=aSB.ErrorStatus();
@ -564,7 +579,11 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid,
// //
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext(); IntTools_Context& aCtx= pPF->ChangeContext();
#endif
// //
//Standard_Boolean bHasImage; //Standard_Boolean bHasImage;
Standard_Integer i, j, jT, aNbS, aNbSI, aNbSx, aNbSd; Standard_Integer i, j, jT, aNbS, aNbSI, aNbSx, aNbSd;

View File

@ -18,14 +18,20 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Builder_4.cxx // File: GEOMAlgo_Builder_4.cxx
// Created: // Author: Peter KURNEV
// Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.hxx> #include <GEOMAlgo_Builder.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <Basics_OCCTVersion.hxx>
#include <TopoDS_Iterator.hxx> #include <TopoDS_Iterator.hxx>
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
@ -35,25 +41,22 @@
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <GEOMAlgo_Tools3D.hxx>
static static
void MapShapes(const TopoDS_Shape& aS, void MapShapes(const TopoDS_Shape& aS,
TopTools_MapOfShape& aM); TopTools_MapOfShape& aM);
//======================================================================= //=======================================================================
//function : Generated //function : Generated
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS) const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
{ {
/*const NMTDS_ShapesDataStructure& aDS=**/myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext(); IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
Standard_Boolean bHasImage, bToReverse; Standard_Boolean bHasImage, bToReverse;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@ -72,8 +75,8 @@ static
// //
aType=theS.ShapeType(); aType=theS.ShapeType();
// //
if (aType==TopAbs_EDGE || aType==TopAbs_FACE || if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
const TopTools_ListOfShape& aLSp=myImages.Image(theS); const TopTools_ListOfShape& aLSp=myImages.Image(theS);
aIt.Initialize(aLSp); aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
@ -102,13 +105,16 @@ static
} }
//======================================================================= //=======================================================================
//function : Modified //function : Modified
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS) const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
{ {
/*const NMTDS_ShapesDataStructure& aDS=**/myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller; NMTTools_PaveFiller* pPF=myPaveFiller;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext(); IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
Standard_Boolean bHasImage, bToReverse; Standard_Boolean bHasImage, bToReverse;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@ -127,8 +133,8 @@ static
// //
aType=theS.ShapeType(); aType=theS.ShapeType();
// //
if (aType==TopAbs_EDGE || aType==TopAbs_FACE || if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
const TopTools_ListOfShape& aLSp=myImages.Image(theS); const TopTools_ListOfShape& aLSp=myImages.Image(theS);
aIt.Initialize(aLSp); aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
@ -156,7 +162,7 @@ static
} }
//======================================================================= //=======================================================================
//function : IsDeleted //function : IsDeleted
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_Builder::IsDeleted(const TopoDS_Shape& theS) Standard_Boolean GEOMAlgo_Builder::IsDeleted(const TopoDS_Shape& theS)
{ {
@ -181,8 +187,8 @@ static
} }
// //
aType=theS.ShapeType(); aType=theS.ShapeType();
if (aType==TopAbs_EDGE || aType==TopAbs_FACE || if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
const TopTools_ListOfShape& aLSp=myImages.Image(theS); const TopTools_ListOfShape& aLSp=myImages.Image(theS);
aIt.Initialize(aLSp); aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
@ -205,7 +211,7 @@ static
} }
//======================================================================= //=======================================================================
//function : PrepareHistory //function : PrepareHistory
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Builder::PrepareHistory() void GEOMAlgo_Builder::PrepareHistory()
{ {
@ -219,10 +225,10 @@ static
TopTools_ListIteratorOfListOfShape aIt; TopTools_ListIteratorOfListOfShape aIt;
TopTools_MapIteratorOfMapOfShape aItM; TopTools_MapIteratorOfMapOfShape aItM;
// //
// 1. Clearing // 1. Clearing
GEOMAlgo_BuilderShape::PrepareHistory(); GEOMAlgo_BuilderShape::PrepareHistory();
// //
// 2. myMapShape - all shapes of result with theirs sub-shapes // 2. myMapShape - all shapes of result with theirs sub-shapes
MapShapes(myShape, myMapShape); MapShapes(myShape, myMapShape);
// //
// 3. MS - all argument shapes with theirs sub-shapes // 3. MS - all argument shapes with theirs sub-shapes
@ -263,13 +269,13 @@ static
// //
//modified by NIZNHY-PKV Thu Dec 7 11:34:10 2006t //modified by NIZNHY-PKV Thu Dec 7 11:34:10 2006t
// //
// 4.2 As it was // 4.2 As it was
if (!myHasDeleted) { if (!myHasDeleted) {
myHasDeleted=IsDeleted(aSx);//xx myHasDeleted=IsDeleted(aSx);//xx
} }
// //
if (!myHasGenerated || !myHasModified) { if (!myHasGenerated || !myHasModified) {
if (aType==TopAbs_EDGE || aType==TopAbs_FACE || if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
//modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f //modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f
//bHasImage=myImages.HasImage(aSx); //bHasImage=myImages.HasImage(aSx);
@ -296,14 +302,13 @@ static
} // if (myMapShape.Contains(aSp)) } // if (myMapShape.Contains(aSp))
} }
} }
} }
} }
} }
} }
//======================================================================= //=======================================================================
//function : MapShapes //function : MapShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void MapShapes(const TopoDS_Shape& theS, void MapShapes(const TopoDS_Shape& theS,
TopTools_MapOfShape& theM) TopTools_MapOfShape& theM)

View File

@ -18,12 +18,11 @@
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-- --
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: GEOMAlgo_FinderShapeOn.cdl -- File: GEOMAlgo_FinderShapeOn.cdl
-- Created: Tue Jan 11 14:35:52 2005 -- Created: Tue Jan 11 14:35:52 2005
-- Author: Peter KURNEV -- Author: Peter KURNEV
--
class FinderShapeOn from GEOMAlgo class FinderShapeOn from GEOMAlgo
inherits ShapeAlgo from GEOMAlgo inherits ShapeAlgo from GEOMAlgo
@ -98,8 +97,11 @@ is
aImages : out DataMapOfShapeShape from TopTools; aImages : out DataMapOfShapeShape from TopTools;
aOriginals: out DataMapOfShapeShape from TopTools; aOriginals: out DataMapOfShapeShape from TopTools;
aSC : out Shape from TopoDS); aSC : out Shape from TopoDS);
BuildTriangulation(myclass;
aS :Shape from TopoDS)
returns Boolean from Standard;
fields fields
mySurface : Surface from Geom is protected; mySurface : Surface from Geom is protected;

View File

@ -187,6 +187,11 @@ void GEOMAlgo_FinderShapeOn::Perform()
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface); myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface);
// //
MakeArgument1(); MakeArgument1();
@ -544,9 +549,9 @@ void GEOMAlgo_FinderShapeOn::CopySource(const TopoDS_Shape& aE,
// //
//======================================================================= //=======================================================================
//function : BuildTriangulation //function : BuildTriangulation
//purpose : //purpose :
//======================================================================= //=======================================================================
bool GEOMAlgo_FinderShapeOn::BuildTriangulation (const TopoDS_Shape& theShape) Standard_Boolean GEOMAlgo_FinderShapeOn::BuildTriangulation (const TopoDS_Shape& theShape)
{ {
// calculate deflection // calculate deflection
Standard_Real aDeviationCoefficient = 0.001; Standard_Real aDeviationCoefficient = 0.001;

View File

@ -68,80 +68,63 @@ class GEOMAlgo_FinderShapeOn : public GEOMAlgo_ShapeAlgo {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
return anAddress; return anAddress;
} }
void* operator new(size_t size) void* operator new(size_t size)
{ {
return Standard::Allocate(size); return Standard::Allocate(size);
} }
void operator delete(void *anAddress) void operator delete(void *anAddress)
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
// Methods PUBLIC
//
Standard_EXPORT GEOMAlgo_FinderShapeOn(); Standard_EXPORT GEOMAlgo_FinderShapeOn();
Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn(); Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn();
Standard_EXPORT virtual void Perform();
Standard_EXPORT virtual void Perform() ; Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& aS) ;
Standard_EXPORT void SetShapeType(const TopAbs_ShapeEnum aST) ;
Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& aS) ; Standard_EXPORT void SetState(const GEOMAlgo_State aSF) ;
Standard_EXPORT const Handle_Geom_Surface& Surface() const;
Standard_EXPORT void SetShapeType(const TopAbs_ShapeEnum aST) ; Standard_EXPORT TopAbs_ShapeEnum ShapeType() const;
Standard_EXPORT GEOMAlgo_State State() const;
Standard_EXPORT void SetState(const GEOMAlgo_State aSF) ; Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
Standard_EXPORT static void CopySource (const TopoDS_Shape& aS,
TopTools_DataMapOfShapeShape& aImages,
TopTools_DataMapOfShapeShape& aOriginals,
TopoDS_Shape& aSC) ;
Standard_EXPORT const Handle_Geom_Surface& Surface() const; Standard_EXPORT static Standard_Boolean BuildTriangulation (const TopoDS_Shape& theShape);
Standard_EXPORT TopAbs_ShapeEnum ShapeType() const;
Standard_EXPORT GEOMAlgo_State State() const;
Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
Standard_EXPORT static void CopySource(const TopoDS_Shape& aS,TopTools_DataMapOfShapeShape& aImages,TopTools_DataMapOfShapeShape& aOriginals,TopoDS_Shape& aSC) ;
Standard_EXPORT static bool BuildTriangulation (const TopoDS_Shape& theShape);
protected: protected:
// Methods PROTECTED
// Standard_EXPORT virtual void CheckData() ;
Standard_EXPORT void MakeArgument1() ;
Standard_EXPORT void MakeArgument2() ;
Standard_EXPORT void Find() ;
Standard_EXPORT void Find(const TopoDS_Shape& aS) ;
Standard_EXPORT void FindVertices() ;
Standard_EXPORT virtual void CheckData() ;
Standard_EXPORT void MakeArgument1() ;
Standard_EXPORT void MakeArgument2() ;
Standard_EXPORT void Find() ;
Standard_EXPORT void Find(const TopoDS_Shape& aS) ;
Standard_EXPORT void FindVertices() ;
// Fields PROTECTED
//
Handle_Geom_Surface mySurface; Handle_Geom_Surface mySurface;
TopAbs_ShapeEnum myShapeType; TopAbs_ShapeEnum myShapeType;
GEOMAlgo_State myState; GEOMAlgo_State myState;
@ -155,22 +138,9 @@ Standard_Boolean myIsAnalytic;
private: private:
// Methods PRIVATE
//
// Fields PRIVATE
//
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,6 +25,18 @@
#include <GEOMAlgo_FinderShapeOn1.ixx> #include <GEOMAlgo_FinderShapeOn1.ixx>
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#include <GEOMAlgo_SurfaceTools.hxx>
#include <GEOMAlgo_StateCollector.hxx>
#include <GEOMAlgo_FinderShapeOn.hxx>
#include <GEOMAlgo_PassKey.hxx>
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#include <Basics_OCCTVersion.hxx>
#include <math.h> #include <math.h>
#include <Precision.hxx> #include <Precision.hxx>
@ -67,16 +79,6 @@
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepLib_MakeEdge.hxx> #include <BRepLib_MakeEdge.hxx>
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#include <GEOMAlgo_SurfaceTools.hxx>
#include <GEOMAlgo_StateCollector.hxx>
#include <GEOMAlgo_FinderShapeOn.hxx>
#include <GEOMAlgo_PassKey.hxx>
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
//======================================================================= //=======================================================================
//function : GEOMAlgo_FinderShapeOn1 //function : GEOMAlgo_FinderShapeOn1
//purpose : //purpose :
@ -223,6 +225,11 @@ void GEOMAlgo_FinderShapeOn1::Perform()
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
// 1 // 1
ProcessVertices(); ProcessVertices();
if(myErrorStatus) { if(myErrorStatus) {

View File

@ -18,16 +18,26 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_FinderShapeOn1.cxx // File: GEOMAlgo_FinderShapeOn1.cxx
// Created: Fri Mar 4 10:31:06 2005 // Created: Fri Mar 4 10:31:06 2005
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_FinderShapeOn2.ixx>
#include <math.h>
#include <GEOMAlgo_FinderShapeOn2.ixx>
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#include <GEOMAlgo_SurfaceTools.hxx>
#include <GEOMAlgo_StateCollector.hxx>
#include <GEOMAlgo_FinderShapeOn.hxx>
#include <GEOMAlgo_PassKey.hxx>
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#include <Basics_OCCTVersion.hxx>
#include <math.h>
#include <Precision.hxx> #include <Precision.hxx>
#include <TColStd_Array1OfInteger.hxx> #include <TColStd_Array1OfInteger.hxx>
@ -69,16 +79,6 @@
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepLib_MakeEdge.hxx> #include <BRepLib_MakeEdge.hxx>
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#include <GEOMAlgo_SurfaceTools.hxx>
#include <GEOMAlgo_StateCollector.hxx>
#include <GEOMAlgo_FinderShapeOn.hxx>
#include <GEOMAlgo_PassKey.hxx>
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
//======================================================================= //=======================================================================
//function : GEOMAlgo_FinderShapeOn1 //function : GEOMAlgo_FinderShapeOn1
//purpose : //purpose :
@ -225,6 +225,11 @@
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
myClsf->SetTolerance(myTolerance); myClsf->SetTolerance(myTolerance);
// //
// 1 // 1

View File

@ -18,14 +18,20 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GetInPlace.cxx // File: GEOMAlgo_GetInPlace.cxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
#include <GEOMAlgo_GetInPlace.hxx> #include <GEOMAlgo_GetInPlace.hxx>
#include <GEOMAlgo_Tools.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTDS_BoxBndTree.hxx> #include <NMTDS_BoxBndTree.hxx>
#include <Basics_OCCTVersion.hxx>
#include <NCollection_UBTreeFiller.hxx> #include <NCollection_UBTreeFiller.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
@ -59,10 +65,6 @@
#include <TopTools_MapIteratorOfMapOfShape.hxx> #include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <GEOMAlgo_Tools.hxx>
static static
void MapBRepShapes(const TopoDS_Shape& aS, void MapBRepShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aM); TopTools_IndexedMapOfShape& aM);
@ -197,6 +199,11 @@ void GEOMAlgo_GetInPlace::Perform()
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_GluerAlgo::Perform();
#endif
//
Intersect(); Intersect();
if (myErrorStatus) { if (myErrorStatus) {
return; return;

View File

@ -19,11 +19,13 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// File: GEOMAlgo_GetInPlace_1.cxx // File: GEOMAlgo_GetInPlace_1.cxx
// Author: Peter KURNEV // Author: Peter KURNEV
#include <GEOMAlgo_GetInPlace.hxx> #include <GEOMAlgo_GetInPlace.hxx>
#include <Basics_OCCTVersion.hxx>
#include <math.h> #include <math.h>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -38,9 +40,10 @@
#include <Geom2dAdaptor_Curve.hxx> #include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dHatch_Hatcher.hxx> #include <Geom2dHatch_Hatcher.hxx>
#include <Geom2dHatch_Intersector.hxx> #include <Geom2dHatch_Intersector.hxx>
#include <HatchGen_Domain.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx> #include <GeomAPI_ProjectPointOnCurve.hxx>
#include <HatchGen_Domain.hxx>
#include <TopAbs_State.hxx> #include <TopAbs_State.hxx>
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
#include <TopAbs_Orientation.hxx> #include <TopAbs_Orientation.hxx>
@ -50,9 +53,9 @@
#include <TopoDS_Solid.hxx> #include <TopoDS_Solid.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <BRep_Tool.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx> #include <BRepTools.hxx>
#include <BRepClass3d_SolidClassifier.hxx> #include <BRepClass3d_SolidClassifier.hxx>
@ -62,33 +65,31 @@
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
static
static Standard_Integer PntInEdge(const TopoDS_Edge& aF,
Standard_Integer PntInEdge(const TopoDS_Edge& aF, gp_Pnt& aP);
gp_Pnt& aP); static
static Standard_Integer PntInEdge(const TopoDS_Edge& aF,
Standard_Integer PntInEdge(const TopoDS_Edge& aF, gp_Pnt& aP,
gp_Pnt& aP, Standard_Real& aT);
Standard_Real& aT); static
static Standard_Integer PntInFace(const TopoDS_Face& aF,
Standard_Integer PntInFace(const TopoDS_Face& aF, gp_Pnt& aP);
gp_Pnt& aP); static
static Standard_Integer PntInFace(const TopoDS_Face& aF,
Standard_Integer PntInFace(const TopoDS_Face& aF, gp_Pnt& aP,
gp_Pnt& aP, gp_Pnt2d& theP2D);
gp_Pnt2d& theP2D); static
static Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
Standard_Integer PntInSolid(const TopoDS_Solid& aZ, const Standard_Real aTol,
const Standard_Real aTol, gp_Pnt& aP);
gp_Pnt& aP);
//======================================================================= //=======================================================================
//function : CheckCoincidence //function : CheckCoincidence
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1, Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2) const TopoDS_Shape& aS2)
{ {
Standard_Boolean bOk; Standard_Boolean bOk;
Standard_Integer iErr; Standard_Integer iErr;
@ -122,12 +123,12 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
// //
else if (aType2==TopAbs_FACE) { else if (aType2==TopAbs_FACE) {
const TopoDS_Face& aF2=*((TopoDS_Face*)&aS2); const TopoDS_Face& aF2=*((TopoDS_Face*)&aS2);
iErr=PntInFace(aF2, aP2); iErr=PntInFace(aF2, aP2);
} }
// //
else if (aType2==TopAbs_SOLID) { else if (aType2==TopAbs_SOLID) {
const TopoDS_Solid& aZ2=*((TopoDS_Solid*)&aS2); const TopoDS_Solid& aZ2=*((TopoDS_Solid*)&aS2);
iErr=PntInSolid(aZ2, myTolerance, aP2); iErr=PntInSolid(aZ2, myTolerance, aP2);
} }
// //
else { else {
@ -149,18 +150,22 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
// //
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1); const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
// //
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aPPC=myContext->ProjPC(aE1);
#else
GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1); GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1);
#endif
aPPC.Perform(aP2); aPPC.Perform(aP2);
aNbPoints=aPPC.NbPoints(); aNbPoints=aPPC.NbPoints();
if (aNbPoints) { if (aNbPoints) {
aDmin=aPPC.LowerDistance(); aDmin=aPPC.LowerDistance();
aT=aPPC.LowerDistanceParameter(); aT=aPPC.LowerDistanceParameter();
if (aDmin < myTolerance) { if (aDmin < myTolerance) {
dT=1.e-12; dT=1.e-12;
BRep_Tool::Curve(aE1, aT1, aT2); BRep_Tool::Curve(aE1, aT1, aT2);
if(aT > (aT1-dT) && aT < (aT2+dT)) { if(aT > (aT1-dT) && aT < (aT2+dT)) {
bOk=Standard_True; bOk=Standard_True;
} }
} }
} }
//else { //else {
@ -171,13 +176,21 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
else if (aType1==TopAbs_FACE) { else if (aType1==TopAbs_FACE) {
const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1); const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1);
// //
#if OCC_VERSION_LARGE > 0x06050200
bOk=myContext->IsValidPointForFace(aP2, aF1, myTolerance);
#else
bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance); bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance);
} #endif
}
// //
else if (aType1==TopAbs_SOLID) { else if (aType1==TopAbs_SOLID) {
const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1); const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1);
// //
#if OCC_VERSION_LARGE > 0x06050200
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ1);
#else
BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1); BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1);
#endif
aSC.Perform(aP2, myTolerance); aSC.Perform(aP2, myTolerance);
aState=aSC.State(); aState=aSC.State();
bOk=(aState==TopAbs_IN); bOk=(aState==TopAbs_IN);
@ -193,11 +206,10 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
// //
//======================================================================= //=======================================================================
//function : PntInEdge //function : PntInEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer PntInEdge(const TopoDS_Edge& aE, Standard_Integer PntInEdge(const TopoDS_Edge& aE,
gp_Pnt& aP) gp_Pnt& aP)
{ {
Standard_Integer iErr; Standard_Integer iErr;
Standard_Real aT; Standard_Real aT;
@ -208,11 +220,11 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE,
} }
//======================================================================= //=======================================================================
//function : PntInEdge //function : PntInEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer PntInEdge(const TopoDS_Edge& aE, Standard_Integer PntInEdge(const TopoDS_Edge& aE,
gp_Pnt& aP, gp_Pnt& aP,
Standard_Real& aT) Standard_Real& aT)
{ {
Standard_Integer iErr; Standard_Integer iErr;
Standard_Real aT1, aT2; Standard_Real aT1, aT2;
@ -228,18 +240,18 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE,
} }
//======================================================================= //=======================================================================
//function : PntInSolid //function : PntInSolid
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer PntInSolid(const TopoDS_Solid& aZ, Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
const Standard_Real aTol, const Standard_Real aTol,
gp_Pnt& aP) gp_Pnt& aP)
{ {
Standard_Integer iErr; Standard_Integer iErr;
Standard_Real aUx, aVx, aCoef; Standard_Real aUx, aVx, aCoef;
gp_Pnt aPx; gp_Pnt aPx;
gp_Pnt2d aP2Dx; gp_Pnt2d aP2Dx;
gp_Vec aDNx; gp_Vec aDNx;
TopoDS_Face aF; TopoDS_Face aF;
TopExp_Explorer aExp; TopExp_Explorer aExp;
// //
@ -267,26 +279,26 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
} }
//======================================================================= //=======================================================================
//function : PntInFace //function : PntInFace
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer PntInFace(const TopoDS_Face& aF, Standard_Integer PntInFace(const TopoDS_Face& aF,
gp_Pnt& aP) gp_Pnt& aP)
{ {
Standard_Integer iErr; Standard_Integer iErr;
// //
gp_Pnt2d aP2Dx; gp_Pnt2d aP2Dx;
// //
iErr=PntInFace(aF, aP, aP2Dx); iErr=PntInFace(aF, aP, aP2Dx);
// //
return iErr; return iErr;
} }
//======================================================================= //=======================================================================
//function : PntInFace //function : PntInFace
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer PntInFace(const TopoDS_Face& aF, Standard_Integer PntInFace(const TopoDS_Face& aF,
gp_Pnt& theP, gp_Pnt& theP,
gp_Pnt2d& theP2D) gp_Pnt2d& theP2D)
{ {
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
Standard_Integer iErr, aIx, aNbDomains, i; Standard_Integer iErr, aIx, aNbDomains, i;
@ -310,16 +322,16 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
aTolTangfIntr=1.e-10; aTolTangfIntr=1.e-10;
// //
Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr); Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
Geom2dHatch_Hatcher aHatcher(aIntr, Geom2dHatch_Hatcher aHatcher(aIntr,
aTolHatch2D, aTolHatch3D, aTolHatch2D, aTolHatch3D,
Standard_True, Standard_False); Standard_True, Standard_False);
// //
iErr=0; iErr=0;
aEpsT=1.e-12; aEpsT=1.e-12;
// //
aFF=aF; aFF=aF;
aFF.Orientation (TopAbs_FORWARD); aFF.Orientation (TopAbs_FORWARD);
// //
aS=BRep_Tool::Surface(aFF); aS=BRep_Tool::Surface(aFF);
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax); BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
// //
@ -398,4 +410,3 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
// //
return iErr; return iErr;
} }

View File

@ -18,67 +18,68 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GlueDetector.cxx // File: GEOMAlgo_GlueDetector.cxx
// Created: Wed Dec 15 11:08:09 2004 // Created: Wed Dec 15 11:08:09 2004
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_GlueAnalyser.ixx> #include <GEOMAlgo_GlueAnalyser.ixx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_Tools.hxx>
#include <GEOMAlgo_CoupleOfShapes.hxx>
#include <GEOMAlgo_Gluer.hxx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <Basics_OCCTVersion.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Compound.hxx> #include <TopoDS_Compound.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_Tools.hxx>
#include <GEOMAlgo_CoupleOfShapes.hxx>
#include <GEOMAlgo_Gluer.hxx>
#include <Bnd_HArray1OfBox.hxx> #include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx> #include <Bnd_BoundSortBox.hxx>
#include <TopoDS_Vertex.hxx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser() GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser()
: : GEOMAlgo_Gluer()
GEOMAlgo_Gluer()
{} {}
//======================================================================= //=======================================================================
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_GlueAnalyser::~GEOMAlgo_GlueAnalyser() GEOMAlgo_GlueAnalyser::~GEOMAlgo_GlueAnalyser()
{} {}
//======================================================================= //=======================================================================
//function : HasSolidsToGlue //function : HasSolidsToGlue
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsToGlue()const Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsToGlue()const
{ {
return !mySolidsToGlue.IsEmpty(); return !mySolidsToGlue.IsEmpty();
} }
@ -86,7 +87,7 @@
//function : HasSolidsAlone //function : HasSolidsAlone
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const
{ {
return !mySolidsAlone.IsEmpty(); return !mySolidsAlone.IsEmpty();
} }
@ -123,6 +124,11 @@
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
InnerTolerance(); InnerTolerance();
if (myErrorStatus) { if (myErrorStatus) {
return; return;

View File

@ -18,15 +18,23 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GlueDetector.cxx // File: GEOMAlgo_GlueDetector.cxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_GlueDetector.hxx> #include <GEOMAlgo_GlueDetector.hxx>
#include <Bnd_Box.hxx> #include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_Tools.hxx>
#include <NMTDS_BndSphereTree.hxx>
#include <NMTDS_BndSphere.hxx>
#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
#include <Basics_OCCTVersion.hxx>
#include <NCollection_UBTreeFiller.hxx> #include <NCollection_UBTreeFiller.hxx>
#include <TColStd_ListOfInteger.hxx> #include <TColStd_ListOfInteger.hxx>
@ -49,27 +57,20 @@
#include <TopTools_MapIteratorOfMapOfShape.hxx> #include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
#include <NMTDS_BndSphereTree.hxx> #include <Bnd_Box.hxx>
#include <NMTDS_BndSphere.hxx>
#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_Tools.hxx>
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector() GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
: : GEOMAlgo_GluerAlgo(),
GEOMAlgo_GluerAlgo(), GEOMAlgo_Algo()
GEOMAlgo_Algo()
{} {}
//======================================================================= //=======================================================================
//function : ~ //function : ~
@ -91,6 +92,11 @@ void GEOMAlgo_GlueDetector::Perform()
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_GluerAlgo::Perform();
#endif
//
DetectVertices(); DetectVertices();
if (myErrorStatus) { if (myErrorStatus) {
return; return;

View File

@ -18,16 +18,26 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Gluer.cxx // File: GEOMAlgo_Gluer.cxx
// Created: Sat Dec 04 12:45:53 2004 // Created: Sat Dec 04 12:45:53 2004
// Author: Peter KURNEV // Author: Peter KURNEV
// <peter@PREFEX>
//
#include <GEOMAlgo_Gluer.ixx> #include <GEOMAlgo_Gluer.ixx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_Tools.hxx>
#include <NMTDS_BoxBndTree.hxx> #include <NMTDS_BoxBndTree.hxx>
#include <NMTDS_BndSphereTree.hxx>
#include <NMTDS_BndSphere.hxx>
#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
#include <Basics_OCCTVersion.hxx>
#include <NCollection_UBTreeFiller.hxx> #include <NCollection_UBTreeFiller.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx> #include <TColStd_MapIteratorOfMapOfInteger.hxx>
@ -82,18 +92,6 @@
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
#include <BOP_CorrectTolerances.hxx> #include <BOP_CorrectTolerances.hxx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_Tools.hxx>
//
//modified by NIZNHY-PKV Thu Jan 21 10:02:52 2010f
#include <NMTDS_BndSphereTree.hxx>
#include <NMTDS_BndSphere.hxx>
#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
//modified by NIZNHY-PKV Thu Jan 21 10:02:56 2010t
//
static static
void GetSubShapes(const TopoDS_Shape& aS, void GetSubShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aMSS); TopTools_IndexedMapOfShape& aMSS);
@ -181,11 +179,17 @@ const TopTools_DataMapOfShapeShape& GEOMAlgo_Gluer::Origins()const
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::Perform() void GEOMAlgo_Gluer::Perform()
{ {
const Standard_Integer aNb=8;
Standard_Integer i;
//
myErrorStatus=0; myErrorStatus=0;
myWarningStatus=0; myWarningStatus=0;
// //
Standard_Integer i; #if OCC_VERSION_LARGE > 0x06050200
const Standard_Integer aNb=8; // Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
void (GEOMAlgo_Gluer::* pF[aNb])()={ void (GEOMAlgo_Gluer::* pF[aNb])()={
&GEOMAlgo_Gluer::CheckData, &GEOMAlgo_Gluer::InnerTolerance, &GEOMAlgo_Gluer::CheckData, &GEOMAlgo_Gluer::InnerTolerance,
&GEOMAlgo_Gluer::MakeVertices, &GEOMAlgo_Gluer::MakeEdges, &GEOMAlgo_Gluer::MakeVertices, &GEOMAlgo_Gluer::MakeEdges,
@ -1031,7 +1035,11 @@ Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
aC3D=BRep_Tool::Curve(aE, aT1, aT2); aC3D=BRep_Tool::Curve(aE, aT1, aT2);
aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2); aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
aC3D->D0(aT, aP); aC3D->D0(aT, aP);
#if OCC_VERSION_LARGE > 0x06050200
myContext->ProjectPointOnEdge(aP, aER, aTR);
#else
myContext.ProjectPointOnEdge(aP, aER, aTR); myContext.ProjectPointOnEdge(aP, aER, aTR);
#endif
// //
BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF); BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
if (aF.Orientation()==TopAbs_REVERSED) { if (aF.Orientation()==TopAbs_REVERSED) {

View File

@ -18,12 +18,17 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Gluer2.cxx // File: GEOMAlgo_Gluer2.cxx
// Author: Peter KURNEV // Author: Peter KURNEV
#include <GEOMAlgo_Gluer2.hxx> #include <GEOMAlgo_Gluer2.hxx>
#include <GEOMAlgo_GlueDetector.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <Basics_OCCTVersion.hxx>
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Compound.hxx> #include <TopoDS_Compound.hxx>
@ -31,8 +36,9 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <BRep_Builder.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib.hxx> #include <BRepLib.hxx>
#include <TopTools_MapOfShape.hxx> #include <TopTools_MapOfShape.hxx>
@ -43,9 +49,6 @@
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <GEOMAlgo_GlueDetector.hxx>
#include <GEOMAlgo_Tools3D.hxx>
//======================================================================= //=======================================================================
//function : GEOMAlgo_Gluer2 //function : GEOMAlgo_Gluer2
//purpose : //purpose :
@ -144,6 +147,11 @@ void GEOMAlgo_Gluer2::Perform()
return; return;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_GluerAlgo::Perform();
#endif
//
PerformShapesToWork(); PerformShapesToWork();
if (myErrorStatus) { if (myErrorStatus) {
return; return;
@ -620,6 +628,7 @@ void GEOMAlgo_Gluer2::BuildResult()
// //
myShape=aCnew; myShape=aCnew;
} }
//-------------------------------------------------------- //--------------------------------------------------------
// //
// ErrorStatus // ErrorStatus

View File

@ -18,14 +18,17 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GluerAlgo.cxx // File: GEOMAlgo_GluerAlgo.cxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
// <peter@PREFEX>
//
#include <GEOMAlgo_GluerAlgo.hxx> #include <GEOMAlgo_GluerAlgo.hxx>
#include <Basics_OCCTVersion.hxx>
#if OCC_VERSION_LARGE > 0x06050200
#include <IntTools_Context.hxx>
#endif
//======================================================================= //=======================================================================
//function : GEOMAlgo_GluerAlgo //function : GEOMAlgo_GluerAlgo
@ -36,6 +39,7 @@ GEOMAlgo_GluerAlgo::GEOMAlgo_GluerAlgo()
myTolerance=0.0001; myTolerance=0.0001;
myCheckGeometry=Standard_True; myCheckGeometry=Standard_True;
} }
//======================================================================= //=======================================================================
//function : ~GEOMAlgo_GluerAlgo //function : ~GEOMAlgo_GluerAlgo
//purpose : //purpose :
@ -43,6 +47,7 @@ GEOMAlgo_GluerAlgo::GEOMAlgo_GluerAlgo()
GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo() GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo()
{ {
} }
//======================================================================= //=======================================================================
//function : SetArgument //function : SetArgument
//purpose : //purpose :
@ -51,6 +56,7 @@ void GEOMAlgo_GluerAlgo::SetArgument(const TopoDS_Shape& theShape)
{ {
myArgument=theShape; myArgument=theShape;
} }
//======================================================================= //=======================================================================
//function : Argument //function : Argument
//purpose : //purpose :
@ -59,6 +65,7 @@ const TopoDS_Shape& GEOMAlgo_GluerAlgo::Argument()const
{ {
return myArgument; return myArgument;
} }
//======================================================================= //=======================================================================
//function : SetTolerance //function : SetTolerance
//purpose : //purpose :
@ -67,6 +74,7 @@ void GEOMAlgo_GluerAlgo::SetTolerance(const Standard_Real aT)
{ {
myTolerance=aT; myTolerance=aT;
} }
//======================================================================= //=======================================================================
//function : Tolerance //function : Tolerance
//purpose : //purpose :
@ -84,6 +92,7 @@ void GEOMAlgo_GluerAlgo::SetCheckGeometry(const Standard_Boolean aFlag)
{ {
myCheckGeometry=aFlag; myCheckGeometry=aFlag;
} }
//======================================================================= //=======================================================================
//function : CheckGeometry //function : CheckGeometry
//purpose : //purpose :
@ -92,14 +101,31 @@ Standard_Boolean GEOMAlgo_GluerAlgo::CheckGeometry() const
{ {
return myCheckGeometry; return myCheckGeometry;
} }
#if OCC_VERSION_LARGE > 0x06050200
//=======================================================================
//function : SetContext
//purpose :
//=======================================================================
void GEOMAlgo_GluerAlgo::SetContext(const Handle(IntTools_Context)& theContext)
{
myContext=theContext;
}
#endif
//======================================================================= //=======================================================================
//function : Context //function : Context
//purpose : //purpose :
//======================================================================= //=======================================================================
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& GEOMAlgo_GluerAlgo::Context()
#else
IntTools_Context& GEOMAlgo_GluerAlgo::Context() IntTools_Context& GEOMAlgo_GluerAlgo::Context()
#endif
{ {
return myContext; return myContext;
} }
//======================================================================= //=======================================================================
//function : Images //function : Images
//purpose : //purpose :
@ -108,6 +134,7 @@ const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_GluerAlgo::Images()const
{ {
return myImages; return myImages;
} }
//======================================================================= //=======================================================================
//function : Origins //function : Origins
//purpose : //purpose :
@ -116,6 +143,7 @@ const TopTools_DataMapOfShapeShape& GEOMAlgo_GluerAlgo::Origins()const
{ {
return myOrigins; return myOrigins;
} }
//======================================================================= //=======================================================================
//function : Clear //function : Clear
//purpose : //purpose :
@ -125,10 +153,16 @@ void GEOMAlgo_GluerAlgo::Clear()
myImages.Clear(); myImages.Clear();
myOrigins.Clear(); myOrigins.Clear();
} }
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_GluerAlgo::Perform() void GEOMAlgo_GluerAlgo::Perform()
{ {
#if OCC_VERSION_LARGE > 0x06050200
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
#endif
} }

View File

@ -18,24 +18,26 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GluerAlgo.hxx // File: GEOMAlgo_GluerAlgo.hxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#ifndef _GEOMAlgo_GluerAlgo_HeaderFile #ifndef _GEOMAlgo_GluerAlgo_HeaderFile
#define _GEOMAlgo_GluerAlgo_HeaderFile #define _GEOMAlgo_GluerAlgo_HeaderFile
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <TopoDS_Shape.hxx>
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#include <TopoDS_Shape.hxx>
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx> #include <TopTools_DataMapOfShapeShape.hxx>
#include <GEOMAlgo_BuilderShape.hxx> #include <GEOMAlgo_BuilderShape.hxx>
#include <Basics_OCCTVersion.hxx>
//======================================================================= //=======================================================================
//class : GEOMAlgo_GluerAlgo //class : GEOMAlgo_GluerAlgo
//purpose : //purpose :
@ -72,10 +74,14 @@ public:
Standard_EXPORT Standard_EXPORT
virtual void Clear() ; virtual void Clear() ;
Standard_EXPORT #if OCC_VERSION_LARGE > 0x06050200
IntTools_Context& Context() ; Standard_EXPORT void SetContext(const Handle(IntTools_Context)&);
Standard_EXPORT const Handle(IntTools_Context)& Context();
#else
Standard_EXPORT IntTools_Context& Context();
#endif
Standard_EXPORT Standard_EXPORT
const TopTools_DataMapOfShapeListOfShape& Images() const; const TopTools_DataMapOfShapeListOfShape& Images() const;
@ -86,7 +92,11 @@ protected:
TopoDS_Shape myArgument; TopoDS_Shape myArgument;
Standard_Real myTolerance; Standard_Real myTolerance;
Standard_Boolean myCheckGeometry; Standard_Boolean myCheckGeometry;
#if OCC_VERSION_LARGE > 0x06050200
Handle(IntTools_Context) myContext;
#else
IntTools_Context myContext; IntTools_Context myContext;
#endif
TopTools_DataMapOfShapeListOfShape myImages; TopTools_DataMapOfShapeListOfShape myImages;
TopTools_DataMapOfShapeShape myOrigins; TopTools_DataMapOfShapeShape myOrigins;

View File

@ -39,7 +39,16 @@ is
Initialize Initialize
returns ShapeAlgo from GEOMAlgo; returns ShapeAlgo from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ShapeAlgo();" ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ShapeAlgo();"
SetContext(me:out;
theContext:Context from IntTools);
---Purpose: Sets cashed geometrical tools
Context(me)
returns Context from IntTools;
---Purpose: Returns cashed geometrical tools
---C++: return const &
SetShape(me:out; SetShape(me:out;
aS:Shape from TopoDS); aS:Shape from TopoDS);
@ -56,7 +65,10 @@ is
Result(me) Result(me)
returns Shape from TopoDS; returns Shape from TopoDS;
---C++:return const & ---C++:return const &
Perform(me:out)
is redefined;
fields fields
myShape : Shape from TopoDS is protected; myShape : Shape from TopoDS is protected;
myTolerance : Real from Standard is protected; myTolerance : Real from Standard is protected;

View File

@ -18,22 +18,21 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_ShapeAlgo.cxx // File: GEOMAlgo_ShapeAlgo.cxx
// Created: Tue Dec 7 12:06:54 2004 // Created: Tue Dec 7 12:06:54 2004
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_ShapeAlgo.ixx> #include <GEOMAlgo_ShapeAlgo.ixx>
#include <Basics_OCCTVersion.hxx>
//======================================================================= //=======================================================================
//function : GEOMAlgo_ShapeAlgo //function : GEOMAlgo_ShapeAlgo
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo() GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo()
: : GEOMAlgo_Algo()
GEOMAlgo_Algo()
{ {
myTolerance=0.0001; myTolerance=0.0001;
} }
@ -45,6 +44,38 @@ GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo()
GEOMAlgo_ShapeAlgo::~GEOMAlgo_ShapeAlgo() GEOMAlgo_ShapeAlgo::~GEOMAlgo_ShapeAlgo()
{ {
} }
#if OCC_VERSION_LARGE > 0x06050200
//=======================================================================
//function : SetContext
//purpose :
//=======================================================================
void GEOMAlgo_ShapeAlgo::SetContext(const Handle(IntTools_Context)& theContext)
{
myContext=theContext;
}
//=======================================================================
//function : Context
//purpose :
//=======================================================================
const Handle(IntTools_Context)& GEOMAlgo_ShapeAlgo::Context()const
{
return myContext;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void GEOMAlgo_ShapeAlgo::Perform()
{
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
}
#endif
//======================================================================= //=======================================================================
//function : SetShape //function : SetShape
//purpose : //purpose :

View File

@ -18,108 +18,86 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMAlgo_ShapeAlgo_HeaderFile #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
#define _GEOMAlgo_ShapeAlgo_HeaderFile #define _GEOMAlgo_ShapeAlgo_HeaderFile
#ifndef _TopoDS_Shape_HeaderFile #include <GEOMAlgo_Algo.hxx>
#include <Basics_OCCTVersion.hxx>
#include <Standard.hxx>
#include <Standard_Macro.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#endif
#ifndef _IntTools_Context_HeaderFile #if OCC_VERSION_LARGE > 0x06050200
#include <Handle_IntTools_Context.hxx>
#else
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#endif #endif
#ifndef _GEOMAlgo_Algo_HeaderFile
#include <GEOMAlgo_Algo.hxx> class IntTools_Context;
#endif
class TopoDS_Shape; class TopoDS_Shape;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_ShapeAlgo : public GEOMAlgo_Algo { class GEOMAlgo_ShapeAlgo : public GEOMAlgo_Algo {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
return anAddress; return anAddress;
} }
void* operator new(size_t size) void* operator new(size_t size)
{ {
return Standard::Allocate(size); return Standard::Allocate(size);
} }
void operator delete(void *anAddress) void operator delete(void *anAddress)
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
// Methods PUBLIC
//
#if OCC_VERSION_LARGE > 0x06050200
//! Sets cashed geometrical tools <br>
Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ;
//! Returns cashed geometrical tools <br>
Standard_EXPORT const Handle_IntTools_Context& Context() const;
Standard_EXPORT void SetShape(const TopoDS_Shape& aS) ; Standard_EXPORT virtual void Perform() ;
#endif
Standard_EXPORT void SetShape(const TopoDS_Shape& aS) ;
Standard_EXPORT void SetTolerance(const Standard_Real aT) ; Standard_EXPORT void SetTolerance(const Standard_Real aT) ;
Standard_EXPORT const TopoDS_Shape& Shape() const;
Standard_EXPORT Standard_Real Tolerance() const;
Standard_EXPORT const TopoDS_Shape& Result() const;
Standard_EXPORT const TopoDS_Shape& Shape() const;
Standard_EXPORT Standard_Real Tolerance() const;
Standard_EXPORT const TopoDS_Shape& Result() const;
protected: protected:
// Methods PROTECTED
// Standard_EXPORT GEOMAlgo_ShapeAlgo();
Standard_EXPORT virtual ~GEOMAlgo_ShapeAlgo();
Standard_EXPORT GEOMAlgo_ShapeAlgo(); TopoDS_Shape myShape;
Standard_EXPORT virtual ~GEOMAlgo_ShapeAlgo(); Standard_Real myTolerance;
TopoDS_Shape myResult;
#if OCC_VERSION_LARGE > 0x06050200
// Fields PROTECTED Handle_IntTools_Context myContext;
// #else
TopoDS_Shape myShape; IntTools_Context myContext;
Standard_Real myTolerance; #endif
TopoDS_Shape myResult;
IntTools_Context myContext;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
private:
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -20,6 +20,9 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
#ifndef _IntTools_Context_HeaderFile
#include <IntTools_Context.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile #ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#endif #endif

View File

@ -18,15 +18,15 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_ShellSolid.cxx // File: GEOMAlgo_ShellSolid.cxx
// Created: Wed Jan 12 12:49:45 2005 // Created: Wed Jan 12 12:49:45 2005
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_ShellSolid.ixx> #include <GEOMAlgo_ShellSolid.ixx>
#include <Basics_OCCTVersion.hxx>
#include <Standard_Failure.hxx> #include <Standard_Failure.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
@ -265,9 +265,15 @@ void GEOMAlgo_ShellSolid::BuildResult()
TopoDS::Solid(aDS.Tool()) : TopoDS::Solid(aDS.Object()); TopoDS::Solid(aDS.Tool()) : TopoDS::Solid(aDS.Object());
// //
BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)& aPaveFiller; BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)& aPaveFiller;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
//
BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aRefSolid);
#else
IntTools_Context& aCtx=pPF->ChangeContext(); IntTools_Context& aCtx=pPF->ChangeContext();
// //
BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aRefSolid); BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aRefSolid);
#endif
aSC.Perform(aP3D, aTol); aSC.Perform(aP3D, aTol);
aSt=aSC.State(); aSt=aSC.State();
if (aSt==TopAbs_IN) { if (aSt==TopAbs_IN) {

View File

@ -49,14 +49,14 @@ is
RefineSDShapes(myclass; RefineSDShapes(myclass;
aMSD:out IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo; --qft aMSD:out IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo; --qft
aTol:Real from Standard; aTol:Real from Standard;
aCtx:out Context from IntTools) aCtx: Context from IntTools)
returns Integer from Standard; returns Integer from Standard;
FindSDShapes(myclass; FindSDShapes(myclass;
aLE :ListOfShape from TopTools; aLE :ListOfShape from TopTools;
aTol:Real from Standard; aTol:Real from Standard;
aMEE:out IndexedDataMapOfShapeListOfShape from TopTools; aMEE:out IndexedDataMapOfShapeListOfShape from TopTools;
aCtx:out Context from IntTools) aCtx: Context from IntTools)
returns Integer from Standard; returns Integer from Standard;
FindSDShapes(myclass; FindSDShapes(myclass;
@ -64,14 +64,14 @@ is
aLE :ListOfShape from TopTools; aLE :ListOfShape from TopTools;
aTol :Real from Standard; aTol :Real from Standard;
aLESD :out ListOfShape from TopTools; aLESD :out ListOfShape from TopTools;
aCtx :out Context from IntTools) aCtx : Context from IntTools)
returns Integer from Standard; returns Integer from Standard;
ProjectPointOnShape(myclass; ProjectPointOnShape(myclass;
aP1: Pnt from gp; aP1: Pnt from gp;
aS :Shape from TopoDS; aS :Shape from TopoDS;
aP2:out Pnt from gp; aP2:out Pnt from gp;
aCtx :out Context from IntTools) aCtx : Context from IntTools)
returns Boolean from Standard; returns Boolean from Standard;
PointOnShape(myclass; PointOnShape(myclass;
@ -111,14 +111,12 @@ is
aS :Shape from TopoDS) aS :Shape from TopoDS)
returns Boolean from Standard; returns Boolean from Standard;
--modified by NIZNHY-PKV Mon Feb 06 06:59:14 2012f
BuildPCurveForEdgeOnFace (myclass; BuildPCurveForEdgeOnFace (myclass;
aE : Edge from TopoDS; aE : Edge from TopoDS;
aEold: Edge from TopoDS; aEold: Edge from TopoDS;
aF : Face from TopoDS; aF : Face from TopoDS;
aCtx :out Context from IntTools) aCtx : Context from IntTools)
returns Integer from Standard; returns Integer from Standard;
--modified by NIZNHY-PKV Mon Feb 06 06:59:22 2012t
--fields --fields

View File

@ -25,6 +25,11 @@
#include <GEOMAlgo_Tools.ixx> #include <GEOMAlgo_Tools.ixx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <Basics_OCCTVersion.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
@ -60,9 +65,6 @@
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
static static
void GetCount(const TopoDS_Shape& aS, void GetCount(const TopoDS_Shape& aS,
Standard_Integer& iCnt); Standard_Integer& iCnt);
@ -115,9 +117,13 @@ void GetCount(const TopoDS_Shape& aS,
//function : RefineSDShapes //function : RefineSDShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE, Standard_Integer GEOMAlgo_Tools::RefineSDShapes (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE,
const Standard_Real aTol, const Standard_Real aTol,
IntTools_Context& aCtx) #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx)
#endif
{ {
Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd; Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd; TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
@ -177,10 +183,14 @@ void GetCount(const TopoDS_Shape& aS,
//function : FindSDShapes //function : FindSDShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopTools_ListOfShape& aLE, Standard_Integer GEOMAlgo_Tools::FindSDShapes (const TopTools_ListOfShape& aLE,
const Standard_Real aTol, const Standard_Real aTol,
TopTools_IndexedDataMapOfShapeListOfShape& aMEE, TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
IntTools_Context& aCtx) #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx)
#endif
{ {
Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr; Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr;
TopTools_ListOfShape aLESD; TopTools_ListOfShape aLESD;
@ -253,7 +263,11 @@ Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
const TopTools_ListOfShape& aLE, const TopTools_ListOfShape& aLE,
const Standard_Real aTol, const Standard_Real aTol,
TopTools_ListOfShape& aLESD, TopTools_ListOfShape& aLESD,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx) IntTools_Context& aCtx)
#endif
{ {
Standard_Boolean bIsDone; Standard_Boolean bIsDone;
Standard_Real aTol2, aD2; Standard_Real aTol2, aD2;
@ -291,7 +305,11 @@ Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1, Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
const TopoDS_Shape& aS, const TopoDS_Shape& aS,
gp_Pnt& aP2, gp_Pnt& aP2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx) IntTools_Context& aCtx)
#endif
{ {
Standard_Boolean bIsDone = Standard_False; Standard_Boolean bIsDone = Standard_False;
Standard_Real aT2; Standard_Real aT2;
@ -313,7 +331,11 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
if (aC3D.IsNull()) { if (aC3D.IsNull()) {
return Standard_True; return Standard_True;
} }
#if OCC_VERSION_LARGE > 0x06050200
bIsDone = aCtx->ProjectPointOnEdge(aP1, aE2, aT2);
#else
bIsDone = aCtx.ProjectPointOnEdge(aP1, aE2, aT2); bIsDone = aCtx.ProjectPointOnEdge(aP1, aE2, aT2);
#endif
} }
if (!bIsDone) { if (!bIsDone) {
return bIsDone; return bIsDone;
@ -326,7 +348,11 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
case TopAbs_FACE: case TopAbs_FACE:
{ {
const TopoDS_Face& aF2 = TopoDS::Face(aS); const TopoDS_Face& aF2 = TopoDS::Face(aS);
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aProj = aCtx->ProjPS(aF2);
#else
GeomAPI_ProjectPointOnSurf& aProj = aCtx.ProjPS(aF2); GeomAPI_ProjectPointOnSurf& aProj = aCtx.ProjPS(aF2);
#endif
// //
aProj.Perform(aP1); aProj.Perform(aP1);
bIsDone = aProj.IsDone(); bIsDone = aProj.IsDone();
@ -488,7 +514,11 @@ Standard_Integer
GEOMAlgo_Tools::BuildPCurveForEdgeOnFace(const TopoDS_Edge& aEold, GEOMAlgo_Tools::BuildPCurveForEdgeOnFace(const TopoDS_Edge& aEold,
const TopoDS_Edge& aEnew, const TopoDS_Edge& aEnew,
const TopoDS_Face& aF, const TopoDS_Face& aF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx) IntTools_Context& aCtx)
#endif
{ {
Standard_Boolean bIsClosed, bUClosed, bHasOld; Standard_Boolean bIsClosed, bUClosed, bHasOld;
Standard_Integer iRet, aNbPoints; Standard_Integer iRet, aNbPoints;
@ -553,7 +583,11 @@ Standard_Integer
aS=BRep_Tool::Surface(aF); aS=BRep_Tool::Surface(aF);
aS->D0(aUS1, aVS1, aP); aS->D0(aUS1, aVS1, aP);
// //
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aProjPC=aCtx->ProjPC(aEnew);
#else
GeomAPI_ProjectPointOnCurve& aProjPC=aCtx.ProjPC(aEnew); GeomAPI_ProjectPointOnCurve& aProjPC=aCtx.ProjPC(aEnew);
#endif
// //
aProjPC.Perform(aP); aProjPC.Perform(aP);
aNbPoints=aProjPC.NbPoints(); aNbPoints=aProjPC.NbPoints();

View File

@ -22,6 +22,15 @@
#ifndef _GEOMAlgo_Tools_HeaderFile #ifndef _GEOMAlgo_Tools_HeaderFile
#define _GEOMAlgo_Tools_HeaderFile #define _GEOMAlgo_Tools_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile #ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#endif #endif
@ -31,6 +40,13 @@
#ifndef _Standard_Real_HeaderFile #ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#endif #endif
#if OCC_VERSION_LARGE > 0x06050200
#ifndef _Handle_IntTools_Context_HeaderFile
#include <Handle_IntTools_Context.hxx>
#endif
#endif
#ifndef _Handle_Geom_Surface_HeaderFile #ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx> #include <Handle_Geom_Surface.hxx>
#endif #endif
@ -45,91 +61,93 @@ class TopoDS_Edge;
class TopoDS_Face; class TopoDS_Face;
class Geom_Surface; class Geom_Surface;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_Tools {
class GEOMAlgo_Tools {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
return anAddress; return anAddress;
} }
void* operator new(size_t size) void* operator new(size_t size)
{ {
return Standard::Allocate(size); return Standard::Allocate(size);
} }
void operator delete(void *anAddress) void operator delete(void *anAddress)
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
// Methods PUBLIC Standard_EXPORT static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS);
//
Standard_EXPORT static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS) ; Standard_EXPORT static Standard_Integer RefineSDShapes (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD,
const Standard_Real aTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Integer RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD,const Standard_Real aTol,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Integer FindSDShapes (const TopTools_ListOfShape& aLE,
const Standard_Real aTol,
TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Integer FindSDShapes(const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_IndexedDataMapOfShapeListOfShape& aMEE,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Integer FindSDShapes (const TopoDS_Shape& aE1,
const TopTools_ListOfShape& aLE,
const Standard_Real aTol,
TopTools_ListOfShape& aLESD,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Integer FindSDShapes(const TopoDS_Shape& aE1,const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_ListOfShape& aLESD,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Boolean ProjectPointOnShape (const gp_Pnt& aP1,
const TopoDS_Shape& aS,
gp_Pnt& aP2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Boolean ProjectPointOnShape(const gp_Pnt& aP1,const TopoDS_Shape& aS,gp_Pnt& aP2,IntTools_Context& aCtx) ; Standard_EXPORT static void PointOnShape(const TopoDS_Shape& aS,gp_Pnt& aP3D);
Standard_EXPORT static void PointOnShape(const TopoDS_Shape& aS,gp_Pnt& aP3D) ; Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aE,gp_Pnt& aP3D);
Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aE,gp_Pnt& aP3D) ; Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aE,const Standard_Real aT,gp_Pnt& aP3D);
Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aE,const Standard_Real aT,gp_Pnt& aP3D) ; Standard_EXPORT static void PointOnFace(const TopoDS_Face& aF,gp_Pnt& aP3D);
Standard_EXPORT static void PointOnFace(const TopoDS_Face& aF,gp_Pnt& aP3D) ; Standard_EXPORT static void PointOnFace(const TopoDS_Face& aF,const Standard_Real aU,const Standard_Real aV,gp_Pnt& aP3D);
Standard_EXPORT static void PointOnFace(const TopoDS_Face& aF,const Standard_Real aU,const Standard_Real aV,gp_Pnt& aP3D) ; Standard_EXPORT static void RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,const TopoDS_Face& aF,const Standard_Real aU1,const Standard_Real aU2);
Standard_EXPORT static void RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,const TopoDS_Face& aF,const Standard_Real aU1,const Standard_Real aU2) ; Standard_EXPORT static Standard_Boolean IsUPeriodic(const Handle(Geom_Surface)& aS);
Standard_EXPORT static Standard_Boolean IsUPeriodic(const Handle(Geom_Surface)& aS) ;
Standard_EXPORT static Standard_Boolean CorrectWires(const TopoDS_Shape& aS) ;
Standard_EXPORT static Standard_Integer BuildPCurveForEdgeOnFace(const TopoDS_Edge& aE,const TopoDS_Edge& aEold,const TopoDS_Face& aF,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Boolean CorrectWires(const TopoDS_Shape& aS);
Standard_EXPORT static Standard_Integer BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
const TopoDS_Edge& aEold,
const TopoDS_Face& aF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
protected: protected:
// Methods PROTECTED private:
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
#endif #endif

View File

@ -44,14 +44,14 @@ uses
IndexedDataMapOfShapeListOfShape from TopTools, IndexedDataMapOfShapeListOfShape from TopTools,
Context from IntTools, Context from IntTools,
ListOfCoupleOfShape from NMTTools ListOfCoupleOfShape from NMTTools
--raises --raises
is is
IsSplitToReverse(myclass; IsSplitToReverse(myclass;
theSplit : Shape from TopoDS; theSplit : Shape from TopoDS;
theShape : Shape from TopoDS; theShape : Shape from TopoDS;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Returns True if the shape theSplit has opposite ---Purpose: Returns True if the shape theSplit has opposite
-- direction than theShape -- direction than theShape
-- theContext - cashed geometrical tools -- theContext - cashed geometrical tools
@ -60,7 +60,7 @@ is
IsSplitToReverse(myclass; IsSplitToReverse(myclass;
theSplit : Face from TopoDS; theSplit : Face from TopoDS;
theShape : Face from TopoDS; theShape : Face from TopoDS;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Returns True if normal direction of the face ---Purpose: Returns True if normal direction of the face
-- theShape is not the same as for the face -- theShape is not the same as for the face
-- theSplit -- theSplit
@ -70,7 +70,7 @@ is
IsSplitToReverse(myclass; IsSplitToReverse(myclass;
theEdge : Edge from TopoDS; theEdge : Edge from TopoDS;
theSplit : Edge from TopoDS; theSplit : Edge from TopoDS;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Returns True if tangent direction of the edge ---Purpose: Returns True if tangent direction of the edge
-- theEdge is not the same as for the edge -- theEdge is not the same as for the edge
-- theSplit -- theSplit
@ -112,7 +112,7 @@ is
theShape :Shape from TopoDS; theShape :Shape from TopoDS;
theSolid :Solid from TopoDS; theSolid :Solid from TopoDS;
theTol :Real from Standard; theTol :Real from Standard;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Computes the 3-D state of the shape theShape ---Purpose: Computes the 3-D state of the shape theShape
-- toward solid theSolid. -- toward solid theSolid.
-- theTol - value of precision of computation -- theTol - value of precision of computation
@ -124,7 +124,7 @@ is
thePoint :Pnt from gp; thePoint :Pnt from gp;
theSolid :Solid from TopoDS; theSolid :Solid from TopoDS;
theTol :Real from Standard; theTol :Real from Standard;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Computes the 3-D state of the point thePoint ---Purpose: Computes the 3-D state of the point thePoint
-- toward solid theSolid. -- toward solid theSolid.
-- theTol - value of precision of computation -- theTol - value of precision of computation
@ -136,7 +136,7 @@ is
theVertex:Vertex from TopoDS; theVertex:Vertex from TopoDS;
theSolid :Solid from TopoDS; theSolid :Solid from TopoDS;
theTol :Real from Standard; theTol :Real from Standard;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Computes the 3-D state of the vertex theVertex ---Purpose: Computes the 3-D state of the vertex theVertex
-- toward solid theSolid. -- toward solid theSolid.
-- theTol - value of precision of computation -- theTol - value of precision of computation
@ -148,7 +148,7 @@ is
theEdge :Edge from TopoDS; theEdge :Edge from TopoDS;
theSolid :Solid from TopoDS; theSolid :Solid from TopoDS;
theTol :Real from Standard; theTol :Real from Standard;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Computes the 3-D state of the edge theEdge ---Purpose: Computes the 3-D state of the edge theEdge
-- toward solid theSolid. -- toward solid theSolid.
-- theTol - value of precision of computation -- theTol - value of precision of computation
@ -161,7 +161,7 @@ is
theSolid :Solid from TopoDS; theSolid :Solid from TopoDS;
theTol :Real from Standard; theTol :Real from Standard;
theBounds:IndexedMapOfShape from TopTools; theBounds:IndexedMapOfShape from TopTools;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Computes the 3-D state of the face theFace ---Purpose: Computes the 3-D state of the face theFace
-- toward solid theSolid. -- toward solid theSolid.
-- theTol - value of precision of computation -- theTol - value of precision of computation
@ -175,7 +175,7 @@ is
theEdge :Edge from TopoDS; theEdge :Edge from TopoDS;
theFace1 :Face from TopoDS; theFace1 :Face from TopoDS;
theFace2 :Face from TopoDS; theFace2 :Face from TopoDS;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Returns True if the face theFace is inside of the ---Purpose: Returns True if the face theFace is inside of the
-- couple of faces theFace1, theFace2. -- couple of faces theFace1, theFace2.
-- The faces theFace, theFace1, theFace2 must -- The faces theFace, theFace1, theFace2 must
@ -186,7 +186,7 @@ is
theFace :Face from TopoDS; theFace :Face from TopoDS;
theEdge :Edge from TopoDS; theEdge :Edge from TopoDS;
theLF :ListOfShape from TopTools; theLF :ListOfShape from TopTools;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Returns True if the face theFace is inside of the ---Purpose: Returns True if the face theFace is inside of the
-- appropriate couple of faces (from the set theLF) . -- appropriate couple of faces (from the set theLF) .
-- The faces of the set theLF and theFace must -- The faces of the set theLF and theFace must
@ -198,7 +198,7 @@ is
theSolid :Solid from TopoDS; theSolid :Solid from TopoDS;
theMEF :IndexedDataMapOfShapeListOfShape from TopTools; theMEF :IndexedDataMapOfShapeListOfShape from TopTools;
theTol :Real from Standard; theTol :Real from Standard;
theContext:out Context from IntTools) theContext: Context from IntTools)
---Purpose: Returns True if the face theFace is inside the ---Purpose: Returns True if the face theFace is inside the
-- solid theSolid. -- solid theSolid.
-- theMEF - Map Edge/Faces for theSolid -- theMEF - Map Edge/Faces for theSolid

View File

@ -18,13 +18,18 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMAlgo_Tools3D.cxx // File : GEOMAlgo_Tools3D.cxx
// Created :
// Author : Peter KURNEV // Author : Peter KURNEV
#include <GEOMAlgo_Tools3D.ixx> #include <GEOMAlgo_Tools3D.ixx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <Basics_OCCTVersion.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
@ -44,6 +49,7 @@
#include <Geom2dHatch_Intersector.hxx> #include <Geom2dHatch_Intersector.hxx>
#include <Geom2dHatch_Hatcher.hxx> #include <Geom2dHatch_Hatcher.hxx>
#include <HatchGen_Domain.hxx> #include <HatchGen_Domain.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
@ -69,7 +75,7 @@
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
//
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
@ -87,19 +93,15 @@
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools.hxx> #include <BOPTools_Tools.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_MapOfShape.hxx> #include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx> #include <TopTools_MapIteratorOfMapOfShape.hxx>
//
#include <GeomAdaptor_Surface.hxx> #include <GeomAdaptor_Surface.hxx>
//
static static
Standard_Boolean FindFacePairs (const TopoDS_Edge& , Standard_Boolean FindFacePairs (const TopoDS_Edge& ,
const TopTools_ListOfShape& , const TopTools_ListOfShape& ,
@ -117,7 +119,11 @@ static
Standard_Real aT, Standard_Real aT,
gp_Pnt& aPF, gp_Pnt& aPF,
gp_Dir& aDNF, gp_Dir& aDNF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx); IntTools_Context& aCtx);
#endif
//======================================================================= //=======================================================================
//function : IsInternalFace //function : IsInternalFace
@ -127,7 +133,11 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Solid& theSolid, const TopoDS_Solid& theSolid,
const TopTools_IndexedDataMapOfShapeListOfShape& theMEF, const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
const Standard_Real theTol, const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_Context& theContext) IntTools_Context& theContext)
#endif
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer aNbF; Standard_Integer aNbF;
@ -193,7 +203,11 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace, Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge, const TopoDS_Edge& theEdge,
const TopTools_ListOfShape& theLF, const TopTools_ListOfShape& theLF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_Context& theContext) IntTools_Context& theContext)
#endif
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Boolean aNbF; Standard_Boolean aNbF;
@ -236,7 +250,11 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge, const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1, const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2, const TopoDS_Face& theFace2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_Context& theContext) IntTools_Context& theContext)
#endif
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Real aT1, aT2, aT, aDt2D, aDt2Dx; Standard_Real aT1, aT2, aT, aDt2D, aDt2Dx;
@ -426,7 +444,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
const TopoDS_Solid& theRef, const TopoDS_Solid& theRef,
const Standard_Real theTol, const Standard_Real theTol,
const TopTools_IndexedMapOfShape& theBounds, const TopTools_IndexedMapOfShape& theBounds,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theCtx)
#else
IntTools_Context& theCtx) IntTools_Context& theCtx)
#endif
{ {
TopAbs_State aState; TopAbs_State aState;
TopExp_Explorer aExp; TopExp_Explorer aExp;
@ -467,7 +489,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
TopAbs_State GEOMAlgo_Tools3D::ComputeStateByOnePoint(const TopoDS_Shape& theS, TopAbs_State GEOMAlgo_Tools3D::ComputeStateByOnePoint(const TopoDS_Shape& theS,
const TopoDS_Solid& theRef, const TopoDS_Solid& theRef,
const Standard_Real theTol, const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theCtx)
#else
IntTools_Context& theCtx) IntTools_Context& theCtx)
#endif
{ {
TopAbs_State aState; TopAbs_State aState;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@ -491,7 +517,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Vertex& theV, TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Vertex& theV,
const TopoDS_Solid& theRef, const TopoDS_Solid& theRef,
const Standard_Real theTol, const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theCtx)
#else
IntTools_Context& theCtx) IntTools_Context& theCtx)
#endif
{ {
TopAbs_State aState; TopAbs_State aState;
gp_Pnt aP3D; gp_Pnt aP3D;
@ -507,7 +537,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Edge& theE, TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Edge& theE,
const TopoDS_Solid& theRef, const TopoDS_Solid& theRef,
const Standard_Real theTol, const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theCtx)
#else
IntTools_Context& theCtx) IntTools_Context& theCtx)
#endif
{ {
Standard_Real aT1, aT2, aT = 0.; Standard_Real aT1, aT2, aT = 0.;
TopAbs_State aState; TopAbs_State aState;
@ -557,11 +591,19 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const gp_Pnt& theP, TopAbs_State GEOMAlgo_Tools3D::ComputeState(const gp_Pnt& theP,
const TopoDS_Solid& theRef, const TopoDS_Solid& theRef,
const Standard_Real theTol, const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theCtx)
#else
IntTools_Context& theCtx) IntTools_Context& theCtx)
#endif
{ {
TopAbs_State aState; TopAbs_State aState;
// //
#if OCC_VERSION_LARGE > 0x06050200
BRepClass3d_SolidClassifier& aSC=theCtx->SolidClassifier(theRef);
#else
BRepClass3d_SolidClassifier& aSC=theCtx.SolidClassifier(theRef); BRepClass3d_SolidClassifier& aSC=theCtx.SolidClassifier(theRef);
#endif
aSC.Perform(theP, theTol); aSC.Perform(theP, theTol);
// //
aState=aSC.State(); aState=aSC.State();
@ -572,9 +614,13 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
// function: IsSplitToReverse // function: IsSplitToReverse
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Shape& theSp, Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse (const TopoDS_Shape& theSp,
const TopoDS_Shape& theSr, const TopoDS_Shape& theSr,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theCtx)
#else
IntTools_Context& theCtx) IntTools_Context& theCtx)
#endif
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@ -606,9 +652,13 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
//function :IsSplitToReverse //function :IsSplitToReverse
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Face& theFSp, Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse (const TopoDS_Face& theFSp,
const TopoDS_Face& theFSr, const TopoDS_Face& theFSr,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_Context& theContext) IntTools_Context& theContext)
#endif
{ {
Standard_Boolean bRet, bFound, bInFace; Standard_Boolean bRet, bFound, bInFace;
Standard_Real aT1, aT2, aT, aU, aV, aScPr; Standard_Real aT1, aT2, aT, aU, aV, aScPr;
@ -677,7 +727,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
//modified by NIZNHY-PKV Tue Nov 22 10:50:37 2011t //modified by NIZNHY-PKV Tue Nov 22 10:50:37 2011t
// //
// Parts of theContext.ComputeVS(..) // Parts of theContext.ComputeVS(..)
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aProjector=theContext->ProjPS(theFSr);
#else
GeomAPI_ProjectPointOnSurf& aProjector=theContext.ProjPS(theFSr); GeomAPI_ProjectPointOnSurf& aProjector=theContext.ProjPS(theFSr);
#endif
aProjector.Perform(aPFSp); aProjector.Perform(aPFSp);
if (!aProjector.IsDone()) { if (!aProjector.IsDone()) {
return bRet; return bRet;
@ -685,7 +739,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
// //
aProjector.LowerDistanceParameters(aU, aV); aProjector.LowerDistanceParameters(aU, aV);
gp_Pnt2d aP2D(aU, aV); gp_Pnt2d aP2D(aU, aV);
#if OCC_VERSION_LARGE > 0x06050200
bInFace=theContext->IsPointInFace (theFSr, aP2D);
#else
bInFace=theContext.IsPointInFace (theFSr, aP2D); bInFace=theContext.IsPointInFace (theFSr, aP2D);
#endif
if (!bInFace) { if (!bInFace) {
return bRet; return bRet;
} }
@ -707,9 +765,13 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
//function :IsSplitToReverse //function :IsSplitToReverse
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Edge& theSplit, Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse (const TopoDS_Edge& theSplit,
const TopoDS_Edge& theEdge, const TopoDS_Edge& theEdge,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_Context& theContext) IntTools_Context& theContext)
#endif
{ {
Standard_Boolean bRet, aFlag, bIsDegenerated; Standard_Boolean bRet, aFlag, bIsDegenerated;
Standard_Real aTE, aTS, aScPr, aTa, aTb, aT1, aT2; Standard_Real aTE, aTS, aScPr, aTa, aTb, aT1, aT2;
@ -741,7 +803,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
aFlag=BOPTools_Tools2D::EdgeTangent(theSplit, aTS, aVS); aFlag=BOPTools_Tools2D::EdgeTangent(theSplit, aTS, aVS);
gp_Dir aDTS(aVS); gp_Dir aDTS(aVS);
// //
#if OCC_VERSION_LARGE > 0x06050200
aFlag=theContext->ProjectPointOnEdge(aP, theEdge, aTE);
#else
aFlag=theContext.ProjectPointOnEdge(aP, theEdge, aTE); aFlag=theContext.ProjectPointOnEdge(aP, theEdge, aTE);
#endif
aFlag=BOPTools_Tools2D::EdgeTangent(theEdge, aTE, aVE); aFlag=BOPTools_Tools2D::EdgeTangent(theEdge, aTE, aVE);
gp_Dir aDTE(aVE); gp_Dir aDTE(aVE);
// //
@ -1086,7 +1152,11 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
Standard_Real aT, Standard_Real aT,
gp_Pnt& aPF, gp_Pnt& aPF,
gp_Dir& aDNF, gp_Dir& aDNF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx) IntTools_Context& aCtx)
#endif
{ {
Standard_Boolean bReverse; Standard_Boolean bReverse;
Standard_Real aT1, aT2, dT, aU, aV; Standard_Real aT1, aT2, dT, aU, aV;
@ -1166,7 +1236,11 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
aDNF.Reverse(); aDNF.Reverse();
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aProjector=aCtx->ProjPS(aF);
#else
GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF); GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF);
#endif
// //
aProjector.Perform(aPFx); aProjector.Perform(aPFx);
if(aProjector.IsDone()) { if(aProjector.IsDone()) {

View File

@ -18,14 +18,27 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMAlgo_Tools3D_HeaderFile #ifndef _GEOMAlgo_Tools3D_HeaderFile
#define _GEOMAlgo_Tools3D_HeaderFile #define _GEOMAlgo_Tools3D_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile #ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#endif #endif
#if OCC_VERSION_LARGE > 0x06050200
#ifndef _Handle_IntTools_Context_HeaderFile
#include <Handle_IntTools_Context.hxx>
#endif
#endif
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
@ -38,6 +51,7 @@
#ifndef _Standard_Real_HeaderFile #ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#endif #endif
class TopoDS_Shape; class TopoDS_Shape;
class IntTools_Context; class IntTools_Context;
class TopoDS_Face; class TopoDS_Face;
@ -52,180 +66,234 @@ class TopTools_IndexedDataMapOfShapeListOfShape;
class NMTTools_ListOfCoupleOfShape; class NMTTools_ListOfCoupleOfShape;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
//! Auxiliary tools for Algorithms <br> //! Auxiliary tools for Algorithms <br>
class GEOMAlgo_Tools3D { class GEOMAlgo_Tools3D {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
return anAddress; return anAddress;
} }
void* operator new(size_t size) void* operator new(size_t size)
{ {
return Standard::Allocate(size); return Standard::Allocate(size);
} }
void operator delete(void *anAddress) void operator delete(void *anAddress)
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
// Methods PUBLIC
//
//! Returns True if the shape theSplit has opposite <br> //! Returns True if the shape theSplit has opposite <br>
//! direction than theShape <br> //! direction than theShape <br>
//! theContext - cashed geometrical tools <br> //! theContext - cashed geometrical tools <br>
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,const TopoDS_Shape& theShape,IntTools_Context& theContext) ; Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Shape& theSplit,
const TopoDS_Shape& theShape,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if normal direction of the face <br> //! Returns True if normal direction of the face <br>
//! theShape is not the same as for the face <br> //! theShape is not the same as for the face <br>
//! theSplit <br> //! theSplit <br>
//! theContext - cashed geometrical tools <br> //! theContext - cashed geometrical tools <br>
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,const TopoDS_Face& theShape,IntTools_Context& theContext) ; Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Face& theSplit,
const TopoDS_Face& theShape,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if tangent direction of the edge <br> //! Returns True if tangent direction of the edge <br>
//! theEdge is not the same as for the edge <br> //! theEdge is not the same as for the edge <br>
//! theSplit <br> //! theSplit <br>
//! theContext - cashed geometrical tools <br> //! theContext - cashed geometrical tools <br>
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theEdge,const TopoDS_Edge& theSplit,IntTools_Context& theContext) ; Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Edge& theEdge,
const TopoDS_Edge& theSplit,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! For the couple of faces theF1, theF2 <br> //! For the couple of faces theF1, theF2 <br>
//! computes sense value <br> //! computes sense value <br>
//! Returns 0 if the faces are not sensible <br> //! Returns 0 if the faces are not sensible <br>
//! Returns 1 if the faces have same sense <br> //! Returns 1 if the faces have same sense <br>
//! Returns 2 if the faces have opposite sense <br> //! Returns 2 if the faces have opposite sense <br>
Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,const TopoDS_Face& theF2) ; Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1, const TopoDS_Face& theF2);
//! Makes new face theF2 from surface and wires <br> //! Makes new face theF2 from surface and wires <br>
//! of the face theF1 <br> //! of the face theF1 <br>
Standard_EXPORT static void CopyFace(const TopoDS_Face& theF1,TopoDS_Face& theF2) ; Standard_EXPORT static void CopyFace (const TopoDS_Face& theF1, TopoDS_Face& theF2);
//! Makes empty shape theShape of the type theType <br> //! Makes empty shape theShape of the type theType <br>
Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,TopoDS_Shape& theShape) ; Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
//! For the list of faces theLS build block <br> //! For the list of faces theLS build block <br>
//! theLSCB in terms of connexity by edges <br> //! theLSCB in terms of connexity by edges <br>
//! theMapAvoid - set of edges to avoid for <br> //! theMapAvoid - set of edges to avoid for <br>
//! the treatment <br> //! the treatment <br>
Standard_EXPORT static void MakeConnexityBlock(const TopTools_ListOfShape& theLS,const TopTools_IndexedMapOfShape& theMapAvoid,TopTools_ListOfShape& theLSCB) ; Standard_EXPORT static void MakeConnexityBlock (const TopTools_ListOfShape& theLS,
const TopTools_IndexedMapOfShape& theMapAvoid,
TopTools_ListOfShape& theLSCB);
//! Computes the 3-D state of the shape theShape <br> //! Computes the 3-D state of the shape theShape <br>
//! toward solid theSolid. <br> //! toward solid theSolid. <br>
//! theTol - value of precision of computation <br> //! theTol - value of precision of computation <br>
//! theContext- cahed geometrical tools <br> //! theContext- cahed geometrical tools <br>
//! Returns 3-D state. <br> //! Returns 3-D state. <br>
Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; Standard_EXPORT static TopAbs_State ComputeStateByOnePoint (const TopoDS_Shape& theShape,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the point thePoint <br> //! Computes the 3-D state of the point thePoint <br>
//! toward solid theSolid. <br> //! toward solid theSolid. <br>
//! theTol - value of precision of computation <br> //! theTol - value of precision of computation <br>
//! theContext- cahed geometrical tools <br> //! theContext- cahed geometrical tools <br>
//! Returns 3-D state. <br> //! Returns 3-D state. <br>
Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; Standard_EXPORT static TopAbs_State ComputeState (const gp_Pnt& thePoint,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the vertex theVertex <br> //! Computes the 3-D state of the vertex theVertex <br>
//! toward solid theSolid. <br> //! toward solid theSolid. <br>
//! theTol - value of precision of computation <br> //! theTol - value of precision of computation <br>
//! theContext- cahed geometrical tools <br> //! theContext- cahed geometrical tools <br>
//! Returns 3-D state. <br> //! Returns 3-D state. <br>
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Vertex& theVertex,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the edge theEdge <br> //! Computes the 3-D state of the edge theEdge <br>
//! toward solid theSolid. <br> //! toward solid theSolid. <br>
//! theTol - value of precision of computation <br> //! theTol - value of precision of computation <br>
//! theContext- cahed geometrical tools <br> //! theContext- cahed geometrical tools <br>
//! Returns 3-D state. <br> //! Returns 3-D state. <br>
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Edge& theEdge,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the face theFace <br> //! Computes the 3-D state of the face theFace <br>
//! toward solid theSolid. <br> //! toward solid theSolid. <br>
//! theTol - value of precision of computation <br> //! theTol - value of precision of computation <br>
//! theBounds - set of edges of theFace to avoid <br> //! theBounds - set of edges of theFace to avoid <br>
//! theContext- cahed geometrical tools <br> //! theContext- cahed geometrical tools <br>
//! Returns 3-D state. <br> //! Returns 3-D state. <br>
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const Standard_Real theTol,const TopTools_IndexedMapOfShape& theBounds,IntTools_Context& theContext) ; Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Face& theFace,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
const TopTools_IndexedMapOfShape& theBounds,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if the face theFace is inside of the <br> //! Returns True if the face theFace is inside of the <br>
//! couple of faces theFace1, theFace2. <br> //! couple of faces theFace1, theFace2. <br>
//! The faces theFace, theFace1, theFace2 must <br> //! The faces theFace, theFace1, theFace2 must <br>
//! share the edge theEdge <br> //! share the edge theEdge <br>
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopoDS_Face& theFace1,const TopoDS_Face& theFace2,IntTools_Context& theContext) ; Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if the face theFace is inside of the <br> //! Returns True if the face theFace is inside of the <br>
//! appropriate couple of faces (from the set theLF) . <br> //! appropriate couple of faces (from the set theLF) . <br>
//! The faces of the set theLF and theFace must <br> //! The faces of the set theLF and theFace must <br>
//! share the edge theEdge <br> //! share the edge theEdge <br>
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopTools_ListOfShape& theLF,IntTools_Context& theContext) ; Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
const TopTools_ListOfShape& theLF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if the face theFace is inside the <br> //! Returns True if the face theFace is inside the <br>
//! solid theSolid. <br> //! solid theSolid. <br>
//! theMEF - Map Edge/Faces for theSolid <br> //! theMEF - Map Edge/Faces for theSolid <br>
//! theTol - value of precision of computation <br> //! theTol - value of precision of computation <br>
//! theContext- cahed geometrical tools <br> //! theContext- cahed geometrical tools <br>
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,const Standard_Real theTol,IntTools_Context& theContext) ; Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
const TopoDS_Solid& theSolid,
const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! For the face theFace and its edge theEdge <br> //! For the face theFace and its edge theEdge <br>
//! finds the face suitable to produce shell. <br> //! finds the face suitable to produce shell. <br>
//! theLCEF - set of faces to search. All faces <br> //! theLCEF - set of faces to search. All faces <br>
//! from theLCEF must share edge theEdge <br> //! from theLCEF must share edge theEdge <br>
Standard_EXPORT static void GetFaceOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,const NMTTools_ListOfCoupleOfShape& theLCEF,TopoDS_Face& theFaceOff) ; Standard_EXPORT static void GetFaceOff (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
//! For the face theFace gets the edge theEdgeOnF <br> const NMTTools_ListOfCoupleOfShape& theLCEF,
//! that is the same as theEdge <br> TopoDS_Face& theFaceOff);
//! Returns True if such edge exists <br>
//! Returns False if there is no such edge <br>
Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOnF) ;
//! Returns True if the face theFace contains <br>
//! the edge theEdge but with opposite orientation. <br>
//! If the method returns True theEdgeOff is the <br>
//! edge founded <br>
Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOff) ;
//! Computes a point <theP> inside the face <theF>. <br>
//! <theP2D> - 2D representation of <theP> <br>
//! on the surface of <theF> <br>
//! Returns 0 in case of success. <br>
Standard_EXPORT static Standard_Integer PntInFace(const TopoDS_Face& theF,gp_Pnt& theP,gp_Pnt2d& theP2D) ;
//! For the face theFace gets the edge theEdgeOnF <br>
//! that is the same as theEdge <br>
//! Returns True if such edge exists <br>
//! Returns False if there is no such edge <br>
Standard_EXPORT static Standard_Boolean GetEdgeOnFace (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
TopoDS_Edge& theEdgeOnF);
//! Returns True if the face theFace contains <br>
//! the edge theEdge but with opposite orientation. <br>
//! If the method returns True theEdgeOff is the <br>
//! edge founded <br>
Standard_EXPORT static Standard_Boolean GetEdgeOff (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
TopoDS_Edge& theEdgeOff);
//! Computes a point <theP> inside the face <theF>. <br>
//! <theP2D> - 2D representation of <theP> <br>
//! on the surface of <theF> <br>
//! Returns 0 in case of success. <br>
Standard_EXPORT static Standard_Integer PntInFace (const TopoDS_Face& theF,
gp_Pnt& theP,
gp_Pnt2d& theP2D);
protected: protected:
// Methods PROTECTED private:
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -18,15 +18,15 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_VertexSolid.cxx // File: GEOMAlgo_VertexSolid.cxx
// Created: Wed Jan 12 16:36:40 2005 // Created: Wed Jan 12 16:36:40 2005
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_VertexSolid.ixx> #include <GEOMAlgo_VertexSolid.ixx>
#include <Basics_OCCTVersion.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
@ -136,14 +136,22 @@ void GEOMAlgo_VertexSolid::Prepare()
BOPTools_CArray1OfVVInterference& aVVs=pIP->VVInterferences(); BOPTools_CArray1OfVVInterference& aVVs=pIP->VVInterferences();
const BOPTools_PaveFiller& aPF=myDSFiller->PaveFiller(); const BOPTools_PaveFiller& aPF=myDSFiller->PaveFiller();
BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)&aPF; BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)&aPF;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext(); IntTools_Context& aCtx=pPF->ChangeContext();
#endif
// //
const TopoDS_Shape& aObj=aDS.Object(); const TopoDS_Shape& aObj=aDS.Object();
const TopoDS_Shape& aTool=aDS.Tool(); const TopoDS_Shape& aTool=aDS.Tool();
// //
const TopoDS_Solid& aSolid=(myRank==1) ? TopoDS::Solid(aTool) : TopoDS::Solid(aObj); const TopoDS_Solid& aSolid=(myRank==1) ? TopoDS::Solid(aTool) : TopoDS::Solid(aObj);
// //
#if OCC_VERSION_LARGE > 0x06050200
BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
#else
BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aSolid); BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aSolid);
#endif
// //
iBeg=1; iBeg=1;
iEnd=aDS.NumberOfShapesOfTheObject(); iEnd=aDS.NumberOfShapesOfTheObject();

View File

@ -43,7 +43,6 @@
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx> #include <TopoDS_Iterator.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve2d.hxx> #include <BRepAdaptor_Curve2d.hxx>
@ -51,8 +50,6 @@
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <TopTools_SequenceOfShape.hxx> #include <TopTools_SequenceOfShape.hxx>
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
@ -113,15 +110,15 @@ static
const TopoDS_Face& aF); const TopoDS_Face& aF);
static static
Standard_Real Tolerance2D (const TopoDS_Vertex& aV, Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS); const GeomAdaptor_Surface& aGAS);
static static
Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& ); Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& );
// //
//======================================================================= //=======================================================================
// function: // function:
// purpose: // purpose:
//======================================================================= //=======================================================================
GEOMAlgo_WireSplitter::GEOMAlgo_WireSplitter() GEOMAlgo_WireSplitter::GEOMAlgo_WireSplitter()
: :
@ -131,14 +128,14 @@ static
} }
//======================================================================= //=======================================================================
// function: ~ // function: ~
// purpose: // purpose:
//======================================================================= //=======================================================================
GEOMAlgo_WireSplitter::~GEOMAlgo_WireSplitter() GEOMAlgo_WireSplitter::~GEOMAlgo_WireSplitter()
{ {
} }
//======================================================================= //=======================================================================
// function: SetFace // function: SetFace
// purpose: // purpose:
//======================================================================= //=======================================================================
void GEOMAlgo_WireSplitter::SetFace(const TopoDS_Face& aFace) void GEOMAlgo_WireSplitter::SetFace(const TopoDS_Face& aFace)
{ {
@ -146,7 +143,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Face // function: Face
// purpose: // purpose:
//======================================================================= //=======================================================================
const TopoDS_Face& GEOMAlgo_WireSplitter::Face()const const TopoDS_Face& GEOMAlgo_WireSplitter::Face()const
{ {
@ -154,7 +151,7 @@ static
} }
//======================================================================= //=======================================================================
// function: SetEdges // function: SetEdges
// purpose: // purpose:
//======================================================================= //=======================================================================
void GEOMAlgo_WireSplitter::SetEdges(const TopTools_ListOfShape& aLE) void GEOMAlgo_WireSplitter::SetEdges(const TopTools_ListOfShape& aLE)
{ {
@ -174,7 +171,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Edges // function: Edges
// purpose: // purpose:
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_WireSplitter::Edges()const const TopTools_ListOfShape& GEOMAlgo_WireSplitter::Edges()const
{ {
@ -182,7 +179,7 @@ static
} }
//======================================================================= //=======================================================================
// function: IsNothingToDo // function: IsNothingToDo
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_WireSplitter::IsNothingToDo()const Standard_Boolean GEOMAlgo_WireSplitter::IsNothingToDo()const
{ {
@ -190,7 +187,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Shapes // function: Shapes
// purpose: // purpose:
//======================================================================= //=======================================================================
const BOPTColStd_ListOfListOfShape& GEOMAlgo_WireSplitter::Shapes()const const BOPTColStd_ListOfListOfShape& GEOMAlgo_WireSplitter::Shapes()const
{ {
@ -198,7 +195,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Perform // function: Perform
// purpose: // purpose:
//======================================================================= //=======================================================================
void GEOMAlgo_WireSplitter::Perform() void GEOMAlgo_WireSplitter::Perform()
{ {
@ -208,7 +205,7 @@ static
Standard_Integer index, i, aNb, aCntIn, aCntOut; Standard_Integer index, i, aNb, aCntIn, aCntOut;
Standard_Boolean anIsIn; Standard_Boolean anIsIn;
Standard_Real anAngle; Standard_Real anAngle;
BOP_ListOfEdgeInfo emptyInfo; BOP_ListOfEdgeInfo emptyInfo;
TopTools_ListIteratorOfListOfShape anItList; TopTools_ListIteratorOfListOfShape anItList;
// //
@ -231,12 +228,12 @@ static
if (!index) { if (!index) {
index=mySmartMap.Add(aVertex, emptyInfo); index=mySmartMap.Add(aVertex, emptyInfo);
} }
BOP_ListOfEdgeInfo& aListOfEInfo=mySmartMap(index); BOP_ListOfEdgeInfo& aListOfEInfo=mySmartMap(index);
BOP_EdgeInfo aEInfo; BOP_EdgeInfo aEInfo;
aEInfo.SetEdge(anEdge); aEInfo.SetEdge(anEdge);
TopAbs_Orientation anOr=aVertex.Orientation(); TopAbs_Orientation anOr=aVertex.Orientation();
if (anOr==TopAbs_FORWARD) { if (anOr==TopAbs_FORWARD) {
@ -253,9 +250,9 @@ static
// //
aNb=mySmartMap.Extent(); aNb=mySmartMap.Extent();
// //
// 2. myNothingToDo // 2. myNothingToDo
myNothingToDo=Standard_True; myNothingToDo=Standard_True;
for (i=1; i<=aNb; i++) { for (i=1; i<=aNb; i++) {
aCntIn=0; aCntIn=0;
aCntOut=0; aCntOut=0;
@ -280,16 +277,16 @@ static
// Each vertex has one edge In and one - Out. Good. But it is not enought // Each vertex has one edge In and one - Out. Good. But it is not enought
// to consider that nothing to do with this. We must check edges on TShape // to consider that nothing to do with this. We must check edges on TShape
// coinsidence. If there are such edges there is something to do with. // coinsidence. If there are such edges there is something to do with.
// //
if (myNothingToDo) { if (myNothingToDo) {
Standard_Integer aNbE, aNbMapEE; Standard_Integer aNbE, aNbMapEE;
TopTools_IndexedDataMapOfShapeListOfShape aMapEE; TopTools_IndexedDataMapOfShapeListOfShape aMapEE;
aNbE=myEdges.Extent(); aNbE=myEdges.Extent();
anItList.Initialize(myEdges); anItList.Initialize(myEdges);
for (; anItList.More(); anItList.Next()) { for (; anItList.More(); anItList.Next()) {
const TopoDS_Shape& aE = anItList.Value(); const TopoDS_Shape& aE = anItList.Value();
if (!aMapEE.Contains(aE)) { if (!aMapEE.Contains(aE)) {
TopTools_ListOfShape aLEx; TopTools_ListOfShape aLEx;
aLEx.Append(aE); aLEx.Append(aE);
@ -300,7 +297,7 @@ static
aLEx.Append(aE); aLEx.Append(aE);
} }
} }
Standard_Boolean bFlag; Standard_Boolean bFlag;
bFlag=Standard_True; bFlag=Standard_True;
aNbMapEE=aMapEE.Extent(); aNbMapEE=aMapEE.Extent();
@ -326,7 +323,7 @@ static
} }
myNothingToDo=myNothingToDo && bFlag; myNothingToDo=myNothingToDo && bFlag;
} }
// //
// //
if (myNothingToDo) { if (myNothingToDo) {
myErrorStatus=0; myErrorStatus=0;
@ -353,45 +350,45 @@ static
aVV.Orientation(TopAbs_REVERSED); aVV.Orientation(TopAbs_REVERSED);
anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_True); anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_True);
} }
// //
else { // OUT else { // OUT
// //
aVV.Orientation(TopAbs_FORWARD); aVV.Orientation(TopAbs_FORWARD);
anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_False); anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_False);
} }
anEdgeInfo.SetAngle(anAngle); anEdgeInfo.SetAngle(anAngle);
} }
} }
// //
// 4. Do // 4. Do
// //
Standard_Boolean anIsOut, anIsNotPassed; Standard_Boolean anIsOut, anIsNotPassed;
TopTools_SequenceOfShape aLS, aVertVa; TopTools_SequenceOfShape aLS, aVertVa;
TColgp_SequenceOfPnt2d aCoordVa; TColgp_SequenceOfPnt2d aCoordVa;
BOP_ListIteratorOfListOfEdgeInfo anIt; BOP_ListIteratorOfListOfEdgeInfo anIt;
for (i=1; i<=aNb; i++) { for (i=1; i<=aNb; i++) {
const TopoDS_Vertex aVa=TopoDS::Vertex (mySmartMap.FindKey(i)); const TopoDS_Vertex aVa=TopoDS::Vertex (mySmartMap.FindKey(i));
const BOP_ListOfEdgeInfo& aLEInfo=mySmartMap(i); const BOP_ListOfEdgeInfo& aLEInfo=mySmartMap(i);
anIt.Initialize(aLEInfo); anIt.Initialize(aLEInfo);
for (; anIt.More(); anIt.Next()) { for (; anIt.More(); anIt.Next()) {
BOP_EdgeInfo& anEdgeInfo=anIt.Value(); BOP_EdgeInfo& anEdgeInfo=anIt.Value();
const TopoDS_Edge& aEOuta=anEdgeInfo.Edge(); const TopoDS_Edge& aEOuta=anEdgeInfo.Edge();
anIsOut=!anEdgeInfo.IsIn(); anIsOut=!anEdgeInfo.IsIn();
anIsNotPassed=!anEdgeInfo.Passed(); anIsNotPassed=!anEdgeInfo.Passed();
if (anIsOut && anIsNotPassed) { if (anIsOut && anIsNotPassed) {
// //
aLS.Clear(); aLS.Clear();
aVertVa.Clear(); aVertVa.Clear();
aCoordVa.Clear(); aCoordVa.Clear();
// //
Path(aGAS, myFace, aVa, aEOuta, anEdgeInfo, aLS, Path(aGAS, myFace, aVa, aEOuta, anEdgeInfo, aLS,
aVertVa, aCoordVa, myShapes, mySmartMap); aVertVa, aCoordVa, myShapes, mySmartMap);
} }
} }
@ -402,7 +399,7 @@ static
TopoDS_Vertex aV1, aV2; TopoDS_Vertex aV1, aV2;
BOPTColStd_ListOfListOfShape aShapes; BOPTColStd_ListOfListOfShape aShapes;
BOPTColStd_ListIteratorOfListOfListOfShape anItW(myShapes); BOPTColStd_ListIteratorOfListOfListOfShape anItW(myShapes);
for (; anItW.More(); anItW.Next()) { for (; anItW.More(); anItW.Next()) {
TopTools_IndexedMapOfShape aMV, aME; TopTools_IndexedMapOfShape aMV, aME;
const TopTools_ListOfShape& aLE=anItW.Value(); const TopTools_ListOfShape& aLE=anItW.Value();
@ -433,7 +430,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Path // function: Path
// purpose: // purpose:
//======================================================================= //=======================================================================
void Path (const GeomAdaptor_Surface& aGAS, void Path (const GeomAdaptor_Surface& aGAS,
const TopoDS_Face& myFace, const TopoDS_Face& myFace,
@ -445,12 +442,11 @@ static
TColgp_SequenceOfPnt2d& aCoordVa, TColgp_SequenceOfPnt2d& aCoordVa,
BOPTColStd_ListOfListOfShape& myShapes, BOPTColStd_ListOfListOfShape& myShapes,
BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap) BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap)
{ {
Standard_Integer i,j, aNb, aNbj; Standard_Integer i,j, aNb, aNbj;
Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle; Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle;
Standard_Real aTol2D, aTol2D2; Standard_Real aTol2D, aTol2D2;
Standard_Real aTol2, aD2;//, aTolUVb, aTolVVb; Standard_Real aTol2, aD2;//, aTolUVb, aTolVVb;
Standard_Boolean anIsSameV2d, anIsSameV, anIsFound, anIsOut, anIsNotPassed; Standard_Boolean anIsSameV2d, anIsSameV, anIsFound, anIsOut, anIsNotPassed;
BOP_ListIteratorOfListOfEdgeInfo anIt; BOP_ListIteratorOfListOfEdgeInfo anIt;
TopoDS_Vertex aVb; TopoDS_Vertex aVb;
@ -460,7 +456,7 @@ static
// //
// append block // append block
// //
// Do not escape through edge from which you enter // Do not escape through edge from which you enter
aNb=aLS.Length(); aNb=aLS.Length();
if (aNb==1) { if (aNb==1) {
const TopoDS_Shape& anEPrev=aLS(aNb); const TopoDS_Shape& anEPrev=aLS(aNb);
@ -473,12 +469,12 @@ static
anEdgeInfo.SetPassed(Standard_True); anEdgeInfo.SetPassed(Standard_True);
aLS.Append(aEOuta); aLS.Append(aEOuta);
aVertVa.Append(aVa); aVertVa.Append(aVa);
TopoDS_Vertex pVa=aVa; TopoDS_Vertex pVa=aVa;
pVa.Orientation(TopAbs_FORWARD); pVa.Orientation(TopAbs_FORWARD);
gp_Pnt2d aPa=Coord2d(pVa, aEOuta, myFace); gp_Pnt2d aPa=Coord2d(pVa, aEOuta, myFace);
aCoordVa.Append(aPa); aCoordVa.Append(aPa);
GetNextVertex (pVa, aEOuta, aVb); GetNextVertex (pVa, aEOuta, aVb);
gp_Pnt2d aPb=Coord2d(aVb, aEOuta, myFace); gp_Pnt2d aPb=Coord2d(aVb, aEOuta, myFace);
@ -569,11 +565,11 @@ static
const TopoDS_Edge& aE=anEI.Edge(); const TopoDS_Edge& aE=anEI.Edge();
anIsOut=!anEI.IsIn(); anIsOut=!anEI.IsIn();
anIsNotPassed=!anEI.Passed(); anIsNotPassed=!anEI.Passed();
if (anIsOut && anIsNotPassed) { if (anIsOut && anIsNotPassed) {
aCurIndexE++; aCurIndexE++;
// //
// Is there one way to go out of the vertex // Is there one way to go out of the vertex
// we have to use it only. // we have to use it only.
Standard_Integer iCnt; Standard_Integer iCnt;
iCnt=NbWaysOut (aLEInfo); iCnt=NbWaysOut (aLEInfo);
@ -610,16 +606,16 @@ static
anIsFound=Standard_True; anIsFound=Standard_True;
} }
} }
} // for (; anIt.More(); anIt.Next()) } // for (; anIt.More(); anIt.Next())
// //
if (!anIsFound) { if (!anIsFound) {
// no way to go . (Error) // no way to go . (Error)
return; return;
} }
aEOutb=pEdgeInfo->Edge(); aEOutb=pEdgeInfo->Edge();
// //
Path (aGAS, myFace, aVb, aEOutb, *pEdgeInfo, aLS, Path (aGAS, myFace, aVb, aEOutb, *pEdgeInfo, aLS,
aVertVa, aCoordVa, myShapes, mySmartMap); aVertVa, aCoordVa, myShapes, mySmartMap);
} }
//======================================================================= //=======================================================================
@ -649,7 +645,7 @@ static
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Real Tolerance2D (const TopoDS_Vertex& aV, Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS) const GeomAdaptor_Surface& aGAS)
{ {
Standard_Real aTol2D, anUr, aVr, aTolV3D; Standard_Real aTol2D, anUr, aVr, aTolV3D;
GeomAbs_SurfaceType aType; GeomAbs_SurfaceType aType;
@ -733,19 +729,19 @@ static
if (AIn >= aTwoPi) { if (AIn >= aTwoPi) {
AIn=AIn-aTwoPi; AIn=AIn-aTwoPi;
} }
if (AOut >= aTwoPi) { if (AOut >= aTwoPi) {
AOut=AOut-aTwoPi; AOut=AOut-aTwoPi;
} }
A1 = AIn + M_PI; A1 = AIn + M_PI;
if (A1 >= aTwoPi) { if (A1 >= aTwoPi) {
A1=A1-aTwoPi; A1=A1-aTwoPi;
} }
A2=AOut; A2=AOut;
dA=A1-A2; dA=A1-A2;
if (dA <= 0.) { if (dA <= 0.) {
dA=aTwoPi+dA; dA=aTwoPi+dA;
@ -763,7 +759,7 @@ static
} }
//======================================================================= //=======================================================================
// function: GetNextVertex // function: GetNextVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void GetNextVertex(const TopoDS_Vertex& aV, void GetNextVertex(const TopoDS_Vertex& aV,
const TopoDS_Edge& aE, const TopoDS_Edge& aE,
@ -783,7 +779,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Angle2D // function: Angle2D
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Real Angle2D (const TopoDS_Vertex& aV, Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge, const TopoDS_Edge& anEdge,
@ -801,7 +797,7 @@ static
return 0.; return 0.;
} }
// //
BOPTools_Tools2D::CurveOnSurface (anEdge, myFace, aC2D, BOPTools_Tools2D::CurveOnSurface (anEdge, myFace, aC2D,
aFirst, aLast, aToler, Standard_True); aFirst, aLast, aToler, Standard_True);
//dt=1.e-7; //dt=1.e-7;
dt=2.*Tolerance2D(aV, aGAS); dt=2.*Tolerance2D(aV, aGAS);
@ -810,7 +806,7 @@ static
if(dt > aTX) { if(dt > aTX) {
// to save direction of the curve as much as it possible // to save direction of the curve as much as it possible
// in the case of big tolerances // in the case of big tolerances
dt = aTX; dt = aTX;
} }
// //
if (fabs (aTV-aFirst) < fabs(aTV - aLast)) { if (fabs (aTV-aFirst) < fabs(aTV - aLast)) {
@ -839,7 +835,7 @@ static
} }
//======================================================================= //=======================================================================
// function: Angle // function: Angle
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Real Angle (const gp_Dir2d& aDir2D) Standard_Real Angle (const gp_Dir2d& aDir2D)
{ {
@ -851,10 +847,10 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
return anAngle; return anAngle;
} }
//
//======================================================================= //=======================================================================
// function: NbWaysOut // function: NbWaysOut
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& aLEInfo) Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& aLEInfo)
{ {

View File

@ -15,26 +15,29 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_CheckerSI.cxx // File: NMTTools_CheckerSI.cxx
// Created: Mon Feb 19 11:32:08 2007 // Created: Mon Feb 19 11:32:08 2007
// Author: Peter KURNEV // Author: Peter KURNEV
//
#include <NMTTools_CheckerSI.ixx> #include <NMTTools_CheckerSI.ixx>
#include <NMTTools_DEProcessor.hxx>
#include <NMTDS_ShapesDataStructure.hxx> #include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_IteratorCheckerSI.hxx> #include <NMTDS_IteratorCheckerSI.hxx>
#include <NMTDS_InterfPool.hxx> #include <NMTDS_InterfPool.hxx>
#include <NMTTools_DEProcessor.hxx>
#include <Basics_OCCTVersion.hxx>
#include <IntTools_Context.hxx>
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
NMTTools_CheckerSI::NMTTools_CheckerSI() NMTTools_CheckerSI::NMTTools_CheckerSI()
: : NMTTools_PaveFiller()
NMTTools_PaveFiller()
{ {
myStopStatus=0; myStopStatus=0;
} }
@ -42,14 +45,14 @@
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
NMTTools_CheckerSI::~NMTTools_CheckerSI() NMTTools_CheckerSI::~NMTTools_CheckerSI()
{ {
} }
//======================================================================= //=======================================================================
//function : Clear //function : Clear
//purpose : //purpose :
//======================================================================= //=======================================================================
void NMTTools_CheckerSI::Clear() void NMTTools_CheckerSI::Clear()
{ {
NMTTools_PaveFiller::Clear(); NMTTools_PaveFiller::Clear();
} }
@ -57,7 +60,7 @@
//function : StopStatus //function : StopStatus
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer NMTTools_CheckerSI::StopStatus()const Standard_Integer NMTTools_CheckerSI::StopStatus()const
{ {
return myStopStatus; return myStopStatus;
} }
@ -65,7 +68,7 @@
//function : Init //function : Init
//purpose : //purpose :
//======================================================================= //=======================================================================
void NMTTools_CheckerSI::Init() void NMTTools_CheckerSI::Init()
{ {
myIsDone=Standard_False; myIsDone=Standard_False;
if (myCompositeShape.IsNull()) { if (myCompositeShape.IsNull()) {
@ -83,18 +86,24 @@
myDSIt->SetDS(myDS); myDSIt->SetDS(myDS);
myDSIt->Prepare(); myDSIt->Prepare();
// //
// 4. // 3.
myNbSources=myDS->NumberOfShapesOfTheObject()+ myNbSources=myDS->NumberOfShapesOfTheObject()+
myDS->NumberOfShapesOfTheTool(); myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges(); myNbEdges=myDS->NbEdges();
// 5 // 4.
myIP=new NMTDS_InterfPool; myIP=new NMTDS_InterfPool;
//
// 5.
#if OCC_VERSION_LARGE > 0x06050200
// In OCCT6.5.3 class IntTools_Context become a handle
myContext=new IntTools_Context;
#endif
} }
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void NMTTools_CheckerSI::Perform() void NMTTools_CheckerSI::Perform()
{ {
myIsDone=Standard_False; myIsDone=Standard_False;
myStopStatus=0; myStopStatus=0;

View File

@ -155,10 +155,6 @@ is
returns Context from IntTools; returns Context from IntTools;
---C++:return const & ---C++:return const &
ChangeContext(me:out)
returns Context from IntTools;
---C++:return &
PavePool(me) PavePool(me)
returns PavePool from BOPTools; returns PavePool from BOPTools;
---C++:return const & ---C++:return const &

View File

@ -18,21 +18,23 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_PaveFiller.cxx // File: NMTTools_PaveFiller.cxx
// Created: Fri Dec 5 14:58:54 2003 // Created: Fri Dec 5 14:58:54 2003
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx> #include <NMTTools_PaveFiller.ixx>
//
#include <BOPTColStd_Failure.hxx> #include <Basics_OCCTVersion.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_DEProcessor.hxx> #include <NMTTools_DEProcessor.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_Iterator.hxx> #include <NMTDS_Iterator.hxx>
#include <NMTDS_InterfPool.hxx> #include <NMTDS_InterfPool.hxx>
#include <BOPTColStd_Failure.hxx>
//======================================================================= //=======================================================================
// function: NMTTools_PaveFiller::NMTTools_PaveFiller // function: NMTTools_PaveFiller::NMTTools_PaveFiller
// purpose: // purpose:
@ -126,18 +128,26 @@
// function: Context // function: Context
// purpose: // purpose:
//======================================================================= //=======================================================================
const IntTools_Context& NMTTools_PaveFiller::Context() const #if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& NMTTools_PaveFiller::Context() const
#else
const IntTools_Context& NMTTools_PaveFiller::Context() const
#endif
{ {
return myContext; return myContext;
} }
#if OCC_VERSION_LARGE <= 0x06050200
//======================================================================= //=======================================================================
// function: ChangeContext // function: ChangeContext
// purpose: // purpose:
//======================================================================= //=======================================================================
IntTools_Context& NMTTools_PaveFiller::ChangeContext() IntTools_Context& NMTTools_PaveFiller::ChangeContext()
{ {
return myContext; return myContext;
} }
#endif
//======================================================================= //=======================================================================
// function: PavePool // function: PavePool
// purpose: // purpose:
@ -221,8 +231,13 @@
myDS->NumberOfShapesOfTheTool(); myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges(); myNbEdges=myDS->NbEdges();
// //
// 4 // 4.
myIP=new NMTDS_InterfPool; myIP=new NMTDS_InterfPool;
#if OCC_VERSION_LARGE > 0x06050200
//
// 5.
myContext=new IntTools_Context;
#endif
} }
//======================================================================= //=======================================================================

View File

@ -22,6 +22,8 @@
#ifndef _NMTTools_PaveFiller_HeaderFile #ifndef _NMTTools_PaveFiller_HeaderFile
#define _NMTTools_PaveFiller_HeaderFile #define _NMTTools_PaveFiller_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
#include <Standard.hxx> #include <Standard.hxx>
#endif #endif
@ -47,9 +49,13 @@
#ifndef _BOPTools_SplitShapesPool_HeaderFile #ifndef _BOPTools_SplitShapesPool_HeaderFile
#include <BOPTools_SplitShapesPool.hxx> #include <BOPTools_SplitShapesPool.hxx>
#endif #endif
#ifndef _IntTools_Context_HeaderFile
#if OCC_VERSION_LARGE > 0x06050200
#include <Handle_IntTools_Context.hxx>
#else
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#endif #endif
#ifndef _BOPTools_SSIntersectionAttribute_HeaderFile #ifndef _BOPTools_SSIntersectionAttribute_HeaderFile
#include <BOPTools_SSIntersectionAttribute.hxx> #include <BOPTools_SSIntersectionAttribute.hxx>
#endif #endif
@ -77,10 +83,10 @@
#ifndef _Standard_Real_HeaderFile #ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#endif #endif
class TopoDS_Shape; class TopoDS_Shape;
class BOPTools_Pave; class BOPTools_Pave;
class IntTools_ShrunkRange; class IntTools_ShrunkRange;
class IntTools_Context;
class BOPTools_PavePool; class BOPTools_PavePool;
class NMTTools_CommonBlockPool; class NMTTools_CommonBlockPool;
class BOPTools_SplitShapesPool; class BOPTools_SplitShapesPool;
@ -105,204 +111,201 @@ class TopTools_DataMapOfShapeShape;
class TColStd_MapOfInteger; class TColStd_MapOfInteger;
class NMTTools_PaveFiller { class NMTTools_PaveFiller {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
return anAddress; return anAddress;
} }
void* operator new(size_t size) void* operator new(size_t size)
{ {
return Standard::Allocate(size); return Standard::Allocate(size);
} }
void operator delete(void *anAddress) void operator delete(void *anAddress)
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
Standard_EXPORT NMTTools_PaveFiller(); Standard_EXPORT NMTTools_PaveFiller();
Standard_EXPORT virtual ~NMTTools_PaveFiller(); Standard_EXPORT virtual ~NMTTools_PaveFiller();
Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ;
Standard_EXPORT const TopoDS_Shape& CompositeShape() const; Standard_EXPORT const TopoDS_Shape& CompositeShape() const;
Standard_EXPORT NMTDS_PShapesDataStructure DS() ; Standard_EXPORT NMTDS_PShapesDataStructure DS() ;
Standard_EXPORT NMTDS_PIterator DSIt() ; Standard_EXPORT NMTDS_PIterator DSIt() ;
Standard_EXPORT NMTDS_PInterfPool IP() ; Standard_EXPORT NMTDS_PInterfPool IP() ;
Standard_EXPORT virtual void Perform() ; Standard_EXPORT virtual void Perform() ;
Standard_EXPORT Standard_Boolean IsDone() const; Standard_EXPORT Standard_Boolean IsDone() const;
#if OCC_VERSION_LARGE > 0x06050200
Standard_EXPORT const Handle_IntTools_Context& Context() const;
#else
Standard_EXPORT const IntTools_Context& Context() const; Standard_EXPORT const IntTools_Context& Context() const;
Standard_EXPORT IntTools_Context& ChangeContext() ; Standard_EXPORT IntTools_Context& ChangeContext() ;
#endif
Standard_EXPORT const BOPTools_PavePool& PavePool() const; Standard_EXPORT const BOPTools_PavePool& PavePool() const;
Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; Standard_EXPORT BOPTools_PavePool& ChangePavePool() ;
Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const;
Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ;
Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const;
Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ;
Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const;
Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ;
Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ;
Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ;
Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ;
Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ;
Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ;
Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ;
Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ;
Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ;
Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ;
Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ;
Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void RealSplitsInFace(const Standard_Integer nF1,BOPTools_ListOfPaveBlock& aLPB) ; Standard_EXPORT void RealSplitsInFace(const Standard_Integer nF1,BOPTools_ListOfPaveBlock& aLPB) ;
Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ;
Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ;
Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ;
Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ;
Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ;
Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ;
Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ;
Standard_EXPORT void MakePCurves() ; Standard_EXPORT void MakePCurves() ;
Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const;
Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ;
Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ;
Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ;
Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ; Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ;
Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const; Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const;
Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ;
Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ;
Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ;
Standard_EXPORT void PutClosingPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; Standard_EXPORT void PutClosingPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ;
protected: protected:
Standard_EXPORT virtual void Init() ; Standard_EXPORT virtual void Init() ;
Standard_EXPORT virtual void Clear() ; Standard_EXPORT virtual void Clear() ;
Standard_EXPORT virtual void PerformVV() ; Standard_EXPORT virtual void PerformVV() ;
Standard_EXPORT virtual void PerformVE() ; Standard_EXPORT virtual void PerformVE() ;
Standard_EXPORT virtual void PerformVF() ; Standard_EXPORT virtual void PerformVF() ;
Standard_EXPORT virtual void PerformEE() ; Standard_EXPORT virtual void PerformEE() ;
Standard_EXPORT virtual void PerformEF() ; Standard_EXPORT virtual void PerformEF() ;
Standard_EXPORT virtual void PerformFF() ; Standard_EXPORT virtual void PerformFF() ;
Standard_EXPORT void MakeSplitEdges() ; Standard_EXPORT void MakeSplitEdges() ;
Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ;
Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ;
Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ;
Standard_EXPORT virtual void PrepareEdges() ; Standard_EXPORT virtual void PrepareEdges() ;
Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const; Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const; Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const;
Standard_EXPORT void RefinePavePool() ; Standard_EXPORT void RefinePavePool() ;
Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ;
Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ;
Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ;
Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ;
Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
Standard_EXPORT void UpdateCommonBlocks() ; Standard_EXPORT void UpdateCommonBlocks() ;
Standard_EXPORT void UpdateCommonBlocks (const Standard_Integer aI); Standard_EXPORT void UpdateCommonBlocks (const Standard_Integer aI);
@ -310,15 +313,15 @@ protected:
Standard_EXPORT void UpdatePaveBlocks() ; Standard_EXPORT void UpdatePaveBlocks() ;
Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const;
Standard_EXPORT void MakeBlocks() ; Standard_EXPORT void MakeBlocks() ;
Standard_EXPORT void PerformVF1() ; Standard_EXPORT void PerformVF1() ;
Standard_EXPORT void MakeAloneVertices() ; Standard_EXPORT void MakeAloneVertices() ;
Standard_EXPORT void FillFaceInfo() ; Standard_EXPORT void FillFaceInfo() ;
Standard_EXPORT void CorrectTolR3D(const BOPTools_SSInterference& aFF,const TColStd_MapOfInteger& aMVStick,Standard_Real& aTolR3D) ; Standard_EXPORT void CorrectTolR3D(const BOPTools_SSInterference& aFF,const TColStd_MapOfInteger& aMVStick,Standard_Real& aTolR3D) ;
@ -330,7 +333,11 @@ BOPTools_PavePool myPavePool;
BOPTools_PavePool myPavePoolNew; BOPTools_PavePool myPavePoolNew;
NMTTools_CommonBlockPool myCommonBlockPool; NMTTools_CommonBlockPool myCommonBlockPool;
BOPTools_SplitShapesPool mySplitShapesPool; BOPTools_SplitShapesPool mySplitShapesPool;
IntTools_Context myContext; #if OCC_VERSION_LARGE > 0x06050200
Handle_IntTools_Context myContext;
#else
IntTools_Context myContext;
#endif
BOPTools_SSIntersectionAttribute mySectionAttribute; BOPTools_SSIntersectionAttribute mySectionAttribute;
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices; NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
TColStd_DataMapOfIntegerInteger myVSD; TColStd_DataMapOfIntegerInteger myVSD;
@ -339,13 +346,8 @@ TopoDS_Shape myCompositeShape;
NMTDS_PInterfPool myIP; NMTDS_PInterfPool myIP;
NMTTools_DataMapOfIntegerFaceInfo myFaceInfo; NMTTools_DataMapOfIntegerFaceInfo myFaceInfo;
private: private:
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)

View File

@ -154,7 +154,10 @@ void NMTTools_PaveFiller::PerformVE()
} }
// //
//modified by NIZNHY-PKV Mon Dec 28 08:58:05 2009f //modified by NIZNHY-PKV Mon Dec 28 08:58:05 2009f
#if OCC_VERSION_LARGE > 0x06030008 #if OCC_VERSION_LARGE > 0x06050200
// In OCCT6.5.3 class IntTools_Context become a handle
aFlag = myContext->ComputeVE (aV1, aE2, aT, bToUpdateVertex, aDist);
#elif OCC_VERSION_LARGE > 0x06030008
// In OCCT6.3.0sp9 is changed a signature of IntTools_Context::ComputeVE() method // In OCCT6.3.0sp9 is changed a signature of IntTools_Context::ComputeVE() method
aFlag = myContext.ComputeVE (aV1, aE2, aT, bToUpdateVertex, aDist); aFlag = myContext.ComputeVE (aV1, aE2, aT, bToUpdateVertex, aDist);
#else #else

View File

@ -18,15 +18,15 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_PaveFiller_3.cxx // File: NMTTools_PaveFiller_3.cxx
// Created: Mon Dec 8 16:06:56 2003 // Created: Mon Dec 8 16:06:56 2003
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx> #include <NMTTools_PaveFiller.ixx>
#include <Basics_OCCTVersion.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
@ -48,6 +48,7 @@ static
Standard_Boolean Contains(const TopoDS_Face& aF, Standard_Boolean Contains(const TopoDS_Face& aF,
const TopoDS_Vertex& aV); const TopoDS_Vertex& aV);
// Contribution of Samtech www.samcef.com END // Contribution of Samtech www.samcef.com END
//======================================================================= //=======================================================================
// function: PerformVF // function: PerformVF
// purpose: // purpose:
@ -106,7 +107,11 @@ static
} }
// Contribution of Samtech www.samcef.com END // Contribution of Samtech www.samcef.com END
// //
#if OCC_VERSION_LARGE > 0x06050200
aFlag=myContext->ComputeVS (aV1, aF2, aU, aV);
#else
aFlag=myContext.ComputeVS (aV1, aF2, aU, aV); aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
#endif
// //
if (!aFlag) { if (!aFlag) {
// //

View File

@ -25,6 +25,8 @@
#include <NMTTools_PaveFiller.ixx> #include <NMTTools_PaveFiller.ixx>
#include <Basics_OCCTVersion.hxx>
#include <stdio.h> #include <stdio.h>
#include <Precision.hxx> #include <Precision.hxx>
@ -479,7 +481,11 @@ void NMTTools_PaveFiller::TreatPaveBlocks (NMTTools_ListOfCommonBlock& theLCB)
// Append Pave of nV to rhe edge nE // Append Pave of nV to rhe edge nE
const TopoDS_Edge& aE=*(TopoDS_Edge*)(&myDS->Shape(nE)); const TopoDS_Edge& aE=*(TopoDS_Edge*)(&myDS->Shape(nE));
const TopoDS_Vertex& aV= *(TopoDS_Vertex*)(&myDS->Shape(nV)); const TopoDS_Vertex& aV= *(TopoDS_Vertex*)(&myDS->Shape(nV));
#if OCC_VERSION_LARGE > 0x06050200
iFlag=myContext->ComputeVE (aV, aE, aT);
#else
iFlag=myContext.ComputeVE (aV, aE, aT); iFlag=myContext.ComputeVE (aV, aE, aT);
#endif
if (!iFlag) { if (!iFlag) {
BOPTools_Pave aPave; BOPTools_Pave aPave;
// //
@ -569,7 +575,11 @@ void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapO
for (j=0; j<2; ++j) { for (j=0; j<2; ++j) {
if (aMFence.Add(nE[j])) { if (aMFence.Add(nE[j])) {
aE=TopoDS::Edge(myDS->Shape(nE[j])); aE=TopoDS::Edge(myDS->Shape(nE[j]));
#if OCC_VERSION_LARGE > 0x06050200
iFlag=myContext->ComputeVE (aVnew, aE, aT);
#else
iFlag=myContext.ComputeVE (aVnew, aE, aT); iFlag=myContext.ComputeVE (aVnew, aE, aT);
#endif
if (!iFlag) { if (!iFlag) {
aPave.SetInterference(-1); aPave.SetInterference(-1);
aPave.SetType (BooleanOperations_EdgeEdge); aPave.SetType (BooleanOperations_EdgeEdge);
@ -1553,7 +1563,11 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
} }
// //
anIndexIn=0; anIndexIn=0;
#if OCC_VERSION_LARGE > 0x06050200
aFlag=myContext->ComputeVS (aVnew, aF, aU, aV);
#else
aFlag=myContext.ComputeVS (aVnew, aF, aU, aV); aFlag=myContext.ComputeVS (aVnew, aF, aU, aV);
#endif
if (!aFlag) { if (!aFlag) {
BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV); BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV);
// //
@ -1592,7 +1606,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock&
nE2=aPB2.OriginalEdge(); nE2=aPB2.OriginalEdge();
const TopoDS_Edge& aE2=(*(TopoDS_Edge*)(&myDS->Shape(nE2))); const TopoDS_Edge& aE2=(*(TopoDS_Edge*)(&myDS->Shape(nE2)));
// //
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aPPC=myContext->ProjPC(aE2);
#else
GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE2); GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE2);
#endif
aPPC.Perform(aP1m); aPPC.Perform(aP1m);
aNbPoints=aPPC.NbPoints(); aNbPoints=aPPC.NbPoints();
if (aNbPoints) { if (aNbPoints) {

View File

@ -27,6 +27,8 @@
// //
#include <NMTTools_PaveFiller.ixx> #include <NMTTools_PaveFiller.ixx>
#include <Basics_OCCTVersion.hxx>
#include <TColStd_IndexedMapOfInteger.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
@ -49,7 +51,9 @@
#include <IntTools_ShrunkRange.hxx> #include <IntTools_ShrunkRange.hxx>
#include <IntTools_Range.hxx> #include <IntTools_Range.hxx>
#include <IntTools_EdgeFace.hxx> #include <IntTools_EdgeFace.hxx>
#if OCC_VERSION_LARGE <= 0x06050200
#include <IntTools_PContext.hxx> #include <IntTools_PContext.hxx>
#endif
#include <IntTools_SequenceOfCommonPrts.hxx> #include <IntTools_SequenceOfCommonPrts.hxx>
#include <IntTools_CommonPrt.hxx> #include <IntTools_CommonPrt.hxx>
#include <IntTools_Tools.hxx> #include <IntTools_Tools.hxx>
@ -191,7 +195,11 @@ static
aEF.SetDiscretize (aDiscretize); aEF.SetDiscretize (aDiscretize);
aEF.SetDeflection (aDeflection); aEF.SetDeflection (aDeflection);
// //
#if OCC_VERSION_LARGE > 0x06050200
aEF.SetContext(myContext);
#else
aEF.SetContext((IntTools_PContext)&myContext); aEF.SetContext((IntTools_PContext)&myContext);
#endif
// //
IntTools_Range anewSR = aSR; IntTools_Range anewSR = aSR;
// //
@ -527,7 +535,11 @@ static
nE=aME(j); nE=aME(j);
const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
// //
#if OCC_VERSION_LARGE > 0x06050200
aFlag=myContext->ComputeVE (aNewVertex, aE, aT);
#else
aFlag=myContext.ComputeVE (aNewVertex, aE, aT); aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
#endif
// //
if (!aFlag) { if (!aFlag) {
aPave.SetInterference(-1); aPave.SetInterference(-1);

View File

@ -37,7 +37,6 @@
#include <TColStd_ListIteratorOfListOfInteger.hxx> #include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx> #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx> #include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Curve.hxx> #include <Geom2d_Curve.hxx>
@ -113,7 +112,11 @@
static static
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx); IntTools_Context& aCtx);
#endif
//======================================================================= //=======================================================================
// function: PerformFF // function: PerformFF
@ -414,7 +417,11 @@ void NMTTools_PaveFiller::MakeBlocks()
// //
// Checking of validity in 2D // Checking of validity in 2D
// //
#if OCC_VERSION_LARGE > 0x06050200
bIsValidIn2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
#else
bIsValidIn2D=myContext.IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D); bIsValidIn2D=myContext.IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
#endif
if (!bIsValidIn2D) { if (!bIsValidIn2D) {
continue; continue;
} }
@ -429,10 +436,18 @@ void NMTTools_PaveFiller::MakeBlocks()
{ {
Standard_Real aT; Standard_Real aT;
// //
#if OCC_VERSION_LARGE > 0x06050200
myContext->IsVertexOnLine(aV1, aIC, aTolR3D, aT);
#else
myContext.IsVertexOnLine(aV1, aIC, aTolR3D, aT); myContext.IsVertexOnLine(aV1, aIC, aTolR3D, aT);
#endif
BOPTools_Tools::UpdateVertex (aIC, aT, aV1); BOPTools_Tools::UpdateVertex (aIC, aT, aV1);
// //
#if OCC_VERSION_LARGE > 0x06050200
myContext->IsVertexOnLine(aV2, aIC, aTolR3D, aT);
#else
myContext.IsVertexOnLine(aV2, aIC, aTolR3D, aT); myContext.IsVertexOnLine(aV2, aIC, aTolR3D, aT);
#endif
BOPTools_Tools::UpdateVertex (aIC, aT, aV2); BOPTools_Tools::UpdateVertex (aIC, aT, aV2);
} }
// //
@ -930,7 +945,11 @@ Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_Pave
// //
aBB.MakeVertex (aVM, aPM, aTolC); aBB.MakeVertex (aVM, aPM, aTolC);
// //
#if OCC_VERSION_LARGE > 0x06050200
iVM=myContext->ComputeVE(aVM, aE2, aTmp);
#else
iVM=myContext.ComputeVE(aVM, aE2, aTmp); iVM=myContext.ComputeVE(aVM, aE2, aTmp);
#endif
// //
return iVM; return iVM;
} }
@ -963,12 +982,20 @@ void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
const TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));//mpv const TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));//mpv
const TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));//mpv const TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));//mpv
// //
#if OCC_VERSION_LARGE > 0x06050200
bVF=myContext->IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
#else
bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D); bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
#endif
if (bVF) { if (bVF) {
PutBoundPaveOnCurve (aP1, aT1, aBC, aFFi); PutBoundPaveOnCurve (aP1, aT1, aBC, aFFi);
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
bVF=myContext->IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
#else
bVF=myContext.IsValidPointForFaces (aP2, aF1, aF2, aTolR3D); bVF=myContext.IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
#endif
if (bVF) { if (bVF) {
PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi); PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
} }
@ -1160,7 +1187,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock&
} }
// VE // VE
if (!iV) { if (!iV) {
#if OCC_VERSION_LARGE > 0x06050200
iVE=myContext->ComputeVE (aV11, aE2, aTE);
#else
iVE=myContext.ComputeVE (aV11, aE2, aTE); iVE=myContext.ComputeVE (aV11, aE2, aTE);
#endif
if (!iVE) { if (!iVE) {
iCount++; iCount++;
if (iCount>iCountExt) { if (iCount>iCountExt) {
@ -1189,7 +1220,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock&
} }
// VE // VE
if (!iV) { if (!iV) {
#if OCC_VERSION_LARGE > 0x06050200
iVE=myContext->ComputeVE (aV12, aE2, aTE);
#else
iVE=myContext.ComputeVE (aV12, aE2, aTE); iVE=myContext.ComputeVE (aV12, aE2, aTE);
#endif
if (!iVE) { if (!iVE) {
iCount++; iCount++;
if (iCount>iCountExt) { if (iCount>iCountExt) {
@ -1207,7 +1242,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock&
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx) IntTools_Context& aCtx)
#endif
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer iErr; Standard_Integer iErr;
@ -1274,7 +1313,11 @@ void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet,
continue; continue;
} }
// //
#if OCC_VERSION_LARGE > 0x06050200
bIsVertexOnLine=myContext->IsVertexOnLine(aV, aC, aTolR3D, aT);
#else
bIsVertexOnLine=myContext.IsVertexOnLine(aV, aC, aTolR3D, aT); bIsVertexOnLine=myContext.IsVertexOnLine(aV, aC, aTolR3D, aT);
#endif
// //
// //
if (bIsVertexOnLine) { if (bIsVertexOnLine) {
@ -1503,7 +1546,11 @@ void NMTTools_PaveFiller::CorrectTolR3D(const BOPTools_SSInterference& aFF,
aC3D->D0(aT, aP); aC3D->D0(aT, aP);
// //
for (i=0; i<2; ++i) { for (i=0; i<2; ++i) {
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aPPS=myContext->ProjPS(aF[i]);
#else
GeomAPI_ProjectPointOnSurf& aPPS=myContext.ProjPS(aF[i]); GeomAPI_ProjectPointOnSurf& aPPS=myContext.ProjPS(aF[i]);
#endif
aPPS.Perform(aP); aPPS.Perform(aP);
aPPS.LowerDistanceParameters(aU, aV); aPPS.LowerDistanceParameters(aU, aV);
BOPTools_Tools3D::GetNormalToSurface(aS[i], aU, aV, aDN[i]); BOPTools_Tools3D::GetNormalToSurface(aS[i], aU, aV, aDN[i]);

View File

@ -24,6 +24,8 @@
#include <NMTTools_PaveFiller.ixx> #include <NMTTools_PaveFiller.ixx>
#include <Basics_OCCTVersion.hxx>
#include <Bnd_HArray1OfBox.hxx> #include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx> #include <Bnd_BoundSortBox.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
@ -57,7 +59,7 @@
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
//
#include <IntTools_SequenceOfPntOn2Faces.hxx> #include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_PntOnFace.hxx> #include <IntTools_PntOnFace.hxx>
#include <IntTools_PntOn2Faces.hxx> #include <IntTools_PntOn2Faces.hxx>
@ -293,7 +295,11 @@ void NMTTools_PaveFiller::UpdateCommonBlocks(const Standard_Integer)
} }
// //
const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx)); const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx));
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aPPCx=myContext->ProjPC(aEx);
#else
GeomAPI_ProjectPointOnCurve& aPPCx=myContext.ProjPC(aEx); GeomAPI_ProjectPointOnCurve& aPPCx=myContext.ProjPC(aEx);
#endif
// //
for (j=0; j<2; ++j) { for (j=0; j<2; ++j) {
aPPCx.Perform(aPMax[j]); aPPCx.Perform(aPMax[j]);

View File

@ -65,13 +65,13 @@ is
IsSplitInOnFace(myclass; IsSplitInOnFace(myclass;
aE : Edge from TopoDS; aE : Edge from TopoDS;
aF : Face from TopoDS; aF : Face from TopoDS;
aCtx:out Context from IntTools) aCtx: Context from IntTools)
returns Boolean from Standard; returns Boolean from Standard;
AreFacesSameDomain(myclass; AreFacesSameDomain(myclass;
aF1 : Face from TopoDS; aF1 : Face from TopoDS;
aF2 : Face from TopoDS; aF2 : Face from TopoDS;
aCtx : out Context from IntTools) aCtx : Context from IntTools)
returns Boolean from Standard; returns Boolean from Standard;
FindChains(myclass; FindChains(myclass;
@ -81,14 +81,7 @@ is
FindChains(myclass; FindChains(myclass;
aM1: IndexedDataMapOfShapeIndexedMapOfShape from NMTTools; aM1: IndexedDataMapOfShapeIndexedMapOfShape from NMTTools;
aM2:out IndexedDataMapOfShapeIndexedMapOfShape from NMTTools); aM2:out IndexedDataMapOfShapeIndexedMapOfShape from NMTTools);
--modified by NIZNHY-PKV Thu Nov 16 10:58:08 2006f
-- MakePCurve(myclass;
-- aE : Edge from TopoDS;
-- aF : Face from TopoDS;
-- aC2D: Curve from Geom2d;
-- aTolR2D: Real from Standard);
MakePCurve(myclass; MakePCurve(myclass;
aE : Edge from TopoDS; aE : Edge from TopoDS;
aF : Face from TopoDS; aF : Face from TopoDS;
@ -97,7 +90,6 @@ is
UpdateEdge(myclass; UpdateEdge(myclass;
aE : Edge from TopoDS; aE : Edge from TopoDS;
aTol : Real from Standard); aTol : Real from Standard);
--modified by NIZNHY-PKV Thu Nov 16 10:58:14 2006t
--fields --fields
end Tools; end Tools;

View File

@ -18,63 +18,60 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_Tools.cxx // File: NMTTools_Tools.cxx
// Created: Mon Dec 8 10:35:15 2003 // Created: Mon Dec 8 10:35:15 2003
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <NMTTools_Tools.ixx> #include <NMTTools_Tools.ixx>
#include <Basics_OCCTVersion.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BRepLib.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools3D.hxx>
#include <BOPTools_Tools.hxx>
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Surface.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Geom2d_Curve.hxx>
#include <TColStd_IndexedMapOfInteger.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
#include <Geom_Surface.hxx> static
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopExp.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BRepLib.hxx>
#include <BOPTools_Tools3D.hxx>
#include <TopExp_Explorer.hxx>
//
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopoDS_Iterator.hxx>
static
void ProcessBlock(const Standard_Integer iV, void ProcessBlock(const Standard_Integer iV,
const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV, const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
TColStd_IndexedMapOfInteger& aProcessed, TColStd_IndexedMapOfInteger& aProcessed,
@ -88,11 +85,11 @@ static
//modified by NIZNHY-PKV Thu Nov 16 10:46:53 2006f SKL/PartC5 //modified by NIZNHY-PKV Thu Nov 16 10:46:53 2006f SKL/PartC5
//======================================================================= //=======================================================================
// function: UpdateEdge // function: UpdateEdge
// purpose: // purpose:
//======================================================================= //=======================================================================
void NMTTools_Tools::UpdateEdge(const TopoDS_Edge& aE, void NMTTools_Tools::UpdateEdge(const TopoDS_Edge& aE,
const Standard_Real aTolR) const Standard_Real aTolR)
{ {
Standard_Real aTolE, aTolES, aTolV; Standard_Real aTolE, aTolES, aTolV;
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
BRep_Builder aBB; BRep_Builder aBB;
@ -112,12 +109,11 @@ static
} }
//======================================================================= //=======================================================================
// function: MakePCurve // function: MakePCurve
// purpose: // purpose:
//======================================================================= //=======================================================================
void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE, void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE,
const TopoDS_Face& aF, const TopoDS_Face& aF,
const Handle(Geom2d_Curve)& aC2Dx1) const Handle(Geom2d_Curve)& aC2Dx1)
{ {
Standard_Real aTolE, aT1, aT2, aOutFirst, aOutLast, aOutTol; Standard_Real aTolE, aT1, aT2, aOutFirst, aOutLast, aOutTol;
Handle(Geom2d_Curve) aC2D, aC2DA; Handle(Geom2d_Curve) aC2D, aC2DA;
@ -139,10 +135,10 @@ static
} }
// //
if (aC3DE->IsPeriodic()) { if (aC3DE->IsPeriodic()) {
BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA); BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA);
} }
else { else {
BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA);
} }
// //
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE); aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
@ -151,14 +147,14 @@ static
/* /*
//======================================================================= //=======================================================================
// function: MakePCurve // function: MakePCurve
// purpose: // purpose:
//======================================================================= //=======================================================================
void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE, void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE,
const TopoDS_Face& aF, const TopoDS_Face& aF,
const Handle(Geom2d_Curve)& aC2Dx, const Handle(Geom2d_Curve)& aC2Dx,
const Standard_Real aTolR2D) const Standard_Real aTolR2D)
{ {
Standard_Integer k, aNbV; Standard_Integer k, aNbV;
Standard_Real aTolEdge, aTolFact, aTolV, aTolVmax; Standard_Real aTolEdge, aTolFact, aTolV, aTolVmax;
Standard_Real aTFirst, aTLast, aOutFirst, aOutLast, aOutTol; Standard_Real aTFirst, aTLast, aOutFirst, aOutLast, aOutTol;
TopoDS_Face aFFWD; TopoDS_Face aFFWD;
@ -198,24 +194,28 @@ static
BOPTools_Tools2D::CurveOnSurface(aE, aFFWD, aC2D, aOutFirst, aOutLast, aOutTol, Standard_True); BOPTools_Tools2D::CurveOnSurface(aE, aFFWD, aC2D, aOutFirst, aOutLast, aOutTol, Standard_True);
} }
if (aC3DE->IsPeriodic()) { if (aC3DE->IsPeriodic()) {
BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aTFirst, aTLast, aC2D, aC2DA); BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aTFirst, aTLast, aC2D, aC2DA);
} }
else { else {
BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA);
} }
// //
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolFact); aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolFact);
BRepLib::SameParameter(aE); BRepLib::SameParameter(aE);
} }
*/ */
//modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t //modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t
//======================================================================= //=======================================================================
// function: IsSplitInOnFace // function: IsSplitInOnFace
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean NMTTools_Tools::IsSplitInOnFace(const TopoDS_Edge& aE, Standard_Boolean NMTTools_Tools::IsSplitInOnFace(const TopoDS_Edge& aE,
const TopoDS_Face& aF, const TopoDS_Face& aF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aContext)
#else
IntTools_Context& aContext) IntTools_Context& aContext)
#endif
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
Standard_Real aT, aTolE, aTolF, aTol, aDist, aU, aV; Standard_Real aT, aTolE, aTolF, aTol, aDist, aU, aV;
@ -226,7 +226,11 @@ static
aTolF=BRep_Tool::Tolerance(aF); aTolF=BRep_Tool::Tolerance(aF);
aTol=aTolE+aTolF; aTol=aTolE+aTolF;
// //
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aProjector=aContext->ProjPS(aF);
#else
GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF); GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF);
#endif
// //
aT=BOPTools_Tools2D::IntermediatePoint(aE); aT=BOPTools_Tools2D::IntermediatePoint(aE);
BOPTools_Tools::PointOnEdge(aE, aT, aP); BOPTools_Tools::PointOnEdge(aE, aT, aP);
@ -245,12 +249,16 @@ static
// //
aProjector.LowerDistanceParameters(aU, aV); aProjector.LowerDistanceParameters(aU, aV);
aP2D.SetCoord(aU, aV); aP2D.SetCoord(aU, aV);
#if OCC_VERSION_LARGE > 0x06050200
bFlag=aContext->IsPointInOnFace (aF, aP2D);
#else
bFlag=aContext.IsPointInOnFace (aF, aP2D); bFlag=aContext.IsPointInOnFace (aF, aP2D);
#endif
return bFlag; return bFlag;
} }
//======================================================================= //=======================================================================
// function: NMTTools_Tools::MakeNewVertex // function: NMTTools_Tools::MakeNewVertex
// purpose : // purpose :
//======================================================================= //=======================================================================
void NMTTools_Tools::MakeNewVertex(const TopTools_ListOfShape& aLVs, void NMTTools_Tools::MakeNewVertex(const TopTools_ListOfShape& aLVs,
TopoDS_Vertex& aNewVertex) TopoDS_Vertex& aNewVertex)
@ -293,7 +301,7 @@ static
} }
//======================================================================= //=======================================================================
// function: FindChains // function: FindChains
// purpose : // purpose :
//======================================================================= //=======================================================================
void NMTTools_Tools::FindChains(const BOPTools_CArray1OfSSInterference& FFs, void NMTTools_Tools::FindChains(const BOPTools_CArray1OfSSInterference& FFs,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains) BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
@ -341,7 +349,7 @@ static
} }
//======================================================================= //=======================================================================
// function: FindChains // function: FindChains
// purpose : // purpose :
//======================================================================= //=======================================================================
void NMTTools_Tools::FindChains(const BOPTools_CArray1OfVVInterference& VVs, void NMTTools_Tools::FindChains(const BOPTools_CArray1OfVVInterference& VVs,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains) BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
@ -383,7 +391,7 @@ static
//======================================================================= //=======================================================================
// function: FindChains // function: FindChains
// purpose : // purpose :
//======================================================================= //=======================================================================
void NMTTools_Tools::FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV, void NMTTools_Tools::FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains) BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
@ -413,7 +421,7 @@ static
} }
//======================================================================= //=======================================================================
// function: ProcessBlock // function: ProcessBlock
// purpose: // purpose:
//======================================================================= //=======================================================================
void ProcessBlock(const Standard_Integer iV, void ProcessBlock(const Standard_Integer iV,
const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV, const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
@ -437,14 +445,18 @@ void ProcessBlock(const Standard_Integer iV,
} }
//======================================================================= //=======================================================================
// function: AreFacesSameDomain // function: AreFacesSameDomain
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean NMTTools_Tools::AreFacesSameDomain(const TopoDS_Face& aF1x, Standard_Boolean NMTTools_Tools::AreFacesSameDomain(const TopoDS_Face& aF1x,
const TopoDS_Face& aF2y, const TopoDS_Face& aF2y,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx) IntTools_Context& aCtx)
#endif
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
// Modified Thu Sep 14 14:35:18 2006 // Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN // Contribution of Samtech www.samcef.com BEGIN
Standard_Integer aNbE1, aNbE2; Standard_Integer aNbE1, aNbE2;
Standard_Real aTolF1, aTolF2, aTol; Standard_Real aTolF1, aTolF2, aTol;
@ -463,7 +475,7 @@ void ProcessBlock(const Standard_Integer iV,
aF2=aF2y; aF2=aF2y;
aF2.Orientation(TopAbs_FORWARD); aF2.Orientation(TopAbs_FORWARD);
// //
// Modified Thu Sep 14 14:35:18 2006 // Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN // Contribution of Samtech www.samcef.com BEGIN
// //
// 1 // 1
@ -508,7 +520,11 @@ void ProcessBlock(const Standard_Integer iV,
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(aIt.Key()); const TopoDS_Edge& aE=TopoDS::Edge(aIt.Key());
BOPTools_Tools3D::PointNearEdge(aE, aF1, aP2D, aP); BOPTools_Tools3D::PointNearEdge(aE, aF1, aP2D, aP);
#if OCC_VERSION_LARGE > 0x06050200
bFlag=aCtx->IsValidPointForFace(aP, aF2, aTol);
#else
bFlag=aCtx.IsValidPointForFace(aP, aF2, aTol); bFlag=aCtx.IsValidPointForFace(aP, aF2, aTol);
#endif
break; break;
} }
// //
@ -516,12 +532,12 @@ void ProcessBlock(const Standard_Integer iV,
} }
//======================================================================= //=======================================================================
// function: FindChains // function: FindChains
// purpose : // purpose :
//======================================================================= //=======================================================================
void NMTTools_Tools::FindChains(const NMTTools_ListOfCoupleOfShape& aLCS, void NMTTools_Tools::FindChains(const NMTTools_ListOfCoupleOfShape& aLCS,
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains) NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
{ {
NMTTools_ListIteratorOfListOfCoupleOfShape aItCS; NMTTools_ListIteratorOfListOfCoupleOfShape aItCS;
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMCV; NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMCV;
// //
aItCS.Initialize(aLCS); aItCS.Initialize(aLCS);
@ -560,7 +576,7 @@ void ProcessBlock(const Standard_Integer iV,
} }
//======================================================================= //=======================================================================
// function: FindChains // function: FindChains
// purpose : // purpose :
//======================================================================= //=======================================================================
void NMTTools_Tools::FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV, void NMTTools_Tools::FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains) NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
@ -590,7 +606,7 @@ void ProcessBlock(const Standard_Integer iV,
} }
//======================================================================= //=======================================================================
// function: ProcessBlock // function: ProcessBlock
// purpose: // purpose:
//======================================================================= //=======================================================================
void ProcessBlock(const TopoDS_Shape& aF, void ProcessBlock(const TopoDS_Shape& aF,
const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV, const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,

View File

@ -18,11 +18,19 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _NMTTools_Tools_HeaderFile #ifndef _NMTTools_Tools_HeaderFile
#define _NMTTools_Tools_HeaderFile #define _NMTTools_Tools_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_Boolean_HeaderFile #ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#endif #endif
@ -32,6 +40,13 @@
#ifndef _Standard_Real_HeaderFile #ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#endif #endif
#if OCC_VERSION_LARGE > 0x06050200
#include <Handle_IntTools_Context.hxx>
#else
class IntTools_Context;
#endif
class TopTools_ListOfShape; class TopTools_ListOfShape;
class TopoDS_Vertex; class TopoDS_Vertex;
class BOPTools_CArray1OfVVInterference; class BOPTools_CArray1OfVVInterference;
@ -39,101 +54,65 @@ class BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger;
class BOPTools_CArray1OfSSInterference; class BOPTools_CArray1OfSSInterference;
class TopoDS_Edge; class TopoDS_Edge;
class TopoDS_Face; class TopoDS_Face;
class IntTools_Context;
class NMTTools_ListOfCoupleOfShape; class NMTTools_ListOfCoupleOfShape;
class NMTTools_IndexedDataMapOfShapeIndexedMapOfShape; class NMTTools_IndexedDataMapOfShapeIndexedMapOfShape;
class Geom2d_Curve; class Geom2d_Curve;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTTools_Tools { class NMTTools_Tools {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
return anAddress; return anAddress;
} }
void* operator new(size_t size) void* operator new(size_t size)
{ {
return Standard::Allocate(size); return Standard::Allocate(size);
} }
void operator delete(void *anAddress) void operator delete(void *anAddress)
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
// Methods PUBLIC
//
Standard_EXPORT static void MakeNewVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewVertex) ; Standard_EXPORT static void MakeNewVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewVertex) ;
Standard_EXPORT static void FindChains(const BOPTools_CArray1OfVVInterference& aVVs,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ;
Standard_EXPORT static void FindChains(const BOPTools_CArray1OfVVInterference& aVVs,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ; Standard_EXPORT static void FindChains(const BOPTools_CArray1OfSSInterference& aVVs,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ;
Standard_EXPORT static void FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ;
Standard_EXPORT static void FindChains(const BOPTools_CArray1OfSSInterference& aVVs,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ; Standard_EXPORT static Standard_Boolean IsSplitInOnFace (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Boolean AreFacesSameDomain (const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static void FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ; Standard_EXPORT static void FindChains(const NMTTools_ListOfCoupleOfShape& aLCS,NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM) ;
Standard_EXPORT static Standard_Boolean IsSplitInOnFace(const TopoDS_Edge& aE,const TopoDS_Face& aF,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Boolean AreFacesSameDomain(const TopoDS_Face& aF1,const TopoDS_Face& aF2,IntTools_Context& aCtx) ;
Standard_EXPORT static void FindChains(const NMTTools_ListOfCoupleOfShape& aLCS,NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM) ;
Standard_EXPORT static void FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM1,NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM2) ;
Standard_EXPORT static void MakePCurve(const TopoDS_Edge& aE,const TopoDS_Face& aF,const Handle(Geom2d_Curve)& aC2D) ;
Standard_EXPORT static void UpdateEdge(const TopoDS_Edge& aE,const Standard_Real aTol) ;
Standard_EXPORT static void FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM1,NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM2) ;
Standard_EXPORT static void MakePCurve(const TopoDS_Edge& aE,const TopoDS_Face& aF,const Handle(Geom2d_Curve)& aC2D) ;
Standard_EXPORT static void UpdateEdge(const TopoDS_Edge& aE,const Standard_Real aTol) ;
protected: protected:
// Methods PROTECTED private:
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
//
#endif #endif