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,78 +18,82 @@
-- 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 deferred class BuilderArea from GEOMAlgo
inherits Algo from GEOMAlgo inherits Algo from GEOMAlgo
---Purpose: The root class for algorithms to build ---Purpose: The root class for algorithms to build
-- faces/solids from set of edges/faces -- faces/solids from set of edges/faces
uses 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; SetContext(me:out;
theContext:Context from IntTools); theContext:Context from IntTools);
---Purpose: Sets cashed geometrical tools ---Purpose: Sets cashed geometrical tools
Context(me)
returns Context from IntTools;
---Purpose: Returns cashed geometrical tools
---C++: return const &
SetShapes(me:out; SetShapes(me:out;
theLS:ListOfShape from TopTools); theLS:ListOfShape from TopTools);
---Purpose: Sets edges/faces to process ---Purpose: Sets edges/faces to process
Shapes(me) Shapes(me)
---Purpose: Returns edges/faces to process ---Purpose: Returns edges/faces to process
returns ListOfShape from TopTools; returns ListOfShape from TopTools;
---C++: return const & ---C++: return const &
Loops(me) Loops(me)
---Purpose: Returns wires/shells that have been built ---Purpose: Returns wires/shells that have been built
returns ListOfShape from TopTools; returns ListOfShape from TopTools;
---C++: return const & ---C++: return const &
Areas(me) Areas(me)
---Purpose: Returns faces/solids that have been built ---Purpose: Returns faces/solids that have been built
returns ListOfShape from TopTools; returns ListOfShape from TopTools;
---C++: return const & ---C++: return const &
Perform(me:out)
is redefined;
PerformShapesToAvoid(me:out) PerformShapesToAvoid(me:out)
---Purpose: Collect the edges/faces that ---Purpose: Collect the edges/faces that
-- a) are internal -- a) are internal
-- b) are the same and have different orientation -- b) are the same and have different orientation
is virtual protected; is virtual protected;
PerformLoops(me:out) PerformLoops(me:out)
---Purpose: Build draft faces/shells ---Purpose: Build draft faces/shells
-- a)myLoops - draft faces/shells that consist of -- a)myLoops - draft faces/shells that consist of
-- boundary edges/faces -- boundary edges/faces
-- b)myLoopsInternal - draft faces/shells that contains -- b)myLoopsInternal - draft faces/shells that contains
-- inner edges/faces -- inner edges/faces
is virtual protected; is virtual protected;
PerformAreas(me:out) PerformAreas(me:out)
---Purpose: Build draft faces/solids that contains boundary faces ---Purpose: Build draft faces/solids that contains boundary faces
is virtual protected; is virtual protected;
PerformInternalShapes(me:out) PerformInternalShapes(me:out)
---Purpose: Build finalized faces/solids with internal wires/shells ---Purpose: Build finalized faces/solids with internal wires/shells
is virtual protected; is virtual protected;
fields fields
myShapes : ListOfShape from TopTools is protected; myShapes : ListOfShape from TopTools is protected;
@ -98,7 +102,6 @@ fields
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 : Perform
//purpose :
//=======================================================================
void GEOMAlgo_BuilderArea::Perform()
{
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
}
#endif
//======================================================================= //=======================================================================
//function : SetShapes //function : SetShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF) void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF)
{ {
TopTools_ListIteratorOfListOfShape aIt; TopTools_ListIteratorOfListOfShape aIt;
// //
@ -73,7 +107,7 @@
//function : Shapes //function : Shapes
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const
{ {
return myShapes; return myShapes;
} }
@ -81,15 +115,15 @@
//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;
} }
@ -97,28 +131,27 @@
//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,58 +94,45 @@ 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,17 +108,15 @@ 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()
{ {
@ -117,17 +125,21 @@ static
//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;
@ -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) {
@ -170,7 +183,7 @@ 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;
@ -195,7 +208,7 @@ static
} }
/* /*
else { else {
int a=0; int a=0;
} }
*/ */
} }
@ -264,7 +277,7 @@ static
//function : PerformLoops //function : PerformLoops
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformLoops() void GEOMAlgo_BuilderSolid::PerformLoops()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -403,7 +416,7 @@ 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
@ -491,7 +504,7 @@ static
//function : PerformAreas //function : PerformAreas
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformAreas() void GEOMAlgo_BuilderSolid::PerformAreas()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -608,7 +621,7 @@ static
//function : PerformInternalShapes //function : PerformInternalShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_BuilderSolid::PerformInternalShapes() void GEOMAlgo_BuilderSolid::PerformInternalShapes()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -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);
} }
} }
@ -738,7 +755,11 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF,
//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);
@ -753,7 +774,11 @@ Standard_Boolean IsHole(const TopoDS_Shape& theS2,
//======================================================================= //=======================================================================
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,7 +794,11 @@ 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);
} }
@ -834,14 +863,13 @@ 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;
@ -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);
} }
} }
} }
@ -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,12 +41,6 @@
#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);
@ -51,9 +51,12 @@ static
//======================================================================= //=======================================================================
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;
@ -106,9 +109,12 @@ static
//======================================================================= //=======================================================================
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;
@ -299,7 +305,6 @@ static
} }
} }
} }
} }
//======================================================================= //=======================================================================
//function : MapShapes //function : MapShapes

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
@ -99,6 +98,9 @@ is
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

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();
@ -546,7 +551,7 @@ 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;
@ -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);
@ -196,8 +209,7 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
//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;
@ -211,8 +223,8 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE,
//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;
@ -231,8 +243,8 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE,
//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;
@ -270,7 +282,7 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
//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;
// //
@ -285,8 +297,8 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
//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;
@ -311,8 +323,8 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
// //
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;
@ -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 :
@ -73,8 +75,12 @@ 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

