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

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

View File

@ -52,7 +52,7 @@ is
WarningStatus (me)
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.

View File

@ -18,12 +18,10 @@
-- 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
@ -34,8 +32,7 @@ uses
Shape from TopoDS,
ListOfShape from TopTools,
MapOfOrientedShape from TopTools,
Context from IntTools,
PContext from IntTools
Context from IntTools
--raises
@ -49,6 +46,11 @@ is
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
@ -68,6 +70,9 @@ is
returns ListOfShape from TopTools;
---C++: return const &
Perform(me:out)
is redefined;
PerformShapesToAvoid(me:out)
---Purpose: Collect the edges/faces that
-- a) are internal
@ -90,7 +95,6 @@ is
---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;
@ -98,7 +102,6 @@ fields
myShapesToAvoid : MapOfOrientedShape from TopTools is protected;
myAreas : ListOfShape from TopTools is protected;
--
myContext : PContext from IntTools is protected;
myContext : Context from IntTools is protected;
end BuilderArea;

View File

@ -18,26 +18,30 @@
// 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
//
#include <GEOMAlgo_BuilderArea.ixx>
#include <Basics_OCCTVersion.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Shape.hxx>
#include <IntTools_Context.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea()
:
GEOMAlgo_Algo()
: GEOMAlgo_Algo()
{
#if OCC_VERSION_LARGE <= 0x06050200
myContext=NULL;
#endif
}
//=======================================================================
//function : ~
@ -50,10 +54,40 @@
//function : SetContext
//purpose :
//=======================================================================
#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 :
@ -86,7 +120,7 @@
return myLoops;
}
//=======================================================================
//function : Solids
//function : Areas
//purpose :
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const
@ -121,4 +155,3 @@
void GEOMAlgo_BuilderArea::PerformInternalShapes()
{
}

View File

@ -18,20 +18,25 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMAlgo_BuilderArea_HeaderFile
#define _GEOMAlgo_BuilderArea_HeaderFile
#include <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
@ -64,11 +69,18 @@ public:
{
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) ;
@ -82,58 +94,45 @@ Standard_EXPORT const TopTools_ListOfShape& Loops() const;
//! 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();
Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();
//! 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>
//! 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() ;
//! 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
//
};
@ -141,7 +140,6 @@ private:
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

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

View File

@ -18,14 +18,21 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_BuilderSolid.cxx
// Created:
// Author: Peter KURNEV
//
#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>
@ -73,24 +80,27 @@
#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& );
@ -98,11 +108,9 @@ static
static
Standard_Boolean IsClosedShell(const TopoDS_Shell& );
//modified by NIZNHY-PKV Tue Oct 26 13:30:39 2010f
static
Standard_Boolean RefineShell(const TopoDS_Shell& ,
TopoDS_Shell& );
//modified by NIZNHY-PKV Tue Oct 26 13:30:42 2010t
//=======================================================================
//function :
@ -128,6 +136,10 @@ static
{
myErrorStatus=0;
//
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_BuilderArea::Perform();
#endif
//
TopoDS_Compound aC;
BRep_Builder aBB;
@ -140,11 +152,12 @@ static
aBB.Add(aC, aF);
}
//
//
#if OCC_VERSION_LARGE <= 0x06050200
if (myContext==NULL) {
myErrorStatus=11;// Null Context
return;
}
#endif
//
PerformShapesToAvoid();
if (myErrorStatus) {
@ -650,7 +663,11 @@ static
aItMF.Initialize(aMF);
for (; aItMF.More(); aItMF.Next()) {
const TopoDS_Face& aF=*((TopoDS_Face*)(&aItMF.Key()));
#if OCC_VERSION_LARGE > 0x06050200
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, myContext)) {
#else
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
#endif
aMFP.Add(aF);
}
}
@ -738,7 +755,11 @@ void MakeInternalShells(const TopTools_MapOfShape& theMF,
//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);
@ -753,7 +774,11 @@ Standard_Boolean IsHole(const TopoDS_Shape& theS2,
//=======================================================================
Standard_Boolean IsInside(const TopoDS_Shape& theS1,
const TopoDS_Shape& theS2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext)
#else
IntTools_PContext& theContext)
#endif
{
TopExp_Explorer aExp;
TopAbs_State aState;
@ -769,7 +794,11 @@ Standard_Boolean IsInside(const TopoDS_Shape& theS1,
else {
TopTools_IndexedMapOfShape aBounds;
const TopoDS_Face& aF = TopoDS::Face(aExp.Current());
#if OCC_VERSION_LARGE > 0x06050200
aState=GEOMAlgo_Tools3D::ComputeState(aF, *pS2, 1.e-14, aBounds, theContext);
#else
aState=GEOMAlgo_Tools3D::ComputeState(aF, *pS2, 1.e-14, aBounds, *theContext);
#endif
}
return (aState==TopAbs_IN);
}
@ -834,14 +863,13 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
}
return bRet;
}
//modified by NIZNHY-PKV Tue Oct 26 13:30:23 2010f
//=======================================================================
//function : RefineShell
//purpose :
//=======================================================================
Standard_Boolean RefineShell (const TopoDS_Shell& aShell,
TopoDS_Shell& aShx)
{
Standard_Boolean bRet;
Standard_Integer i, aNbE, aNbF;
@ -916,7 +944,6 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
//
return bRet;
}
//modified by NIZNHY-PKV Tue Oct 26 13:30:26 2010t
//
// ErrorStatus :
// 11 - Null Context

