#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <NCollection_DataMap.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
}
}
//
- aAllocator=new NCollection_IncAllocator;
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPCol_ListOfShape aLS(aAllocator);
//
aItLS.Initialize(myArguments);
#include <BOPTools_AlgoTools.hxx>
#include <BRep_Builder.hxx>
#include <IntTools_Context.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <TopoDS_Compound.hxx>
}
}
//
- Handle(NCollection_BaseAllocator) aAllocator=new NCollection_IncAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPAlgo_PaveFiller* pPF=new BOPAlgo_PaveFiller(aAllocator);
//
#include <gp_Vec.hxx>
#include <IntTools_Context.hxx>
#include <NCollection_DataMap.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <NCollection_List.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <TColStd_MapIntegerHasher.hxx>
myErrorStatus=0;
myLoops.Clear();
//
- aAlr=new NCollection_IncAllocator();
+ aAlr=
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPAlgo_ShellSplitter aSSp(aAlr);
//
// 1. Shells Usual
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <IntTools_Context.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
void FillMap(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
BOPCol_IndexedDataMapOfShapeListOfShape& aDMSLS,
- Handle(NCollection_IncAllocator)& aAllocator);
+ Handle(NCollection_BaseAllocator)& aAllocator);
static
void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI,
BOPCol_DataMapOfIntegerListOfShape& aMBlocks,
- Handle(NCollection_IncAllocator)& aAllocator);
+ Handle(NCollection_BaseAllocator)& aAllocator);
//
typedef BOPCol_NCVector<TopoDS_Shape> BOPAlgo_VectorOfShape;
//
myErrorStatus=0;
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~scope f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_ListOfShape aLE(aAllocator);
BOPCol_MapOfShape aMDE(100, aAllocator);
mySplits.Bind(aF, aLFIm);
}// for (k=0; k<aNbBF; ++k) {
//
- aAllocator.Nullify();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~scope t
}
//=======================================================================
{
Standard_Boolean bFlag;
Standard_Integer i, j, k, aNbFFs, aNbCurves, aNbPoints, nF1, nF2, aNbS;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListIteratorOfListOfShape aItF;
BOPCol_MapOfShape aMFence;
BOPAlgo_IndexedDataMapOfSetInteger aIDMSS;
//================================================================
BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB, myContext);
//================================================================
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS(100, aAllocator);
BOPCol_DataMapOfIntegerListOfShape aMBlocks(100, aAllocator);
//
}
aMBlocks.Clear();
aDMSLS.Clear();
- aAllocator.Nullify();
}
//=======================================================================
// function: FillImagesFaces1
//=======================================================================
void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI,
BOPCol_DataMapOfIntegerListOfShape& aMBlocks,
- Handle(NCollection_IncAllocator)& aAllocator)
+ Handle(NCollection_BaseAllocator)& aAllocator)
{
Standard_Integer aNbV, aNbVS, aNbVP, aNbEC, k, i, j;
BOPCol_ListIteratorOfListOfShape aItLI;
void FillMap(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
BOPCol_IndexedDataMapOfShapeListOfShape& aDMSLS,
- Handle(NCollection_IncAllocator)& aAllocator)
+ Handle(NCollection_BaseAllocator)& aAllocator)
{
if (aDMSLS.Contains(aS1)) {
BOPCol_ListOfShape& aLS=aDMSLS.ChangeFromKey(aS1);
//
#include <Precision.hxx>
//
-#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
//
#include <Bnd_Box.hxx>
//=======================================================================
void BOPAlgo_FillIn3DParts::Perform()
{
- Handle(NCollection_IncAllocator) aAlr1;
+ Handle(NCollection_BaseAllocator) aAlr1;
BOPAlgo_Algo::UserBreak();
//
Standard_Integer aNbFP, k, nFP, iIsIN;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_BoxBndTreeSelector aSelector;
//
- aAlr1=new NCollection_IncAllocator();
+ aAlr1=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_ListOfShape aLFP(aAlr1);
BOPCol_ListOfShape aLCBF(aAlr1);
if (!bHasSolids) {
return;
}
+ //
+ Handle(NCollection_BaseAllocator) aAlr;
//
- Handle(NCollection_IncAllocator) aAlr;
+ aAlr=NCollection_BaseAllocator::CommonBaseAllocator();
//
- aAlr=new NCollection_IncAllocator();
BOPCol_DataMapOfShapeListOfShape theInParts(100, aAlr);
BOPCol_DataMapOfShapeShape theDraftSolids(100, aAlr);
//
{
Standard_Boolean bHasImage;
Standard_Integer i, k, aNbS, aNbLIF, aNbFIN, aNbVSB, aNbVFIP;
- Handle(NCollection_IncAllocator) aAlr0;
+ Handle(NCollection_BaseAllocator) aAlr0;
TopoDS_Solid aSD;
TopoDS_Iterator aIt;
BRep_Builder aBB;
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
BOPCol_ListIteratorOfListOfShape aItLS;
//
- aAlr0=new NCollection_IncAllocator();
+ aAlr0=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_MapOfShape aMFence(100, aAlr0);
BOPAlgo_VectorOfShapeBox aVSB(256, aAlr0);
TopExp_Explorer aExp;
BOPCol_ListIteratorOfListOfShape aIt;
//
- Handle(NCollection_IncAllocator) aAlr0;
- aAlr0=new NCollection_IncAllocator();
+ Handle(NCollection_BaseAllocator) aAlr0;
+ aAlr0=NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_ListOfShape aSFS(aAlr0), aLSEmpty(aAlr0);
BOPCol_MapOfShape aMFence(100, aAlr0);
aSFS.Append(aF);
}
//
- // 1.3 Build new solids
- Handle(NCollection_IncAllocator) aAlr1;
- aAlr1=new NCollection_IncAllocator();
- //
+ // 1.3 Build new solids
BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
aBS.SetSolid(aSolid);
aBS.SetShapes(aSFS);
BRep_Builder aBB;
BOPCol_ListIteratorOfListOfShape aIt, aIt1;
//
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
//-----------------------------------------------------scope f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
BOPCol_IndexedMapOfShape aMx(100, aAllocator);
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <Bnd_Box.hxx>
#include <BOPAlgo_BuilderSolid.hxx>
#include <BOPAlgo_MakerVolume.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Solid.hxx>
}
}
//
- Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator =
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPAlgo_PaveFiller* pPF = new BOPAlgo_PaveFiller(aAllocator);
//
if (!myIntersect) {
Standard_EXPORT virtual void PerformFZ();
Standard_EXPORT virtual void PerformZZ();
+
+ Standard_EXPORT virtual void PerformSZ(const TopAbs_ShapeEnum aTS);
Standard_EXPORT void TreatVerticesEE();
#include <gp_Pnt.hxx>
#include <IntTools_Context.hxx>
#include <NCollection_BaseAllocator.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
// function: PerformVV
// purpose:
//=======================================================================
- void BOPAlgo_PaveFiller::PerformVV()
+void BOPAlgo_PaveFiller::PerformVV()
{
Standard_Boolean bWithSubShape;
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, k, aNbBlocks;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2;
TopoDS_Vertex aVn;
BOPDS_ShapeInfo aSIn;
aVVs.SetIncrement(aSize);
//
//-----------------------------------------------------scope f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPCol_IndexedDataMapOfIntegerListOfInteger aMILI(100, aAllocator);
BOPCol_DataMapOfIntegerListOfInteger aMBlocks(100, aAllocator);
BOPCol_ListOfShape aLV(aAllocator);
aLV.Clear();
aMBlocks.Clear();
aMILI.Clear();
- aAllocator.Nullify();
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
#include <BOPDS_Curve.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BRep_Tool.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
-#include <gp_Pnt.hxx>
#include <IntTools_Context.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <gp_Pnt.hxx>
+#include <BOPCol_NCVector.hxx>
#include <TopAbs_State.hxx>
+#include <BOPCol_Parallel.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Solid.hxx>
-#include <TopoDS_Vertex.hxx>
+/////////////////////////////////////////////////////////////////////////
+//=======================================================================
+//class : BOPAlgo_VertexSolid
+//purpose :
+//=======================================================================
+class BOPAlgo_VertexSolid {
+ public:
+ DEFINE_STANDARD_ALLOC
+
+ BOPAlgo_VertexSolid()
+ : myIV(-1), myIZ(-1), myState(TopAbs_UNKNOWN) {
+ };
+ //
+ virtual ~BOPAlgo_VertexSolid(){
+ };
+ //
+ void SetIndices(const Standard_Integer nV,
+ const Standard_Integer nZ){
+ myIV=nV;
+ myIZ=nZ;
+ }
+ //
+ void Indices(Standard_Integer& nV,
+ Standard_Integer& nZ) const {
+ nV=myIV;
+ nZ=myIZ;
+ }
+ //
+ void SetVertex(const TopoDS_Vertex& aV) {
+ myV=aV;
+ }
+ //
+ const TopoDS_Vertex& Vertex()const {
+ return myV;
+ }
+ //
+ void SetSolid(const TopoDS_Solid& aZ) {
+ myZ=aZ;
+ }
+ //
+ const TopoDS_Solid& Solid()const {
+ return myZ;
+ }
+ //
+ void SetContext(const Handle(IntTools_Context)& aContext) {
+ myContext=aContext;
+ }
+ //
+ const Handle(IntTools_Context)& Context()const {
+ return myContext;
+ }
+ //
+ TopAbs_State State() const{
+ return myState;
+ };
+ //
+ void Perform() {
+ Standard_Real aTol;
+ gp_Pnt aPV;
+ //
+ BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(myZ);
+ //
+ aPV=BRep_Tool::Pnt(myV);
+ aTol=BRep_Tool::Tolerance(myV);
+ //
+ aSC.Perform(aPV, aTol);
+ //
+ myState=aSC.State();
+ };
+ //
+ protected:
+ Standard_Integer myIV;
+ Standard_Integer myIZ;
+ TopAbs_State myState;
+ TopoDS_Vertex myV;
+ TopoDS_Solid myZ;
+ Handle(IntTools_Context) myContext;
+};
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
+//
+typedef BOPCol_ContextFunctor
+ <BOPAlgo_VertexSolid,
+ BOPAlgo_VectorOfVertexSolid,
+ Handle(IntTools_Context),
+ IntTools_Context> BOPAlgo_VertexSolidFunctor;
+//
+typedef BOPCol_ContextCnt
+ <BOPAlgo_VertexSolidFunctor,
+ BOPAlgo_VectorOfVertexSolid,
+ Handle(IntTools_Context)> BOPAlgo_VertexSolidCnt;
+/////////////////////////////////////////////////////////////////////////
+//=======================================================================
+//class : BOPAlgo_ShapeSolid
+//purpose :
+//=======================================================================
+class BOPAlgo_ShapeSolid {
+ public:
+ DEFINE_STANDARD_ALLOC
+
+ BOPAlgo_ShapeSolid() :
+ myIE(-1),
+ myIZ(-1),
+ myHasInterf(Standard_False),
+ myDS(NULL) {
+ };
+ //
+ virtual ~BOPAlgo_ShapeSolid(){
+ };
+ //
+ void SetIndices(const Standard_Integer nE,
+ const Standard_Integer nZ){
+ myIE=nE;
+ myIZ=nZ;
+ }
+ //
+ void Indices(Standard_Integer& nE,
+ Standard_Integer& nZ) const {
+ nE=myIE;
+ nZ=myIZ;
+ }
+ //
+ void SetDS(BOPDS_DS* pDS) {
+ myDS=pDS;
+ }
+ //
+ Standard_Boolean HasInterf() const{
+ return myHasInterf;
+ };
+ //
+ virtual void Perform() {
+ Standard_Boolean bHasInterf;
+ //
+ myHasInterf=Standard_False;
+ //
+ bHasInterf=myDS->HasInterfShapeSubShapes(myIE, myIZ);
+ if (!bHasInterf) {
+ myHasInterf=myDS->HasInterfShapeSubShapes(myIZ, myIE);
+ }
+ };
+ //
+ protected:
+ Standard_Integer myIE;
+ Standard_Integer myIZ;
+ Standard_Boolean myHasInterf;
+ BOPDS_DS* myDS;
+};
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
+//
+typedef BOPCol_Functor
+ <BOPAlgo_ShapeSolid,
+ BOPAlgo_VectorOfShapeSolid> BOPAlgo_ShapeSolidFunctor;
+//
+typedef BOPCol_Cnt
+ <BOPAlgo_ShapeSolidFunctor,
+ BOPAlgo_VectorOfShapeSolid> BOPAlgo_ShapeSolidCnt;
+//
+/////////////////////////////////////////////////////////////////////////
+//=======================================================================
+//class : BOPAlgo_SolidSolid
+//purpose :
+//=======================================================================
+class BOPAlgo_SolidSolid : public BOPAlgo_ShapeSolid {
+ public:
+ DEFINE_STANDARD_ALLOC
+
+ BOPAlgo_SolidSolid() :
+ BOPAlgo_ShapeSolid() {
+ };
+ //
+ virtual ~BOPAlgo_SolidSolid(){
+ };
+ //
+ virtual void Perform() {
+ Standard_Boolean bFlag;
+ //
+ bFlag=Standard_False;
+ myHasInterf=Standard_False;
+ //
+ myHasInterf=myDS->HasInterfShapeSubShapes(myIZ, myIE, bFlag);
+ if (!myHasInterf) {
+ myHasInterf=myDS->HasInterfShapeSubShapes(myIE, myIZ, bFlag);
+ }
+ };
+};
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
+//
+typedef BOPCol_Functor
+ <BOPAlgo_SolidSolid,
+ BOPAlgo_VectorOfSolidSolid> BOPAlgo_SolidSolidFunctor;
+//
+typedef BOPCol_Cnt
+ <BOPAlgo_SolidSolidFunctor,
+ BOPAlgo_VectorOfSolidSolid> BOPAlgo_SolidSolidCnt;
+//
+/////////////////////////////////////////////////////////////////////////
//=======================================================================
//function : PerformVZ
void BOPAlgo_PaveFiller::PerformVZ()
{
Standard_Boolean bJustAdd;
- Standard_Integer iSize, nV, nZ;
- Standard_Real aTol;
- gp_Pnt aPV;
+ Standard_Integer iSize, nV, nZ, k, aNbVVS;
TopAbs_State aState;
//
myErrorStatus=0;
BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
aVZs.SetIncrement(iSize);
//
+ BOPAlgo_VectorOfVertexSolid aVVS;
+ //
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nV, nZ, bJustAdd);
if(bJustAdd) {
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aSIV.Shape());
const TopoDS_Solid& aZ=*((TopoDS_Solid*)&aSIZ.Shape());
//
- BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ);
- //
- aPV=BRep_Tool::Pnt(aV);
- aTol=BRep_Tool::Tolerance(aV);
- //
- aSC.Perform(aPV, aTol);
- //
- aState=aSC.State();
+ BOPAlgo_VertexSolid& aVertexSolid=aVVS.Append1();
+ aVertexSolid.SetIndices(nV, nZ);
+ aVertexSolid.SetVertex(aV);
+ aVertexSolid.SetSolid(aZ);
+ }
+ //
+ aNbVVS=aVVS.Extent();
+ //=============================================================
+ BOPAlgo_VertexSolidCnt::Perform(myRunParallel, aVVS, myContext);
+ //=============================================================
+ for (k=0; k < aNbVVS; ++k) {
+ const BOPAlgo_VertexSolid& aVertexSolid=aVVS(k);
+ aState=aVertexSolid.State();
if (aState==TopAbs_IN) {
+ aVertexSolid.Indices(nV, nZ);
+ //
BOPDS_InterfVZ& aVZ=aVZs.Append1();
aVZ.SetIndices(nV, nZ);
//
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::PerformEZ()
-{
- Standard_Boolean bJustAdd, bHasInterf;
- Standard_Integer iSize, nE, nZ;
- //
- myErrorStatus=0;
- //
- myIterator->Initialize(TopAbs_EDGE, TopAbs_SOLID);
- iSize=myIterator->ExpectedLength();
- if (!iSize) {
- return;
- }
- //
- BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
- aEZs.SetIncrement(iSize);
- //
- for (; myIterator->More(); myIterator->Next()) {
- myIterator->Value(nE, nZ, bJustAdd);
- if(bJustAdd) {
- continue;
- }
- //
- bHasInterf=myDS->HasInterfShapeSubShapes(nE, nZ);
- if (bHasInterf) {
- continue;
- }
- //
- bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nE);
- if (!bHasInterf) {
- continue;
- }
- //
- BOPDS_InterfEZ& aEZ=aEZs.Append1();
- aEZ.SetIndices(nE, nZ);
- //
- myDS->AddInterf(nE, nZ);
- }
+{
+ PerformSZ(TopAbs_EDGE);
}
//=======================================================================
//function : PerformFZ
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::PerformFZ()
+{
+ PerformSZ(TopAbs_FACE);
+}
+//=======================================================================
+//function : PerformZZ
+//purpose :
+//=======================================================================
+void BOPAlgo_PaveFiller::PerformZZ()
{
Standard_Boolean bJustAdd, bHasInterf;
- Standard_Integer iSize, nF, nZ;
+ Standard_Integer iSize, nZ1, nZ, k, aNbSolidSolid;
//
myErrorStatus=0;
//
- myIterator->Initialize(TopAbs_FACE, TopAbs_SOLID);
+ myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
- BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
- aFZs.SetIncrement(iSize);
+ BOPAlgo_VectorOfSolidSolid aVSolidSolid;
//
for (; myIterator->More(); myIterator->Next()) {
- myIterator->Value(nF, nZ, bJustAdd);
+ myIterator->Value(nZ1, nZ, bJustAdd);
if(bJustAdd) {
continue;
}
//
- bHasInterf=myDS->HasInterfShapeSubShapes(nF, nZ);
+ BOPAlgo_SolidSolid& aSolidSolid=aVSolidSolid.Append1();
+ aSolidSolid.SetIndices(nZ1, nZ);
+ aSolidSolid.SetDS(myDS);
+ }
+ //
+ aNbSolidSolid=aVSolidSolid.Extent();
+ //======================================================
+ BOPAlgo_SolidSolidCnt::Perform(myRunParallel, aVSolidSolid);
+ //======================================================
+ //
+ BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
+ //
+ aZZs.SetIncrement(iSize);
+ //
+ for (k=0; k < aNbSolidSolid; ++k) {
+ const BOPAlgo_SolidSolid& aSolidSolid=aVSolidSolid(k);
+ bHasInterf=aSolidSolid.HasInterf();
if (bHasInterf) {
- continue;
- }
- //
- bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nF);
- if (!bHasInterf) {
- continue;
+ aSolidSolid.Indices(nZ1, nZ);
+ //
+ BOPDS_InterfZZ& aZZ=aZZs.Append1();
+ aZZ.SetIndices(nZ1, nZ);
+ //
+ myDS->AddInterf(nZ1, nZ);
}
- //
- BOPDS_InterfFZ& aFZ=aFZs.Append1();
- aFZ.SetIndices(nF, nZ);
- //
- myDS->AddInterf(nF, nZ);
}
}
//=======================================================================
-//function : PerformZZ
+//function : PerformSZ
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::PerformZZ()
+void BOPAlgo_PaveFiller::PerformSZ(const TopAbs_ShapeEnum aTS)
{
- Standard_Boolean bJustAdd, bHasInterf, bFlag;
- Standard_Integer iSize, nZ1, nZ;
+ Standard_Boolean bJustAdd, bHasInterf;
+ Standard_Integer iSize, nS, nZ, k, aNbShapeSolid;
//
myErrorStatus=0;
//
- myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID);
+ myIterator->Initialize(aTS, TopAbs_SOLID);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
- BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
- aZZs.SetIncrement(iSize);
- //
- bFlag=Standard_False;
+ BOPAlgo_VectorOfShapeSolid aVShapeSolid;
//
for (; myIterator->More(); myIterator->Next()) {
- myIterator->Value(nZ1, nZ, bJustAdd);
+ myIterator->Value(nS, nZ, bJustAdd);
if(bJustAdd) {
continue;
}
//
- bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nZ1, bFlag);
- if (!bHasInterf) {
- bHasInterf=myDS->HasInterfShapeSubShapes(nZ1, nZ, bFlag);
- }
- if (!bHasInterf) {
- continue;
+ BOPAlgo_ShapeSolid& aShapeSolid=aVShapeSolid.Append1();
+ aShapeSolid.SetIndices(nS, nZ);
+ aShapeSolid.SetDS(myDS);
+ }
+ //
+ aNbShapeSolid=aVShapeSolid.Extent();
+ //======================================================
+ BOPAlgo_ShapeSolidCnt::Perform(myRunParallel, aVShapeSolid);
+ //======================================================
+ //
+ BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
+ BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
+ //
+ if (aTS==TopAbs_EDGE) {
+ aEZs.SetIncrement(iSize);
+ }
+ else {//if (aTS==TopAbs_FACE)
+ aFZs.SetIncrement(iSize);
+ }
+ //
+ for (k=0; k < aNbShapeSolid; ++k) {
+ const BOPAlgo_ShapeSolid& aShapeSolid=aVShapeSolid(k);
+ bHasInterf=aShapeSolid.HasInterf();
+ if (bHasInterf) {
+ aShapeSolid.Indices(nS, nZ);
+ //
+ if (aTS==TopAbs_EDGE) {
+ BOPDS_InterfEZ& aEZ=aEZs.Append1();
+ aEZ.SetIndices(nS, nZ);
+ }
+ else {//if (aTS==TopAbs_FACE)
+ BOPDS_InterfFZ& aFZ=aFZs.Append1();
+ aFZ.SetIndices(nS, nZ);
+ }
+ //
+ myDS->AddInterf(nS, nZ);
}
- //
- BOPDS_InterfZZ& aZZ=aZZs.Append1();
- aZZ.SetIndices(nZ1, nZ);
- //
- myDS->AddInterf(nZ1, nZ);
}
}
#include <IntTools_SequenceOfRanges.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <IntTools_Tools.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <Precision.hxx>
#include <TopoDS_Compound.hxx>
Standard_Real aTS11, aTS12, aTS21, aTS22, aT11, aT12, aT21, aT22;
TopAbs_ShapeEnum aType;
BOPDS_ListIteratorOfListOfPaveBlock aIt1, aIt2;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPDS_MapOfPaveBlock aMPBToUpdate;
BOPAlgo_VectorOfEdgeEdge aVEdgeEdge;
BOPDS_MapIteratorOfMapOfPaveBlock aItPB;
//
+ aAllocator=NCollection_BaseAllocator::CommonBaseAllocator();
//-----------------------------------------------------scope f
BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(100, aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
#include <BRepBndLib.hxx>
#include <gp_Pnt.hxx>
#include <IntTools_Context.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
Standard_Integer i, aNbS,aNbEEs, nF, nV, iFlag;
Standard_Real aT1, aT2;
BOPCol_ListIteratorOfListOfInteger aItLI;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
//
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPCol_ListOfInteger aLIV(aAllocator), aLIF(aAllocator);
BOPCol_MapOfInteger aMI(100, aAllocator);
BOPDS_MapOfPaveBlock aMPBF(100, aAllocator);
}
}
}
- //
- aAllocator.Nullify();
}
#include <IntTools_Range.hxx>
#include <IntTools_SequenceOfCommonPrts.hxx>
#include <IntTools_Tools.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
Standard_Integer nE, nF, aDiscretize, i, aNbCPrts, iX, nV[2];
Standard_Integer aNbEdgeFace, k;
Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2, aDeflection;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
TopAbs_ShapeEnum aType;
BOPDS_ListIteratorOfListOfPaveBlock aIt;
BOPAlgo_VectorOfEdgeFace aVEdgeFace;
BRep_Builder aBB;
//-----------------------------------------------------scope f
//
- ////aAllocator=new NCollection_IncAllocator();
-
+ aAllocator=NCollection_BaseAllocator::CommonBaseAllocator();
+ //
BOPCol_MapOfInteger aMIEFC(100, aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, aAllocator);
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <IntTools_Tools.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <Precision.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
Standard_Integer nV1, nV2;
Standard_Real aTolR3D, aT1, aT2, aTol;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
TopoDS_Edge aES;
Handle(BOPDS_PaveBlock) aPBOut;
//
//-----------------------------------------------------scope f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
BOPCol_MapOfInteger aMVOnIn(100, aAllocator), aMF(100, aAllocator),
aDMExEdges.Clear();
aMI.Clear();
aDMI.Clear();
- aAllocator.Nullify();
}
//=======================================================================
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <IntTools_Context.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Edge.hxx>
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <gp_Pnt2d.hxx>
#include <IntRes2d_IntersectionPoint.hxx>
#include <IntTools_Context.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <Precision.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
//function : ProcessDE
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::ProcessDE()
+void BOPAlgo_PaveFiller::ProcessDE()
{
Standard_Integer nF, aNb, nE, nV, nVSD, aNbPB;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
Handle(BOPDS_PaveBlock) aPBD;
BOPCol_ListIteratorOfListOfInteger aItLI;
//
// 1. Find degnerated edges
//-----------------------------------------------------scope f
//
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
BOPDS_ListOfPaveBlock aLPBOut(aAllocator);
//
aNb=myDS->NbSourceShapes();
#include <BOPTools_AlgoTools3D.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
#include <gp_Pnt.hxx>
#include <IntTools_Tools.hxx>
#include <NCollection_BaseAllocator.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <Precision.hxx>
#include <Standard_Assert.hxx>
#include <TopoDS_Edge.hxx>
BOPCol_ListIteratorOfListOfInteger aIt1, aIt2, aIt3;
BOPCol_ListIteratorOfListOfShape aIt;
BOPDS_IndexRange aR;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
//
// 1 Append Source Shapes
aNb=myArguments.Extent();
//
myLines.SetIncrement(2*aNbS);
//-----------------------------------------------------scope_1 f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_DataMapOfShapeInteger& aMSI=myMapShapeIndex;
//
}//for (j=0; j<myNbSourceShapes; ++j) {
//
aMI.Clear();
- aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
// 3 myPaveBlocksPool
// 4. myFaceInfoPool
#include <BOPDS_MapOfPassKeyBoolean.hxx>
#include <BOPDS_PassKeyBoolean.hxx>
#include <BOPDS_Tools.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <TopoDS_Shape.hxx>
Standard_Integer aNb, i, aNbR, iTi, iTj;
Standard_Integer i1, i2, aNbSD, iX, j, iR;
TopAbs_ShapeEnum aTi, aTj;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListIteratorOfListOfInteger aIt;
//
//-----------------------------------------------------scope_1 f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPDS_MapOfPassKeyBoolean aMPKXB(100, aAllocator);
BOPDS_PassKeyBoolean aPKXB;
//
aMPKXB.Clear();
aVTSR.Clear();
- aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
}
#include <BOPDS_Tools.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS.hxx>
Standard_Integer aNbS, i, aNbB;
Standard_Integer aNbSD, iX, j, iDS, jB;
TopAbs_ShapeEnum aTi, aTj;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListIteratorOfListOfInteger aIt;
//
//-----------------------------------------------------scope_1 f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_DataMapOfShapeInteger aMSI(100, aAllocator);
BOPCol_DataMapOfIntegerInteger aMII(100, aAllocator);
aMPKXB.Clear();
aMSB.Clear();
//
- aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
}
#include <BOPDS_PassKeyBoolean.hxx>
#include <BOPDS_SubIterator.hxx>
#include <BOPDS_Tools.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
// purpose:
//=======================================================================
void BOPDS_SubIterator::Value(Standard_Integer& theI1,
- Standard_Integer& theI2) const
+ Standard_Integer& theI2) const
{
Standard_Integer iT1, iT2, n1, n2;
//
void BOPDS_SubIterator::Intersect()
{
Standard_Integer i, aNbB, aNbSD, j, iDS, jB;
- Handle(NCollection_IncAllocator) aAllocator;
+ Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListIteratorOfListOfInteger aIt, aIt1, aIt2;
BOPDS_PassKeyBoolean aPKXB;
//
//-----------------------------------------------------scope_1 f
- aAllocator=new NCollection_IncAllocator();
+ aAllocator=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
BOPCol_DataMapOfShapeInteger aMSI(100, aAllocator);
BOPCol_DataMapOfIntegerInteger aMII(100, aAllocator);
//
aPKXB.SetIds(i, j);
if (aMPKXB.Add(aPKXB)) {
- myList.Append(aPKXB);
+ myList.Append(aPKXB);
}// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
}
aMPKXB.Clear();
aMSB.Clear();
//
- aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
}
#include <IntTools_FaceFace.hxx>
#include <IntTools_PntOn2Faces.hxx>
#include <NCollection_BaseAllocator.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
delete pPF;
pPF=NULL;
}
- Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator;
+ Handle(NCollection_BaseAllocator)aAL=
+ NCollection_BaseAllocator::CommonBaseAllocator();
pPF=new BOPAlgo_PaveFiller(aAL);
//
pPF->SetArguments(aLC);
aTol=BOPTest_Objects::FuzzyValue();
bRunParallel = BOPTest_Objects::RunParallel();
//
- Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator;
+ Handle(NCollection_BaseAllocator)aAL=
+ NCollection_BaseAllocator::CommonBaseAllocator();
//
//---------------------------------------------------------------
BOPAlgo_PaveFiller aPF(aAL);
#include <BOPAlgo_Section.hxx>
#include <BOPTest_Objects.hxx>
#include <NCollection_BaseAllocator.hxx>
-#include <NCollection_IncAllocator.hxx>
static Handle(NCollection_BaseAllocator)& Allocator1();
void Init() {
Handle(NCollection_BaseAllocator) pA1, pA2;
//
- pA1=new NCollection_IncAllocator;
- pA2=new NCollection_IncAllocator;
+ pA1=NCollection_BaseAllocator::CommonBaseAllocator();
+ pA2=NCollection_BaseAllocator::CommonBaseAllocator();
//
myPaveFiller=new BOPAlgo_PaveFiller(pA1);
myBuilderDefault=new BOPAlgo_Builder(pA2);
Handle(NCollection_BaseAllocator)& Allocator1()
{
static Handle(NCollection_BaseAllocator) sAL1=
- new NCollection_IncAllocator;
+ NCollection_BaseAllocator::CommonBaseAllocator();
return sAL1;
}
#include <Draw.hxx>
#include <Draw_Color.hxx>
#include <DrawTrSurf.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <OSD_Timer.hxx>
#include <TopoDS_Shape.hxx>
#include <IntTools_FClass2d.hxx>
#include <IntTools_SurfaceRangeLocalizeData.hxx>
#include <IntTools_Tools.hxx>
-#include <NCollection_IncAllocator.hxx>
#include <Precision.hxx>
#include <Standard_Type.hxx>
#include <TopAbs_State.hxx>
//=======================================================================
IntTools_Context::IntTools_Context()
:
- myAllocator(new NCollection_IncAllocator()),
+ myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
myFClass2dMap(100, myAllocator),
myProjPSMap(100, myAllocator),
myProjPCMap(100, myAllocator),
-puts "TODO OCC25921 ALL: Tcl Exception: Memory leak detected"
-puts "TODO OCC25921 ALL: TEST INCOMPLETE"
-
puts "============"
puts "OCC7287"
puts "============"
set NCycles 10
box b1 100 100 100
box b2 50 50 50
+bop b1 b2
+bopcut r
set listmem {}
for {set i 1} {${i} <= ${NCycles}} {incr i } {
bopcut r
lappend listmem [meminfo h]
- checktrend $listmem 0 100 "Memory leak detected"
+ checktrend $listmem 0 10 "Memory leak detected"
}