@ -40,6 +40,15 @@ is
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);
@ -57,6 +66,9 @@ is
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: 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

@ -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
//
// Fields PROTECTED
//
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

@ -51,7 +51,7 @@ 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
//
// Fields PROTECTED
//
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

@ -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>
@ -445,7 +442,6 @@ 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;
@ -851,7 +847,7 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
return anAngle; return anAngle;
} }
//
//======================================================================= //=======================================================================
// function: NbWaysOut // function: NbWaysOut
// purpose: // purpose:

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,7 +111,6 @@ class TopTools_DataMapOfShapeShape;
class TColStd_MapOfInteger; class TColStd_MapOfInteger;
class NMTTools_PaveFiller { class NMTTools_PaveFiller {
public: public:
@ -140,9 +145,12 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller();
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;
@ -242,13 +250,8 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller();
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() ;
@ -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;
@ -82,13 +82,6 @@ is
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,61 +18,58 @@
// 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 <TColStd_IndexedMapOfInteger.hxx> #include <Basics_OCCTVersion.hxx>
#include <gp_Pnt.hxx> #include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <gp_XYZ.hxx> #include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
#include <gp_Pnt2d.hxx> #include <NMTTools_CoupleOfShape.hxx>
#include <Geom_Surface.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <BRepTools.hxx> #include <BRepTools.hxx>
#include <BRepLib.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx> #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx> #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_VVInterference.hxx> #include <BOPTools_VVInterference.hxx>
#include <BOPTools_SSInterference.hxx> #include <BOPTools_SSInterference.hxx>
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools3D.hxx>
#include <BOPTools_Tools.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_Curve.hxx>
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <BOPTools_Tools2D.hxx> #include <Geom_Surface.hxx>
#include <BRepLib.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
#include <BOPTools_Tools3D.hxx> #include <Geom2d_Curve.hxx>
#include <TopExp_Explorer.hxx>
// #include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx> #include <gp_Pnt.hxx>
#include <TopoDS_Iterator.hxx> #include <gp_XYZ.hxx>
#include <gp_Pnt2d.hxx>
static static
void ProcessBlock(const Standard_Integer iV, void ProcessBlock(const Standard_Integer iV,
@ -117,7 +114,6 @@ static
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;
@ -215,7 +211,11 @@ static
//======================================================================= //=======================================================================
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,7 +249,11 @@ 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;
} }
//======================================================================= //=======================================================================
@ -441,7 +449,11 @@ void ProcessBlock(const Standard_Integer iV,
//======================================================================= //=======================================================================
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
@ -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;
} }
// //

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
//
// Fields PROTECTED
//
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