View File

@ -18,38 +18,16 @@
// 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 <TColStd_ListOfInteger.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Iterator.hxx>
//
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
//
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
//
#include <IntTools_Context.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
//
#include <NMTDS_ShapesDataStructure.hxx>
//
#include <GEOMAlgo_Builder.hxx>
#include <Basics_OCCTVersion.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_CommonBlockPool.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
@ -57,10 +35,32 @@
#include <NMTTools_CommonBlockPool.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
//
#include <GEOMAlgo_Tools3D.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <IntTools_Context.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
static
@ -112,8 +112,11 @@ static
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
/* NMTTools_CommonBlockPool& aCBP=*/pPF->ChangeCommonBlockPool();
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext();
#endif
//
Standard_Boolean bToReverse;
Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB, aNbLB;
@ -227,7 +230,11 @@ static
//
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext();
#endif
//
aNbS=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) {

View File

@ -24,8 +24,27 @@
#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>
@ -39,6 +58,8 @@
#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>
@ -51,8 +72,13 @@
#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>
@ -67,34 +93,11 @@
#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 ,
@ -208,7 +211,11 @@ void GEOMAlgo_Builder::BuildSplitFaces()
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext();
#endif
//
Standard_Boolean bToReverse, bIsClosed, bIsDegenerated;
Standard_Integer i, aNb, aNbF, nF;
@ -420,7 +427,11 @@ void GEOMAlgo_Builder::FillSameDomainFaces()
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx=pPF->Context();
#else
IntTools_Context& aCtx=pPF->ChangeContext();
#endif
//
//
//mySameDomainShapes.Clear();
@ -707,7 +718,11 @@ void GEOMAlgo_Builder::FillInternalVertices()
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx= pPF->Context();
#else
IntTools_Context& aCtx= pPF->ChangeContext();
#endif
//
BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences();
BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences();
@ -880,10 +895,18 @@ void GEOMAlgo_Builder::FillInternalVertices()
for (; aIt.More(); aIt.Next()) {
TopoDS_Face aFx=TopoDS::Face(aIt.Value());
// update classifier
#if OCC_VERSION_LARGE > 0x06050200
IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx);
#else
IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
#endif
aClsf.Init(aFx, aTol);
//
#if OCC_VERSION_LARGE > 0x06050200
iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2);
#else
iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
#endif
if (!iFlag) {
aBB.Add(aFx, aV);
break;
@ -893,10 +916,18 @@ void GEOMAlgo_Builder::FillInternalVertices()
else {
const TopoDS_Face& aFx=TopoDS::Face(aF);
// update classifier
#if OCC_VERSION_LARGE > 0x06050200
IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx);
#else
IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
#endif
aClsf.Init(aFx, aTol);
//
#if OCC_VERSION_LARGE > 0x06050200
iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2);
#else
iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
#endif
if (!iFlag) {
TopoDS_Face aFz;
//

View File

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

View File

@ -18,14 +18,20 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Builder_4.cxx
// Created:
// Author: Peter KURNEV
//
#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>
@ -35,12 +41,6 @@
#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);
@ -51,9 +51,12 @@ static
//=======================================================================
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;
@ -106,9 +109,12 @@ static
//=======================================================================
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;
@ -299,7 +305,6 @@ static
}
}
}
}
//=======================================================================
//function : MapShapes

