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.
-- 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;
// 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 <GEOMAlgo_BuilderArea.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <TopTools_ListIteratorOfListOfShape.hxx>
+
#include <TopoDS_Shape.hxx>
+#include <IntTools_Context.hxx>
+
//=======================================================================
-//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;
//
}
//=======================================================================
//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()
{
}
-
// 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 <Basics_OCCTVersion.hxx>
+
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _TopTools_MapOfOrientedShape_HeaderFile
#include <TopTools_MapOfOrientedShape.hxx>
#endif
-#ifndef _IntTools_PContext_HeaderFile
+
+#if OCC_VERSION_LARGE > 0x06050200
+#include <Handle_IntTools_Context.hxx>
+#else
#include <IntTools_PContext.hxx>
#endif
+
#ifndef _GEOMAlgo_Algo_HeaderFile
#include <GEOMAlgo_Algo.hxx>
#endif
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
- // Methods PUBLIC
- //
//! Sets cashed geometrical tools <br>
+#if OCC_VERSION_LARGE > 0x06050200
+ Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ;
+#else
Standard_EXPORT void SetContext(const IntTools_Context& theContext) ;
+#endif
+
+#if OCC_VERSION_LARGE > 0x06050200
+ //! Returns cashed geometrical tools <br>
+ Standard_EXPORT const Handle_IntTools_Context& Context() const;
+#endif
//! Sets edges/faces to process <br>
Standard_EXPORT void SetShapes(const TopTools_ListOfShape& theLS) ;
//! Returns faces/solids that have been built <br>
Standard_EXPORT const TopTools_ListOfShape& Areas() const;
-
-
-
+#if OCC_VERSION_LARGE > 0x06050200
+ Standard_EXPORT virtual void Perform() ;
+#endif
protected:
- // Methods PROTECTED
- //
-
-//! Empty constructor <br>
-Standard_EXPORT GEOMAlgo_BuilderArea();
+ //! Empty constructor <br>
+ Standard_EXPORT GEOMAlgo_BuilderArea();
Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();
-
-//! Collect the edges/faces that <br>
+ //! Collect the edges/faces that <br>
//! a) are internal <br>
//! b) are the same and have different orientation <br>
-Standard_EXPORT virtual void PerformShapesToAvoid() ;
-
-//! Build draft faces/shells <br>
+ Standard_EXPORT virtual void PerformShapesToAvoid() ;
+ //! Build draft faces/shells <br>
//! a)myLoops - draft faces/shells that consist of <br>
//! boundary edges/faces <br>
//! b)myLoopsInternal - draft faces/shells that contains <br>
//! inner edges/faces <br>
-Standard_EXPORT virtual void PerformLoops() ;
+ Standard_EXPORT virtual void PerformLoops() ;
+ //! Build draft faces/solids that contains boundary faces <br>
+ Standard_EXPORT virtual void PerformAreas() ;
+ //! Build finalized faces/solids with internal wires/shells <br>
+ Standard_EXPORT virtual void PerformInternalShapes() ;
-//! Build draft faces/solids that contains boundary faces <br>
-Standard_EXPORT virtual void PerformAreas() ;
-//! Build finalized faces/solids with internal wires/shells <br>
-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:
};
// other Inline functions and methods (like "C++: function call" methods)
-//
#endif
// 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 <GEOMAlgo_BuilderFace.ixx>
+#include <GEOMAlgo_Tools3D.hxx>
+#include <GEOMAlgo_BuilderTools.hxx>
+#include <GEOMAlgo_WireEdgeSet.hxx>
+#include <GEOMAlgo_WESCorrector.hxx>
+
+#include <NMTTools_ListOfCoupleOfShape.hxx>
+#include <NMTTools_CoupleOfShape.hxx>
+#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <BOP_WireEdgeSet.hxx>
#include <BOP_WESCorrector.hxx>
-#include <NMTTools_ListOfCoupleOfShape.hxx>
-#include <NMTTools_CoupleOfShape.hxx>
-#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
-
-#include <GEOMAlgo_Tools3D.hxx>
-#include <GEOMAlgo_BuilderTools.hxx>
-#include <GEOMAlgo_WireEdgeSet.hxx>
-#include <GEOMAlgo_WESCorrector.hxx>
-
//
static
Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
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& );
{
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;
//=======================================================================
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;
// 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 <GEOMAlgo_BuilderSolid.ixx>
+#include <GEOMAlgo_Tools3D.hxx>
+#include <GEOMAlgo_BuilderTools.hxx>
+
+#include <NMTTools_ListOfCoupleOfShape.hxx>
+#include <NMTTools_CoupleOfShape.hxx>
+#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools3D.hxx>
-#include <NMTTools_ListOfCoupleOfShape.hxx>
-#include <NMTTools_CoupleOfShape.hxx>
-#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
-
-#include <GEOMAlgo_Tools3D.hxx>
-#include <GEOMAlgo_BuilderTools.hxx>
-
//
static
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& );
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()) {
aBB.Add(aC, aF);
}
//
- //
+#if OCC_VERSION_LARGE <= 0x06050200
if (myContext==NULL) {
myErrorStatus=11;// Null Context
return;
}
+#endif
//
PerformShapesToAvoid();
if (myErrorStatus) {
}
//=======================================================================
//function :PerformShapesToAvoid
-//purpose :
+//purpose :
//=======================================================================
- void GEOMAlgo_BuilderSolid::PerformShapesToAvoid()
+void GEOMAlgo_BuilderSolid::PerformShapesToAvoid()
{
Standard_Boolean bFound;
Standard_Integer i, iCnt, aNbE, aNbF;
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
/*
- else {
- int a=0;
+ else {
+ int a=0;
}
*/
}
myShapesToAvoid.Add(aF2);
}
}
- /*//DEB
+ /*//DEB
else {
TopTools_ListIteratorOfListOfShape aItLF;
//
break;
}
//
- }//while (1)
-}
+ }//while (1)
+}
//=======================================================================
//function : PerformLoops
-//purpose :
+//purpose :
//=======================================================================
- void GEOMAlgo_BuilderSolid::PerformLoops()
+void GEOMAlgo_BuilderSolid::PerformLoops()
{
myErrorStatus=0;
//
if (aMEFP.Contains(aE)) {
const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
aNbFP=aLFP.Extent();
- if (aNbFP>1) {
+ if (aNbFP>1) {
continue;
}
}
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;
}
aCSOff.SetShape1(aEL);
aCSOff.SetShape2(aFL);
aLCSOff.Append(aCSOff);
- }//for (; aItLF.More(); aItLF.Next()) {
+ }//for (; aItLF.More(); aItLF.Next()) {
//
aNbOff=aLCSOff.Extent();
if (!aNbOff){
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)) {
//
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()) {
aMP.Add(aF);
}
}
- //
+ //
// b. collect all faces that are to avoid
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
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);
}
//=======================================================================
//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;
//
}
//
- // 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;
//
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;
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);
}
}
//=======================================================================
//function : MakeInternalShells
-//purpose :
+//purpose :
//=======================================================================
void MakeInternalShells(const TopTools_MapOfShape& theMF,
TopTools_ListOfShape& theShells)
//
// make a new shell
TopoDS_Shell aShell;
- aBB.MakeShell(aShell);
+ aBB.MakeShell(aShell);
aFF.Orientation(TopAbs_INTERNAL);
aBB.Add(aShell, aFF);
//
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);
}
//=======================================================================
//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);
}
//=======================================================================
//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;
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);
}
//=======================================================================
//function : IsClosedShell
-//purpose :
+//purpose :
//=======================================================================
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()) {
}
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);
const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
if (aNbF==1) {
if (aOrE==TopAbs_INTERNAL) {
- continue;
+ continue;
}
aMFx.Add(aF1);
}
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);
}
}
}
aNbF=aMFx.Extent();
if (!aNbF) {
return bRet;
- }
+ }
//
BRep_Builder aBB;
TopoDS_Iterator aIt;
//
return bRet;
}
-//modified by NIZNHY-PKV Tue Oct 26 13:30:26 2010t
-//
+
// ErrorStatus :
// 11 - Null Context
// 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 <GEOMAlgo_Builder.hxx>
-//
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <GEOMAlgo_Tools3D.hxx>
+
+#include <NMTTools_PaveFiller.hxx>
+#include <NMTTools_CommonBlockPool.hxx>
+#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
+#include <NMTTools_CommonBlock.hxx>
+#include <NMTTools_CommonBlockPool.hxx>
+#include <NMTTools_ListOfCommonBlock.hxx>
+#include <NMTTools_CommonBlockAPI.hxx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
+
#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Iterator.hxx>
-//
+
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
-//
+
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
-//
+
#include <IntTools_Context.hxx>
+
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
-//
-#include <NMTDS_ShapesDataStructure.hxx>
-//
-#include <NMTTools_PaveFiller.hxx>
-#include <NMTTools_CommonBlockPool.hxx>
-#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <NMTTools_CommonBlock.hxx>
-#include <NMTTools_CommonBlockPool.hxx>
-#include <NMTTools_ListOfCommonBlock.hxx>
-#include <NMTTools_CommonBlockAPI.hxx>
-//
-#include <GEOMAlgo_Tools3D.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
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;
//
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) {
#include <GEOMAlgo_Builder.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
+#include <Basics_OCCTVersion.hxx>
+
+#include <GEOMAlgo_Tools3D.hxx>
+#include <GEOMAlgo_WireEdgeSet.hxx>
+#include <GEOMAlgo_BuilderFace.hxx>
+#include <GEOMAlgo_ShapeSet.hxx>
+
+#include <NMTTools_PaveFiller.hxx>
+#include <NMTTools_ListOfCoupleOfShape.hxx>
+#include <NMTTools_Tools.hxx>
+#include <NMTTools_CoupleOfShape.hxx>
+#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
+#include <NMTTools_Tools.hxx>
+#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
+#include <NMTTools_ListOfCommonBlock.hxx>
+#include <NMTTools_CommonBlock.hxx>
+#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
+
+#include <NMTDS_BoxBndTree.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_DataMapOfIntegerShape.hxx>
+#include <TopTools_DataMapOfShapeInteger.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <IntTools_Context.hxx>
#include <IntTools_FClass2d.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+
#include <BooleanOperations_OnceExplorer.hxx>
+
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
+
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_ESInterference.hxx>
#include <BOPTools_CArray1OfESInterference.hxx>
-#include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTDS_InterfPool.hxx>
-
-#include <NMTTools_PaveFiller.hxx>
-#include <NMTTools_ListOfCoupleOfShape.hxx>
-#include <NMTTools_Tools.hxx>
-#include <NMTTools_CoupleOfShape.hxx>
-#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
-#include <NMTTools_Tools.hxx>
-#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <NMTTools_ListOfCommonBlock.hxx>
-#include <NMTTools_CommonBlock.hxx>
-#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
-//
-#include <GEOMAlgo_Tools3D.hxx>
-#include <GEOMAlgo_WireEdgeSet.hxx>
-#include <GEOMAlgo_BuilderFace.hxx>
-
-#include <GEOMAlgo_ShapeSet.hxx>
-//
-#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_DataMapOfIntegerShape.hxx>
+
+#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
static
void UpdateCandidates(const Standard_Integer ,
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;
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();
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();
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;
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;
//
// 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 <GEOMAlgo_Builder.hxx>
+#include <Basics_OCCTVersion.hxx>
+
+#include <GEOMAlgo_Tools3D.hxx>
+#include <GEOMAlgo_BuilderSolid.hxx>
+#include <GEOMAlgo_ShapeSet.hxx>
+#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
+
+#include <NMTTools_PaveFiller.hxx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
+
#include <TopAbs_State.hxx>
#include <TopoDS.hxx>
#include <IntTools_Context.hxx>
-#include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_PaveFiller.hxx>
-
-#include <GEOMAlgo_Tools3D.hxx>
-#include <GEOMAlgo_BuilderSolid.hxx>
-#include <GEOMAlgo_ShapeSet.hxx>
-#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
-#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
-
-
static
void OwnInternalShapes(const TopoDS_Shape& ,
{
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;
//
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;
//
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;
//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();
//
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;
// 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 <GEOMAlgo_Builder.hxx>
+#include <GEOMAlgo_Tools3D.hxx>
+
+#include <NMTTools_PaveFiller.hxx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <TopoDS_Iterator.hxx>
#include <TopTools_ListOfShape.hxx>
#include <IntTools_Context.hxx>
-#include <NMTDS_ShapesDataStructure.hxx>
-
-#include <NMTTools_PaveFiller.hxx>
-
-#include <GEOMAlgo_Tools3D.hxx>
-
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;
//
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()) {
}
//=======================================================================
//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;
//
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()) {
}
//=======================================================================
//function : IsDeleted
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Builder::IsDeleted(const TopoDS_Shape& theS)
{
}
//
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()) {
}
//=======================================================================
//function : PrepareHistory
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_Builder::PrepareHistory()
{
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
//
//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);
} // if (myMapShape.Contains(aSp))
}
}
- }
+ }
}
}
-
}
//=======================================================================
//function : MapShapes
-//purpose :
+//purpose :
//=======================================================================
void MapShapes(const TopoDS_Shape& theS,
TopTools_MapOfShape& theM)
-- 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
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;
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_ShapeAlgo::Perform();
+#endif
+ //
myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface);
//
MakeArgument1();
//
//=======================================================================
//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;
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;
private:
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
-
};
-
-
-
-
// other Inline functions and methods (like "C++: function call" methods)
-//
-
#endif
#include <GEOMAlgo_FinderShapeOn1.ixx>
+#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
+
+#include <GEOMAlgo_SurfaceTools.hxx>
+#include <GEOMAlgo_StateCollector.hxx>
+#include <GEOMAlgo_FinderShapeOn.hxx>
+
+#include <GEOMAlgo_PassKey.hxx>
+#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <math.h>
#include <Precision.hxx>
#include <BRep_Tool.hxx>
#include <BRepLib_MakeEdge.hxx>
-#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
-
-#include <GEOMAlgo_SurfaceTools.hxx>
-#include <GEOMAlgo_StateCollector.hxx>
-#include <GEOMAlgo_FinderShapeOn.hxx>
-
-#include <GEOMAlgo_PassKey.hxx>
-#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
-#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
-
//=======================================================================
//function : GEOMAlgo_FinderShapeOn1
//purpose :
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_ShapeAlgo::Perform();
+#endif
+ //
// 1
ProcessVertices();
if(myErrorStatus) {
// 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
-// <pkv@irinox>
-//
+
#include <GEOMAlgo_FinderShapeOn2.ixx>
-#include <math.h>
+#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
+
+#include <GEOMAlgo_SurfaceTools.hxx>
+#include <GEOMAlgo_StateCollector.hxx>
+#include <GEOMAlgo_FinderShapeOn.hxx>
+
+#include <GEOMAlgo_PassKey.hxx>
+#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <math.h>
#include <Precision.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <BRep_Tool.hxx>
#include <BRepLib_MakeEdge.hxx>
-#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
-
-#include <GEOMAlgo_SurfaceTools.hxx>
-#include <GEOMAlgo_StateCollector.hxx>
-#include <GEOMAlgo_FinderShapeOn.hxx>
-
-#include <GEOMAlgo_PassKey.hxx>
-#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
-#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
-
//=======================================================================
//function : GEOMAlgo_FinderShapeOn1
//purpose :
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_ShapeAlgo::Perform();
+#endif
+ //
myClsf->SetTolerance(myTolerance);
//
// 1
// 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 <GEOMAlgo_GetInPlace.hxx>
+#include <GEOMAlgo_Tools.hxx>
+
+#include <NMTTools_CoupleOfShape.hxx>
+
#include <NMTDS_BoxBndTree.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <NCollection_UBTreeFiller.hxx>
#include <Bnd_Box.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <NMTTools_CoupleOfShape.hxx>
-#include <GEOMAlgo_Tools.hxx>
-
-
static
void MapBRepShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aM);
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_GluerAlgo::Perform();
+#endif
+ //
Intersect();
if (myErrorStatus) {
return;
//
// 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 <GEOMAlgo_GetInPlace.hxx>
+#include <Basics_OCCTVersion.hxx>
+
#include <math.h>
#include <gp_Pnt.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dHatch_Hatcher.hxx>
#include <Geom2dHatch_Intersector.hxx>
-#include <HatchGen_Domain.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <HatchGen_Domain.hxx>
+
#include <TopAbs_State.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Face.hxx>
-#include <BRep_Tool.hxx>
#include <TopExp_Explorer.hxx>
+#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BOPTools_Tools2D.hxx>
-
-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;
//
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 {
//
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 {
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);
//
//=======================================================================
//function : PntInEdge
-//purpose :
+//purpose :
//=======================================================================
Standard_Integer PntInEdge(const TopoDS_Edge& aE,
- gp_Pnt& aP)
-
+ gp_Pnt& aP)
{
Standard_Integer iErr;
Standard_Real aT;
}
//=======================================================================
//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;
}
//=======================================================================
//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;
//
}
//=======================================================================
//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;
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);
//
//
return iErr;
}
-
// 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
-// <pkv@irinox>
-//
+
#include <GEOMAlgo_GlueAnalyser.ixx>
+#include <GEOMAlgo_PassKeyShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
+#include <GEOMAlgo_Tools.hxx>
+#include <GEOMAlgo_CoupleOfShapes.hxx>
+#include <GEOMAlgo_Gluer.hxx>
+#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Compound.hxx>
+#include <TopoDS_Vertex.hxx>
#include <BRep_Builder.hxx>
#include <TopExp.hxx>
+#include <TopTools_MapOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <GEOMAlgo_PassKeyShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
-#include <GEOMAlgo_Tools.hxx>
-#include <GEOMAlgo_CoupleOfShapes.hxx>
-
-#include <GEOMAlgo_Gluer.hxx>
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <Bnd_Box.hxx>
+
+#include <BRepBndLib.hxx>
+
#include <TColStd_ListOfInteger.hxx>
-#include <TopTools_MapOfShape.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <BRepBndLib.hxx>
//=======================================================================
//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();
}
//function : HasSolidsAlone
//purpose :
//=======================================================================
- Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const
+Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const
{
return !mySolidsAlone.IsEmpty();
}
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_ShapeAlgo::Perform();
+#endif
+ //
InnerTolerance();
if (myErrorStatus) {
return;
// 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
-// <pkv@irinox>
-//
+
#include <GEOMAlgo_GlueDetector.hxx>
-#include <Bnd_Box.hxx>
+#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
+#include <GEOMAlgo_PassKeyShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
+#include <GEOMAlgo_Tools.hxx>
+
+#include <NMTDS_BndSphereTree.hxx>
+#include <NMTDS_BndSphere.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <NCollection_UBTreeFiller.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopExp.hxx>
+
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRepBndLib.hxx>
-#include <NMTDS_BndSphereTree.hxx>
-#include <NMTDS_BndSphere.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
-
-#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
-#include <GEOMAlgo_PassKeyShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
-#include <GEOMAlgo_Tools.hxx>
+#include <Bnd_Box.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
-:
- GEOMAlgo_GluerAlgo(),
- GEOMAlgo_Algo()
+ : GEOMAlgo_GluerAlgo(),
+ GEOMAlgo_Algo()
{}
//=======================================================================
//function : ~
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_GluerAlgo::Perform();
+#endif
+ //
DetectVertices();
if (myErrorStatus) {
return;
// 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
-// <peter@PREFEX>
-//
+
#include <GEOMAlgo_Gluer.ixx>
+#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
+#include <GEOMAlgo_PassKeyShape.hxx>
+#include <GEOMAlgo_Tools.hxx>
+
#include <NMTDS_BoxBndTree.hxx>
+#include <NMTDS_BndSphereTree.hxx>
+#include <NMTDS_BndSphere.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <NCollection_UBTreeFiller.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BOP_CorrectTolerances.hxx>
-#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
-#include <GEOMAlgo_PassKeyShape.hxx>
-#include <GEOMAlgo_Tools.hxx>
-//
-//modified by NIZNHY-PKV Thu Jan 21 10:02:52 2010f
-#include <NMTDS_BndSphereTree.hxx>
-#include <NMTDS_BndSphere.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
-//modified by NIZNHY-PKV Thu Jan 21 10:02:56 2010t
-//
static
void GetSubShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aMSS);
//=======================================================================
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,
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) {
// 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 <GEOMAlgo_Gluer2.hxx>
+#include <GEOMAlgo_GlueDetector.hxx>
+#include <GEOMAlgo_Tools3D.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
-#include <BRep_Builder.hxx>
#include <TopExp.hxx>
+
+#include <BRep_Builder.hxx>
#include <BRepLib.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
-#include <GEOMAlgo_GlueDetector.hxx>
-#include <GEOMAlgo_Tools3D.hxx>
-
//=======================================================================
//function : GEOMAlgo_Gluer2
//purpose :
return;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ // Initialize the context
+ GEOMAlgo_GluerAlgo::Perform();
+#endif
+ //
PerformShapesToWork();
if (myErrorStatus) {
return;
//
myShape=aCnew;
}
+
//--------------------------------------------------------
//
// ErrorStatus
// 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
-// <peter@PREFEX>
-//
+
#include <GEOMAlgo_GluerAlgo.hxx>
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE > 0x06050200
+#include <IntTools_Context.hxx>
+#endif
//=======================================================================
//function : GEOMAlgo_GluerAlgo
myTolerance=0.0001;
myCheckGeometry=Standard_True;
}
+
//=======================================================================
//function : ~GEOMAlgo_GluerAlgo
//purpose :
GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo()
{
}
+
//=======================================================================
//function : SetArgument
//purpose :
{
myArgument=theShape;
}
+
//=======================================================================
//function : Argument
//purpose :
{
return myArgument;
}
+
//=======================================================================
//function : SetTolerance
//purpose :
{
myTolerance=aT;
}
+
//=======================================================================
//function : Tolerance
//purpose :
{
myCheckGeometry=aFlag;
}
+
//=======================================================================
//function : CheckGeometry
//purpose :
{
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 :
{
return myImages;
}
+
//=======================================================================
//function : Origins
//purpose :
{
return myOrigins;
}
+
//=======================================================================
//function : Clear
//purpose :
myImages.Clear();
myOrigins.Clear();
}
+
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void GEOMAlgo_GluerAlgo::Perform()
{
+#if OCC_VERSION_LARGE > 0x06050200
+ if (myContext.IsNull()) {
+ myContext=new IntTools_Context;
+ }
+#endif
}
// 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
-// <pkv@irinox>
-//
+
#ifndef _GEOMAlgo_GluerAlgo_HeaderFile
#define _GEOMAlgo_GluerAlgo_HeaderFile
#include <Standard_Macro.hxx>
-#include <TopoDS_Shape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
+
+#include <TopoDS_Shape.hxx>
#include <IntTools_Context.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
+
#include <GEOMAlgo_BuilderShape.hxx>
+#include <Basics_OCCTVersion.hxx>
+
//=======================================================================
//class : GEOMAlgo_GluerAlgo
//purpose :
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;
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;
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);
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;
// 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
-// <pkv@irinox>
-//
+
#include <GEOMAlgo_ShapeAlgo.ixx>
+#include <Basics_OCCTVersion.hxx>
+
//=======================================================================
//function : GEOMAlgo_ShapeAlgo
//purpose :
//=======================================================================
GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo()
-:
- GEOMAlgo_Algo()
+ : GEOMAlgo_Algo()
{
myTolerance=0.0001;
}
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 :
// 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 <TopoDS_Shape.hxx>
-#endif
-#ifndef _Standard_Real_HeaderFile
-#include <Standard_Real.hxx>
-#endif
-#ifndef _IntTools_Context_HeaderFile
-#include <IntTools_Context.hxx>
-#endif
-#ifndef _GEOMAlgo_Algo_HeaderFile
#include <GEOMAlgo_Algo.hxx>
-#endif
-class TopoDS_Shape;
+#include <Basics_OCCTVersion.hxx>
-#ifndef _Standard_HeaderFile
#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
-#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 <TopoDS_Shape.hxx>
-Standard_EXPORT void SetTolerance(const Standard_Real aT) ;
+#include <Standard_Real.hxx>
+#if OCC_VERSION_LARGE > 0x06050200
+#include <Handle_IntTools_Context.hxx>
+#else
+#include <IntTools_Context.hxx>
+#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 <br>
+ Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ;
+ //! Returns cashed geometrical tools <br>
+ Standard_EXPORT const Handle_IntTools_Context& Context() const;
+
+ Standard_EXPORT 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#ifndef _IntTools_Context_HeaderFile
+#include <IntTools_Context.hxx>
+#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
// 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
-// <pkv@irinox>
-//
+
#include <GEOMAlgo_ShellSolid.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <Standard_Failure.hxx>
#include <gp_Pnt2d.hxx>
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) {
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;
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;
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
#include <GEOMAlgo_Tools.ixx>
+#include <GEOMAlgo_PassKeyShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <gp.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <BOPTools_Tools2D.hxx>
#include <IntTools_Context.hxx>
-#include <GEOMAlgo_PassKeyShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
-
static
void GetCount(const TopoDS_Shape& aS,
Standard_Integer& iCnt);
//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;
//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;
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;
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;
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;
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();
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;
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();
#ifndef _GEOMAlgo_Tools_HeaderFile
#define _GEOMAlgo_Tools_HeaderFile
+#include <Basics_OCCTVersion.hxx>
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
+
+#if OCC_VERSION_LARGE > 0x06050200
+#ifndef _Handle_IntTools_Context_HeaderFile
+#include <Handle_IntTools_Context.hxx>
+#endif
+#endif
+
#ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx>
#endif
class TopoDS_Face;
class Geom_Surface;
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-
-class GEOMAlgo_Tools {
+class GEOMAlgo_Tools {
public:
- 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
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
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
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
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
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
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
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
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
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
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
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
// 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 <GEOMAlgo_Tools3D.ixx>
+#include <NMTTools_ListOfCoupleOfShape.hxx>
+#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
+#include <NMTTools_CoupleOfShape.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <Precision.hxx>
#include <gp_Vec.hxx>
#include <Geom2dHatch_Intersector.hxx>
#include <Geom2dHatch_Hatcher.hxx>
+
#include <HatchGen_Domain.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
-//
+
#include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BOPTools_Tools.hxx>
-#include <NMTTools_ListOfCoupleOfShape.hxx>
-#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
-#include <NMTTools_CoupleOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
-//
+
#include <GeomAdaptor_Surface.hxx>
-//
static
Standard_Boolean FindFacePairs (const TopoDS_Edge& ,
const TopTools_ListOfShape& ,
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
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;
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;
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;
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;
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;
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;
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;
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();
// 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;
//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;
//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;
//
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;
}
//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;
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);
//
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;
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()) {
// 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 <Basics_OCCTVersion.hxx>
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
+#if OCC_VERSION_LARGE > 0x06050200
+#ifndef _Handle_IntTools_Context_HeaderFile
+#include <Handle_IntTools_Context.hxx>
+#endif
+#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
+
class TopoDS_Shape;
class IntTools_Context;
class TopoDS_Face;
class NMTTools_ListOfCoupleOfShape;
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-
//! Auxiliary tools for Algorithms <br>
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 <br>
-//! direction than theShape <br>
-//! theContext - cashed geometrical tools <br>
-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 <br>
-//! theShape is not the same as for the face <br>
-//! theSplit <br>
-//! theContext - cashed geometrical tools <br>
-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 <br>
-//! theEdge is not the same as for the edge <br>
-//! theSplit <br>
-//! theContext - cashed geometrical tools <br>
-Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theEdge,const TopoDS_Edge& theSplit,IntTools_Context& theContext) ;
-
-//! For the couple of faces theF1, theF2 <br>
-//! computes sense value <br>
-//! Returns 0 if the faces are not sensible <br>
-//! Returns 1 if the faces have same sense <br>
-//! Returns 2 if the faces have opposite sense <br>
-Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,const TopoDS_Face& theF2) ;
-
-//! Makes new face theF2 from surface and wires <br>
-//! of the face theF1 <br>
-Standard_EXPORT static void CopyFace(const TopoDS_Face& theF1,TopoDS_Face& theF2) ;
-
-//! Makes empty shape theShape of the type theType <br>
-Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,TopoDS_Shape& theShape) ;
-
-//! For the list of faces theLS build block <br>
-//! theLSCB in terms of connexity by edges <br>
-//! theMapAvoid - set of edges to avoid for <br>
-//! the treatment <br>
-Standard_EXPORT static void MakeConnexityBlock(const TopTools_ListOfShape& theLS,const TopTools_IndexedMapOfShape& theMapAvoid,TopTools_ListOfShape& theLSCB) ;
-
-//! Computes the 3-D state of the shape theShape <br>
-//! toward solid theSolid. <br>
-//! theTol - value of precision of computation <br>
-//! theContext- cahed geometrical tools <br>
-//! Returns 3-D state. <br>
-Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
-
-//! Computes the 3-D state of the point thePoint <br>
-//! toward solid theSolid. <br>
-//! theTol - value of precision of computation <br>
-//! theContext- cahed geometrical tools <br>
-//! Returns 3-D state. <br>
-Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
-
-//! Computes the 3-D state of the vertex theVertex <br>
-//! toward solid theSolid. <br>
-//! theTol - value of precision of computation <br>
-//! theContext- cahed geometrical tools <br>
-//! Returns 3-D state. <br>
-Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
-
-//! Computes the 3-D state of the edge theEdge <br>
-//! toward solid theSolid. <br>
-//! theTol - value of precision of computation <br>
-//! theContext- cahed geometrical tools <br>
-//! Returns 3-D state. <br>
-Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
-
-//! Computes the 3-D state of the face theFace <br>
-//! toward solid theSolid. <br>
-//! theTol - value of precision of computation <br>
-//! theBounds - set of edges of theFace to avoid <br>
-//! theContext- cahed geometrical tools <br>
-//! Returns 3-D state. <br>
-Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const Standard_Real theTol,const TopTools_IndexedMapOfShape& theBounds,IntTools_Context& theContext) ;
-
-//! Returns True if the face theFace is inside of the <br>
-//! couple of faces theFace1, theFace2. <br>
-//! The faces theFace, theFace1, theFace2 must <br>
-//! share the edge theEdge <br>
-Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopoDS_Face& theFace1,const TopoDS_Face& theFace2,IntTools_Context& theContext) ;
-
-//! Returns True if the face theFace is inside of the <br>
-//! appropriate couple of faces (from the set theLF) . <br>
-//! The faces of the set theLF and theFace must <br>
-//! share the edge theEdge <br>
-Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopTools_ListOfShape& theLF,IntTools_Context& theContext) ;
-
-//! Returns True if the face theFace is inside the <br>
-//! solid theSolid. <br>
-//! theMEF - Map Edge/Faces for theSolid <br>
-//! theTol - value of precision of computation <br>
-//! theContext- cahed geometrical tools <br>
-Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,const Standard_Real theTol,IntTools_Context& theContext) ;
-
-//! For the face theFace and its edge theEdge <br>
-//! finds the face suitable to produce shell. <br>
-//! theLCEF - set of faces to search. All faces <br>
-//! from theLCEF must share edge theEdge <br>
-Standard_EXPORT static void GetFaceOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,const NMTTools_ListOfCoupleOfShape& theLCEF,TopoDS_Face& theFaceOff) ;
-
-//! For the face theFace gets the edge theEdgeOnF <br>
-//! that is the same as theEdge <br>
-//! Returns True if such edge exists <br>
-//! Returns False if there is no such edge <br>
-Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOnF) ;
-
-//! Returns True if the face theFace contains <br>
-//! the edge theEdge but with opposite orientation. <br>
-//! If the method returns True theEdgeOff is the <br>
-//! edge founded <br>
-Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOff) ;
-
-//! Computes a point <theP> inside the face <theF>. <br>
-//! <theP2D> - 2D representation of <theP> <br>
-//! on the surface of <theF> <br>
-//! Returns 0 in case of success. <br>
-Standard_EXPORT static Standard_Integer PntInFace(const TopoDS_Face& theF,gp_Pnt& theP,gp_Pnt2d& theP2D) ;
+ 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 <br>
+ //! direction than theShape <br>
+ //! theContext - cashed geometrical tools <br>
+ Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Shape& theSplit,
+ const TopoDS_Shape& theShape,
+#if OCC_VERSION_LARGE > 0x06050200
+ const Handle(IntTools_Context)& theContext);
+#else
+ IntTools_Context& theContext);
+#endif
+ //! Returns True if normal direction of the face <br>
+ //! theShape is not the same as for the face <br>
+ //! theSplit <br>
+ //! theContext - cashed geometrical tools <br>
+ Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Face& theSplit,
+ const TopoDS_Face& theShape,
+#if OCC_VERSION_LARGE > 0x06050200
+ const Handle(IntTools_Context)& theContext);
+#else
+ IntTools_Context& theContext);
+#endif
+ //! Returns True if tangent direction of the edge <br>
+ //! theEdge is not the same as for the edge <br>
+ //! theSplit <br>
+ //! theContext - cashed geometrical tools <br>
+ Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Edge& theEdge,
+ const TopoDS_Edge& theSplit,
+#if OCC_VERSION_LARGE > 0x06050200
+ const Handle(IntTools_Context)& theContext);
+#else
+ IntTools_Context& theContext);
+#endif
+ //! For the couple of faces theF1, theF2 <br>
+ //! computes sense value <br>
+ //! Returns 0 if the faces are not sensible <br>
+ //! Returns 1 if the faces have same sense <br>
+ //! Returns 2 if the faces have opposite sense <br>
+ Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1, const TopoDS_Face& theF2);
+
+ //! Makes new face theF2 from surface and wires <br>
+ //! of the face theF1 <br>
+ Standard_EXPORT static void CopyFace (const TopoDS_Face& theF1, TopoDS_Face& theF2);
+
+ //! Makes empty shape theShape of the type theType <br>
+ Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
+
+ //! For the list of faces theLS build block <br>
+ //! theLSCB in terms of connexity by edges <br>
+ //! theMapAvoid - set of edges to avoid for <br>
+ //! the treatment <br>
+ Standard_EXPORT static void MakeConnexityBlock (const TopTools_ListOfShape& theLS,
+ const TopTools_IndexedMapOfShape& theMapAvoid,
+ TopTools_ListOfShape& theLSCB);
+
+ //! Computes the 3-D state of the shape theShape <br>
+ //! toward solid theSolid. <br>
+ //! theTol - value of precision of computation <br>
+ //! theContext- cahed geometrical tools <br>
+ //! Returns 3-D state. <br>
+ 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 <br>
+ //! toward solid theSolid. <br>
+ //! theTol - value of precision of computation <br>
+ //! theContext- cahed geometrical tools <br>
+ //! Returns 3-D state. <br>
+ 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 <br>
+ //! toward solid theSolid. <br>
+ //! theTol - value of precision of computation <br>
+ //! theContext- cahed geometrical tools <br>
+ //! Returns 3-D state. <br>
+ Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Vertex& theVertex,
+ const TopoDS_Solid& theSolid,
+ const Standard_Real theTol,
+#if OCC_VERSION_LARGE > 0x06050200
+ const Handle(IntTools_Context)& theContext);
+#else
+ IntTools_Context& theContext);
+#endif
+ //! Computes the 3-D state of the edge theEdge <br>
+ //! toward solid theSolid. <br>
+ //! theTol - value of precision of computation <br>
+ //! theContext- cahed geometrical tools <br>
+ //! Returns 3-D state. <br>
+ 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 <br>
+ //! toward solid theSolid. <br>
+ //! theTol - value of precision of computation <br>
+ //! theBounds - set of edges of theFace to avoid <br>
+ //! theContext- cahed geometrical tools <br>
+ //! Returns 3-D state. <br>
+ Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Face& theFace,
+ const TopoDS_Solid& theSolid,
+ const Standard_Real theTol,
+ const TopTools_IndexedMapOfShape& theBounds,
+#if OCC_VERSION_LARGE > 0x06050200
+ const Handle(IntTools_Context)& theContext);
+#else
+ IntTools_Context& theContext);
+#endif
+ //! Returns True if the face theFace is inside of the <br>
+ //! couple of faces theFace1, theFace2. <br>
+ //! The faces theFace, theFace1, theFace2 must <br>
+ //! share the edge theEdge <br>
+ Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
+ const TopoDS_Edge& theEdge,
+ const TopoDS_Face& theFace1,
+ const TopoDS_Face& theFace2,
+#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 <br>
+ //! appropriate couple of faces (from the set theLF) . <br>
+ //! The faces of the set theLF and theFace must <br>
+ //! share the edge theEdge <br>
+ 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 <br>
+ //! solid theSolid. <br>
+ //! theMEF - Map Edge/Faces for theSolid <br>
+ //! theTol - value of precision of computation <br>
+ //! theContext- cahed geometrical tools <br>
+ Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
+ const TopoDS_Solid& theSolid,
+ const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
+ const Standard_Real theTol,
+#if OCC_VERSION_LARGE > 0x06050200
+ const Handle(IntTools_Context)& theContext);
+#else
+ IntTools_Context& theContext);
+#endif
+ //! For the face theFace and its edge theEdge <br>
+ //! finds the face suitable to produce shell. <br>
+ //! theLCEF - set of faces to search. All faces <br>
+ //! from theLCEF must share edge theEdge <br>
+ Standard_EXPORT static void GetFaceOff (const TopoDS_Edge& theEdge,
+ const TopoDS_Face& theFace,
+ const NMTTools_ListOfCoupleOfShape& theLCEF,
+ TopoDS_Face& theFaceOff);
+
+ //! For the face theFace gets the edge theEdgeOnF <br>
+ //! that is the same as theEdge <br>
+ //! Returns True if such edge exists <br>
+ //! Returns False if there is no such edge <br>
+ Standard_EXPORT static Standard_Boolean GetEdgeOnFace (const TopoDS_Edge& theEdge,
+ const TopoDS_Face& theFace,
+ TopoDS_Edge& theEdgeOnF);
+
+ //! Returns True if the face theFace contains <br>
+ //! the edge theEdge but with opposite orientation. <br>
+ //! If the method returns True theEdgeOff is the <br>
+ //! edge founded <br>
+ Standard_EXPORT static Standard_Boolean GetEdgeOff (const TopoDS_Edge& theEdge,
+ const TopoDS_Face& theFace,
+ TopoDS_Edge& theEdgeOff);
+
+ //! Computes a point <theP> inside the face <theF>. <br>
+ //! <theP2D> - 2D representation of <theP> <br>
+ //! on the surface of <theF> <br>
+ //! Returns 0 in case of success. <br>
+ Standard_EXPORT static Standard_Integer PntInFace (const TopoDS_Face& theF,
+ gp_Pnt& theP,
+ gp_Pnt2d& theP2D);
- // Fields PRIVATE
- //
+protected:
+private:
};
-
-
-
-
// other Inline functions and methods (like "C++: function call" methods)
-//
-
#endif
// 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
-// <pkv@irinox>
-//
+
#include <GEOMAlgo_VertexSolid.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <gp_Pnt.hxx>
#include <TopAbs_ShapeEnum.hxx>
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();
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
-
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve2d.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
-
-
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
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()
:
}
//=======================================================================
// function: ~
-// purpose:
+// purpose:
//=======================================================================
GEOMAlgo_WireSplitter::~GEOMAlgo_WireSplitter()
{
}
//=======================================================================
// function: SetFace
-// purpose:
+// purpose:
//=======================================================================
void GEOMAlgo_WireSplitter::SetFace(const TopoDS_Face& aFace)
{
}
//=======================================================================
// function: Face
-// purpose:
+// purpose:
//=======================================================================
const TopoDS_Face& GEOMAlgo_WireSplitter::Face()const
{
}
//=======================================================================
// function: SetEdges
-// purpose:
+// purpose:
//=======================================================================
void GEOMAlgo_WireSplitter::SetEdges(const TopTools_ListOfShape& aLE)
{
}
//=======================================================================
// function: Edges
-// purpose:
+// purpose:
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_WireSplitter::Edges()const
{
}
//=======================================================================
// function: IsNothingToDo
-// purpose:
+// purpose:
//=======================================================================
Standard_Boolean GEOMAlgo_WireSplitter::IsNothingToDo()const
{
}
//=======================================================================
// function: Shapes
-// purpose:
+// purpose:
//=======================================================================
const BOPTColStd_ListOfListOfShape& GEOMAlgo_WireSplitter::Shapes()const
{
}
//=======================================================================
// function: Perform
-// purpose:
+// purpose:
//=======================================================================
void GEOMAlgo_WireSplitter::Perform()
{
Standard_Integer index, i, aNb, aCntIn, aCntOut;
Standard_Boolean anIsIn;
Standard_Real anAngle;
-
+
BOP_ListOfEdgeInfo emptyInfo;
TopTools_ListIteratorOfListOfShape anItList;
//
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) {
//
aNb=mySmartMap.Extent();
//
- // 2. myNothingToDo
+ // 2. myNothingToDo
myNothingToDo=Standard_True;
-
+
for (i=1; i<=aNb; i++) {
aCntIn=0;
aCntOut=0;
// 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);
aLEx.Append(aE);
}
}
-
+
Standard_Boolean bFlag;
bFlag=Standard_True;
aNbMapEE=aMapEE.Extent();
}
myNothingToDo=myNothingToDo && bFlag;
}
- //
+ //
//
if (myNothingToDo) {
myErrorStatus=0;
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);
}
}
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();
}
//=======================================================================
// function: Path
-// purpose:
+// purpose:
//=======================================================================
void Path (const GeomAdaptor_Surface& aGAS,
const TopoDS_Face& myFace,
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;
//
// 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);
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);
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);
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);
}
//=======================================================================
// 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;
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;
}
//=======================================================================
// function: GetNextVertex
-// purpose:
+// purpose:
//=======================================================================
void GetNextVertex(const TopoDS_Vertex& aV,
const TopoDS_Edge& aE,
}
//=======================================================================
// function: Angle2D
-// purpose:
+// purpose:
//=======================================================================
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
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);
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)) {
}
//=======================================================================
// function: Angle
-// purpose:
+// purpose:
//=======================================================================
Standard_Real Angle (const gp_Dir2d& aDir2D)
{
return anAngle;
}
-//
+
//=======================================================================
// function: NbWaysOut
-// purpose:
+// purpose:
//=======================================================================
Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& aLEInfo)
{
// 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 <NMTTools_CheckerSI.ixx>
+#include <NMTTools_DEProcessor.hxx>
+
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_IteratorCheckerSI.hxx>
#include <NMTDS_InterfPool.hxx>
-#include <NMTTools_DEProcessor.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <IntTools_Context.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
- NMTTools_CheckerSI::NMTTools_CheckerSI()
-:
- NMTTools_PaveFiller()
+NMTTools_CheckerSI::NMTTools_CheckerSI()
+ : NMTTools_PaveFiller()
{
myStopStatus=0;
}
//function : ~
//purpose :
//=======================================================================
- NMTTools_CheckerSI::~NMTTools_CheckerSI()
+NMTTools_CheckerSI::~NMTTools_CheckerSI()
{
}
//=======================================================================
//function : Clear
//purpose :
//=======================================================================
- void NMTTools_CheckerSI::Clear()
+void NMTTools_CheckerSI::Clear()
{
NMTTools_PaveFiller::Clear();
}
//function : StopStatus
//purpose :
//=======================================================================
- Standard_Integer NMTTools_CheckerSI::StopStatus()const
+Standard_Integer NMTTools_CheckerSI::StopStatus()const
{
return myStopStatus;
}
//function : Init
//purpose :
//=======================================================================
- void NMTTools_CheckerSI::Init()
+void NMTTools_CheckerSI::Init()
{
myIsDone=Standard_False;
if (myCompositeShape.IsNull()) {
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;
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 &
// 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
-// <pkv@irinox>
-//
+
#include <NMTTools_PaveFiller.ixx>
-//
-#include <BOPTColStd_Failure.hxx>
-#include <NMTDS_ShapesDataStructure.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <NMTTools_DEProcessor.hxx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_InterfPool.hxx>
+#include <BOPTColStd_Failure.hxx>
+
//=======================================================================
// function: NMTTools_PaveFiller::NMTTools_PaveFiller
// purpose:
// 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:
myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges();
//
- // 4
+ // 4.
myIP=new NMTDS_InterfPool;
+#if OCC_VERSION_LARGE > 0x06050200
+ //
+ // 5.
+ myContext=new IntTools_Context;
+#endif
}
//=======================================================================
#ifndef _NMTTools_PaveFiller_HeaderFile
#define _NMTTools_PaveFiller_HeaderFile
+#include <Basics_OCCTVersion.hxx>
+
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _BOPTools_SplitShapesPool_HeaderFile
#include <BOPTools_SplitShapesPool.hxx>
#endif
-#ifndef _IntTools_Context_HeaderFile
+
+#if OCC_VERSION_LARGE > 0x06050200
+#include <Handle_IntTools_Context.hxx>
+#else
#include <IntTools_Context.hxx>
#endif
+
#ifndef _BOPTools_SSIntersectionAttribute_HeaderFile
#include <BOPTools_SSIntersectionAttribute.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
+
class TopoDS_Shape;
class BOPTools_Pave;
class IntTools_ShrunkRange;
-class IntTools_Context;
class BOPTools_PavePool;
class NMTTools_CommonBlockPool;
class BOPTools_SplitShapesPool;
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);
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) ;
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;
NMTDS_PInterfPool myIP;
NMTTools_DataMapOfIntegerFaceInfo myFaceInfo;
-
private:
-
-
-
-
};
// other Inline functions and methods (like "C++: function call" methods)
}
//
//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
// 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
-// <pkv@irinox>
-//
+
#include <NMTTools_PaveFiller.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
Standard_Boolean Contains(const TopoDS_Face& aF,
const TopoDS_Vertex& aV);
// Contribution of Samtech www.samcef.com END
+
//=======================================================================
// function: PerformVF
// purpose:
}
// 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) {
//
#include <NMTTools_PaveFiller.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <stdio.h>
#include <Precision.hxx>
// 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;
//
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);
}
//
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);
//
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) {
//
#include <NMTTools_PaveFiller.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <TColStd_IndexedMapOfInteger.hxx>
#include <BRep_Tool.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <IntTools_Range.hxx>
#include <IntTools_EdgeFace.hxx>
+#if OCC_VERSION_LARGE <= 0x06050200
#include <IntTools_PContext.hxx>
+#endif
#include <IntTools_SequenceOfCommonPrts.hxx>
#include <IntTools_CommonPrt.hxx>
#include <IntTools_Tools.hxx>
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;
//
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);
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-
#include <Geom_TrimmedCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Curve.hxx>
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
//
// 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;
}
{
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);
}
//
//
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;
}
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);
}
}
// 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) {
}
// 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) {
//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;
continue;
}
//
+#if OCC_VERSION_LARGE > 0x06050200
+ bIsVertexOnLine=myContext->IsVertexOnLine(aV, aC, aTolR3D, aT);
+#else
bIsVertexOnLine=myContext.IsVertexOnLine(aV, aC, aTolR3D, aT);
+#endif
//
//
if (bIsVertexOnLine) {
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]);
#include <NMTTools_PaveFiller.ixx>
+#include <Basics_OCCTVersion.hxx>
+
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
#include <Bnd_Box.hxx>
#include <TopExp_Explorer.hxx>
#include <TopExp.hxx>
-//
+
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_PntOnFace.hxx>
#include <IntTools_PntOn2Faces.hxx>
}
//
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]);
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;
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;
UpdateEdge(myclass;
aE : Edge from TopoDS;
aTol : Real from Standard);
---modified by NIZNHY-PKV Thu Nov 16 10:58:14 2006t
--fields
end Tools;
// 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
-// <pkv@irinox>
-//
-#include <NMTTools_Tools.ixx>
-#include <TColStd_IndexedMapOfInteger.hxx>
+#include <NMTTools_Tools.ixx>
-#include <gp_Pnt.hxx>
-#include <gp_XYZ.hxx>
-#include <gp_Pnt2d.hxx>
+#include <Basics_OCCTVersion.hxx>
-#include <Geom_Surface.hxx>
-#include <GeomAPI_ProjectPointOnSurf.hxx>
+#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
+#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
+#include <NMTTools_CoupleOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
+#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
+#include <BRepLib.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_SSInterference.hxx>
-
#include <BOPTools_Tools2D.hxx>
+#include <BOPTools_Tools3D.hxx>
#include <BOPTools_Tools.hxx>
-#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
-#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
-#include <NMTTools_CoupleOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <Geom2d_Curve.hxx>
+
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
-#include <BOPTools_Tools2D.hxx>
-#include <BRepLib.hxx>
-#include <BOPTools_Tools3D.hxx>
-#include <TopExp_Explorer.hxx>
-//
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <TopoDS_Iterator.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomAPI_ProjectPointOnSurf.hxx>
+#include <Geom2d_Curve.hxx>
-static
+#include <TColStd_IndexedMapOfInteger.hxx>
+
+#include <gp_Pnt.hxx>
+#include <gp_XYZ.hxx>
+#include <gp_Pnt2d.hxx>
+
+static
void ProcessBlock(const Standard_Integer iV,
const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
TColStd_IndexedMapOfInteger& aProcessed,
//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;
}
//=======================================================================
// 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;
}
//
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);
/*
//=======================================================================
// 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;
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;
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);
//
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)
}
//=======================================================================
// function: FindChains
-// purpose :
+// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const BOPTools_CArray1OfSSInterference& FFs,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
}
//=======================================================================
// function: FindChains
-// purpose :
+// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const BOPTools_CArray1OfVVInterference& VVs,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
//=======================================================================
// function: FindChains
-// purpose :
+// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
}
//=======================================================================
// function: ProcessBlock
-// purpose:
+// purpose:
//=======================================================================
void ProcessBlock(const Standard_Integer iV,
const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
}
//=======================================================================
// 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;
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
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;
}
//
}
//=======================================================================
// 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);
}
//=======================================================================
// function: FindChains
-// purpose :
+// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
}
//=======================================================================
// function: ProcessBlock
-// purpose:
+// purpose:
//=======================================================================
void ProcessBlock(const TopoDS_Shape& aF,
const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
// 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 <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+#include <Basics_OCCTVersion.hxx>
+
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
+
+#if OCC_VERSION_LARGE > 0x06050200
+#include <Handle_IntTools_Context.hxx>
+#else
+class IntTools_Context;
+#endif
+
class TopTools_ListOfShape;
class TopoDS_Vertex;
class BOPTools_CArray1OfVVInterference;
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 <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#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