1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0026567: Exception in Boolean intersection command

Correcting the usage of NCollection_IncAllocator
This commit is contained in:
pkv 2015-08-18 10:06:11 +03:00 committed by abv
parent 55b22036f8
commit 5d3ec53550
25 changed files with 455 additions and 235 deletions

View File

@ -38,7 +38,6 @@
#include <BOPAlgo_BuilderSolid.hxx>
#include <BRep_Tool.hxx>
#include <NCollection_IncAllocator.hxx>
//
#include <BOPTools_Set.hxx>
#include <BOPTools_SetMapHasher.hxx>
@ -361,7 +360,8 @@ void BOPAlgo_BOP::Perform()
}
}
//
aAllocator=new NCollection_IncAllocator;
aAllocator=
NCollection_BaseAllocator::CommonBaseAllocator();
BOPCol_ListOfShape aLS(aAllocator);
//
aItLS.Initialize(myArguments);

View File

@ -20,8 +20,6 @@
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <NCollection_IncAllocator.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
@ -267,7 +265,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);
//

View File

@ -15,30 +15,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//
#include <BOPAlgo_BuilderSolid.hxx>
#include <BOPAlgo_ShellSplitter.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeShape.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfOrientedShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <BOPTools_CoupleOfShape.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBndLib.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <BOPAlgo_BuilderSolid.ixx>
//
#include <NCollection_List.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_UBTreeFiller.hxx>
//
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
//
@ -66,6 +51,23 @@
#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <BOPAlgo_ShellSplitter.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_MapOfOrientedShape.hxx>
#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools.hxx>
#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <TopExp_Explorer.hxx>
//
static
Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
@ -441,7 +443,8 @@ void BOPAlgo_BuilderSolid::PerformLoops()
myErrorStatus=0;
myLoops.Clear();
//
aAlr=new NCollection_IncAllocator();
aAlr=
NCollection_BaseAllocator::CommonBaseAllocator();
BOPAlgo_ShellSplitter aSSp(aAlr);
//
// 1. Shells Usual

View File

@ -17,8 +17,6 @@
#include <BOPAlgo_Builder.ixx>
//
#include <NCollection_IncAllocator.hxx>
//
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
@ -68,11 +66,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;
//
@ -269,7 +267,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);
@ -443,7 +442,6 @@ void BOPAlgo_Builder::BuildSplitFaces()
mySplits.Bind(aF, aLFIm);
}// for (k=0; k<aNbBF; ++k) {
//
aAllocator.Nullify();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~scope t
}
//=======================================================================
@ -454,7 +452,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;
@ -603,7 +601,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);
//
@ -647,7 +646,6 @@ void BOPAlgo_Builder::FillSameDomainFaces()
}
aMBlocks.Clear();
aDMSLS.Clear();
aAllocator.Nullify();
}
//=======================================================================
// function: FillImagesFaces1
@ -753,7 +751,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;
@ -835,7 +833,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);

View File

@ -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);

View File

@ -14,8 +14,6 @@
#include <BOPAlgo_MakerVolume.ixx>
#include <NCollection_IncAllocator.hxx>
#include <Bnd_Box.hxx>
#include <TopoDS_Solid.hxx>
@ -81,7 +79,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) {

View File

@ -148,6 +148,10 @@ is
PerformZZ(me:out)
is virtual protected;
--Purpose: Computes Solid/Solid interferences
PerformSZ(me:out;
aTS:ShapeEnum from TopAbs)
is virtual protected;
TreatVerticesEE(me:out)
is protected;

View File

@ -17,7 +17,6 @@
#include <BOPAlgo_PaveFiller.ixx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_BaseAllocator.hxx>
#include <Bnd_Box.hxx>
@ -45,7 +44,7 @@
{
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;
@ -64,7 +63,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);
@ -133,5 +133,4 @@
aLV.Clear();
aMBlocks.Clear();
aMILI.Clear();
aAllocator.Nullify();
}

View File

@ -15,22 +15,227 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BOPAlgo_PaveFiller.ixx>
#include <gp_Pnt.hxx>
#include <TopAbs_State.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Solid.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
#include <BOPDS_Curve.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_Interf.hxx>
#include <BOPDS_IteratorSI.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BRep_Tool.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <gp_Pnt.hxx>
#include <IntTools_Context.hxx>
#include <TopAbs_State.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_IteratorSI.hxx>
#include <BOPDS_Interf.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.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 +244,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 +258,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 +272,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 +300,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 +317,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 +328,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 +336,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);
}
}

View File

@ -18,7 +18,7 @@
#include <BOPAlgo_PaveFiller.ixx>
#include <Precision.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <Bnd_Box.hxx>
@ -288,11 +288,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);

View File

@ -17,8 +17,6 @@
#include <BOPAlgo_PaveFiller.ixx>
//
#include <NCollection_IncAllocator.hxx>
//
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
#include <BRep_Tool.hxx>
@ -249,9 +247,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);
@ -322,6 +321,4 @@ void BOPAlgo_PaveFiller::TreatVerticesEE()
}
}
}
//
aAllocator.Nullify();
}

View File