View File

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

View File

@ -187,6 +187,11 @@ void GEOMAlgo_FinderShapeOn::Perform()
return;
}
//
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface);
//
MakeArgument1();
@ -546,7 +551,7 @@ void GEOMAlgo_FinderShapeOn::CopySource(const TopoDS_Shape& aE,
//function : BuildTriangulation
//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;

View File

@ -80,68 +80,51 @@ public:
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT GEOMAlgo_FinderShapeOn();
Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn();
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 SetState(const GEOMAlgo_State aSF) ;
Standard_EXPORT const Handle_Geom_Surface& Surface() const;
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 void CopySource(const TopoDS_Shape& aS,TopTools_DataMapOfShapeShape& aImages,TopTools_DataMapOfShapeShape& aOriginals,TopoDS_Shape& aSC) ;
Standard_EXPORT static Standard_Boolean BuildTriangulation (const TopoDS_Shape& theShape);
Standard_EXPORT static bool BuildTriangulation (const TopoDS_Shape& theShape);
protected:
// Methods PROTECTED
//
Standard_EXPORT virtual void CheckData() ;
Standard_EXPORT void MakeArgument1() ;
Standard_EXPORT void MakeArgument2() ;
Standard_EXPORT void Find() ;
Standard_EXPORT void Find(const TopoDS_Shape& aS) ;
Standard_EXPORT void FindVertices() ;
// Fields PROTECTED
//
Handle_Geom_Surface mySurface;
TopAbs_ShapeEnum myShapeType;
GEOMAlgo_State myState;
@ -155,22 +138,9 @@ Standard_Boolean myIsAnalytic;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -25,6 +25,18 @@
#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>
@ -67,16 +79,6 @@
#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 :
@ -223,6 +225,11 @@ void GEOMAlgo_FinderShapeOn1::Perform()
return;
}
//
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
// 1
ProcessVertices();
if(myErrorStatus) {

View File

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

View File

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

View File

@ -24,6 +24,8 @@
#include <GEOMAlgo_GetInPlace.hxx>
#include <Basics_OCCTVersion.hxx>
#include <math.h>
#include <gp_Pnt.hxx>
@ -38,9 +40,10 @@
#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>
@ -50,9 +53,9 @@
#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>
@ -62,7 +65,6 @@
#include <BOPTools_Tools2D.hxx>
static
Standard_Integer PntInEdge(const TopoDS_Edge& aF,
gp_Pnt& aP);
@ -82,7 +84,6 @@ static
const Standard_Real aTol,
gp_Pnt& aP);
//=======================================================================
//function : CheckCoincidence
//purpose :
@ -149,7 +150,11 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
//
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
//
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aPPC=myContext->ProjPC(aE1);
#else
GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1);
#endif
aPPC.Perform(aP2);
aNbPoints=aPPC.NbPoints();
if (aNbPoints) {
@ -171,13 +176,21 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
else if (aType1==TopAbs_FACE) {
const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1);
//
#if OCC_VERSION_LARGE > 0x06050200
bOk=myContext->IsValidPointForFace(aP2, aF1, myTolerance);
#else
bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance);
#endif
}
//
else if (aType1==TopAbs_SOLID) {
const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1);
//
#if OCC_VERSION_LARGE > 0x06050200
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ1);
#else
BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1);
#endif
aSC.Perform(aP2, myTolerance);
aState=aSC.State();
bOk=(aState==TopAbs_IN);
@ -197,7 +210,6 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
//=======================================================================
Standard_Integer PntInEdge(const TopoDS_Edge& aE,
gp_Pnt& aP)
{
Standard_Integer iErr;
Standard_Real aT;
@ -398,4 +410,3 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
//
return iErr;
}

View File

