mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0026515: Exponential memory usage problems with BOPDS_IndexedMapOfPaveBlock and NCollection_IncAllocator
Correcting the usage of NCollection_IncAllocator Conflicts: src/BOPAlgo/BOPAlgo_BOP.cxx src/BOPAlgo/BOPAlgo_Builder.cxx src/BOPAlgo/BOPAlgo_BuilderSolid.cxx src/BOPAlgo/BOPAlgo_Builder_2.cxx src/BOPAlgo/BOPAlgo_MakerVolume.cxx src/BOPAlgo/BOPAlgo_PaveFiller.cdl src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx src/BOPAlgo/BOPAlgo_Section.cxx src/BOPDS/BOPDS_DS.cxx src/BOPDS/BOPDS_Iterator.cxx src/BOPDS/BOPDS_IteratorSI.cxx src/BOPDS/BOPDS_SubIterator.cxx src/BOPTest/BOPTest_BOPCommands.cxx src/BOPTest/BOPTest_PartitionCommands.cxx src/IntTools/IntTools_Context.cxx additional corrections Adaptation of test case bugs fclasses bug7287_1 (limit for detection of memory leak reduced due to leak reduction) Adjusting test-case bugs fclasses bug7287_1
This commit is contained in:
parent
6bf8a928bd
commit
488e5b9da0
@ -30,7 +30,6 @@
|
||||
#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>
|
||||
@ -340,7 +339,8 @@ void BOPAlgo_BOP::Perform()
|
||||
}
|
||||
}
|
||||
//
|
||||
aAllocator=new NCollection_IncAllocator;
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
BOPCol_ListOfShape aLS(aAllocator);
|
||||
//
|
||||
aItLS.Initialize(myArguments);
|
||||
|
@ -21,7 +21,6 @@
|
||||
#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>
|
||||
@ -251,7 +250,8 @@ void BOPAlgo_Builder::Perform()
|
||||
}
|
||||
}
|
||||
//
|
||||
Handle(NCollection_BaseAllocator) aAllocator=new NCollection_IncAllocator;
|
||||
Handle(NCollection_BaseAllocator) aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
//
|
||||
BOPAlgo_PaveFiller* pPF=new BOPAlgo_PaveFiller(aAllocator);
|
||||
//
|
||||
|
@ -46,7 +46,6 @@
|
||||
#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>
|
||||
@ -437,7 +436,8 @@ void BOPAlgo_BuilderSolid::PerformLoops()
|
||||
myErrorStatus=0;
|
||||
myLoops.Clear();
|
||||
//
|
||||
aAlr=new NCollection_IncAllocator();
|
||||
aAlr=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
BOPAlgo_ShellSplitter aSSp(aAlr);
|
||||
//
|
||||
// 1. Shells Usual
|
||||
|
@ -46,7 +46,6 @@
|
||||
#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>
|
||||
@ -69,11 +68,11 @@ static
|
||||
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;
|
||||
//
|
||||
@ -270,7 +269,8 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
myErrorStatus=0;
|
||||
//
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~scope f
|
||||
aAllocator=new NCollection_IncAllocator();
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
//
|
||||
BOPCol_ListOfShape aLE(aAllocator);
|
||||
BOPCol_MapOfShape aMDE(100, aAllocator);
|
||||
@ -444,7 +444,6 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
mySplits.Bind(aF, aLFIm);
|
||||
}// for (k=0; k<aNbBF; ++k) {
|
||||
//
|
||||
aAllocator.Nullify();
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~scope t
|
||||
}
|
||||
//=======================================================================
|
||||
@ -455,7 +454,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
||||
{
|
||||
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;
|
||||
@ -604,7 +603,8 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
||||
//================================================================
|
||||
BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB, myContext);
|
||||
//================================================================
|
||||
aAllocator=new NCollection_IncAllocator();
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS(100, aAllocator);
|
||||
BOPCol_DataMapOfIntegerListOfShape aMBlocks(100, aAllocator);
|
||||
//
|
||||
@ -648,7 +648,6 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
||||
}
|
||||
aMBlocks.Clear();
|
||||
aDMSLS.Clear();
|
||||
aAllocator.Nullify();
|
||||
}
|
||||
//=======================================================================
|
||||
// function: FillImagesFaces1
|
||||
@ -754,7 +753,7 @@ void BOPAlgo_Builder::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;
|
||||
@ -836,7 +835,7 @@ void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI,
|
||||
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);
|
||||
|
@ -19,7 +19,6 @@
|
||||
//
|
||||
#include <Precision.hxx>
|
||||
//
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
//
|
||||
#include <Bnd_Box.hxx>
|
||||
@ -253,7 +252,7 @@ class BOPAlgo_FillIn3DParts : public BOPAlgo_Algo {
|
||||
//=======================================================================
|
||||
void BOPAlgo_FillIn3DParts::Perform()
|
||||
{
|
||||
Handle(NCollection_IncAllocator) aAlr1;
|
||||
Handle(NCollection_BaseAllocator) aAlr1;
|
||||
BOPAlgo_Algo::UserBreak();
|
||||
//
|
||||
Standard_Integer aNbFP, k, nFP, iIsIN;
|
||||
@ -262,7 +261,8 @@ void BOPAlgo_FillIn3DParts::Perform()
|
||||
BOPCol_ListIteratorOfListOfShape aItLS;
|
||||
BOPCol_BoxBndTreeSelector aSelector;
|
||||
//
|
||||
aAlr1=new NCollection_IncAllocator();
|
||||
aAlr1=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
//
|
||||
BOPCol_ListOfShape aLFP(aAlr1);
|
||||
BOPCol_ListOfShape aLCBF(aAlr1);
|
||||
@ -518,10 +518,11 @@ void BOPAlgo_Builder::FillImagesSolids()
|
||||
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);
|
||||
//
|
||||
@ -543,7 +544,7 @@ void BOPAlgo_Builder::FillIn3DParts
|
||||
{
|
||||
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;
|
||||
@ -551,7 +552,8 @@ void BOPAlgo_Builder::FillIn3DParts
|
||||
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);
|
||||
@ -802,8 +804,8 @@ void BOPAlgo_Builder::BuildSplitSolids
|
||||
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);
|
||||
@ -869,10 +871,7 @@ void BOPAlgo_Builder::BuildSplitSolids
|
||||
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);
|
||||
@ -934,9 +933,9 @@ void BOPAlgo_Builder::FillInternalShapes()
|
||||
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);
|
||||
|
@ -12,7 +12,6 @@
|
||||
// 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>
|
||||
@ -23,7 +22,6 @@
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
|
||||
@ -73,7 +71,8 @@ void BOPAlgo_MakerVolume::Perform()
|
||||
}
|
||||
}
|
||||
//
|
||||
Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator;
|
||||
Handle(NCollection_BaseAllocator) aAllocator =
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
BOPAlgo_PaveFiller* pPF = new BOPAlgo_PaveFiller(aAllocator);
|
||||
//
|
||||
if (!myIntersect) {
|
||||
|
@ -124,6 +124,8 @@ protected:
|
||||
Standard_EXPORT virtual void PerformFZ();
|
||||
|
||||
Standard_EXPORT virtual void PerformZZ();
|
||||
|
||||
Standard_EXPORT virtual void PerformSZ(const TopAbs_ShapeEnum aTS);
|
||||
|
||||
Standard_EXPORT void TreatVerticesEE();
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
@ -42,11 +41,11 @@
|
||||
// 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;
|
||||
@ -65,7 +64,8 @@
|
||||
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);
|
||||
@ -134,5 +134,4 @@
|
||||
aLV.Clear();
|
||||
aMBlocks.Clear();
|
||||
aMILI.Clear();
|
||||
aAllocator.Nullify();
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
// 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>
|
||||
@ -25,12 +24,215 @@
|
||||
#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
|
||||
@ -39,9 +241,7 @@
|
||||
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;
|
||||
@ -55,6 +255,8 @@ void BOPAlgo_PaveFiller::PerformVZ()
|
||||
BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
|
||||
aVZs.SetIncrement(iSize);
|
||||
//
|
||||
BOPAlgo_VectorOfVertexSolid aVVS;
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nV, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
@ -67,15 +269,22 @@ void BOPAlgo_PaveFiller::PerformVZ()
|
||||
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);
|
||||
//
|
||||
@ -88,84 +297,16 @@ void BOPAlgo_PaveFiller::PerformVZ()
|
||||
//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()
|
||||
{
|
||||
Standard_Boolean bJustAdd, bHasInterf;
|
||||
Standard_Integer iSize, nF, nZ;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myIterator->Initialize(TopAbs_FACE, TopAbs_SOLID);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
|
||||
aFZs.SetIncrement(iSize);
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nF, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nF, nZ);
|
||||
if (bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nF);
|
||||
if (!bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
BOPDS_InterfFZ& aFZ=aFZs.Append1();
|
||||
aFZ.SetIndices(nF, nZ);
|
||||
//
|
||||
myDS->AddInterf(nF, nZ);
|
||||
}
|
||||
{
|
||||
PerformSZ(TopAbs_FACE);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformZZ
|
||||
@ -173,8 +314,8 @@ void BOPAlgo_PaveFiller::PerformFZ()
|
||||
//=======================================================================
|
||||
void BOPAlgo_PaveFiller::PerformZZ()
|
||||
{
|
||||
Standard_Boolean bJustAdd, bHasInterf, bFlag;
|
||||
Standard_Integer iSize, nZ1, nZ;
|
||||
Standard_Boolean bJustAdd, bHasInterf;
|
||||
Standard_Integer iSize, nZ1, nZ, k, aNbSolidSolid;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -184,10 +325,7 @@ void BOPAlgo_PaveFiller::PerformZZ()
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
|
||||
aZZs.SetIncrement(iSize);
|
||||
//
|
||||
bFlag=Standard_False;
|
||||
BOPAlgo_VectorOfSolidSolid aVSolidSolid;
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nZ1, nZ, bJustAdd);
|
||||
@ -195,17 +333,94 @@ void BOPAlgo_PaveFiller::PerformZZ()
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nZ1, bFlag);
|
||||
if (!bHasInterf) {
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ1, nZ, bFlag);
|
||||
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) {
|
||||
aSolidSolid.Indices(nZ1, nZ);
|
||||
//
|
||||
BOPDS_InterfZZ& aZZ=aZZs.Append1();
|
||||
aZZ.SetIndices(nZ1, nZ);
|
||||
//
|
||||
myDS->AddInterf(nZ1, nZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformSZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_PaveFiller::PerformSZ(const TopAbs_ShapeEnum aTS)
|
||||
{
|
||||
Standard_Boolean bJustAdd, bHasInterf;
|
||||
Standard_Integer iSize, nS, nZ, k, aNbShapeSolid;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myIterator->Initialize(aTS, TopAbs_SOLID);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPAlgo_VectorOfShapeSolid aVShapeSolid;
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nS, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
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);
|
||||
}
|
||||
if (!bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
BOPDS_InterfZZ& aZZ=aZZs.Append1();
|
||||
aZZ.SetIndices(nZ1, nZ);
|
||||
//
|
||||
myDS->AddInterf(nZ1, nZ);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,6 @@
|
||||
#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>
|
||||
@ -291,11 +290,12 @@ void BOPAlgo_PaveFiller::PerformEE()
|
||||
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);
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
@ -255,9 +254,10 @@ void BOPAlgo_PaveFiller::TreatVerticesEE()
|
||||
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);
|
||||
@ -328,6 +328,4 @@ void BOPAlgo_PaveFiller::TreatVerticesEE()
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aAllocator.Nullify();
|
||||
}
|
||||
|
@ -46,7 +46,6 @@
|
||||
#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>
|
||||
@ -156,15 +155,15 @@ void BOPAlgo_PaveFiller::PerformEF()
|
||||
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);
|
||||
|
@ -67,7 +67,6 @@
|
||||
#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>
|
||||
@ -351,13 +350,14 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
||||
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),
|
||||
@ -595,7 +595,6 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
||||
aDMExEdges.Clear();
|
||||
aMI.Clear();
|
||||
aDMI.Clear();
|
||||
aAllocator.Nullify();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -47,7 +47,6 @@
|
||||
#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>
|
||||
|
@ -15,7 +15,6 @@
|
||||
// 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>
|
||||
@ -39,7 +38,6 @@
|
||||
#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>
|
||||
@ -58,10 +56,10 @@ static
|
||||
//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;
|
||||
//
|
||||
@ -70,7 +68,8 @@ static
|
||||
// 1. Find degnerated edges
|
||||
//-----------------------------------------------------scope f
|
||||
//
|
||||
aAllocator=new NCollection_IncAllocator();
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
BOPDS_ListOfPaveBlock aLPBOut(aAllocator);
|
||||
//
|
||||
aNb=myDS->NbSourceShapes();
|
||||
|
@ -34,7 +34,6 @@
|
||||
#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>
|
||||
|
@ -41,7 +41,6 @@
|
||||
#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>
|
||||
@ -354,7 +353,7 @@ void BOPDS_DS::Init()
|
||||
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();
|
||||
@ -382,7 +381,8 @@ void BOPDS_DS::Init()
|
||||
//
|
||||
myLines.SetIncrement(2*aNbS);
|
||||
//-----------------------------------------------------scope_1 f
|
||||
aAllocator=new NCollection_IncAllocator();
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
//
|
||||
BOPCol_DataMapOfShapeInteger& aMSI=myMapShapeIndex;
|
||||
//
|
||||
@ -647,7 +647,6 @@ void BOPDS_DS::Init()
|
||||
}//for (j=0; j<myNbSourceShapes; ++j) {
|
||||
//
|
||||
aMI.Clear();
|
||||
aAllocator.Nullify();
|
||||
//-----------------------------------------------------scope_1 t
|
||||
// 3 myPaveBlocksPool
|
||||
// 4. myFaceInfoPool
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <BOPDS_MapOfPassKeyBoolean.hxx>
|
||||
#include <BOPDS_PassKeyBoolean.hxx>
|
||||
#include <BOPDS_Tools.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
@ -272,11 +271,11 @@ void BOPDS_Iterator::Intersect()
|
||||
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;
|
||||
@ -375,6 +374,5 @@ void BOPDS_Iterator::Intersect()
|
||||
//
|
||||
aMPKXB.Clear();
|
||||
aVTSR.Clear();
|
||||
aAllocator.Nullify();
|
||||
//-----------------------------------------------------scope_1 t
|
||||
}
|
||||
|
@ -28,7 +28,6 @@
|
||||
#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>
|
||||
@ -85,11 +84,12 @@ void BOPDS_IteratorSI::Intersect()
|
||||
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);
|
||||
@ -199,6 +199,5 @@ void BOPDS_IteratorSI::Intersect()
|
||||
aMPKXB.Clear();
|
||||
aMSB.Clear();
|
||||
//
|
||||
aAllocator.Nullify();
|
||||
//-----------------------------------------------------scope_1 t
|
||||
}
|
||||
|
@ -25,7 +25,6 @@
|
||||
#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>
|
||||
@ -142,7 +141,7 @@
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_SubIterator::Value(Standard_Integer& theI1,
|
||||
Standard_Integer& theI2) const
|
||||
Standard_Integer& theI2) const
|
||||
{
|
||||
Standard_Integer iT1, iT2, n1, n2;
|
||||
//
|
||||
@ -182,12 +181,13 @@
|
||||
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);
|
||||
@ -244,7 +244,7 @@
|
||||
//
|
||||
aPKXB.SetIds(i, j);
|
||||
if (aMPKXB.Add(aPKXB)) {
|
||||
myList.Append(aPKXB);
|
||||
myList.Append(aPKXB);
|
||||
}// if (aMPKXB.Add(aPKXB)) {
|
||||
}// for (; aIt.More(); aIt.Next()) {
|
||||
}
|
||||
@ -254,6 +254,5 @@
|
||||
aMPKXB.Clear();
|
||||
aMSB.Clear();
|
||||
//
|
||||
aAllocator.Nullify();
|
||||
//-----------------------------------------------------scope_1 t
|
||||
}
|
||||
|
@ -40,7 +40,6 @@
|
||||
#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>
|
||||
@ -153,7 +152,8 @@ Standard_Integer bop(Draw_Interpretor& di,
|
||||
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);
|
||||
@ -484,7 +484,8 @@ Standard_Integer bsmt (Draw_Interpretor& di,
|
||||
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);
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <BOPAlgo_Section.hxx>
|
||||
#include <BOPTest_Objects.hxx>
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
|
||||
static Handle(NCollection_BaseAllocator)& Allocator1();
|
||||
|
||||
@ -42,8 +41,8 @@ class BOPTest_Session {
|
||||
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);
|
||||
@ -279,6 +278,6 @@ Standard_Real BOPTest_Objects::FuzzyValue()
|
||||
Handle(NCollection_BaseAllocator)& Allocator1()
|
||||
{
|
||||
static Handle(NCollection_BaseAllocator) sAL1=
|
||||
new NCollection_IncAllocator;
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
return sAL1;
|
||||
}
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <Draw.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <OSD_Timer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#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>
|
||||
@ -54,7 +53,7 @@
|
||||
//=======================================================================
|
||||
IntTools_Context::IntTools_Context()
|
||||
:
|
||||
myAllocator(new NCollection_IncAllocator()),
|
||||
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
|
||||
myFClass2dMap(100, myAllocator),
|
||||
myProjPSMap(100, myAllocator),
|
||||
myProjPCMap(100, myAllocator),
|
||||
|
@ -1,6 +1,3 @@
|
||||
puts "TODO OCC25921 ALL: Tcl Exception: Memory leak detected"
|
||||
puts "TODO OCC25921 ALL: TEST INCOMPLETE"
|
||||
|
||||
puts "============"
|
||||
puts "OCC7287"
|
||||
puts "============"
|
||||
@ -18,6 +15,8 @@ set BugNumber OCC7287
|
||||
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 } {
|
||||
@ -25,5 +24,5 @@ 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"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user