@ -17,8 +17,6 @@
#include <BOPAlgo_PaveFiller.ixx>
#include <NCollection_IncAllocator.hxx>
//
#include <GeomAPI_ProjectPointOnSurf.hxx>
//
#include <Bnd_Box.hxx>
@ -152,15 +150,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);

View File

@ -18,7 +18,6 @@
#include <BOPAlgo_PaveFiller.ixx>
//
#include <Precision.hxx>
#include <NCollection_IncAllocator.hxx>
#include <Bnd_Box.hxx>
#include <Geom_Curve.hxx>
@ -364,13 +363,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),
@ -608,7 +608,6 @@ void BOPAlgo_PaveFiller::MakeBlocks()
aDMExEdges.Clear();
aMI.Clear();
aDMI.Clear();
aAllocator.Nullify();
}
//=======================================================================

View File

@ -17,9 +17,27 @@
#include <BOPAlgo_PaveFiller.ixx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
#include <BOPCol_IndexedMapOfShape.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <BRepBndLib.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <Geom2d_Curve.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
#include <BOPCol_MapOfShape.hxx>

View File

@ -19,8 +19,6 @@
#include <Precision.hxx>
#include <NCollection_IncAllocator.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Lin2d.hxx>
#include <ElCLib.hxx>
@ -62,10 +60,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;
//
@ -74,7 +72,8 @@ static
// 1. Find degnerated edges
//-----------------------------------------------------scope f
//
aAllocator=new NCollection_IncAllocator();
aAllocator=
NCollection_BaseAllocator::CommonBaseAllocator();
BOPDS_ListOfPaveBlock aLPBOut(aAllocator);
//
aNb=myDS->NbSourceShapes();

View File

@ -14,8 +14,6 @@
#include <BOPAlgo_Section.ixx>
#include <NCollection_IncAllocator.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Compound.hxx>

View File

@ -16,7 +16,6 @@
//
#include <Standard_Assert.hxx>
//
#include <NCollection_IncAllocator.hxx>
#include <NCollection_BaseAllocator.hxx>
#include <gp_Pnt.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

View File

@ -19,7 +19,6 @@
//
#include <Bnd_Box.hxx>
//
#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
//
#include <TopoDS_Shape.hxx>
@ -270,11 +269,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;
@ -373,6 +372,5 @@ void BOPDS_Iterator::Intersect()
//
aMPKXB.Clear();
aVTSR.Clear();
aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
}

View File

@ -24,7 +24,6 @@
#include <BRep_Tool.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <NCollection_IncAllocator.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPDS_IndexRange.hxx>
@ -90,11 +89,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);
@ -204,6 +204,5 @@ void BOPDS_IteratorSI::Intersect()
aMPKXB.Clear();
aMSB.Clear();
//
aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
}

View File

@ -16,7 +16,6 @@
//
#include <Bnd_Box.hxx>
//
#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
//
#include <TopoDS.hxx>
@ -141,7 +140,7 @@
// purpose:
//=======================================================================
void BOPDS_SubIterator::Value(Standard_Integer& theI1,
Standard_Integer& theI2) const
Standard_Integer& theI2) const
{
Standard_Integer iT1, iT2, n1, n2;
//
@ -181,12 +180,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);
@ -243,7 +243,7 @@
//
aPKXB.SetIds(i, j);
if (aMPKXB.Add(aPKXB)) {
myList.Append(aPKXB);
myList.Append(aPKXB);
}// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
}
@ -253,6 +253,5 @@
aMPKXB.Clear();
aMSB.Clear();
//
aAllocator.Nullify();
//-----------------------------------------------------scope_1 t
}

View File

@ -25,7 +25,6 @@
#include <Draw.hxx>
#include <NCollection_BaseAllocator.hxx>
#include <NCollection_IncAllocator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
@ -161,7 +160,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);
@ -492,7 +492,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);

View File

@ -15,7 +15,6 @@
#include <BOPTest_Objects.ixx>
#include <NCollection_BaseAllocator.hxx>
#include <NCollection_IncAllocator.hxx>
static Handle(NCollection_BaseAllocator)& Allocator1();
@ -38,8 +37,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);
@ -275,6 +274,6 @@ Standard_Real BOPTest_Objects::FuzzyValue()
Handle(NCollection_BaseAllocator)& Allocator1()
{
static Handle(NCollection_BaseAllocator) sAL1=
new NCollection_IncAllocator;
NCollection_BaseAllocator::CommonBaseAllocator();
return sAL1;
}

View File

@ -16,9 +16,6 @@
#include <stdio.h>
#include <string.h>
#include <NCollection_IncAllocator.hxx>
#include <DBRep.hxx>
#include <Draw.hxx>
#include <Draw_Color.hxx>

View File

@ -39,7 +39,7 @@
#include <Extrema_LocateExtPC.hxx>
#include <Geom2d_Curve.hxx>
#include <NCollection_IncAllocator.hxx>
#include <IntTools_SurfaceRangeLocalizeData.hxx>
@ -49,7 +49,7 @@
//=======================================================================
IntTools_Context::IntTools_Context()
:
myAllocator(new NCollection_IncAllocator()),
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
myFClass2dMap(100, myAllocator),
myProjPSMap(100, myAllocator),
myProjPCMap(100, myAllocator),

View File

@ -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"
}