@ -18,55 +18,56 @@
// 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 <TColStd_ListOfInteger.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <BRepBndLib.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser()
:
GEOMAlgo_Gluer()
: GEOMAlgo_Gluer()
{}
//=======================================================================
//function : ~
@ -123,6 +124,11 @@
return;
}
//
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
InnerTolerance();
if (myErrorStatus) {
return;

View File

@ -18,15 +18,23 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GlueDetector.cxx
// Created:
// Author: Peter KURNEV
// <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>
@ -49,26 +57,19 @@
#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_GluerAlgo(),
GEOMAlgo_Algo()
{}
//=======================================================================
@ -91,6 +92,11 @@ void GEOMAlgo_GlueDetector::Perform()
return;
}
//
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_GluerAlgo::Perform();
#endif
//
DetectVertices();
if (myErrorStatus) {
return;

View File

@ -18,16 +18,26 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Gluer.cxx
// Created: Sat Dec 04 12:45:53 2004
// Author: Peter KURNEV
// <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>
@ -82,18 +92,6 @@
#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);
@ -181,11 +179,17 @@ const TopTools_DataMapOfShapeShape& GEOMAlgo_Gluer::Origins()const
//=======================================================================
void GEOMAlgo_Gluer::Perform()
{
const Standard_Integer aNb=8;
Standard_Integer i;
//
myErrorStatus=0;
myWarningStatus=0;
//
Standard_Integer i;
const Standard_Integer aNb=8;
#if OCC_VERSION_LARGE > 0x06050200
// Initialize the context
GEOMAlgo_ShapeAlgo::Perform();
#endif
//
void (GEOMAlgo_Gluer::* pF[aNb])()={
&GEOMAlgo_Gluer::CheckData, &GEOMAlgo_Gluer::InnerTolerance,
&GEOMAlgo_Gluer::MakeVertices, &GEOMAlgo_Gluer::MakeEdges,
@ -1031,7 +1035,11 @@ Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
aC3D=BRep_Tool::Curve(aE, aT1, aT2);
aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
aC3D->D0(aT, aP);
#if OCC_VERSION_LARGE > 0x06050200
myContext->ProjectPointOnEdge(aP, aER, aTR);
#else
myContext.ProjectPointOnEdge(aP, aER, aTR);
#endif
//
BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
if (aF.Orientation()==TopAbs_REVERSED) {

View File

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

View File

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

View File

@ -18,24 +18,26 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_GluerAlgo.hxx
// Created:
// Author: Peter KURNEV
// <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 :
@ -73,8 +75,12 @@ public:
Standard_EXPORT
virtual void Clear() ;
Standard_EXPORT
IntTools_Context& Context() ;
#if OCC_VERSION_LARGE > 0x06050200
Standard_EXPORT void SetContext(const Handle(IntTools_Context)&);
Standard_EXPORT const Handle(IntTools_Context)& Context();
#else
Standard_EXPORT IntTools_Context& Context();
#endif
Standard_EXPORT
const TopTools_DataMapOfShapeListOfShape& Images() const;
@ -86,7 +92,11 @@ protected:
TopoDS_Shape myArgument;
Standard_Real myTolerance;
Standard_Boolean myCheckGeometry;
#if OCC_VERSION_LARGE > 0x06050200
Handle(IntTools_Context) myContext;
#else
IntTools_Context myContext;
#endif
TopTools_DataMapOfShapeListOfShape myImages;
TopTools_DataMapOfShapeShape myOrigins;

View File

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

View File

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

View File

@ -18,34 +18,30 @@
// 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 <GEOMAlgo_Algo.hxx>
#include <Basics_OCCTVersion.hxx>
#include <Standard.hxx>
#include <Standard_Macro.hxx>
#include <TopoDS_Shape.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _IntTools_Context_HeaderFile
#if OCC_VERSION_LARGE > 0x06050200
#include <Handle_IntTools_Context.hxx>
#else
#include <IntTools_Context.hxx>
#endif
#ifndef _GEOMAlgo_Algo_HeaderFile
#include <GEOMAlgo_Algo.hxx>
#endif
class IntTools_Context;
class TopoDS_Shape;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_ShapeAlgo : public GEOMAlgo_Algo {
public:
@ -62,64 +58,46 @@ public:
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
#if OCC_VERSION_LARGE > 0x06050200
//! Sets cashed geometrical tools <br>
Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext) ;
//! Returns cashed geometrical tools <br>
Standard_EXPORT const Handle_IntTools_Context& Context() const;
Standard_EXPORT virtual void Perform() ;
#endif
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;
#if OCC_VERSION_LARGE > 0x06050200
Handle_IntTools_Context myContext;
#else
IntTools_Context myContext;
#endif
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -20,6 +20,9 @@
// 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

View File

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

View File

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

View File

@ -25,6 +25,11 @@
#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>
@ -60,9 +65,6 @@
#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);
@ -117,7 +119,11 @@ void GetCount(const TopoDS_Shape& aS,
//=======================================================================
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;
@ -180,7 +186,11 @@ void GetCount(const TopoDS_Shape& aS,
Standard_Integer GEOMAlgo_Tools::FindSDShapes (const TopTools_ListOfShape& aLE,
const Standard_Real aTol,
TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx)
#endif
{
Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr;
TopTools_ListOfShape aLESD;
@ -253,7 +263,11 @@ Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
const TopTools_ListOfShape& aLE,
const Standard_Real aTol,
TopTools_ListOfShape& aLESD,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx)
#endif
{
Standard_Boolean bIsDone;
Standard_Real aTol2, aD2;
@ -291,7 +305,11 @@ Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
const TopoDS_Shape& aS,
gp_Pnt& aP2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx)
#endif
{
Standard_Boolean bIsDone = Standard_False;
Standard_Real aT2;
@ -313,7 +331,11 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
if (aC3D.IsNull()) {
return Standard_True;
}
#if OCC_VERSION_LARGE > 0x06050200
bIsDone = aCtx->ProjectPointOnEdge(aP1, aE2, aT2);
#else
bIsDone = aCtx.ProjectPointOnEdge(aP1, aE2, aT2);
#endif
}
if (!bIsDone) {
return bIsDone;
@ -326,7 +348,11 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
case TopAbs_FACE:
{
const TopoDS_Face& aF2 = TopoDS::Face(aS);
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aProj = aCtx->ProjPS(aF2);
#else
GeomAPI_ProjectPointOnSurf& aProj = aCtx.ProjPS(aF2);
#endif
//
aProj.Perform(aP1);
bIsDone = aProj.IsDone();
@ -488,7 +514,11 @@ Standard_Integer
GEOMAlgo_Tools::BuildPCurveForEdgeOnFace(const TopoDS_Edge& aEold,
const TopoDS_Edge& aEnew,
const TopoDS_Face& aF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx)
#else
IntTools_Context& aCtx)
#endif
{
Standard_Boolean bIsClosed, bUClosed, bHasOld;
Standard_Integer iRet, aNbPoints;
@ -553,7 +583,11 @@ Standard_Integer
aS=BRep_Tool::Surface(aF);
aS->D0(aUS1, aVS1, aP);
//
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aProjPC=aCtx->ProjPC(aEnew);
#else
GeomAPI_ProjectPointOnCurve& aProjPC=aCtx.ProjPC(aEnew);
#endif
//
aProjPC.Perform(aP);
aNbPoints=aProjPC.NbPoints();

View File

@ -22,6 +22,15 @@
#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
@ -31,6 +40,13 @@
#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
@ -45,13 +61,6 @@ class TopoDS_Edge;
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 {
@ -70,18 +79,43 @@ public:
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 RefineSDShapes (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD,
const Standard_Real aTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Integer FindSDShapes(const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_IndexedDataMapOfShapeListOfShape& aMEE,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Integer FindSDShapes (const TopTools_ListOfShape& aLE,
const Standard_Real aTol,
TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Integer FindSDShapes(const TopoDS_Shape& aE1,const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_ListOfShape& aLESD,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Integer FindSDShapes (const TopoDS_Shape& aE1,
const TopTools_ListOfShape& aLE,
const Standard_Real aTol,
TopTools_ListOfShape& aLESD,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static Standard_Boolean ProjectPointOnShape(const gp_Pnt& aP1,const TopoDS_Shape& aS,gp_Pnt& aP2,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Boolean ProjectPointOnShape (const gp_Pnt& aP1,
const TopoDS_Shape& aS,
gp_Pnt& aP2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
Standard_EXPORT static void PointOnShape(const TopoDS_Shape& aS,gp_Pnt& aP3D);
@ -99,37 +133,21 @@ public:
Standard_EXPORT static Standard_Boolean CorrectWires(const TopoDS_Shape& aS);
Standard_EXPORT static Standard_Integer BuildPCurveForEdgeOnFace(const TopoDS_Edge& aE,const TopoDS_Edge& aEold,const TopoDS_Face& aF,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_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
//
};
// other Inline functions and methods (like "C++: function call" methods)
#endif

View File

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

View File

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

View File

@ -18,14 +18,27 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMAlgo_Tools3D_HeaderFile
#define _GEOMAlgo_Tools3D_HeaderFile
#include <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
@ -38,6 +51,7 @@
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class TopoDS_Shape;
class IntTools_Context;
class TopoDS_Face;
@ -52,13 +66,6 @@ class TopTools_IndexedDataMapOfShapeListOfShape;
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 {
@ -76,25 +83,41 @@ public:
{
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) ;
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,IntTools_Context& theContext) ;
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Face& theSplit,
const TopoDS_Face& theShape,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if tangent direction of the edge <br>
//! 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) ;
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>
@ -114,35 +137,65 @@ Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,TopoDS
//! 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) ;
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) ;
Standard_EXPORT static TopAbs_State ComputeStateByOnePoint (const TopoDS_Shape& theShape,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the point thePoint <br>
//! 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) ;
Standard_EXPORT static TopAbs_State ComputeState (const gp_Pnt& thePoint,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the vertex theVertex <br>
//! 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) ;
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,IntTools_Context& theContext) ;
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Edge& theEdge,
const TopoDS_Solid& theSolid,
const Standard_Real theTol,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Computes the 3-D state of the face theFace <br>
//! toward solid theSolid. <br>
@ -150,82 +203,97 @@ Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,con
//! 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) ;
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,IntTools_Context& theContext) ;
Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if the face theFace is inside of the <br>
//! 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) ;
Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
const TopTools_ListOfShape& theLF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& theContext);
#else
IntTools_Context& theContext);
#endif
//! Returns True if the face theFace is inside the <br>
//! 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) ;
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) ;
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) ;
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) ;
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) ;
Standard_EXPORT static Standard_Integer PntInFace (const TopoDS_Face& theF,
gp_Pnt& theP,
gp_Pnt2d& theP2D);
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

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

View File

@ -43,7 +43,6 @@
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve2d.hxx>
@ -51,8 +50,6 @@
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
@ -445,7 +442,6 @@ static
TColgp_SequenceOfPnt2d& aCoordVa,
BOPTColStd_ListOfListOfShape& myShapes,
BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap)
{
Standard_Integer i,j, aNb, aNbj;
Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle;
@ -851,7 +847,7 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
return anAngle;
}
//
//=======================================================================
// function: NbWaysOut
// purpose:

View File

@ -15,26 +15,29 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_CheckerSI.cxx
// Created: Mon Feb 19 11:32:08 2007
// Author: Peter KURNEV
//
#include <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_PaveFiller()
{
myStopStatus=0;
}
@ -83,12 +86,18 @@
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

View File

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

View File

@ -18,21 +18,23 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_PaveFiller.cxx
// Created: Fri Dec 5 14:58:54 2003
// Author: Peter KURNEV
// <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:
@ -126,10 +128,16 @@
// function: Context
// purpose:
//=======================================================================
#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:
@ -138,6 +146,8 @@
{
return myContext;
}
#endif
//=======================================================================
// function: PavePool
// purpose:
@ -221,8 +231,13 @@
myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges();
//
// 4
// 4.
myIP=new NMTDS_InterfPool;
#if OCC_VERSION_LARGE > 0x06050200
//
// 5.
myContext=new IntTools_Context;
#endif
}
//=======================================================================

View File

@ -22,6 +22,8 @@
#ifndef _NMTTools_PaveFiller_HeaderFile
#define _NMTTools_PaveFiller_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
@ -47,9 +49,13 @@
#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
@ -77,10 +83,10 @@
#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;
@ -105,7 +111,6 @@ class TopTools_DataMapOfShapeShape;
class TColStd_MapOfInteger;
class NMTTools_PaveFiller {
public:
@ -140,9 +145,12 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller();
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;
@ -242,13 +250,8 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller();
Standard_EXPORT void PutClosingPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ;
protected:
Standard_EXPORT virtual void Init() ;
Standard_EXPORT virtual void Clear() ;
@ -330,7 +333,11 @@ BOPTools_PavePool myPavePool;
BOPTools_PavePool myPavePoolNew;
NMTTools_CommonBlockPool myCommonBlockPool;
BOPTools_SplitShapesPool mySplitShapesPool;
#if OCC_VERSION_LARGE > 0x06050200
Handle_IntTools_Context myContext;
#else
IntTools_Context myContext;
#endif
BOPTools_SSIntersectionAttribute mySectionAttribute;
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
TColStd_DataMapOfIntegerInteger myVSD;
@ -339,13 +346,8 @@ TopoDS_Shape myCompositeShape;
NMTDS_PInterfPool myIP;
NMTTools_DataMapOfIntegerFaceInfo myFaceInfo;
private:
};
// other Inline functions and methods (like "C++: function call" methods)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,6 +24,8 @@
#include <NMTTools_PaveFiller.ixx>
#include <Basics_OCCTVersion.hxx>
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
#include <Bnd_Box.hxx>
@ -57,7 +59,7 @@
#include <TopExp_Explorer.hxx>
#include <TopExp.hxx>
//
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_PntOnFace.hxx>
#include <IntTools_PntOn2Faces.hxx>
@ -293,7 +295,11 @@ void NMTTools_PaveFiller::UpdateCommonBlocks(const Standard_Integer)
}
//
const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx));
#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]);

View File

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

View File

@ -18,61 +18,58 @@
// 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 <Basics_OCCTVersion.hxx>
#include <gp_Pnt.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt2d.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>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <gp_Pnt.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt2d.hxx>
static
void ProcessBlock(const Standard_Integer iV,
@ -117,7 +114,6 @@ static
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;
@ -215,7 +211,11 @@ static
//=======================================================================
Standard_Boolean NMTTools_Tools::IsSplitInOnFace(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aContext)
#else
IntTools_Context& aContext)
#endif
{
Standard_Boolean bFlag;
Standard_Real aT, aTolE, aTolF, aTol, aDist, aU, aV;
@ -226,7 +226,11 @@ static
aTolF=BRep_Tool::Tolerance(aF);
aTol=aTolE+aTolF;
//
#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnSurf& aProjector=aContext->ProjPS(aF);
#else
GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF);
#endif
//
aT=BOPTools_Tools2D::IntermediatePoint(aE);
BOPTools_Tools::PointOnEdge(aE, aT, aP);
@ -245,7 +249,11 @@ static
//
aProjector.LowerDistanceParameters(aU, aV);
aP2D.SetCoord(aU, aV);
#if OCC_VERSION_LARGE > 0x06050200
bFlag=aContext->IsPointInOnFace (aF, aP2D);
#else
bFlag=aContext.IsPointInOnFace (aF, aP2D);
#endif
return bFlag;
}
//=======================================================================
@ -441,7 +449,11 @@ void ProcessBlock(const Standard_Integer iV,
//=======================================================================
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
@ -508,7 +520,11 @@ void ProcessBlock(const Standard_Integer iV,
for (; aIt.More(); aIt.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(aIt.Key());
BOPTools_Tools3D::PointNearEdge(aE, aF1, aP2D, aP);
#if OCC_VERSION_LARGE > 0x06050200
bFlag=aCtx->IsValidPointForFace(aP, aF2, aTol);
#else
bFlag=aCtx.IsValidPointForFace(aP, aF2, aTol);
#endif
break;
}
//

View File

@ -18,11 +18,19 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _NMTTools_Tools_HeaderFile
#define _NMTTools_Tools_HeaderFile
#ifndef _Standard_HeaderFile
#include <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
@ -32,6 +40,13 @@
#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;
@ -39,22 +54,11 @@ class BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger;
class BOPTools_CArray1OfSSInterference;
class TopoDS_Edge;
class TopoDS_Face;
class IntTools_Context;
class NMTTools_ListOfCoupleOfShape;
class NMTTools_IndexedDataMapOfShapeIndexedMapOfShape;
class Geom2d_Curve;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTTools_Tools {
public:
void* operator new(size_t,void* anAddress)
@ -69,71 +73,46 @@ public:
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT static void MakeNewVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewVertex) ;
Standard_EXPORT static void 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,
#if OCC_VERSION_LARGE > 0x06050200
const Handle(IntTools_Context)& aCtx);
#else
IntTools_Context& aCtx);
#endif
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 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
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif