From a292cd4a4d5b43417459eb3ef70d72218b5d4e6d Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 20 Feb 2012 09:30:57 +0000 Subject: [PATCH] 0021434: Boolean operations generate a shape with big vertex tolerance. --- src/GEOMAlgo/GEOMAlgo_Algo.cdl | 2 +- src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl | 151 ++++----- src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx | 95 ++++-- src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx | 70 ++--- src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx | 40 ++- src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx | 183 ++++++----- src/GEOMAlgo/GEOMAlgo_Builder_1.cxx | 51 +-- src/GEOMAlgo/GEOMAlgo_Builder_2.cxx | 87 ++++-- src/GEOMAlgo/GEOMAlgo_Builder_3.cxx | 51 ++- src/GEOMAlgo/GEOMAlgo_Builder_4.cxx | 63 ++-- src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cdl | 10 +- src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx | 9 +- src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx | 96 ++---- src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx | 27 +- src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx | 33 +- src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx | 19 +- src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx | 127 ++++---- src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx | 46 +-- src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx | 38 ++- src/GEOMAlgo/GEOMAlgo_Gluer.cxx | 42 ++- src/GEOMAlgo/GEOMAlgo_Gluer2.cxx | 19 +- src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx | 42 ++- src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx | 28 +- src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cdl | 16 +- src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx | 41 ++- src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx | 120 +++----- src/GEOMAlgo/GEOMAlgo_ShapeAlgo.jxx | 3 + src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx | 12 +- src/GEOMAlgo/GEOMAlgo_Tools.cdl | 12 +- src/GEOMAlgo/GEOMAlgo_Tools.cxx | 54 +++- src/GEOMAlgo/GEOMAlgo_Tools.hxx | 144 +++++---- src/GEOMAlgo/GEOMAlgo_Tools3D.cdl | 24 +- src/GEOMAlgo/GEOMAlgo_Tools3D.cxx | 96 +++++- src/GEOMAlgo/GEOMAlgo_Tools3D.hxx | 376 +++++++++++++---------- src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx | 14 +- src/GEOMAlgo/GEOMAlgo_WireSplitter.cxx | 108 ++++--- src/NMTTools/NMTTools_CheckerSI.cxx | 35 ++- src/NMTTools/NMTTools_PaveFiller.cdl | 4 - src/NMTTools/NMTTools_PaveFiller.cxx | 33 +- src/NMTTools/NMTTools_PaveFiller.hxx | 222 ++++++------- src/NMTTools/NMTTools_PaveFiller_2.cxx | 5 +- src/NMTTools/NMTTools_PaveFiller_3.cxx | 11 +- src/NMTTools/NMTTools_PaveFiller_4.cxx | 18 ++ src/NMTTools/NMTTools_PaveFiller_5.cxx | 12 + src/NMTTools/NMTTools_PaveFiller_6.cxx | 49 ++- src/NMTTools/NMTTools_PaveFiller_7.cxx | 8 +- src/NMTTools/NMTTools_Tools.cdl | 14 +- src/NMTTools/NMTTools_Tools.cxx | 116 ++++--- src/NMTTools/NMTTools_Tools.hxx | 123 +++----- 49 files changed, 1772 insertions(+), 1227 deletions(-) diff --git a/src/GEOMAlgo/GEOMAlgo_Algo.cdl b/src/GEOMAlgo/GEOMAlgo_Algo.cdl index 7ba2a50df..00f2d3c1b 100755 --- a/src/GEOMAlgo/GEOMAlgo_Algo.cdl +++ b/src/GEOMAlgo/GEOMAlgo_Algo.cdl @@ -52,7 +52,7 @@ is WarningStatus (me) 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). -- Needed for the SALOME/TRIPOLI module. diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl b/src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl index e110d806a..25a0650ac 100755 --- a/src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl +++ b/src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl @@ -18,87 +18,90 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com --- --- File: ModGlue_BuilderArea.cdl --- Created: --- Author: Peter KURNEV --- -deferred class BuilderArea from GEOMAlgo - inherits Algo from GEOMAlgo - - ---Purpose: The root class for algorithms to build - -- faces/solids from set of edges/faces +-- File: ModGlue_BuilderArea.cdl +-- Author: Peter KURNEV + +deferred class BuilderArea from GEOMAlgo + inherits Algo from GEOMAlgo -uses + ---Purpose: The root class for algorithms to build + -- faces/solids from set of edges/faces + +uses Shape from TopoDS, ListOfShape from TopTools, - MapOfOrientedShape from TopTools, - Context from IntTools, - PContext from IntTools + MapOfOrientedShape from TopTools, + Context from IntTools --raises -is - Initialize - ---Purpose: Empty constructor - returns BuilderArea from GEOMAlgo; - ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();" - - SetContext(me:out; - theContext:Context from IntTools); - ---Purpose: Sets cashed geometrical tools - - SetShapes(me:out; - theLS:ListOfShape from TopTools); - ---Purpose: Sets edges/faces to process - - Shapes(me) - ---Purpose: Returns edges/faces to process - returns ListOfShape from TopTools; - ---C++: return const & - - Loops(me) - ---Purpose: Returns wires/shells that have been built - returns ListOfShape from TopTools; - ---C++: return const & - - Areas(me) - ---Purpose: Returns faces/solids that have been built - returns ListOfShape from TopTools; - ---C++: return const & - - PerformShapesToAvoid(me:out) - ---Purpose: Collect the edges/faces that - -- a) are internal - -- b) are the same and have different orientation - is virtual protected; - - PerformLoops(me:out) - ---Purpose: Build draft faces/shells - -- a)myLoops - draft faces/shells that consist of - -- boundary edges/faces - -- b)myLoopsInternal - draft faces/shells that contains - -- inner edges/faces - is virtual protected; - - PerformAreas(me:out) - ---Purpose: Build draft faces/solids that contains boundary faces - is virtual protected; - - PerformInternalShapes(me:out) - ---Purpose: Build finalized faces/solids with internal wires/shells - is virtual protected; - - -fields - myShapes : ListOfShape from TopTools is protected; - myLoops : ListOfShape from TopTools is protected; +is + Initialize + ---Purpose: Empty constructor + returns BuilderArea from GEOMAlgo; + ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();" + + 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 & + + SetShapes(me:out; + theLS:ListOfShape from TopTools); + ---Purpose: Sets edges/faces to process + + Shapes(me) + ---Purpose: Returns edges/faces to process + returns ListOfShape from TopTools; + ---C++: return const & + + Loops(me) + ---Purpose: Returns wires/shells that have been built + returns ListOfShape from TopTools; + ---C++: return const & + + Areas(me) + ---Purpose: Returns faces/solids that have been built + returns ListOfShape from TopTools; + ---C++: return const & + + Perform(me:out) + is redefined; + + PerformShapesToAvoid(me:out) + ---Purpose: Collect the edges/faces that + -- a) are internal + -- b) are the same and have different orientation + is virtual protected; + + PerformLoops(me:out) + ---Purpose: Build draft faces/shells + -- a)myLoops - draft faces/shells that consist of + -- boundary edges/faces + -- b)myLoopsInternal - draft faces/shells that contains + -- inner edges/faces + is virtual protected; + + PerformAreas(me:out) + ---Purpose: Build draft faces/solids that contains boundary faces + is virtual protected; + + PerformInternalShapes(me:out) + ---Purpose: Build finalized faces/solids with internal wires/shells + is virtual protected; + +fields + myShapes : ListOfShape from TopTools is protected; + myLoops : ListOfShape from TopTools is protected; myLoopsInternal : ListOfShape from TopTools is protected; - myShapesToAvoid : MapOfOrientedShape from TopTools is protected; - myAreas : ListOfShape from TopTools is protected; + myShapesToAvoid : MapOfOrientedShape from TopTools is protected; + myAreas : ListOfShape from TopTools is protected; -- - myContext : PContext from IntTools is protected; - -end BuilderArea; + myContext : Context from IntTools is protected; +end BuilderArea; diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx b/src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx index 557e8eecb..a7d2aba71 100755 --- a/src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx +++ b/src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx @@ -18,47 +18,81 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_BuilderArea.cxx -// Created: -// Author: Peter KURNEV -// +// Author: Peter KURNEV + #include +#include + #include + #include +#include + //======================================================================= -//function : -//purpose : +//function : +//purpose : //======================================================================= - GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea() -: - GEOMAlgo_Algo() +GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea() + : GEOMAlgo_Algo() { +#if OCC_VERSION_LARGE <= 0x06050200 myContext=NULL; +#endif } //======================================================================= //function : ~ -//purpose : +//purpose : //======================================================================= - GEOMAlgo_BuilderArea::~GEOMAlgo_BuilderArea() +GEOMAlgo_BuilderArea::~GEOMAlgo_BuilderArea() { } //======================================================================= //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; +#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 -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF) +void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF) { TopTools_ListIteratorOfListOfShape aIt; // @@ -71,54 +105,53 @@ } //======================================================================= //function : Shapes -//purpose : +//purpose : //======================================================================= - const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const +const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const { return myShapes; } //======================================================================= //function : Loops -//purpose : +//purpose : //======================================================================= - const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Loops()const +const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Loops()const { return myLoops; } //======================================================================= -//function : Solids -//purpose : +//function : Areas +//purpose : //======================================================================= - const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const +const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const { return myAreas; } //======================================================================= //function :PerformShapesToAvoid -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderArea::PerformShapesToAvoid() +void GEOMAlgo_BuilderArea::PerformShapesToAvoid() { } //======================================================================= //function : PerformLoops -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderArea::PerformLoops() +void GEOMAlgo_BuilderArea::PerformLoops() { } //======================================================================= //function : PerformAreas -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderArea::PerformAreas() +void GEOMAlgo_BuilderArea::PerformAreas() { } //======================================================================= //function : PerformInternalShapes -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderArea::PerformInternalShapes() +void GEOMAlgo_BuilderArea::PerformInternalShapes() { } - diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx b/src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx index 319b2ea21..d548480eb 100644 --- a/src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx +++ b/src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx @@ -18,20 +18,25 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_BuilderArea_HeaderFile #define _GEOMAlgo_BuilderArea_HeaderFile +#include + #ifndef _TopTools_ListOfShape_HeaderFile #include #endif #ifndef _TopTools_MapOfOrientedShape_HeaderFile #include #endif -#ifndef _IntTools_PContext_HeaderFile + +#if OCC_VERSION_LARGE > 0x06050200 +#include +#else #include #endif + #ifndef _GEOMAlgo_Algo_HeaderFile #include #endif @@ -64,11 +69,18 @@ public: { if (anAddress) Standard::Free((Standard_Address&)anAddress); } - // Methods PUBLIC - // //! Sets cashed geometrical tools
+#if OCC_VERSION_LARGE > 0x06050200 + Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ; +#else Standard_EXPORT void SetContext(const IntTools_Context& theContext) ; +#endif + +#if OCC_VERSION_LARGE > 0x06050200 + //! Returns cashed geometrical tools
+ Standard_EXPORT const Handle_IntTools_Context& Context() const; +#endif //! Sets edges/faces to process
Standard_EXPORT void SetShapes(const TopTools_ListOfShape& theLS) ; @@ -82,57 +94,44 @@ Standard_EXPORT const TopTools_ListOfShape& Loops() const; //! Returns faces/solids that have been built
Standard_EXPORT const TopTools_ListOfShape& Areas() const; - - - +#if OCC_VERSION_LARGE > 0x06050200 + Standard_EXPORT virtual void Perform() ; +#endif protected: - // Methods PROTECTED - // - -//! Empty constructor
-Standard_EXPORT GEOMAlgo_BuilderArea(); + //! Empty constructor
+ Standard_EXPORT GEOMAlgo_BuilderArea(); Standard_EXPORT virtual ~GEOMAlgo_BuilderArea(); - -//! Collect the edges/faces that
+ //! Collect the edges/faces that
//! a) are internal
//! b) are the same and have different orientation
-Standard_EXPORT virtual void PerformShapesToAvoid() ; - -//! Build draft faces/shells
+ Standard_EXPORT virtual void PerformShapesToAvoid() ; + //! Build draft faces/shells
//! a)myLoops - draft faces/shells that consist of
//! boundary edges/faces
//! b)myLoopsInternal - draft faces/shells that contains
//! inner edges/faces
-Standard_EXPORT virtual void PerformLoops() ; + Standard_EXPORT virtual void PerformLoops() ; + //! Build draft faces/solids that contains boundary faces
+ Standard_EXPORT virtual void PerformAreas() ; + //! Build finalized faces/solids with internal wires/shells
+ Standard_EXPORT virtual void PerformInternalShapes() ; -//! Build draft faces/solids that contains boundary faces
-Standard_EXPORT virtual void PerformAreas() ; -//! Build finalized faces/solids with internal wires/shells
-Standard_EXPORT virtual void PerformInternalShapes() ; - - - // Fields PROTECTED - // TopTools_ListOfShape myShapes; TopTools_ListOfShape myLoops; TopTools_ListOfShape myLoopsInternal; TopTools_MapOfOrientedShape myShapesToAvoid; TopTools_ListOfShape myAreas; +#if OCC_VERSION_LARGE > 0x06050200 +Handle_IntTools_Context myContext; +#else IntTools_PContext myContext; +#endif -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - +private: }; @@ -141,7 +140,6 @@ private: // other Inline functions and methods (like "C++: function call" methods) -// #endif diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx b/src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx index 0a40937de..75e2896e2 100755 --- a/src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx +++ b/src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx @@ -18,14 +18,23 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_BuilderFace.cxx -// Created: // Author: Peter KURNEV -// + #include +#include +#include +#include +#include + +#include +#include +#include + +#include + #include #include #include @@ -71,15 +80,6 @@ #include #include -#include -#include -#include - -#include -#include -#include -#include - // static Standard_Boolean IsGrowthWire(const TopoDS_Shape& , @@ -89,7 +89,12 @@ static static Standard_Boolean IsInside(const TopoDS_Shape& , const TopoDS_Shape& , +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& ); +#else IntTools_PContext& ); +#endif + static void MakeInternalWires(const TopTools_MapOfShape& , TopTools_ListOfShape& ); @@ -134,16 +139,23 @@ static { myErrorStatus=0; // +#if OCC_VERSION_LARGE <= 0x06050200 if (myContext==NULL) { myErrorStatus=11;// Null Context return; } +#endif // if (myFace.IsNull()) { myErrorStatus=12;// Null face generix return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_BuilderArea::Perform(); +#endif + // PerformShapesToAvoid(); if (myErrorStatus) { return; @@ -619,7 +631,11 @@ void MakeInternalWires(const TopTools_MapOfShape& theME, //======================================================================= Standard_Boolean IsInside(const TopoDS_Shape& theHole, const TopoDS_Shape& theF2, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theContext) +#else IntTools_PContext& theContext) +#endif { Standard_Boolean bRet; Standard_Real aT, aU, aV; diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx b/src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx index 848ee7a4d..e3af4d7be 100755 --- a/src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx +++ b/src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx @@ -18,14 +18,21 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_BuilderSolid.cxx -// Created: -// Author: Peter KURNEV -// +// Author: Peter KURNEV + #include +#include +#include + +#include +#include +#include + +#include + #include #include #include @@ -73,24 +80,27 @@ #include #include -#include -#include -#include - -#include -#include - // static Standard_Boolean IsGrowthShell(const TopoDS_Shape& , const TopTools_IndexedMapOfShape& ); static Standard_Boolean IsHole(const TopoDS_Shape& , +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& ); +#else IntTools_PContext& ); +#endif + static Standard_Boolean IsInside(const TopoDS_Shape& , const TopoDS_Shape& , +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& ); +#else IntTools_PContext& ); +#endif + static void MakeInternalShells(const TopTools_MapOfShape& , TopTools_ListOfShape& ); @@ -98,41 +108,43 @@ static static Standard_Boolean IsClosedShell(const TopoDS_Shell& ); -//modified by NIZNHY-PKV Tue Oct 26 13:30:39 2010f static - Standard_Boolean RefineShell(const TopoDS_Shell& , - TopoDS_Shell& ); -//modified by NIZNHY-PKV Tue Oct 26 13:30:42 2010t + Standard_Boolean RefineShell(const TopoDS_Shell& , + TopoDS_Shell& ); //======================================================================= -//function : -//purpose : +//function : +//purpose : //======================================================================= - GEOMAlgo_BuilderSolid::GEOMAlgo_BuilderSolid() +GEOMAlgo_BuilderSolid::GEOMAlgo_BuilderSolid() : GEOMAlgo_BuilderArea() { } //======================================================================= //function : ~ -//purpose : +//purpose : //======================================================================= - GEOMAlgo_BuilderSolid::~GEOMAlgo_BuilderSolid() +GEOMAlgo_BuilderSolid::~GEOMAlgo_BuilderSolid() { } //======================================================================= //function : Perform -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderSolid::Perform() +void GEOMAlgo_BuilderSolid::Perform() { myErrorStatus=0; // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_BuilderArea::Perform(); +#endif // TopoDS_Compound aC; BRep_Builder aBB; TopTools_ListIteratorOfListOfShape aIt; - + aBB.MakeCompound(aC); aIt.Initialize(myShapes); for(; aIt.More(); aIt.Next()) { @@ -140,11 +152,12 @@ static aBB.Add(aC, aF); } // - // +#if OCC_VERSION_LARGE <= 0x06050200 if (myContext==NULL) { myErrorStatus=11;// Null Context return; } +#endif // PerformShapesToAvoid(); if (myErrorStatus) { @@ -168,9 +181,9 @@ static } //======================================================================= //function :PerformShapesToAvoid -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderSolid::PerformShapesToAvoid() +void GEOMAlgo_BuilderSolid::PerformShapesToAvoid() { Standard_Boolean bFound; Standard_Integer i, iCnt, aNbE, aNbF; @@ -194,8 +207,8 @@ static TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF); } /* - else { - int a=0; + else { + int a=0; } */ } @@ -241,7 +254,7 @@ static myShapesToAvoid.Add(aF2); } } - /*//DEB + /*//DEB else { TopTools_ListIteratorOfListOfShape aItLF; // @@ -258,13 +271,13 @@ static break; } // - }//while (1) -} + }//while (1) +} //======================================================================= //function : PerformLoops -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderSolid::PerformLoops() +void GEOMAlgo_BuilderSolid::PerformLoops() { myErrorStatus=0; // @@ -323,7 +336,7 @@ static if (aMEFP.Contains(aE)) { const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE); aNbFP=aLFP.Extent(); - if (aNbFP>1) { + if (aNbFP>1) { continue; } } @@ -351,14 +364,14 @@ static NMTTools_ListOfCoupleOfShape aLCSOff; // aItLF.Initialize(aLF); - for (; aItLF.More(); aItLF.Next()) { + for (; aItLF.More(); aItLF.Next()) { const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItLF.Value())); if (myShapesToAvoid.Contains(aFL)) { continue; } if (aF.IsSame(aFL)) { continue; - } + } if (AddedFacesMap.Contains(aFL)){ continue; } @@ -371,7 +384,7 @@ static aCSOff.SetShape1(aEL); aCSOff.SetShape2(aFL); aLCSOff.Append(aCSOff); - }//for (; aItLF.More(); aItLF.Next()) { + }//for (; aItLF.More(); aItLF.Next()) { // aNbOff=aLCSOff.Extent(); if (!aNbOff){ @@ -386,11 +399,11 @@ static GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF); } // - if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) { + if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) { aBB.Add(aShell, aSelF); TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP); } - } // for (; aEdgeExp.More(); aEdgeExp.Next()) { + } // for (; aEdgeExp.More(); aEdgeExp.Next()) { } //for (; aItAddedF.More(); aItAddedF.Next()) { // if (IsClosedShell(aShell)) { @@ -403,15 +416,15 @@ static // bRefine=RefineShell(aShell, aShx); if (bRefine) { - myLoops.Append(aShx); + myLoops.Append(aShx); } } //modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t - } // for (; aItF.More(); aItF.Next()) { + } // for (; aItF.More(); aItF.Next()) { // // Post Treatment TopTools_MapOfOrientedShape aMP; - // + // // a. collect all edges that are in loops aIt.Initialize (myLoops); for (; aIt.More(); aIt.Next()) { @@ -422,7 +435,7 @@ static aMP.Add(aF); } } - // + // // b. collect all faces that are to avoid aItM.Initialize(myShapesToAvoid); for (; aItM.More(); aItM.Next()) { @@ -475,7 +488,7 @@ static const TopoDS_Edge& aE = *((TopoDS_Edge*)(&aEdgeExp.Current())); const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE); aItF.Initialize(aLF); - for (; aItF.More(); aItF.Next()) { + for (; aItF.More(); aItF.Next()) { const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItF.Value())); if (AddedFacesMap.Add(aFL)){ aBB.Add(aShell, aFL); @@ -489,14 +502,14 @@ static } //======================================================================= //function : PerformAreas -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderSolid::PerformAreas() +void GEOMAlgo_BuilderSolid::PerformAreas() { myErrorStatus=0; // Standard_Boolean bIsGrowthShell, bIsHole; - TopTools_ListOfShape aNewSolids, aHoleShells; + TopTools_ListOfShape aNewSolids, aHoleShells; TopoDS_Shape anInfinitePointShape; TopTools_DataMapOfShapeShape aInOutMap; TopTools_DataMapOfShapeListOfShape aMSH; @@ -599,16 +612,16 @@ static // } // - // These aNewSolids are draft solids that + // These aNewSolids are draft solids that // do not contain any internal shapes // myAreas.Append(aNewSolids); } //======================================================================= //function : PerformInternalShapes -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_BuilderSolid::PerformInternalShapes() +void GEOMAlgo_BuilderSolid::PerformInternalShapes() { myErrorStatus=0; // @@ -616,10 +629,10 @@ static if (!aNbFI) {// nothing to do return; } - // + // BRep_Builder aBB; TopTools_ListIteratorOfListOfShape aShellIt, aSolidIt; - TopoDS_Iterator aIt; + TopoDS_Iterator aIt; TopTools_MapOfShape aMF, aMFP; TopTools_MapIteratorOfMapOfShape aItMF; TopTools_IndexedDataMapOfShapeListOfShape aMEF; @@ -650,7 +663,11 @@ static aItMF.Initialize(aMF); for (; aItMF.More(); aItMF.Next()) { 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)) { +#endif aMFP.Add(aF); } } @@ -682,7 +699,7 @@ static //======================================================================= //function : MakeInternalShells -//purpose : +//purpose : //======================================================================= void MakeInternalShells(const TopTools_MapOfShape& theMF, TopTools_ListOfShape& theShells) @@ -708,7 +725,7 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF, // // make a new shell TopoDS_Shell aShell; - aBB.MakeShell(aShell); + aBB.MakeShell(aShell); aFF.Orientation(TopAbs_INTERNAL); aBB.Add(aShell, aFF); // @@ -721,7 +738,7 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF, const TopoDS_Shape& aE =aEdgeExp.Current(); const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE); aItF.Initialize(aLF); - for (; aItF.More(); aItF.Next()) { + for (; aItF.More(); aItF.Next()) { TopoDS_Shape aFL=aItF.Value(); if (aAddedFacesMap.Add(aFL)){ aFL.Orientation(TopAbs_INTERNAL); @@ -735,10 +752,14 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF, } //======================================================================= //function : IsHole -//purpose : +//purpose : //======================================================================= Standard_Boolean IsHole(const TopoDS_Shape& theS2, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theContext) +#else IntTools_PContext& theContext) +#endif { TopoDS_Solid *pS2=(TopoDS_Solid *)&theS2; BRepClass3d_SolidClassifier& aClsf=theContext->SolidClassifier(*pS2); @@ -749,11 +770,15 @@ Standard_Boolean IsHole(const TopoDS_Shape& theS2, } //======================================================================= //function : IsInside -//purpose : +//purpose : //======================================================================= Standard_Boolean IsInside(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theContext) +#else IntTools_PContext& theContext) +#endif { TopExp_Explorer aExp; TopAbs_State aState; @@ -769,20 +794,24 @@ Standard_Boolean IsInside(const TopoDS_Shape& theS1, else { TopTools_IndexedMapOfShape aBounds; 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); +#endif } return (aState==TopAbs_IN); } //======================================================================= //function : IsGrowthShell -//purpose : +//purpose : //======================================================================= Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell, const TopTools_IndexedMapOfShape& theMHF) { Standard_Boolean bRet; TopoDS_Iterator aIt; - // + // bRet=Standard_False; if (theMHF.Extent()) { aIt.Initialize(theShell); @@ -797,7 +826,7 @@ Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell, } //======================================================================= //function : IsClosedShell -//purpose : +//purpose : //======================================================================= Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) { @@ -806,7 +835,7 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) TopoDS_Iterator aIt; TopExp_Explorer aExp; TopTools_MapOfShape aM; - // + // bRet=Standard_False; aIt.Initialize(theShell); for(; aIt.More(); aIt.Next()) { @@ -834,21 +863,20 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) } return bRet; } -//modified by NIZNHY-PKV Tue Oct 26 13:30:23 2010f + //======================================================================= //function : RefineShell //purpose : //======================================================================= - Standard_Boolean RefineShell(const TopoDS_Shell& aShell, - TopoDS_Shell& aShx) - +Standard_Boolean RefineShell (const TopoDS_Shell& aShell, + TopoDS_Shell& aShx) { Standard_Boolean bRet; Standard_Integer i, aNbE, aNbF; TopAbs_Orientation aOrE; TopTools_IndexedDataMapOfShapeListOfShape aMEF; TopTools_MapOfOrientedShape aMFx; - // + // bRet=Standard_False; // TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF); @@ -871,7 +899,7 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First())); if (aNbF==1) { if (aOrE==TopAbs_INTERNAL) { - continue; + continue; } aMFx.Add(aF1); } @@ -879,14 +907,14 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) else if (aNbF==2) { const TopoDS_Face& aF2=*((TopoDS_Face*)(&aLF.Last())); if (aF2.IsSame(aF1)) { - if (BRep_Tool::IsClosed(aE, aF1)) { - continue; - } - if (aOrE==TopAbs_INTERNAL) { - continue; - } - aMFx.Add(aF1); - aMFx.Add(aF2); + if (BRep_Tool::IsClosed(aE, aF1)) { + continue; + } + if (aOrE==TopAbs_INTERNAL) { + continue; + } + aMFx.Add(aF1); + aMFx.Add(aF2); } } } @@ -894,7 +922,7 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) aNbF=aMFx.Extent(); if (!aNbF) { return bRet; - } + } // BRep_Builder aBB; TopoDS_Iterator aIt; @@ -916,7 +944,6 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) // return bRet; } -//modified by NIZNHY-PKV Tue Oct 26 13:30:26 2010t -// + // ErrorStatus : // 11 - Null Context diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_1.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_1.cxx index 5028b7699..60be7b5e5 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_1.cxx @@ -18,15 +18,28 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_Builder_1.cxx -// Created: // Author: Peter KURNEV -// + #include -// + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + #include +#include #include #include @@ -34,33 +47,20 @@ #include #include #include -// + #include #include #include #include -// + #include #include -// + #include + #include #include #include -// -#include -// -#include -#include -#include -#include -#include -#include -#include -// -#include -#include - static @@ -112,8 +112,11 @@ static const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; 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(); +#endif // Standard_Boolean bToReverse; Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB, aNbLB; @@ -227,7 +230,11 @@ static // const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx= pPF->Context(); +#else IntTools_Context& aCtx= pPF->ChangeContext(); +#endif // aNbS=aDS.NumberOfShapesOfTheObject(); for (i=1; i<=aNbS; ++i) { diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx index 9818ad60e..8b096052a 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx @@ -24,8 +24,27 @@ #include -#include -#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include @@ -39,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -51,8 +72,13 @@ #include #include +#include +#include + #include + #include + #include #include #include @@ -67,34 +93,11 @@ #include #include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// -#include -#include -#include - -#include -// -#include #include -#include -#include -#include + +#include #include #include -#include static void UpdateCandidates(const Standard_Integer , @@ -208,7 +211,11 @@ void GEOMAlgo_Builder::BuildSplitFaces() NMTTools_PaveFiller* pPF=myPaveFiller; NMTDS_InterfPool* pIP=pPF->IP(); BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences(); +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx= pPF->Context(); +#else IntTools_Context& aCtx= pPF->ChangeContext(); +#endif // Standard_Boolean bToReverse, bIsClosed, bIsDegenerated; Standard_Integer i, aNb, aNbF, nF; @@ -420,7 +427,11 @@ void GEOMAlgo_Builder::FillSameDomainFaces() NMTTools_PaveFiller* pPF=myPaveFiller; NMTDS_InterfPool* pIP=pPF->IP(); 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(); @@ -707,7 +718,11 @@ void GEOMAlgo_Builder::FillInternalVertices() const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; NMTDS_InterfPool* pIP=pPF->IP(); +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx= pPF->Context(); +#else IntTools_Context& aCtx= pPF->ChangeContext(); +#endif // BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences(); BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences(); @@ -880,10 +895,18 @@ void GEOMAlgo_Builder::FillInternalVertices() for (; aIt.More(); aIt.Next()) { TopoDS_Face aFx=TopoDS::Face(aIt.Value()); // update classifier +#if OCC_VERSION_LARGE > 0x06050200 + IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx); +#else IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx); +#endif aClsf.Init(aFx, aTol); // +#if OCC_VERSION_LARGE > 0x06050200 + iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2); +#else iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2); +#endif if (!iFlag) { aBB.Add(aFx, aV); break; @@ -893,10 +916,18 @@ void GEOMAlgo_Builder::FillInternalVertices() else { const TopoDS_Face& aFx=TopoDS::Face(aF); // update classifier +#if OCC_VERSION_LARGE > 0x06050200 + IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx); +#else IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx); +#endif aClsf.Init(aFx, aTol); // +#if OCC_VERSION_LARGE > 0x06050200 + iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2); +#else iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2); +#endif if (!iFlag) { TopoDS_Face aFz; // diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx index a45197a70..79b42d1df 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx @@ -18,13 +18,24 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File : GEOMAlgo_Builder_3.cxx -// Created : // Author : Peter KURNEV #include +#include + +#include +#include +#include +#include +#include + +#include + +#include + #include #include @@ -57,16 +68,6 @@ #include -#include -#include - -#include -#include -#include -#include -#include - - static void OwnInternalShapes(const TopoDS_Shape& , @@ -94,9 +95,12 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid, { myErrorStatus=0; // - /*const NMTDS_ShapesDataStructure& aDS=**/myPaveFiller->DS(); 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_Integer iFlag; @@ -189,7 +193,11 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid, // const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); 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_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(); 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; 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 // // 1.3 Build new solids +#if OCC_VERSION_LARGE > 0x06050200 + aSB.SetContext(aCtx); +#endif aSB.SetShapes(aSFS1); aSB.Perform(); iErr=aSB.ErrorStatus(); @@ -564,7 +579,11 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid, // const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx= pPF->Context(); +#else IntTools_Context& aCtx= pPF->ChangeContext(); +#endif // //Standard_Boolean bHasImage; Standard_Integer i, j, jT, aNbS, aNbSI, aNbSx, aNbSd; diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx index 75a533cd6..902614583 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx @@ -18,14 +18,20 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_Builder_4.cxx -// Created: -// Author: Peter KURNEV -// +// Author: Peter KURNEV + #include +#include + +#include + +#include + +#include + #include #include @@ -35,25 +41,22 @@ #include -#include - -#include - -#include - static void MapShapes(const TopoDS_Shape& aS, TopTools_MapOfShape& aM); //======================================================================= //function : Generated -//purpose : +//purpose : //======================================================================= const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS) { - /*const NMTDS_ShapesDataStructure& aDS=**/myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx=pPF->Context(); +#else IntTools_Context& aCtx=pPF->ChangeContext(); +#endif // Standard_Boolean bHasImage, bToReverse; TopAbs_ShapeEnum aType; @@ -72,8 +75,8 @@ static // aType=theS.ShapeType(); // - if (aType==TopAbs_EDGE || aType==TopAbs_FACE || - aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { + if (aType==TopAbs_EDGE || aType==TopAbs_FACE || + aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { const TopTools_ListOfShape& aLSp=myImages.Image(theS); aIt.Initialize(aLSp); for (; aIt.More(); aIt.Next()) { @@ -102,13 +105,16 @@ static } //======================================================================= //function : Modified -//purpose : +//purpose : //======================================================================= const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS) { - /*const NMTDS_ShapesDataStructure& aDS=**/myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx=pPF->Context(); +#else IntTools_Context& aCtx=pPF->ChangeContext(); +#endif // Standard_Boolean bHasImage, bToReverse; TopAbs_ShapeEnum aType; @@ -127,8 +133,8 @@ static // aType=theS.ShapeType(); // - if (aType==TopAbs_EDGE || aType==TopAbs_FACE || - aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { + if (aType==TopAbs_EDGE || aType==TopAbs_FACE || + aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { const TopTools_ListOfShape& aLSp=myImages.Image(theS); aIt.Initialize(aLSp); for (; aIt.More(); aIt.Next()) { @@ -156,7 +162,7 @@ static } //======================================================================= //function : IsDeleted -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Builder::IsDeleted(const TopoDS_Shape& theS) { @@ -181,8 +187,8 @@ static } // aType=theS.ShapeType(); - if (aType==TopAbs_EDGE || aType==TopAbs_FACE || - aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { + if (aType==TopAbs_EDGE || aType==TopAbs_FACE || + aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { const TopTools_ListOfShape& aLSp=myImages.Image(theS); aIt.Initialize(aLSp); for (; aIt.More(); aIt.Next()) { @@ -205,7 +211,7 @@ static } //======================================================================= //function : PrepareHistory -//purpose : +//purpose : //======================================================================= void GEOMAlgo_Builder::PrepareHistory() { @@ -219,10 +225,10 @@ static TopTools_ListIteratorOfListOfShape aIt; TopTools_MapIteratorOfMapOfShape aItM; // - // 1. Clearing + // 1. Clearing GEOMAlgo_BuilderShape::PrepareHistory(); // - // 2. myMapShape - all shapes of result with theirs sub-shapes + // 2. myMapShape - all shapes of result with theirs sub-shapes MapShapes(myShape, myMapShape); // // 3. MS - all argument shapes with theirs sub-shapes @@ -263,13 +269,13 @@ static // //modified by NIZNHY-PKV Thu Dec 7 11:34:10 2006t // - // 4.2 As it was + // 4.2 As it was if (!myHasDeleted) { myHasDeleted=IsDeleted(aSx);//xx } // if (!myHasGenerated || !myHasModified) { - if (aType==TopAbs_EDGE || aType==TopAbs_FACE || + if (aType==TopAbs_EDGE || aType==TopAbs_FACE || aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { //modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f //bHasImage=myImages.HasImage(aSx); @@ -296,14 +302,13 @@ static } // if (myMapShape.Contains(aSp)) } } - } + } } } - } //======================================================================= //function : MapShapes -//purpose : +//purpose : //======================================================================= void MapShapes(const TopoDS_Shape& theS, TopTools_MapOfShape& theM) diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cdl b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cdl index f81950555..c103117a8 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cdl +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cdl @@ -18,12 +18,11 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com --- -- File: GEOMAlgo_FinderShapeOn.cdl -- Created: Tue Jan 11 14:35:52 2005 -- Author: Peter KURNEV --- + class FinderShapeOn from GEOMAlgo inherits ShapeAlgo from GEOMAlgo @@ -98,8 +97,11 @@ is aImages : out DataMapOfShapeShape from TopTools; aOriginals: out DataMapOfShapeShape from TopTools; aSC : out Shape from TopoDS); - - + + BuildTriangulation(myclass; + aS :Shape from TopoDS) + returns Boolean from Standard; + fields mySurface : Surface from Geom is protected; diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx index ee472806e..8975aaabe 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx @@ -187,6 +187,11 @@ void GEOMAlgo_FinderShapeOn::Perform() return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_ShapeAlgo::Perform(); +#endif + // myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface); // MakeArgument1(); @@ -544,9 +549,9 @@ void GEOMAlgo_FinderShapeOn::CopySource(const TopoDS_Shape& aE, // //======================================================================= //function : BuildTriangulation -//purpose : +//purpose : //======================================================================= -bool GEOMAlgo_FinderShapeOn::BuildTriangulation (const TopoDS_Shape& theShape) +Standard_Boolean GEOMAlgo_FinderShapeOn::BuildTriangulation (const TopoDS_Shape& theShape) { // calculate deflection Standard_Real aDeviationCoefficient = 0.001; diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx index 7b959e27f..050a61391 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx @@ -68,80 +68,63 @@ class GEOMAlgo_FinderShapeOn : public GEOMAlgo_ShapeAlgo { public: - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } - // Methods PUBLIC - // + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } -Standard_EXPORT GEOMAlgo_FinderShapeOn(); -Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn(); + Standard_EXPORT 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: - // Methods PROTECTED - // - - -Standard_EXPORT virtual void CheckData() ; - - -Standard_EXPORT void MakeArgument1() ; + Standard_EXPORT virtual void CheckData() ; -Standard_EXPORT void MakeArgument2() ; + Standard_EXPORT void MakeArgument1() ; + Standard_EXPORT void MakeArgument2() ; -Standard_EXPORT void Find() ; + Standard_EXPORT void Find() ; + Standard_EXPORT void Find(const TopoDS_Shape& aS) ; -Standard_EXPORT void Find(const TopoDS_Shape& aS) ; + Standard_EXPORT void FindVertices() ; -Standard_EXPORT void FindVertices() ; - - - // Fields PROTECTED - // Handle_Geom_Surface mySurface; TopAbs_ShapeEnum myShapeType; GEOMAlgo_State myState; @@ -155,22 +138,9 @@ Standard_Boolean myIsAnalytic; private: - // Methods PRIVATE - // - - - // Fields PRIVATE - // - }; - - - - // other Inline functions and methods (like "C++: function call" methods) -// - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx index 863fae5b6..3c1a98d14 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx @@ -25,6 +25,18 @@ #include +#include + +#include +#include +#include + +#include +#include +#include + +#include + #include #include @@ -67,16 +79,6 @@ #include #include -#include - -#include -#include -#include - -#include -#include -#include - //======================================================================= //function : GEOMAlgo_FinderShapeOn1 //purpose : @@ -223,6 +225,11 @@ void GEOMAlgo_FinderShapeOn1::Perform() return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_ShapeAlgo::Perform(); +#endif + // // 1 ProcessVertices(); if(myErrorStatus) { diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx index c919c9c77..35c0a7e3c 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx @@ -18,16 +18,26 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_FinderShapeOn1.cxx // Created: Fri Mar 4 10:31:06 2005 // Author: Peter KURNEV -// -// + #include -#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include #include #include @@ -69,16 +79,6 @@ #include #include -#include - -#include -#include -#include - -#include -#include -#include - //======================================================================= //function : GEOMAlgo_FinderShapeOn1 //purpose : @@ -225,6 +225,11 @@ return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_ShapeAlgo::Perform(); +#endif + // myClsf->SetTolerance(myTolerance); // // 1 diff --git a/src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx b/src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx index 289511977..8407d7a1e 100644 --- a/src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx +++ b/src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx @@ -18,14 +18,20 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File: GEOMAlgo_GetInPlace.cxx -// Created: // Author: Peter KURNEV #include +#include + +#include + #include + +#include + #include #include @@ -59,10 +65,6 @@ #include -#include -#include - - static void MapBRepShapes(const TopoDS_Shape& aS, TopTools_IndexedMapOfShape& aM); @@ -197,6 +199,11 @@ void GEOMAlgo_GetInPlace::Perform() return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_GluerAlgo::Perform(); +#endif + // Intersect(); if (myErrorStatus) { return; diff --git a/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx b/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx index 014a452af..0bebbba4a 100644 --- a/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx @@ -19,11 +19,13 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// File: GEOMAlgo_GetInPlace_1.cxx -// Author: Peter KURNEV +// File: GEOMAlgo_GetInPlace_1.cxx +// Author: Peter KURNEV #include +#include + #include #include @@ -38,9 +40,10 @@ #include #include #include -#include #include +#include + #include #include #include @@ -50,9 +53,9 @@ #include #include -#include #include +#include #include #include @@ -62,33 +65,31 @@ #include - -static - Standard_Integer PntInEdge(const TopoDS_Edge& aF, - gp_Pnt& aP); -static - Standard_Integer PntInEdge(const TopoDS_Edge& aF, - gp_Pnt& aP, - Standard_Real& aT); -static - Standard_Integer PntInFace(const TopoDS_Face& aF, - gp_Pnt& aP); -static - Standard_Integer PntInFace(const TopoDS_Face& aF, - gp_Pnt& aP, - gp_Pnt2d& theP2D); -static - Standard_Integer PntInSolid(const TopoDS_Solid& aZ, - const Standard_Real aTol, - gp_Pnt& aP); - +static + Standard_Integer PntInEdge(const TopoDS_Edge& aF, + gp_Pnt& aP); +static + Standard_Integer PntInEdge(const TopoDS_Edge& aF, + gp_Pnt& aP, + Standard_Real& aT); +static + Standard_Integer PntInFace(const TopoDS_Face& aF, + gp_Pnt& aP); +static + Standard_Integer PntInFace(const TopoDS_Face& aF, + gp_Pnt& aP, + gp_Pnt2d& theP2D); +static + Standard_Integer PntInSolid(const TopoDS_Solid& aZ, + const Standard_Real aTol, + gp_Pnt& aP); //======================================================================= //function : CheckCoincidence -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1, - const TopoDS_Shape& aS2) + const TopoDS_Shape& aS2) { Standard_Boolean bOk; Standard_Integer iErr; @@ -122,12 +123,12 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1, // else if (aType2==TopAbs_FACE) { const TopoDS_Face& aF2=*((TopoDS_Face*)&aS2); - iErr=PntInFace(aF2, aP2); + iErr=PntInFace(aF2, aP2); } // else if (aType2==TopAbs_SOLID) { const TopoDS_Solid& aZ2=*((TopoDS_Solid*)&aS2); - iErr=PntInSolid(aZ2, myTolerance, aP2); + iErr=PntInSolid(aZ2, myTolerance, aP2); } // else { @@ -149,18 +150,22 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& 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); +#endif aPPC.Perform(aP2); aNbPoints=aPPC.NbPoints(); if (aNbPoints) { aDmin=aPPC.LowerDistance(); aT=aPPC.LowerDistanceParameter(); if (aDmin < myTolerance) { - dT=1.e-12; - BRep_Tool::Curve(aE1, aT1, aT2); - if(aT > (aT1-dT) && aT < (aT2+dT)) { - bOk=Standard_True; - } + dT=1.e-12; + BRep_Tool::Curve(aE1, aT1, aT2); + if(aT > (aT1-dT) && aT < (aT2+dT)) { + bOk=Standard_True; + } } } //else { @@ -171,13 +176,21 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1, else if (aType1==TopAbs_FACE) { 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); - } +#endif + } // else if (aType1==TopAbs_SOLID) { 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); +#endif aSC.Perform(aP2, myTolerance); aState=aSC.State(); bOk=(aState==TopAbs_IN); @@ -193,11 +206,10 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1, // //======================================================================= //function : PntInEdge -//purpose : +//purpose : //======================================================================= Standard_Integer PntInEdge(const TopoDS_Edge& aE, - gp_Pnt& aP) - + gp_Pnt& aP) { Standard_Integer iErr; Standard_Real aT; @@ -208,11 +220,11 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE, } //======================================================================= //function : PntInEdge -//purpose : +//purpose : //======================================================================= Standard_Integer PntInEdge(const TopoDS_Edge& aE, - gp_Pnt& aP, - Standard_Real& aT) + gp_Pnt& aP, + Standard_Real& aT) { Standard_Integer iErr; Standard_Real aT1, aT2; @@ -228,18 +240,18 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE, } //======================================================================= //function : PntInSolid -//purpose : +//purpose : //======================================================================= Standard_Integer PntInSolid(const TopoDS_Solid& aZ, - const Standard_Real aTol, - gp_Pnt& aP) + const Standard_Real aTol, + gp_Pnt& aP) { Standard_Integer iErr; Standard_Real aUx, aVx, aCoef; gp_Pnt aPx; gp_Pnt2d aP2Dx; gp_Vec aDNx; - + TopoDS_Face aF; TopExp_Explorer aExp; // @@ -267,26 +279,26 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ, } //======================================================================= //function : PntInFace -//purpose : +//purpose : //======================================================================= -Standard_Integer PntInFace(const TopoDS_Face& aF, - gp_Pnt& aP) +Standard_Integer PntInFace(const TopoDS_Face& aF, + gp_Pnt& aP) { - Standard_Integer iErr; + Standard_Integer iErr; // gp_Pnt2d aP2Dx; // - iErr=PntInFace(aF, aP, aP2Dx); + iErr=PntInFace(aF, aP, aP2Dx); // return iErr; } //======================================================================= //function : PntInFace -//purpose : +//purpose : //======================================================================= -Standard_Integer PntInFace(const TopoDS_Face& aF, - gp_Pnt& theP, - gp_Pnt2d& theP2D) +Standard_Integer PntInFace(const TopoDS_Face& aF, + gp_Pnt& theP, + gp_Pnt2d& theP2D) { Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; Standard_Integer iErr, aIx, aNbDomains, i; @@ -310,16 +322,16 @@ Standard_Integer PntInFace(const TopoDS_Face& aF, aTolTangfIntr=1.e-10; // Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr); - Geom2dHatch_Hatcher aHatcher(aIntr, - aTolHatch2D, aTolHatch3D, - Standard_True, Standard_False); + Geom2dHatch_Hatcher aHatcher(aIntr, + aTolHatch2D, aTolHatch3D, + Standard_True, Standard_False); // iErr=0; aEpsT=1.e-12; // aFF=aF; aFF.Orientation (TopAbs_FORWARD); - // + // aS=BRep_Tool::Surface(aFF); BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax); // @@ -398,4 +410,3 @@ Standard_Integer PntInFace(const TopoDS_Face& aF, // return iErr; } - diff --git a/src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx b/src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx index dfd377326..31083a7f1 100644 --- a/src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx +++ b/src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx @@ -18,67 +18,68 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_GlueDetector.cxx // Created: Wed Dec 15 11:08:09 2004 // Author: Peter KURNEV -// -// + #include +#include +#include +#include +#include +#include +#include +#include + +#include + #include #include #include #include #include +#include #include #include +#include #include #include #include #include #include -#include -#include -#include -#include - -#include #include #include -#include -#include -#include #include + +#include + #include -#include #include -#include //======================================================================= //function : //purpose : //======================================================================= - GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser() -: - GEOMAlgo_Gluer() +GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser() + : GEOMAlgo_Gluer() {} //======================================================================= //function : ~ //purpose : //======================================================================= - GEOMAlgo_GlueAnalyser::~GEOMAlgo_GlueAnalyser() +GEOMAlgo_GlueAnalyser::~GEOMAlgo_GlueAnalyser() {} //======================================================================= //function : HasSolidsToGlue //purpose : //======================================================================= - Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsToGlue()const +Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsToGlue()const { return !mySolidsToGlue.IsEmpty(); } @@ -86,7 +87,7 @@ //function : HasSolidsAlone //purpose : //======================================================================= - Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const +Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const { return !mySolidsAlone.IsEmpty(); } @@ -123,6 +124,11 @@ return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_ShapeAlgo::Perform(); +#endif + // InnerTolerance(); if (myErrorStatus) { return; diff --git a/src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx b/src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx index 9ef4af9c4..c6c1433fe 100644 --- a/src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx +++ b/src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx @@ -18,15 +18,23 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File: GEOMAlgo_GlueDetector.cxx -// Created: // Author: Peter KURNEV -// -// + #include -#include +#include +#include +#include +#include + +#include +#include +#include + +#include + #include #include @@ -49,27 +57,20 @@ #include #include + #include #include #include -#include -#include -#include - -#include -#include -#include -#include +#include //======================================================================= //function : //purpose : //======================================================================= GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector() -: - GEOMAlgo_GluerAlgo(), - GEOMAlgo_Algo() + : GEOMAlgo_GluerAlgo(), + GEOMAlgo_Algo() {} //======================================================================= //function : ~ @@ -91,6 +92,11 @@ void GEOMAlgo_GlueDetector::Perform() return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_GluerAlgo::Perform(); +#endif + // DetectVertices(); if (myErrorStatus) { return; diff --git a/src/GEOMAlgo/GEOMAlgo_Gluer.cxx b/src/GEOMAlgo/GEOMAlgo_Gluer.cxx index a35a31d11..94919c591 100755 --- a/src/GEOMAlgo/GEOMAlgo_Gluer.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Gluer.cxx @@ -18,16 +18,26 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_Gluer.cxx // Created: Sat Dec 04 12:45:53 2004 // Author: Peter KURNEV -// -// + #include +#include +#include +#include +#include +#include + #include +#include +#include +#include + +#include + #include #include @@ -82,18 +92,6 @@ #include #include -#include -#include -#include -#include -#include -// -//modified by NIZNHY-PKV Thu Jan 21 10:02:52 2010f -#include -#include -#include -//modified by NIZNHY-PKV Thu Jan 21 10:02:56 2010t -// static void GetSubShapes(const TopoDS_Shape& aS, TopTools_IndexedMapOfShape& aMSS); @@ -181,11 +179,17 @@ const TopTools_DataMapOfShapeShape& GEOMAlgo_Gluer::Origins()const //======================================================================= void GEOMAlgo_Gluer::Perform() { + const Standard_Integer aNb=8; + Standard_Integer i; + // myErrorStatus=0; myWarningStatus=0; // - Standard_Integer i; - const Standard_Integer aNb=8; +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_ShapeAlgo::Perform(); +#endif + // void (GEOMAlgo_Gluer::* pF[aNb])()={ &GEOMAlgo_Gluer::CheckData, &GEOMAlgo_Gluer::InnerTolerance, &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); aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2); aC3D->D0(aT, aP); +#if OCC_VERSION_LARGE > 0x06050200 + myContext->ProjectPointOnEdge(aP, aER, aTR); +#else myContext.ProjectPointOnEdge(aP, aER, aTR); +#endif // BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF); if (aF.Orientation()==TopAbs_REVERSED) { diff --git a/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx b/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx index b6e0558e4..b48d49740 100644 --- a/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx @@ -18,12 +18,17 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File: GEOMAlgo_Gluer2.cxx // Author: Peter KURNEV #include +#include +#include + +#include + #include #include @@ -31,8 +36,9 @@ #include #include -#include #include + +#include #include #include @@ -43,9 +49,6 @@ #include #include -#include -#include - //======================================================================= //function : GEOMAlgo_Gluer2 //purpose : @@ -144,6 +147,11 @@ void GEOMAlgo_Gluer2::Perform() return; } // +#if OCC_VERSION_LARGE > 0x06050200 + // Initialize the context + GEOMAlgo_GluerAlgo::Perform(); +#endif + // PerformShapesToWork(); if (myErrorStatus) { return; @@ -620,6 +628,7 @@ void GEOMAlgo_Gluer2::BuildResult() // myShape=aCnew; } + //-------------------------------------------------------- // // ErrorStatus diff --git a/src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx b/src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx index fc2e471a7..79fcae64e 100644 --- a/src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx +++ b/src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx @@ -18,14 +18,17 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File: GEOMAlgo_GluerAlgo.cxx -// Created: // Author: Peter KURNEV -// -// + #include +#include + +#if OCC_VERSION_LARGE > 0x06050200 +#include +#endif //======================================================================= //function : GEOMAlgo_GluerAlgo @@ -36,6 +39,7 @@ GEOMAlgo_GluerAlgo::GEOMAlgo_GluerAlgo() myTolerance=0.0001; myCheckGeometry=Standard_True; } + //======================================================================= //function : ~GEOMAlgo_GluerAlgo //purpose : @@ -43,6 +47,7 @@ GEOMAlgo_GluerAlgo::GEOMAlgo_GluerAlgo() GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo() { } + //======================================================================= //function : SetArgument //purpose : @@ -51,6 +56,7 @@ void GEOMAlgo_GluerAlgo::SetArgument(const TopoDS_Shape& theShape) { myArgument=theShape; } + //======================================================================= //function : Argument //purpose : @@ -59,6 +65,7 @@ const TopoDS_Shape& GEOMAlgo_GluerAlgo::Argument()const { return myArgument; } + //======================================================================= //function : SetTolerance //purpose : @@ -67,6 +74,7 @@ void GEOMAlgo_GluerAlgo::SetTolerance(const Standard_Real aT) { myTolerance=aT; } + //======================================================================= //function : Tolerance //purpose : @@ -84,6 +92,7 @@ void GEOMAlgo_GluerAlgo::SetCheckGeometry(const Standard_Boolean aFlag) { myCheckGeometry=aFlag; } + //======================================================================= //function : CheckGeometry //purpose : @@ -92,14 +101,31 @@ Standard_Boolean GEOMAlgo_GluerAlgo::CheckGeometry() const { return myCheckGeometry; } + +#if OCC_VERSION_LARGE > 0x06050200 +//======================================================================= +//function : SetContext +//purpose : +//======================================================================= +void GEOMAlgo_GluerAlgo::SetContext(const Handle(IntTools_Context)& theContext) +{ + myContext=theContext; +} +#endif + //======================================================================= //function : Context //purpose : //======================================================================= +#if OCC_VERSION_LARGE > 0x06050200 +const Handle(IntTools_Context)& GEOMAlgo_GluerAlgo::Context() +#else IntTools_Context& GEOMAlgo_GluerAlgo::Context() +#endif { return myContext; } + //======================================================================= //function : Images //purpose : @@ -108,6 +134,7 @@ const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_GluerAlgo::Images()const { return myImages; } + //======================================================================= //function : Origins //purpose : @@ -116,6 +143,7 @@ const TopTools_DataMapOfShapeShape& GEOMAlgo_GluerAlgo::Origins()const { return myOrigins; } + //======================================================================= //function : Clear //purpose : @@ -125,10 +153,16 @@ void GEOMAlgo_GluerAlgo::Clear() myImages.Clear(); myOrigins.Clear(); } + //======================================================================= //function : Perform //purpose : //======================================================================= void GEOMAlgo_GluerAlgo::Perform() { +#if OCC_VERSION_LARGE > 0x06050200 + if (myContext.IsNull()) { + myContext=new IntTools_Context; + } +#endif } diff --git a/src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx b/src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx index 8fbb3af04..68e08628b 100644 --- a/src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx +++ b/src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx @@ -18,24 +18,26 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File: GEOMAlgo_GluerAlgo.hxx -// Created: // Author: Peter KURNEV -// -// + #ifndef _GEOMAlgo_GluerAlgo_HeaderFile #define _GEOMAlgo_GluerAlgo_HeaderFile #include -#include #include #include + +#include #include #include #include + #include +#include + //======================================================================= //class : GEOMAlgo_GluerAlgo //purpose : @@ -72,10 +74,14 @@ public: Standard_EXPORT virtual void Clear() ; - - Standard_EXPORT - IntTools_Context& Context() ; - + +#if OCC_VERSION_LARGE > 0x06050200 + Standard_EXPORT void SetContext(const Handle(IntTools_Context)&); + Standard_EXPORT const Handle(IntTools_Context)& Context(); +#else + Standard_EXPORT IntTools_Context& Context(); +#endif + Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& Images() const; @@ -86,7 +92,11 @@ protected: TopoDS_Shape myArgument; Standard_Real myTolerance; Standard_Boolean myCheckGeometry; +#if OCC_VERSION_LARGE > 0x06050200 + Handle(IntTools_Context) myContext; +#else IntTools_Context myContext; +#endif TopTools_DataMapOfShapeListOfShape myImages; TopTools_DataMapOfShapeShape myOrigins; diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cdl b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cdl index 701c6feeb..a11ea9301 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cdl +++ b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cdl @@ -39,7 +39,16 @@ is Initialize returns ShapeAlgo from GEOMAlgo; ---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; aS:Shape from TopoDS); @@ -56,7 +65,10 @@ is Result(me) returns Shape from TopoDS; ---C++:return const & - + + Perform(me:out) + is redefined; + fields myShape : Shape from TopoDS is protected; myTolerance : Real from Standard is protected; diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx index a6d09f286..e11f480fc 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx +++ b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx @@ -18,22 +18,21 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_ShapeAlgo.cxx // Created: Tue Dec 7 12:06:54 2004 // Author: Peter KURNEV -// -// + #include +#include + //======================================================================= //function : GEOMAlgo_ShapeAlgo //purpose : //======================================================================= GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo() -: - GEOMAlgo_Algo() + : GEOMAlgo_Algo() { myTolerance=0.0001; } @@ -45,6 +44,38 @@ 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 //purpose : diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx index e0d009ce2..e91a67239 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx +++ b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx @@ -18,108 +18,86 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile #define _GEOMAlgo_ShapeAlgo_HeaderFile -#ifndef _TopoDS_Shape_HeaderFile -#include -#endif -#ifndef _Standard_Real_HeaderFile -#include -#endif -#ifndef _IntTools_Context_HeaderFile -#include -#endif -#ifndef _GEOMAlgo_Algo_HeaderFile #include -#endif -class TopoDS_Shape; +#include -#ifndef _Standard_HeaderFile #include -#endif -#ifndef _Standard_Macro_HeaderFile #include -#endif - - -class GEOMAlgo_ShapeAlgo : public GEOMAlgo_Algo { - -public: - - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } - // Methods PUBLIC - // - - -Standard_EXPORT void SetShape(const TopoDS_Shape& aS) ; +#include -Standard_EXPORT void SetTolerance(const Standard_Real aT) ; +#include +#if OCC_VERSION_LARGE > 0x06050200 +#include +#else +#include +#endif -Standard_EXPORT const TopoDS_Shape& Shape() const; +class IntTools_Context; +class TopoDS_Shape; +class GEOMAlgo_ShapeAlgo : public GEOMAlgo_Algo { -Standard_EXPORT Standard_Real Tolerance() const; +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +#if OCC_VERSION_LARGE > 0x06050200 + //! Sets cashed geometrical tools
+ Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ; + //! Returns cashed geometrical tools
+ Standard_EXPORT const Handle_IntTools_Context& Context() const; + + Standard_EXPORT virtual void Perform() ; +#endif -Standard_EXPORT const TopoDS_Shape& Result() const; + Standard_EXPORT void SetShape(const TopoDS_Shape& aS) ; + 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; protected: - // Methods PROTECTED - // - - -Standard_EXPORT GEOMAlgo_ShapeAlgo(); -Standard_EXPORT virtual ~GEOMAlgo_ShapeAlgo(); - - // Fields PROTECTED - // -TopoDS_Shape myShape; -Standard_Real myTolerance; -TopoDS_Shape myResult; -IntTools_Context myContext; + Standard_EXPORT GEOMAlgo_ShapeAlgo(); + Standard_EXPORT virtual ~GEOMAlgo_ShapeAlgo(); -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // + TopoDS_Shape myShape; + Standard_Real myTolerance; + TopoDS_Shape myResult; +#if OCC_VERSION_LARGE > 0x06050200 + Handle_IntTools_Context myContext; +#else + IntTools_Context myContext; +#endif +private: }; - - - - // other Inline functions and methods (like "C++: function call" methods) -// - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.jxx b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.jxx index ba80ac185..017a2bcee 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.jxx +++ b/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.jxx @@ -20,6 +20,9 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#ifndef _IntTools_Context_HeaderFile +#include +#endif #ifndef _TopoDS_Shape_HeaderFile #include #endif diff --git a/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx b/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx index 535d0056f..cf6e49e5d 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx +++ b/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx @@ -18,15 +18,15 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_ShellSolid.cxx // Created: Wed Jan 12 12:49:45 2005 // Author: Peter KURNEV -// -// + #include +#include + #include #include @@ -265,9 +265,15 @@ void GEOMAlgo_ShellSolid::BuildResult() TopoDS::Solid(aDS.Tool()) : TopoDS::Solid(aDS.Object()); // 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(); // BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aRefSolid); +#endif aSC.Perform(aP3D, aTol); aSt=aSC.State(); if (aSt==TopAbs_IN) { diff --git a/src/GEOMAlgo/GEOMAlgo_Tools.cdl b/src/GEOMAlgo/GEOMAlgo_Tools.cdl index 5a6900667..4d08662e5 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools.cdl +++ b/src/GEOMAlgo/GEOMAlgo_Tools.cdl @@ -49,14 +49,14 @@ is RefineSDShapes(myclass; aMSD:out IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo; --qft aTol:Real from Standard; - aCtx:out Context from IntTools) + aCtx: Context from IntTools) returns Integer from Standard; FindSDShapes(myclass; aLE :ListOfShape from TopTools; aTol:Real from Standard; aMEE:out IndexedDataMapOfShapeListOfShape from TopTools; - aCtx:out Context from IntTools) + aCtx: Context from IntTools) returns Integer from Standard; FindSDShapes(myclass; @@ -64,14 +64,14 @@ is aLE :ListOfShape from TopTools; aTol :Real from Standard; aLESD :out ListOfShape from TopTools; - aCtx :out Context from IntTools) + aCtx : Context from IntTools) returns Integer from Standard; ProjectPointOnShape(myclass; aP1: Pnt from gp; aS :Shape from TopoDS; aP2:out Pnt from gp; - aCtx :out Context from IntTools) + aCtx : Context from IntTools) returns Boolean from Standard; PointOnShape(myclass; @@ -111,14 +111,12 @@ is aS :Shape from TopoDS) returns Boolean from Standard; - --modified by NIZNHY-PKV Mon Feb 06 06:59:14 2012f BuildPCurveForEdgeOnFace (myclass; aE : Edge from TopoDS; aEold: Edge from TopoDS; aF : Face from TopoDS; - aCtx :out Context from IntTools) + aCtx : Context from IntTools) returns Integer from Standard; - --modified by NIZNHY-PKV Mon Feb 06 06:59:22 2012t --fields diff --git a/src/GEOMAlgo/GEOMAlgo_Tools.cxx b/src/GEOMAlgo/GEOMAlgo_Tools.cxx index 414dfa09a..296b6928b 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools.cxx @@ -25,6 +25,11 @@ #include +#include +#include + +#include + #include #include #include @@ -60,9 +65,6 @@ #include #include -#include -#include - static void GetCount(const TopoDS_Shape& aS, Standard_Integer& iCnt); @@ -115,9 +117,13 @@ void GetCount(const TopoDS_Shape& aS, //function : RefineSDShapes //purpose : //======================================================================= - Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE, - const Standard_Real aTol, - IntTools_Context& aCtx) +Standard_Integer GEOMAlgo_Tools::RefineSDShapes (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE, + const Standard_Real aTol, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx) +#else + IntTools_Context& aCtx) +#endif { Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd; TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd; @@ -177,10 +183,14 @@ void GetCount(const TopoDS_Shape& aS, //function : FindSDShapes //purpose : //======================================================================= -Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopTools_ListOfShape& aLE, - const Standard_Real aTol, - TopTools_IndexedDataMapOfShapeListOfShape& aMEE, - IntTools_Context& aCtx) +Standard_Integer GEOMAlgo_Tools::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_Integer aNbE, aNbEProcessed, aNbESD, iErr; TopTools_ListOfShape aLESD; @@ -253,7 +263,11 @@ Standard_Integer GEOMAlgo_Tools::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_Boolean bIsDone; 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, const TopoDS_Shape& aS, gp_Pnt& aP2, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx) +#else IntTools_Context& aCtx) +#endif { Standard_Boolean bIsDone = Standard_False; Standard_Real aT2; @@ -313,7 +331,11 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1, if (aC3D.IsNull()) { return Standard_True; } +#if OCC_VERSION_LARGE > 0x06050200 + bIsDone = aCtx->ProjectPointOnEdge(aP1, aE2, aT2); +#else bIsDone = aCtx.ProjectPointOnEdge(aP1, aE2, aT2); +#endif } if (!bIsDone) { return bIsDone; @@ -326,7 +348,11 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1, case TopAbs_FACE: { 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); +#endif // aProj.Perform(aP1); bIsDone = aProj.IsDone(); @@ -488,7 +514,11 @@ Standard_Integer GEOMAlgo_Tools::BuildPCurveForEdgeOnFace(const TopoDS_Edge& aEold, const TopoDS_Edge& aEnew, const TopoDS_Face& aF, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx) +#else IntTools_Context& aCtx) +#endif { Standard_Boolean bIsClosed, bUClosed, bHasOld; Standard_Integer iRet, aNbPoints; @@ -553,7 +583,11 @@ Standard_Integer aS=BRep_Tool::Surface(aF); aS->D0(aUS1, aVS1, aP); // +#if OCC_VERSION_LARGE > 0x06050200 + GeomAPI_ProjectPointOnCurve& aProjPC=aCtx->ProjPC(aEnew); +#else GeomAPI_ProjectPointOnCurve& aProjPC=aCtx.ProjPC(aEnew); +#endif // aProjPC.Perform(aP); aNbPoints=aProjPC.NbPoints(); diff --git a/src/GEOMAlgo/GEOMAlgo_Tools.hxx b/src/GEOMAlgo/GEOMAlgo_Tools.hxx index aa122e022..30ff7cc51 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools.hxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools.hxx @@ -22,6 +22,15 @@ #ifndef _GEOMAlgo_Tools_HeaderFile #define _GEOMAlgo_Tools_HeaderFile +#include + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + #ifndef _Standard_Boolean_HeaderFile #include #endif @@ -31,6 +40,13 @@ #ifndef _Standard_Real_HeaderFile #include #endif + +#if OCC_VERSION_LARGE > 0x06050200 +#ifndef _Handle_IntTools_Context_HeaderFile +#include +#endif +#endif + #ifndef _Handle_Geom_Surface_HeaderFile #include #endif @@ -45,91 +61,93 @@ class TopoDS_Edge; class TopoDS_Face; class Geom_Surface; -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - -class GEOMAlgo_Tools { +class GEOMAlgo_Tools { public: - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } - - // Methods PUBLIC - // - - Standard_EXPORT static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS) ; - - 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,IntTools_Context& aCtx) ; - - Standard_EXPORT static Standard_Integer FindSDShapes(const TopoDS_Shape& aE1,const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_ListOfShape& aLESD,IntTools_Context& aCtx) ; + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + 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_Boolean ProjectPointOnShape(const gp_Pnt& aP1,const TopoDS_Shape& aS,gp_Pnt& aP2,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 void PointOnShape(const TopoDS_Shape& aS,gp_Pnt& aP3D) ; + 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 void PointOnEdge(const TopoDS_Edge& aE,gp_Pnt& aP3D) ; + 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 void PointOnEdge(const TopoDS_Edge& aE,const Standard_Real aT,gp_Pnt& aP3D) ; + Standard_EXPORT static void PointOnShape(const TopoDS_Shape& aS,gp_Pnt& aP3D); - Standard_EXPORT static void PointOnFace(const TopoDS_Face& aF,gp_Pnt& aP3D) ; + Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aE,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 PointOnEdge(const TopoDS_Edge& aE,const Standard_Real aT,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 PointOnFace(const TopoDS_Face& aF,gp_Pnt& aP3D); - Standard_EXPORT static Standard_Boolean IsUPeriodic(const Handle(Geom_Surface)& aS) ; + Standard_EXPORT static void PointOnFace(const TopoDS_Face& aF,const Standard_Real aU,const Standard_Real aV,gp_Pnt& aP3D); - Standard_EXPORT static Standard_Boolean CorrectWires(const TopoDS_Shape& aS) ; + 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_Integer BuildPCurveForEdgeOnFace(const TopoDS_Edge& aE,const TopoDS_Edge& aEold,const TopoDS_Face& aF,IntTools_Context& aCtx) ; + 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, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx); +#else + IntTools_Context& aCtx); +#endif protected: - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - +private: }; - - - - // other Inline functions and methods (like "C++: function call" methods) - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_Tools3D.cdl b/src/GEOMAlgo/GEOMAlgo_Tools3D.cdl index a3f0033f7..a9d06da58 100755 --- a/src/GEOMAlgo/GEOMAlgo_Tools3D.cdl +++ b/src/GEOMAlgo/GEOMAlgo_Tools3D.cdl @@ -44,14 +44,14 @@ uses IndexedDataMapOfShapeListOfShape from TopTools, Context from IntTools, ListOfCoupleOfShape from NMTTools - + --raises is IsSplitToReverse(myclass; theSplit : 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 -- direction than theShape -- theContext - cashed geometrical tools @@ -60,7 +60,7 @@ is IsSplitToReverse(myclass; theSplit : 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 -- theShape is not the same as for the face -- theSplit @@ -70,7 +70,7 @@ is IsSplitToReverse(myclass; theEdge : 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 -- theEdge is not the same as for the edge -- theSplit @@ -112,7 +112,7 @@ is theShape :Shape from TopoDS; theSolid :Solid from TopoDS; theTol :Real from Standard; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Computes the 3-D state of the shape theShape -- toward solid theSolid. -- theTol - value of precision of computation @@ -124,7 +124,7 @@ is thePoint :Pnt from gp; theSolid :Solid from TopoDS; theTol :Real from Standard; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Computes the 3-D state of the point thePoint -- toward solid theSolid. -- theTol - value of precision of computation @@ -136,7 +136,7 @@ is theVertex:Vertex from TopoDS; theSolid :Solid from TopoDS; theTol :Real from Standard; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Computes the 3-D state of the vertex theVertex -- toward solid theSolid. -- theTol - value of precision of computation @@ -148,7 +148,7 @@ is theEdge :Edge from TopoDS; theSolid :Solid from TopoDS; theTol :Real from Standard; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Computes the 3-D state of the edge theEdge -- toward solid theSolid. -- theTol - value of precision of computation @@ -161,7 +161,7 @@ is theSolid :Solid from TopoDS; theTol :Real from Standard; theBounds:IndexedMapOfShape from TopTools; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Computes the 3-D state of the face theFace -- toward solid theSolid. -- theTol - value of precision of computation @@ -175,7 +175,7 @@ is theEdge :Edge from TopoDS; theFace1 :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 -- couple of faces theFace1, theFace2. -- The faces theFace, theFace1, theFace2 must @@ -186,7 +186,7 @@ is theFace :Face from TopoDS; theEdge :Edge from TopoDS; theLF :ListOfShape from TopTools; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Returns True if the face theFace is inside of the -- appropriate couple of faces (from the set theLF) . -- The faces of the set theLF and theFace must @@ -198,7 +198,7 @@ is theSolid :Solid from TopoDS; theMEF :IndexedDataMapOfShapeListOfShape from TopTools; theTol :Real from Standard; - theContext:out Context from IntTools) + theContext: Context from IntTools) ---Purpose: Returns True if the face theFace is inside the -- solid theSolid. -- theMEF - Map Edge/Faces for theSolid diff --git a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx index f75e6df11..4f400ac42 100755 --- a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx @@ -18,13 +18,18 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File : GEOMAlgo_Tools3D.cxx -// Created : // Author : Peter KURNEV #include +#include +#include +#include + +#include + #include #include @@ -44,6 +49,7 @@ #include #include + #include #include @@ -69,7 +75,7 @@ #include #include -// + #include #include #include @@ -87,19 +93,15 @@ #include #include -#include -#include -#include #include #include #include #include #include -// + #include -// static Standard_Boolean FindFacePairs (const TopoDS_Edge& , const TopTools_ListOfShape& , @@ -117,7 +119,11 @@ static Standard_Real aT, gp_Pnt& aPF, gp_Dir& aDNF, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx); +#else IntTools_Context& aCtx); +#endif //======================================================================= //function : IsInternalFace @@ -127,7 +133,11 @@ Standard_Boolean GEOMAlgo_Tools3D::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 { Standard_Boolean bRet; 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, const TopoDS_Edge& theEdge, const TopTools_ListOfShape& theLF, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theContext) +#else IntTools_Context& theContext) +#endif { Standard_Boolean bRet; Standard_Boolean aNbF; @@ -236,7 +250,11 @@ Standard_Boolean GEOMAlgo_Tools3D::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 { Standard_Boolean bRet; 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 Standard_Real theTol, const TopTools_IndexedMapOfShape& theBounds, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theCtx) +#else IntTools_Context& theCtx) +#endif { TopAbs_State aState; 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, const TopoDS_Solid& theRef, const Standard_Real theTol, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theCtx) +#else IntTools_Context& theCtx) +#endif { TopAbs_State aState; 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, const TopoDS_Solid& theRef, const Standard_Real theTol, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theCtx) +#else IntTools_Context& theCtx) +#endif { TopAbs_State aState; 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, const TopoDS_Solid& theRef, const Standard_Real theTol, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theCtx) +#else IntTools_Context& theCtx) +#endif { Standard_Real aT1, aT2, aT = 0.; 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, const TopoDS_Solid& theRef, const Standard_Real theTol, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theCtx) +#else IntTools_Context& theCtx) +#endif { TopAbs_State aState; // +#if OCC_VERSION_LARGE > 0x06050200 + BRepClass3d_SolidClassifier& aSC=theCtx->SolidClassifier(theRef); +#else BRepClass3d_SolidClassifier& aSC=theCtx.SolidClassifier(theRef); +#endif aSC.Perform(theP, theTol); // aState=aSC.State(); @@ -572,9 +614,13 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1, // function: IsSplitToReverse // purpose: //======================================================================= - Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Shape& theSp, +Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse (const TopoDS_Shape& theSp, const TopoDS_Shape& theSr, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theCtx) +#else IntTools_Context& theCtx) +#endif { Standard_Boolean bRet; TopAbs_ShapeEnum aType; @@ -606,9 +652,13 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1, //function :IsSplitToReverse //purpose : //======================================================================= - Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Face& theFSp, +Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse (const TopoDS_Face& theFSp, const TopoDS_Face& theFSr, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theContext) +#else IntTools_Context& theContext) +#endif { Standard_Boolean bRet, bFound, bInFace; 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 // // Parts of theContext.ComputeVS(..) +#if OCC_VERSION_LARGE > 0x06050200 + GeomAPI_ProjectPointOnSurf& aProjector=theContext->ProjPS(theFSr); +#else GeomAPI_ProjectPointOnSurf& aProjector=theContext.ProjPS(theFSr); +#endif aProjector.Perform(aPFSp); if (!aProjector.IsDone()) { return bRet; @@ -685,7 +739,11 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1, // aProjector.LowerDistanceParameters(aU, aV); gp_Pnt2d aP2D(aU, aV); +#if OCC_VERSION_LARGE > 0x06050200 + bInFace=theContext->IsPointInFace (theFSr, aP2D); +#else bInFace=theContext.IsPointInFace (theFSr, aP2D); +#endif if (!bInFace) { return bRet; } @@ -707,9 +765,13 @@ Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1, //function :IsSplitToReverse //purpose : //======================================================================= - Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Edge& theSplit, +Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse (const TopoDS_Edge& theSplit, const TopoDS_Edge& theEdge, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& theContext) +#else IntTools_Context& theContext) +#endif { Standard_Boolean bRet, aFlag, bIsDegenerated; 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); gp_Dir aDTS(aVS); // +#if OCC_VERSION_LARGE > 0x06050200 + aFlag=theContext->ProjectPointOnEdge(aP, theEdge, aTE); +#else aFlag=theContext.ProjectPointOnEdge(aP, theEdge, aTE); +#endif aFlag=BOPTools_Tools2D::EdgeTangent(theEdge, aTE, aVE); gp_Dir aDTE(aVE); // @@ -1086,7 +1152,11 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, Standard_Real aT, gp_Pnt& aPF, gp_Dir& aDNF, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx) +#else IntTools_Context& aCtx) +#endif { Standard_Boolean bReverse; Standard_Real aT1, aT2, dT, aU, aV; @@ -1166,7 +1236,11 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aDNF.Reverse(); } // +#if OCC_VERSION_LARGE > 0x06050200 + GeomAPI_ProjectPointOnSurf& aProjector=aCtx->ProjPS(aF); +#else GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF); +#endif // aProjector.Perform(aPFx); if(aProjector.IsDone()) { diff --git a/src/GEOMAlgo/GEOMAlgo_Tools3D.hxx b/src/GEOMAlgo/GEOMAlgo_Tools3D.hxx index 43df2edc4..c89435b92 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools3D.hxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools3D.hxx @@ -18,14 +18,27 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_Tools3D_HeaderFile #define _GEOMAlgo_Tools3D_HeaderFile +#include + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + #ifndef _Standard_Boolean_HeaderFile #include #endif +#if OCC_VERSION_LARGE > 0x06050200 +#ifndef _Handle_IntTools_Context_HeaderFile +#include +#endif +#endif #ifndef _Standard_Integer_HeaderFile #include #endif @@ -38,6 +51,7 @@ #ifndef _Standard_Real_HeaderFile #include #endif + class TopoDS_Shape; class IntTools_Context; class TopoDS_Face; @@ -52,180 +66,234 @@ class TopTools_IndexedDataMapOfShapeListOfShape; class NMTTools_ListOfCoupleOfShape; -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - //! Auxiliary tools for Algorithms
class GEOMAlgo_Tools3D { public: - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } - // Methods PUBLIC - // - -//! Returns True if the shape theSplit has opposite
-//! direction than theShape
-//! theContext - cashed geometrical tools
-Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,const TopoDS_Shape& theShape,IntTools_Context& theContext) ; - -//! Returns True if normal direction of the face
-//! theShape is not the same as for the face
-//! theSplit
-//! theContext - cashed geometrical tools
-Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,const TopoDS_Face& theShape,IntTools_Context& theContext) ; - -//! Returns True if tangent direction of the edge
-//! theEdge is not the same as for the edge
-//! theSplit
-//! theContext - cashed geometrical tools
-Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theEdge,const TopoDS_Edge& theSplit,IntTools_Context& theContext) ; - -//! For the couple of faces theF1, theF2
-//! computes sense value
-//! Returns 0 if the faces are not sensible
-//! Returns 1 if the faces have same sense
-//! Returns 2 if the faces have opposite sense
-Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,const TopoDS_Face& theF2) ; - -//! Makes new face theF2 from surface and wires
-//! of the face theF1
-Standard_EXPORT static void CopyFace(const TopoDS_Face& theF1,TopoDS_Face& theF2) ; - -//! Makes empty shape theShape of the type theType
-Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,TopoDS_Shape& theShape) ; - -//! For the list of faces theLS build block
-//! theLSCB in terms of connexity by edges
-//! theMapAvoid - set of edges to avoid for
-//! the treatment
-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
-//! toward solid theSolid.
-//! theTol - value of precision of computation
-//! theContext- cahed geometrical tools
-//! Returns 3-D state.
-Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; - -//! Computes the 3-D state of the point thePoint
-//! toward solid theSolid.
-//! theTol - value of precision of computation
-//! theContext- cahed geometrical tools
-//! Returns 3-D state.
-Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; - -//! Computes the 3-D state of the vertex theVertex
-//! toward solid theSolid.
-//! theTol - value of precision of computation
-//! theContext- cahed geometrical tools
-//! Returns 3-D state.
-Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; - -//! Computes the 3-D state of the edge theEdge
-//! toward solid theSolid.
-//! theTol - value of precision of computation
-//! theContext- cahed geometrical tools
-//! Returns 3-D state.
-Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; - -//! Computes the 3-D state of the face theFace
-//! toward solid theSolid.
-//! theTol - value of precision of computation
-//! theBounds - set of edges of theFace to avoid
-//! theContext- cahed geometrical tools
-//! Returns 3-D state.
-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) ; - -//! Returns True if the face theFace is inside of the
-//! couple of faces theFace1, theFace2.
-//! The faces theFace, theFace1, theFace2 must
-//! share the edge theEdge
-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) ; - -//! Returns True if the face theFace is inside of the
-//! appropriate couple of faces (from the set theLF) .
-//! The faces of the set theLF and theFace must
-//! share the edge theEdge
-Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopTools_ListOfShape& theLF,IntTools_Context& theContext) ; - -//! Returns True if the face theFace is inside the
-//! solid theSolid.
-//! theMEF - Map Edge/Faces for theSolid
-//! theTol - value of precision of computation
-//! theContext- cahed geometrical tools
-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) ; - -//! For the face theFace and its edge theEdge
-//! finds the face suitable to produce shell.
-//! theLCEF - set of faces to search. All faces
-//! from theLCEF must share edge theEdge
-Standard_EXPORT static void GetFaceOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,const NMTTools_ListOfCoupleOfShape& theLCEF,TopoDS_Face& theFaceOff) ; - -//! For the face theFace gets the edge theEdgeOnF
-//! that is the same as theEdge
-//! Returns True if such edge exists
-//! Returns False if there is no such edge
-Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOnF) ; - -//! Returns True if the face theFace contains
-//! the edge theEdge but with opposite orientation.
-//! If the method returns True theEdgeOff is the
-//! edge founded
-Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOff) ; - -//! Computes a point inside the face .
-//! - 2D representation of
-//! on the surface of
-//! Returns 0 in case of success.
-Standard_EXPORT static Standard_Integer PntInFace(const TopoDS_Face& theF,gp_Pnt& theP,gp_Pnt2d& theP2D) ; + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + //! Returns True if the shape theSplit has opposite
+ //! direction than theShape
+ //! theContext - cashed geometrical tools
+ 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
+ //! theShape is not the same as for the face
+ //! theSplit
+ //! theContext - cashed geometrical tools
+ 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
+ //! theEdge is not the same as for the edge
+ //! theSplit
+ //! theContext - cashed geometrical tools
+ 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
+ //! computes sense value
+ //! Returns 0 if the faces are not sensible
+ //! Returns 1 if the faces have same sense
+ //! Returns 2 if the faces have opposite sense
+ Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1, const TopoDS_Face& theF2); + + //! Makes new face theF2 from surface and wires
+ //! of the face theF1
+ Standard_EXPORT static void CopyFace (const TopoDS_Face& theF1, TopoDS_Face& theF2); + + //! Makes empty shape theShape of the type theType
+ Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape); + + //! For the list of faces theLS build block
+ //! theLSCB in terms of connexity by edges
+ //! theMapAvoid - set of edges to avoid for
+ //! the treatment
+ 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
+ //! toward solid theSolid.
+ //! theTol - value of precision of computation
+ //! theContext- cahed geometrical tools
+ //! Returns 3-D state.
+ 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 -protected: + //! Computes the 3-D state of the point thePoint
+ //! toward solid theSolid.
+ //! theTol - value of precision of computation
+ //! theContext- cahed geometrical tools
+ //! Returns 3-D state.
+ 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 - // Methods PROTECTED - // + //! Computes the 3-D state of the vertex theVertex
+ //! toward solid theSolid.
+ //! theTol - value of precision of computation
+ //! theContext- cahed geometrical tools
+ //! Returns 3-D state.
+ 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
+ //! toward solid theSolid.
+ //! theTol - value of precision of computation
+ //! theContext- cahed geometrical tools
+ //! Returns 3-D state.
+ 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 - // Fields PROTECTED - // + //! Computes the 3-D state of the face theFace
+ //! toward solid theSolid.
+ //! theTol - value of precision of computation
+ //! theBounds - set of edges of theFace to avoid
+ //! theContext- cahed geometrical tools
+ //! Returns 3-D state.
+ 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
+ //! couple of faces theFace1, theFace2.
+ //! The faces theFace, theFace1, theFace2 must
+ //! share the edge theEdge
+ 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 -private: + //! Returns True if the face theFace is inside of the
+ //! appropriate couple of faces (from the set theLF) .
+ //! The faces of the set theLF and theFace must
+ //! share the edge theEdge
+ 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 - // Methods PRIVATE - // + //! Returns True if the face theFace is inside the
+ //! solid theSolid.
+ //! theMEF - Map Edge/Faces for theSolid
+ //! theTol - value of precision of computation
+ //! theContext- cahed geometrical tools
+ 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
+ //! finds the face suitable to produce shell.
+ //! theLCEF - set of faces to search. All faces
+ //! from theLCEF must share edge theEdge
+ Standard_EXPORT static void GetFaceOff (const TopoDS_Edge& theEdge, + const TopoDS_Face& theFace, + const NMTTools_ListOfCoupleOfShape& theLCEF, + TopoDS_Face& theFaceOff); + + //! For the face theFace gets the edge theEdgeOnF
+ //! that is the same as theEdge
+ //! Returns True if such edge exists
+ //! Returns False if there is no such edge
+ Standard_EXPORT static Standard_Boolean GetEdgeOnFace (const TopoDS_Edge& theEdge, + const TopoDS_Face& theFace, + TopoDS_Edge& theEdgeOnF); + + //! Returns True if the face theFace contains
+ //! the edge theEdge but with opposite orientation.
+ //! If the method returns True theEdgeOff is the
+ //! edge founded
+ Standard_EXPORT static Standard_Boolean GetEdgeOff (const TopoDS_Edge& theEdge, + const TopoDS_Face& theFace, + TopoDS_Edge& theEdgeOff); + + //! Computes a point inside the face .
+ //! - 2D representation of
+ //! on the surface of
+ //! Returns 0 in case of success.
+ Standard_EXPORT static Standard_Integer PntInFace (const TopoDS_Face& theF, + gp_Pnt& theP, + gp_Pnt2d& theP2D); - // Fields PRIVATE - // +protected: +private: }; - - - - // other Inline functions and methods (like "C++: function call" methods) -// - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx b/src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx index c22ffb11c..5c5ed522f 100644 --- a/src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx +++ b/src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx @@ -18,15 +18,15 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_VertexSolid.cxx // Created: Wed Jan 12 16:36:40 2005 // Author: Peter KURNEV -// -// + #include +#include + #include #include @@ -136,14 +136,22 @@ void GEOMAlgo_VertexSolid::Prepare() BOPTools_CArray1OfVVInterference& aVVs=pIP->VVInterferences(); const BOPTools_PaveFiller& aPF=myDSFiller->PaveFiller(); BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)&aPF; +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx=pPF->Context(); +#else IntTools_Context& aCtx=pPF->ChangeContext(); +#endif // const TopoDS_Shape& aObj=aDS.Object(); const TopoDS_Shape& aTool=aDS.Tool(); // 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); +#endif // iBeg=1; iEnd=aDS.NumberOfShapesOfTheObject(); diff --git a/src/GEOMAlgo/GEOMAlgo_WireSplitter.cxx b/src/GEOMAlgo/GEOMAlgo_WireSplitter.cxx index 66cd6a655..f365d0769 100755 --- a/src/GEOMAlgo/GEOMAlgo_WireSplitter.cxx +++ b/src/GEOMAlgo/GEOMAlgo_WireSplitter.cxx @@ -43,7 +43,6 @@ #include #include - #include #include #include @@ -51,8 +50,6 @@ #include #include - - #include #include #include @@ -113,15 +110,15 @@ static const TopoDS_Face& aF); static Standard_Real Tolerance2D (const TopoDS_Vertex& aV, - const GeomAdaptor_Surface& aGAS); + const GeomAdaptor_Surface& aGAS); static Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& ); // //======================================================================= -// function: -// purpose: +// function: +// purpose: //======================================================================= GEOMAlgo_WireSplitter::GEOMAlgo_WireSplitter() : @@ -131,14 +128,14 @@ static } //======================================================================= // function: ~ -// purpose: +// purpose: //======================================================================= GEOMAlgo_WireSplitter::~GEOMAlgo_WireSplitter() { } //======================================================================= // function: SetFace -// purpose: +// purpose: //======================================================================= void GEOMAlgo_WireSplitter::SetFace(const TopoDS_Face& aFace) { @@ -146,7 +143,7 @@ static } //======================================================================= // function: Face -// purpose: +// purpose: //======================================================================= const TopoDS_Face& GEOMAlgo_WireSplitter::Face()const { @@ -154,7 +151,7 @@ static } //======================================================================= // function: SetEdges -// purpose: +// purpose: //======================================================================= void GEOMAlgo_WireSplitter::SetEdges(const TopTools_ListOfShape& aLE) { @@ -174,7 +171,7 @@ static } //======================================================================= // function: Edges -// purpose: +// purpose: //======================================================================= const TopTools_ListOfShape& GEOMAlgo_WireSplitter::Edges()const { @@ -182,7 +179,7 @@ static } //======================================================================= // function: IsNothingToDo -// purpose: +// purpose: //======================================================================= Standard_Boolean GEOMAlgo_WireSplitter::IsNothingToDo()const { @@ -190,7 +187,7 @@ static } //======================================================================= // function: Shapes -// purpose: +// purpose: //======================================================================= const BOPTColStd_ListOfListOfShape& GEOMAlgo_WireSplitter::Shapes()const { @@ -198,7 +195,7 @@ static } //======================================================================= // function: Perform -// purpose: +// purpose: //======================================================================= void GEOMAlgo_WireSplitter::Perform() { @@ -208,7 +205,7 @@ static Standard_Integer index, i, aNb, aCntIn, aCntOut; Standard_Boolean anIsIn; Standard_Real anAngle; - + BOP_ListOfEdgeInfo emptyInfo; TopTools_ListIteratorOfListOfShape anItList; // @@ -231,12 +228,12 @@ static if (!index) { index=mySmartMap.Add(aVertex, emptyInfo); } - + BOP_ListOfEdgeInfo& aListOfEInfo=mySmartMap(index); BOP_EdgeInfo aEInfo; aEInfo.SetEdge(anEdge); - + TopAbs_Orientation anOr=aVertex.Orientation(); if (anOr==TopAbs_FORWARD) { @@ -253,9 +250,9 @@ static // aNb=mySmartMap.Extent(); // - // 2. myNothingToDo + // 2. myNothingToDo myNothingToDo=Standard_True; - + for (i=1; i<=aNb; i++) { aCntIn=0; aCntOut=0; @@ -280,16 +277,16 @@ static // Each vertex has one edge In and one - Out. Good. But it is not enought // to consider that nothing to do with this. We must check edges on TShape // coinsidence. If there are such edges there is something to do with. - // + // if (myNothingToDo) { Standard_Integer aNbE, aNbMapEE; TopTools_IndexedDataMapOfShapeListOfShape aMapEE; aNbE=myEdges.Extent(); - + anItList.Initialize(myEdges); for (; anItList.More(); anItList.Next()) { const TopoDS_Shape& aE = anItList.Value(); - + if (!aMapEE.Contains(aE)) { TopTools_ListOfShape aLEx; aLEx.Append(aE); @@ -300,7 +297,7 @@ static aLEx.Append(aE); } } - + Standard_Boolean bFlag; bFlag=Standard_True; aNbMapEE=aMapEE.Extent(); @@ -326,7 +323,7 @@ static } myNothingToDo=myNothingToDo && bFlag; } - // + // // if (myNothingToDo) { myErrorStatus=0; @@ -353,45 +350,45 @@ static aVV.Orientation(TopAbs_REVERSED); anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_True); } - // + // else { // OUT // aVV.Orientation(TopAbs_FORWARD); anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_False); } anEdgeInfo.SetAngle(anAngle); - + } } // // 4. Do // Standard_Boolean anIsOut, anIsNotPassed; - + TopTools_SequenceOfShape aLS, aVertVa; TColgp_SequenceOfPnt2d aCoordVa; - + BOP_ListIteratorOfListOfEdgeInfo anIt; for (i=1; i<=aNb; i++) { const TopoDS_Vertex aVa=TopoDS::Vertex (mySmartMap.FindKey(i)); const BOP_ListOfEdgeInfo& aLEInfo=mySmartMap(i); - + anIt.Initialize(aLEInfo); for (; anIt.More(); anIt.Next()) { BOP_EdgeInfo& anEdgeInfo=anIt.Value(); const TopoDS_Edge& aEOuta=anEdgeInfo.Edge(); - + anIsOut=!anEdgeInfo.IsIn(); anIsNotPassed=!anEdgeInfo.Passed(); - + if (anIsOut && anIsNotPassed) { // aLS.Clear(); aVertVa.Clear(); aCoordVa.Clear(); // - Path(aGAS, myFace, aVa, aEOuta, anEdgeInfo, aLS, + Path(aGAS, myFace, aVa, aEOuta, anEdgeInfo, aLS, aVertVa, aCoordVa, myShapes, mySmartMap); } } @@ -402,7 +399,7 @@ static TopoDS_Vertex aV1, aV2; BOPTColStd_ListOfListOfShape aShapes; BOPTColStd_ListIteratorOfListOfListOfShape anItW(myShapes); - + for (; anItW.More(); anItW.Next()) { TopTools_IndexedMapOfShape aMV, aME; const TopTools_ListOfShape& aLE=anItW.Value(); @@ -433,7 +430,7 @@ static } //======================================================================= // function: Path -// purpose: +// purpose: //======================================================================= void Path (const GeomAdaptor_Surface& aGAS, const TopoDS_Face& myFace, @@ -445,12 +442,11 @@ static TColgp_SequenceOfPnt2d& aCoordVa, BOPTColStd_ListOfListOfShape& myShapes, BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap) - { Standard_Integer i,j, aNb, aNbj; Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle; Standard_Real aTol2D, aTol2D2; - Standard_Real aTol2, aD2;//, aTolUVb, aTolVVb; + Standard_Real aTol2, aD2;//, aTolUVb, aTolVVb; Standard_Boolean anIsSameV2d, anIsSameV, anIsFound, anIsOut, anIsNotPassed; BOP_ListIteratorOfListOfEdgeInfo anIt; TopoDS_Vertex aVb; @@ -460,7 +456,7 @@ static // // append block // - // Do not escape through edge from which you enter + // Do not escape through edge from which you enter aNb=aLS.Length(); if (aNb==1) { const TopoDS_Shape& anEPrev=aLS(aNb); @@ -473,12 +469,12 @@ static anEdgeInfo.SetPassed(Standard_True); aLS.Append(aEOuta); aVertVa.Append(aVa); - + TopoDS_Vertex pVa=aVa; pVa.Orientation(TopAbs_FORWARD); gp_Pnt2d aPa=Coord2d(pVa, aEOuta, myFace); aCoordVa.Append(aPa); - + GetNextVertex (pVa, aEOuta, aVb); gp_Pnt2d aPb=Coord2d(aVb, aEOuta, myFace); @@ -569,11 +565,11 @@ static const TopoDS_Edge& aE=anEI.Edge(); anIsOut=!anEI.IsIn(); anIsNotPassed=!anEI.Passed(); - + if (anIsOut && anIsNotPassed) { aCurIndexE++; // - // Is there one way to go out of the vertex + // Is there one way to go out of the vertex // we have to use it only. Standard_Integer iCnt; iCnt=NbWaysOut (aLEInfo); @@ -610,16 +606,16 @@ static anIsFound=Standard_True; } } - } // for (; anIt.More(); anIt.Next()) + } // for (; anIt.More(); anIt.Next()) // if (!anIsFound) { // no way to go . (Error) return; } - + aEOutb=pEdgeInfo->Edge(); // - Path (aGAS, myFace, aVb, aEOutb, *pEdgeInfo, aLS, + Path (aGAS, myFace, aVb, aEOutb, *pEdgeInfo, aLS, aVertVa, aCoordVa, myShapes, mySmartMap); } //======================================================================= @@ -649,7 +645,7 @@ static // purpose: //======================================================================= Standard_Real Tolerance2D (const TopoDS_Vertex& aV, - const GeomAdaptor_Surface& aGAS) + const GeomAdaptor_Surface& aGAS) { Standard_Real aTol2D, anUr, aVr, aTolV3D; GeomAbs_SurfaceType aType; @@ -733,19 +729,19 @@ static if (AIn >= aTwoPi) { AIn=AIn-aTwoPi; } - + if (AOut >= aTwoPi) { AOut=AOut-aTwoPi; } A1 = AIn + M_PI; - + if (A1 >= aTwoPi) { A1=A1-aTwoPi; } - + A2=AOut; - + dA=A1-A2; if (dA <= 0.) { dA=aTwoPi+dA; @@ -763,7 +759,7 @@ static } //======================================================================= // function: GetNextVertex -// purpose: +// purpose: //======================================================================= void GetNextVertex(const TopoDS_Vertex& aV, const TopoDS_Edge& aE, @@ -783,7 +779,7 @@ static } //======================================================================= // function: Angle2D -// purpose: +// purpose: //======================================================================= Standard_Real Angle2D (const TopoDS_Vertex& aV, const TopoDS_Edge& anEdge, @@ -801,7 +797,7 @@ static return 0.; } // - BOPTools_Tools2D::CurveOnSurface (anEdge, myFace, aC2D, + BOPTools_Tools2D::CurveOnSurface (anEdge, myFace, aC2D, aFirst, aLast, aToler, Standard_True); //dt=1.e-7; dt=2.*Tolerance2D(aV, aGAS); @@ -810,7 +806,7 @@ static if(dt > aTX) { // to save direction of the curve as much as it possible // in the case of big tolerances - dt = aTX; + dt = aTX; } // if (fabs (aTV-aFirst) < fabs(aTV - aLast)) { @@ -839,7 +835,7 @@ static } //======================================================================= // function: Angle -// purpose: +// purpose: //======================================================================= Standard_Real Angle (const gp_Dir2d& aDir2D) { @@ -851,10 +847,10 @@ Standard_Real Angle (const gp_Dir2d& aDir2D) return anAngle; } -// + //======================================================================= // function: NbWaysOut -// purpose: +// purpose: //======================================================================= Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& aLEInfo) { diff --git a/src/NMTTools/NMTTools_CheckerSI.cxx b/src/NMTTools/NMTTools_CheckerSI.cxx index ac39cc6dc..84278c382 100644 --- a/src/NMTTools/NMTTools_CheckerSI.cxx +++ b/src/NMTTools/NMTTools_CheckerSI.cxx @@ -15,26 +15,29 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTTools_CheckerSI.cxx // Created: Mon Feb 19 11:32:08 2007 // Author: Peter KURNEV -// + #include +#include + #include #include #include -#include + +#include + +#include //======================================================================= //function : //purpose : //======================================================================= - NMTTools_CheckerSI::NMTTools_CheckerSI() -: - NMTTools_PaveFiller() +NMTTools_CheckerSI::NMTTools_CheckerSI() + : NMTTools_PaveFiller() { myStopStatus=0; } @@ -42,14 +45,14 @@ //function : ~ //purpose : //======================================================================= - NMTTools_CheckerSI::~NMTTools_CheckerSI() +NMTTools_CheckerSI::~NMTTools_CheckerSI() { } //======================================================================= //function : Clear //purpose : //======================================================================= - void NMTTools_CheckerSI::Clear() +void NMTTools_CheckerSI::Clear() { NMTTools_PaveFiller::Clear(); } @@ -57,7 +60,7 @@ //function : StopStatus //purpose : //======================================================================= - Standard_Integer NMTTools_CheckerSI::StopStatus()const +Standard_Integer NMTTools_CheckerSI::StopStatus()const { return myStopStatus; } @@ -65,7 +68,7 @@ //function : Init //purpose : //======================================================================= - void NMTTools_CheckerSI::Init() +void NMTTools_CheckerSI::Init() { myIsDone=Standard_False; if (myCompositeShape.IsNull()) { @@ -83,18 +86,24 @@ myDSIt->SetDS(myDS); myDSIt->Prepare(); // - // 4. + // 3. myNbSources=myDS->NumberOfShapesOfTheObject()+ myDS->NumberOfShapesOfTheTool(); myNbEdges=myDS->NbEdges(); - // 5 + // 4. 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 //purpose : //======================================================================= - void NMTTools_CheckerSI::Perform() +void NMTTools_CheckerSI::Perform() { myIsDone=Standard_False; myStopStatus=0; diff --git a/src/NMTTools/NMTTools_PaveFiller.cdl b/src/NMTTools/NMTTools_PaveFiller.cdl index f4d8ecf41..350f48e87 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cdl +++ b/src/NMTTools/NMTTools_PaveFiller.cdl @@ -155,10 +155,6 @@ is returns Context from IntTools; ---C++:return const & - ChangeContext(me:out) - returns Context from IntTools; - ---C++:return & - PavePool(me) returns PavePool from BOPTools; ---C++:return const & diff --git a/src/NMTTools/NMTTools_PaveFiller.cxx b/src/NMTTools/NMTTools_PaveFiller.cxx index b3c13fcdc..8abecf340 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cxx +++ b/src/NMTTools/NMTTools_PaveFiller.cxx @@ -18,21 +18,23 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTTools_PaveFiller.cxx // Created: Fri Dec 5 14:58:54 2003 // Author: Peter KURNEV -// -// + #include -// -#include -#include + +#include + #include + +#include #include #include +#include + //======================================================================= // function: NMTTools_PaveFiller::NMTTools_PaveFiller // purpose: @@ -126,18 +128,26 @@ // function: Context // 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; } + +#if OCC_VERSION_LARGE <= 0x06050200 //======================================================================= // function: ChangeContext // purpose: //======================================================================= - IntTools_Context& NMTTools_PaveFiller::ChangeContext() +IntTools_Context& NMTTools_PaveFiller::ChangeContext() { return myContext; } +#endif + //======================================================================= // function: PavePool // purpose: @@ -221,8 +231,13 @@ myDS->NumberOfShapesOfTheTool(); myNbEdges=myDS->NbEdges(); // - // 4 + // 4. myIP=new NMTDS_InterfPool; +#if OCC_VERSION_LARGE > 0x06050200 + // + // 5. + myContext=new IntTools_Context; +#endif } //======================================================================= diff --git a/src/NMTTools/NMTTools_PaveFiller.hxx b/src/NMTTools/NMTTools_PaveFiller.hxx index f7c47a2ae..70d59bcbc 100644 --- a/src/NMTTools/NMTTools_PaveFiller.hxx +++ b/src/NMTTools/NMTTools_PaveFiller.hxx @@ -22,6 +22,8 @@ #ifndef _NMTTools_PaveFiller_HeaderFile #define _NMTTools_PaveFiller_HeaderFile +#include + #ifndef _Standard_HeaderFile #include #endif @@ -47,9 +49,13 @@ #ifndef _BOPTools_SplitShapesPool_HeaderFile #include #endif -#ifndef _IntTools_Context_HeaderFile + +#if OCC_VERSION_LARGE > 0x06050200 +#include +#else #include #endif + #ifndef _BOPTools_SSIntersectionAttribute_HeaderFile #include #endif @@ -77,10 +83,10 @@ #ifndef _Standard_Real_HeaderFile #include #endif + class TopoDS_Shape; class BOPTools_Pave; class IntTools_ShrunkRange; -class IntTools_Context; class BOPTools_PavePool; class NMTTools_CommonBlockPool; class BOPTools_SplitShapesPool; @@ -105,204 +111,201 @@ class TopTools_DataMapOfShapeShape; class TColStd_MapOfInteger; - class NMTTools_PaveFiller { public: - void* operator new(size_t,void* anAddress) + void* operator new(size_t,void* anAddress) { return anAddress; } - void* operator new(size_t size) + void* operator new(size_t size) { - return Standard::Allocate(size); + return Standard::Allocate(size); } - void operator delete(void *anAddress) + void operator delete(void *anAddress) { - if (anAddress) Standard::Free((Standard_Address&)anAddress); + if (anAddress) Standard::Free((Standard_Address&)anAddress); } - + Standard_EXPORT NMTTools_PaveFiller(); Standard_EXPORT virtual ~NMTTools_PaveFiller(); - + Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; - + Standard_EXPORT const TopoDS_Shape& CompositeShape() const; - + Standard_EXPORT NMTDS_PShapesDataStructure DS() ; - + Standard_EXPORT NMTDS_PIterator DSIt() ; - + Standard_EXPORT NMTDS_PInterfPool IP() ; - + Standard_EXPORT virtual void Perform() ; - + 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 IntTools_Context& ChangeContext() ; - +#endif + Standard_EXPORT const BOPTools_PavePool& PavePool() const; - + Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; - + Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; - + Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; - + Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; - + Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; - + Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; - + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - + Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; - + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - + Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; - + Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; - + Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; - + Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; - + Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; - + Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT void RealSplitsInFace(const Standard_Integer nF1,BOPTools_ListOfPaveBlock& aLPB) ; - + Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - + Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; - + Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; - + Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - + Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - + Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; - + Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; - + Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; - + Standard_EXPORT void MakePCurves() ; - + Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; - + Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; - + Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; - + Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; - + Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ; - + Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const; - - Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; - - Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; - - Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; - - Standard_EXPORT void PutClosingPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; + Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; + Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; + Standard_EXPORT void PutClosingPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; protected: - Standard_EXPORT virtual void Init() ; - + Standard_EXPORT virtual void Clear() ; - + Standard_EXPORT virtual void PerformVV() ; - + Standard_EXPORT virtual void PerformVE() ; - + Standard_EXPORT virtual void PerformVF() ; - + Standard_EXPORT virtual void PerformEE() ; - + Standard_EXPORT virtual void PerformEF() ; - + Standard_EXPORT virtual void PerformFF() ; - + Standard_EXPORT void MakeSplitEdges() ; - + Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; - + Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; - + Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; - + Standard_EXPORT virtual void PrepareEdges() ; - + Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const; - + Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const; - + Standard_EXPORT void RefinePavePool() ; - + Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; - + Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - + Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - + Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - + Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; - + Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; - + Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; - + Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - + Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - + Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - + Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - + Standard_EXPORT void UpdateCommonBlocks() ; Standard_EXPORT void UpdateCommonBlocks (const Standard_Integer aI); @@ -310,15 +313,15 @@ protected: Standard_EXPORT void UpdatePaveBlocks() ; Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; - + Standard_EXPORT void MakeBlocks() ; - + Standard_EXPORT void PerformVF1() ; - + Standard_EXPORT void MakeAloneVertices() ; - + Standard_EXPORT void FillFaceInfo() ; - + Standard_EXPORT void CorrectTolR3D(const BOPTools_SSInterference& aFF,const TColStd_MapOfInteger& aMVStick,Standard_Real& aTolR3D) ; @@ -330,7 +333,11 @@ BOPTools_PavePool myPavePool; BOPTools_PavePool myPavePoolNew; NMTTools_CommonBlockPool myCommonBlockPool; BOPTools_SplitShapesPool mySplitShapesPool; -IntTools_Context myContext; +#if OCC_VERSION_LARGE > 0x06050200 + Handle_IntTools_Context myContext; +#else + IntTools_Context myContext; +#endif BOPTools_SSIntersectionAttribute mySectionAttribute; NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices; TColStd_DataMapOfIntegerInteger myVSD; @@ -339,13 +346,8 @@ TopoDS_Shape myCompositeShape; NMTDS_PInterfPool myIP; NMTTools_DataMapOfIntegerFaceInfo myFaceInfo; - private: - - - - }; // other Inline functions and methods (like "C++: function call" methods) diff --git a/src/NMTTools/NMTTools_PaveFiller_2.cxx b/src/NMTTools/NMTTools_PaveFiller_2.cxx index 96d6f2493..d7ebc4732 100644 --- a/src/NMTTools/NMTTools_PaveFiller_2.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_2.cxx @@ -154,7 +154,10 @@ void NMTTools_PaveFiller::PerformVE() } // //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 aFlag = myContext.ComputeVE (aV1, aE2, aT, bToUpdateVertex, aDist); #else diff --git a/src/NMTTools/NMTTools_PaveFiller_3.cxx b/src/NMTTools/NMTTools_PaveFiller_3.cxx index b034f96a3..bf387e4a2 100644 --- a/src/NMTTools/NMTTools_PaveFiller_3.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_3.cxx @@ -18,15 +18,15 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTTools_PaveFiller_3.cxx // Created: Mon Dec 8 16:06:56 2003 // Author: Peter KURNEV -// -// + #include +#include + #include #include #include @@ -48,6 +48,7 @@ static Standard_Boolean Contains(const TopoDS_Face& aF, const TopoDS_Vertex& aV); // Contribution of Samtech www.samcef.com END + //======================================================================= // function: PerformVF // purpose: @@ -106,7 +107,11 @@ static } // 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); +#endif // if (!aFlag) { // diff --git a/src/NMTTools/NMTTools_PaveFiller_4.cxx b/src/NMTTools/NMTTools_PaveFiller_4.cxx index 3a5a74215..7711f2701 100644 --- a/src/NMTTools/NMTTools_PaveFiller_4.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_4.cxx @@ -25,6 +25,8 @@ #include +#include + #include #include @@ -479,7 +481,11 @@ void NMTTools_PaveFiller::TreatPaveBlocks (NMTTools_ListOfCommonBlock& theLCB) // Append Pave of nV to rhe edge nE const TopoDS_Edge& aE=*(TopoDS_Edge*)(&myDS->Shape(nE)); 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); +#endif if (!iFlag) { BOPTools_Pave aPave; // @@ -569,7 +575,11 @@ void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapO for (j=0; j<2; ++j) { if (aMFence.Add(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); +#endif if (!iFlag) { aPave.SetInterference(-1); aPave.SetType (BooleanOperations_EdgeEdge); @@ -1553,7 +1563,11 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB, } // anIndexIn=0; +#if OCC_VERSION_LARGE > 0x06050200 + aFlag=myContext->ComputeVS (aVnew, aF, aU, aV); +#else aFlag=myContext.ComputeVS (aVnew, aF, aU, aV); +#endif if (!aFlag) { BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV); // @@ -1592,7 +1606,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& nE2=aPB2.OriginalEdge(); 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); +#endif aPPC.Perform(aP1m); aNbPoints=aPPC.NbPoints(); if (aNbPoints) { diff --git a/src/NMTTools/NMTTools_PaveFiller_5.cxx b/src/NMTTools/NMTTools_PaveFiller_5.cxx index 78901bfc7..96ab2796d 100644 --- a/src/NMTTools/NMTTools_PaveFiller_5.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_5.cxx @@ -27,6 +27,8 @@ // #include +#include + #include #include @@ -49,7 +51,9 @@ #include #include #include +#if OCC_VERSION_LARGE <= 0x06050200 #include +#endif #include #include #include @@ -191,7 +195,11 @@ static aEF.SetDiscretize (aDiscretize); aEF.SetDeflection (aDeflection); // +#if OCC_VERSION_LARGE > 0x06050200 + aEF.SetContext(myContext); +#else aEF.SetContext((IntTools_PContext)&myContext); +#endif // IntTools_Range anewSR = aSR; // @@ -527,7 +535,11 @@ static nE=aME(j); 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); +#endif // if (!aFlag) { aPave.SetInterference(-1); diff --git a/src/NMTTools/NMTTools_PaveFiller_6.cxx b/src/NMTTools/NMTTools_PaveFiller_6.cxx index d713e8851..43ab91e0f 100644 --- a/src/NMTTools/NMTTools_PaveFiller_6.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_6.cxx @@ -37,7 +37,6 @@ #include #include - #include #include #include @@ -113,7 +112,11 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx); +#else IntTools_Context& aCtx); +#endif //======================================================================= // function: PerformFF @@ -414,7 +417,11 @@ void NMTTools_PaveFiller::MakeBlocks() // // 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); +#endif if (!bIsValidIn2D) { continue; } @@ -429,10 +436,18 @@ void NMTTools_PaveFiller::MakeBlocks() { Standard_Real aT; // +#if OCC_VERSION_LARGE > 0x06050200 + myContext->IsVertexOnLine(aV1, aIC, aTolR3D, aT); +#else myContext.IsVertexOnLine(aV1, aIC, aTolR3D, aT); +#endif BOPTools_Tools::UpdateVertex (aIC, aT, aV1); // +#if OCC_VERSION_LARGE > 0x06050200 + myContext->IsVertexOnLine(aV2, aIC, aTolR3D, aT); +#else myContext.IsVertexOnLine(aV2, aIC, aTolR3D, aT); +#endif BOPTools_Tools::UpdateVertex (aIC, aT, aV2); } // @@ -930,7 +945,11 @@ Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_Pave // aBB.MakeVertex (aVM, aPM, aTolC); // +#if OCC_VERSION_LARGE > 0x06050200 + iVM=myContext->ComputeVE(aVM, aE2, aTmp); +#else iVM=myContext.ComputeVE(aVM, aE2, aTmp); +#endif // 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 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); +#endif if (bVF) { 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); +#endif if (bVF) { PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi); } @@ -1160,7 +1187,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& } // VE if (!iV) { +#if OCC_VERSION_LARGE > 0x06050200 + iVE=myContext->ComputeVE (aV11, aE2, aTE); +#else iVE=myContext.ComputeVE (aV11, aE2, aTE); +#endif if (!iVE) { iCount++; if (iCount>iCountExt) { @@ -1189,7 +1220,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& } // VE if (!iV) { +#if OCC_VERSION_LARGE > 0x06050200 + iVE=myContext->ComputeVE (aV12, aE2, aTE); +#else iVE=myContext.ComputeVE (aV12, aE2, aTE); +#endif if (!iVE) { iCount++; if (iCount>iCountExt) { @@ -1207,7 +1242,11 @@ Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& //purpose : //======================================================================= Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx) +#else IntTools_Context& aCtx) +#endif { Standard_Boolean bRet; Standard_Integer iErr; @@ -1274,7 +1313,11 @@ void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet, continue; } // +#if OCC_VERSION_LARGE > 0x06050200 + bIsVertexOnLine=myContext->IsVertexOnLine(aV, aC, aTolR3D, aT); +#else bIsVertexOnLine=myContext.IsVertexOnLine(aV, aC, aTolR3D, aT); +#endif // // if (bIsVertexOnLine) { @@ -1503,7 +1546,11 @@ void NMTTools_PaveFiller::CorrectTolR3D(const BOPTools_SSInterference& aFF, aC3D->D0(aT, aP); // 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]); +#endif aPPS.Perform(aP); aPPS.LowerDistanceParameters(aU, aV); BOPTools_Tools3D::GetNormalToSurface(aS[i], aU, aV, aDN[i]); diff --git a/src/NMTTools/NMTTools_PaveFiller_7.cxx b/src/NMTTools/NMTTools_PaveFiller_7.cxx index dafaeac50..0960fee58 100644 --- a/src/NMTTools/NMTTools_PaveFiller_7.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_7.cxx @@ -24,6 +24,8 @@ #include +#include + #include #include #include @@ -57,7 +59,7 @@ #include #include -// + #include #include #include @@ -293,7 +295,11 @@ void NMTTools_PaveFiller::UpdateCommonBlocks(const Standard_Integer) } // 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); +#endif // for (j=0; j<2; ++j) { aPPCx.Perform(aPMax[j]); diff --git a/src/NMTTools/NMTTools_Tools.cdl b/src/NMTTools/NMTTools_Tools.cdl index ac071f9b4..2d8df63a7 100644 --- a/src/NMTTools/NMTTools_Tools.cdl +++ b/src/NMTTools/NMTTools_Tools.cdl @@ -65,13 +65,13 @@ is IsSplitInOnFace(myclass; aE : Edge from TopoDS; aF : Face from TopoDS; - aCtx:out Context from IntTools) + aCtx: Context from IntTools) returns Boolean from Standard; AreFacesSameDomain(myclass; aF1 : Face from TopoDS; aF2 : Face from TopoDS; - aCtx : out Context from IntTools) + aCtx : Context from IntTools) returns Boolean from Standard; FindChains(myclass; @@ -81,14 +81,7 @@ is FindChains(myclass; aM1: 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; aE : Edge from TopoDS; aF : Face from TopoDS; @@ -97,7 +90,6 @@ is UpdateEdge(myclass; aE : Edge from TopoDS; aTol : Real from Standard); ---modified by NIZNHY-PKV Thu Nov 16 10:58:14 2006t --fields end Tools; diff --git a/src/NMTTools/NMTTools_Tools.cxx b/src/NMTTools/NMTTools_Tools.cxx index ebd27b4b1..cdbcc5f06 100644 --- a/src/NMTTools/NMTTools_Tools.cxx +++ b/src/NMTTools/NMTTools_Tools.cxx @@ -18,63 +18,60 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTTools_Tools.cxx // Created: Mon Dec 8 10:35:15 2003 // Author: Peter KURNEV -// -// -#include -#include +#include -#include -#include -#include +#include -#include -#include +#include +#include +#include #include #include #include #include +#include #include +#include -#include +#include +#include #include +#include #include #include #include +#include #include #include #include #include - #include +#include #include -#include -#include -#include -#include -#include + #include #include -#include -#include -#include -#include -// -#include -#include -#include +#include +#include +#include -static +#include + +#include +#include +#include + +static void ProcessBlock(const Standard_Integer iV, const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV, TColStd_IndexedMapOfInteger& aProcessed, @@ -88,11 +85,11 @@ static //modified by NIZNHY-PKV Thu Nov 16 10:46:53 2006f SKL/PartC5 //======================================================================= // function: UpdateEdge -// purpose: +// purpose: //======================================================================= void NMTTools_Tools::UpdateEdge(const TopoDS_Edge& aE, const Standard_Real aTolR) -{ +{ Standard_Real aTolE, aTolES, aTolV; TopoDS_Iterator aIt; BRep_Builder aBB; @@ -112,12 +109,11 @@ static } //======================================================================= // function: MakePCurve -// purpose: +// purpose: //======================================================================= void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE, const TopoDS_Face& aF, const Handle(Geom2d_Curve)& aC2Dx1) - { Standard_Real aTolE, aT1, aT2, aOutFirst, aOutLast, aOutTol; Handle(Geom2d_Curve) aC2D, aC2DA; @@ -139,10 +135,10 @@ static } // if (aC3DE->IsPeriodic()) { - BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA); + BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA); } else { - BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); + BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); } // aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE); @@ -151,14 +147,14 @@ static /* //======================================================================= // function: MakePCurve -// purpose: +// purpose: //======================================================================= void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE, const TopoDS_Face& aF, const Handle(Geom2d_Curve)& aC2Dx, const Standard_Real aTolR2D) { - Standard_Integer k, aNbV; + Standard_Integer k, aNbV; Standard_Real aTolEdge, aTolFact, aTolV, aTolVmax; Standard_Real aTFirst, aTLast, aOutFirst, aOutLast, aOutTol; TopoDS_Face aFFWD; @@ -198,24 +194,28 @@ static BOPTools_Tools2D::CurveOnSurface(aE, aFFWD, aC2D, aOutFirst, aOutLast, aOutTol, Standard_True); } if (aC3DE->IsPeriodic()) { - BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aTFirst, aTLast, aC2D, aC2DA); + BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aTFirst, aTLast, aC2D, aC2DA); } else { - BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); + BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); } // aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolFact); BRepLib::SameParameter(aE); } */ -//modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t +//modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t //======================================================================= // function: IsSplitInOnFace -// purpose: +// purpose: //======================================================================= Standard_Boolean NMTTools_Tools::IsSplitInOnFace(const TopoDS_Edge& aE, const TopoDS_Face& aF, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aContext) +#else IntTools_Context& aContext) +#endif { Standard_Boolean bFlag; Standard_Real aT, aTolE, aTolF, aTol, aDist, aU, aV; @@ -226,7 +226,11 @@ static aTolF=BRep_Tool::Tolerance(aF); aTol=aTolE+aTolF; // +#if OCC_VERSION_LARGE > 0x06050200 + GeomAPI_ProjectPointOnSurf& aProjector=aContext->ProjPS(aF); +#else GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF); +#endif // aT=BOPTools_Tools2D::IntermediatePoint(aE); BOPTools_Tools::PointOnEdge(aE, aT, aP); @@ -245,12 +249,16 @@ static // aProjector.LowerDistanceParameters(aU, aV); aP2D.SetCoord(aU, aV); +#if OCC_VERSION_LARGE > 0x06050200 + bFlag=aContext->IsPointInOnFace (aF, aP2D); +#else bFlag=aContext.IsPointInOnFace (aF, aP2D); +#endif return bFlag; } //======================================================================= // function: NMTTools_Tools::MakeNewVertex -// purpose : +// purpose : //======================================================================= void NMTTools_Tools::MakeNewVertex(const TopTools_ListOfShape& aLVs, TopoDS_Vertex& aNewVertex) @@ -293,7 +301,7 @@ static } //======================================================================= // function: FindChains -// purpose : +// purpose : //======================================================================= void NMTTools_Tools::FindChains(const BOPTools_CArray1OfSSInterference& FFs, BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains) @@ -341,7 +349,7 @@ static } //======================================================================= // function: FindChains -// purpose : +// purpose : //======================================================================= void NMTTools_Tools::FindChains(const BOPTools_CArray1OfVVInterference& VVs, BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains) @@ -383,7 +391,7 @@ static //======================================================================= // function: FindChains -// purpose : +// purpose : //======================================================================= void NMTTools_Tools::FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV, BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains) @@ -413,7 +421,7 @@ static } //======================================================================= // function: ProcessBlock -// purpose: +// purpose: //======================================================================= void ProcessBlock(const Standard_Integer iV, const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV, @@ -437,14 +445,18 @@ void ProcessBlock(const Standard_Integer iV, } //======================================================================= // function: AreFacesSameDomain -// purpose : +// purpose : //======================================================================= Standard_Boolean NMTTools_Tools::AreFacesSameDomain(const TopoDS_Face& aF1x, const TopoDS_Face& aF2y, +#if OCC_VERSION_LARGE > 0x06050200 + const Handle(IntTools_Context)& aCtx) +#else IntTools_Context& aCtx) +#endif { Standard_Boolean bFlag; - // Modified Thu Sep 14 14:35:18 2006 + // Modified Thu Sep 14 14:35:18 2006 // Contribution of Samtech www.samcef.com BEGIN Standard_Integer aNbE1, aNbE2; Standard_Real aTolF1, aTolF2, aTol; @@ -463,7 +475,7 @@ void ProcessBlock(const Standard_Integer iV, aF2=aF2y; aF2.Orientation(TopAbs_FORWARD); // - // Modified Thu Sep 14 14:35:18 2006 + // Modified Thu Sep 14 14:35:18 2006 // Contribution of Samtech www.samcef.com BEGIN // // 1 @@ -508,7 +520,11 @@ void ProcessBlock(const Standard_Integer iV, for (; aIt.More(); aIt.Next()) { const TopoDS_Edge& aE=TopoDS::Edge(aIt.Key()); 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); +#endif break; } // @@ -516,12 +532,12 @@ void ProcessBlock(const Standard_Integer iV, } //======================================================================= // function: FindChains -// purpose : +// purpose : //======================================================================= void NMTTools_Tools::FindChains(const NMTTools_ListOfCoupleOfShape& aLCS, NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains) { - NMTTools_ListIteratorOfListOfCoupleOfShape aItCS; + NMTTools_ListIteratorOfListOfCoupleOfShape aItCS; NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMCV; // aItCS.Initialize(aLCS); @@ -560,7 +576,7 @@ void ProcessBlock(const Standard_Integer iV, } //======================================================================= // function: FindChains -// purpose : +// purpose : //======================================================================= void NMTTools_Tools::FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV, NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains) @@ -590,7 +606,7 @@ void ProcessBlock(const Standard_Integer iV, } //======================================================================= // function: ProcessBlock -// purpose: +// purpose: //======================================================================= void ProcessBlock(const TopoDS_Shape& aF, const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV, diff --git a/src/NMTTools/NMTTools_Tools.hxx b/src/NMTTools/NMTTools_Tools.hxx index 19e6f1085..ad75e9298 100644 --- a/src/NMTTools/NMTTools_Tools.hxx +++ b/src/NMTTools/NMTTools_Tools.hxx @@ -18,11 +18,19 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _NMTTools_Tools_HeaderFile #define _NMTTools_Tools_HeaderFile +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#include + #ifndef _Standard_Boolean_HeaderFile #include #endif @@ -32,6 +40,13 @@ #ifndef _Standard_Real_HeaderFile #include #endif + +#if OCC_VERSION_LARGE > 0x06050200 +#include +#else +class IntTools_Context; +#endif + class TopTools_ListOfShape; class TopoDS_Vertex; class BOPTools_CArray1OfVVInterference; @@ -39,101 +54,65 @@ class BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger; class BOPTools_CArray1OfSSInterference; class TopoDS_Edge; class TopoDS_Face; -class IntTools_Context; class NMTTools_ListOfCoupleOfShape; class NMTTools_IndexedDataMapOfShapeIndexedMapOfShape; class Geom2d_Curve; - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - - class NMTTools_Tools { - public: - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } - // Methods PUBLIC - // - - -Standard_EXPORT static void MakeNewVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewVertex) ; - + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } -Standard_EXPORT static void FindChains(const BOPTools_CArray1OfVVInterference& aVVs,BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCX) ; + Standard_EXPORT static void MakeNewVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewVertex) ; -Standard_EXPORT static void FindChains(const BOPTools_CArray1OfSSInterference& 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 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 FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,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 void UpdateEdge(const TopoDS_Edge& aE,const Standard_Real aTol) ; + 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 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) ; protected: - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - +private: }; - - - - // other Inline functions and methods (like "C++: function call" methods) -// - #endif -- 2.39.2