mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0024098: Exception Standard_OutOfMemory raised during topological operation.
This commit is contained in:
parent
fa13a85d92
commit
72e88cf7a8
@ -106,13 +106,13 @@ static
|
|||||||
TopoDS_Face aFP;
|
TopoDS_Face aFP;
|
||||||
BOPCol_ListIteratorOfListOfShape aItS, aItFP, aItEx;
|
BOPCol_ListIteratorOfListOfShape aItS, aItFP, aItEx;
|
||||||
//
|
//
|
||||||
BOPCol_ListOfShape aLIF(theAllocator);
|
//BOPCol_ListOfShape aLIF(theAllocator);
|
||||||
BOPCol_MapOfShape aMFDone(100, theAllocator);
|
//BOPCol_MapOfShape aMFDone(100, theAllocator);
|
||||||
|
//BOPCol_IndexedMapOfShape aMFIN(100, theAllocator);
|
||||||
|
//BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, theAllocator);
|
||||||
|
//BOPCol_IndexedMapOfShape aMS(100, theAllocator);
|
||||||
BOPCol_IndexedMapOfShape aMSolids(100, theAllocator);
|
BOPCol_IndexedMapOfShape aMSolids(100, theAllocator);
|
||||||
BOPCol_IndexedMapOfShape aMFaces(100, theAllocator);
|
BOPCol_IndexedMapOfShape aMFaces(100, theAllocator);
|
||||||
BOPCol_IndexedMapOfShape aMFIN(100, theAllocator);
|
|
||||||
BOPCol_IndexedMapOfShape aMS(100, theAllocator);
|
|
||||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, theAllocator);
|
|
||||||
//
|
//
|
||||||
theDraftSolids.Clear();
|
theDraftSolids.Clear();
|
||||||
//
|
//
|
||||||
@ -153,12 +153,21 @@ static
|
|||||||
aNbSolids=aMSolids.Extent();
|
aNbSolids=aMSolids.Extent();
|
||||||
//
|
//
|
||||||
for (i=1; i<=aNbSolids; ++i) {
|
for (i=1; i<=aNbSolids; ++i) {
|
||||||
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aMSolids(i)));
|
Handle(NCollection_IncAllocator) aAllocator1;
|
||||||
|
aAllocator1=new NCollection_IncAllocator();
|
||||||
|
//
|
||||||
|
BOPCol_MapOfShape aMFDone(100, aAllocator1);
|
||||||
|
BOPCol_IndexedMapOfShape aMFIN(100, aAllocator1);
|
||||||
|
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAllocator1);
|
||||||
|
BOPCol_ListOfShape aLIF(aAllocator1);
|
||||||
|
BOPCol_IndexedMapOfShape aMS(100, aAllocator1);
|
||||||
//
|
//
|
||||||
aMFDone.Clear();
|
aMFDone.Clear();
|
||||||
aMFIN.Clear();
|
aMFIN.Clear();
|
||||||
aMEF.Clear();
|
aMEF.Clear();
|
||||||
//
|
//
|
||||||
|
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aMSolids(i)));
|
||||||
|
//
|
||||||
aBB.MakeSolid(aSolidSp);
|
aBB.MakeSolid(aSolidSp);
|
||||||
//
|
//
|
||||||
// Draft solid and its pure internal faces => aSolidSp, aLIF
|
// Draft solid and its pure internal faces => aSolidSp, aLIF
|
||||||
@ -194,12 +203,12 @@ static
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
// 2 all faces that are not from aSolid [ aLFP1 ]
|
// 2 all faces that are not from aSolid [ aLFP1 ]
|
||||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEFP(100, theAllocator);
|
BOPCol_IndexedDataMapOfShapeListOfShape aMEFP(100, aAllocator1);
|
||||||
BOPCol_ListOfShape aLFP1(theAllocator);
|
BOPCol_ListOfShape aLFP1(aAllocator1);
|
||||||
BOPCol_ListOfShape aLFP(theAllocator);
|
BOPCol_ListOfShape aLFP(aAllocator1);
|
||||||
BOPCol_ListOfShape aLCBF(theAllocator);
|
BOPCol_ListOfShape aLCBF(aAllocator1);
|
||||||
BOPCol_ListOfShape aLFIN(theAllocator);
|
BOPCol_ListOfShape aLFIN(aAllocator1);
|
||||||
BOPCol_ListOfShape aLEx(theAllocator);
|
BOPCol_ListOfShape aLEx(aAllocator1);
|
||||||
//
|
//
|
||||||
// for all non-solid faces build EF map [ aMEFP ]
|
// for all non-solid faces build EF map [ aMEFP ]
|
||||||
for (j=1; j<=aNbFaces; ++j) {
|
for (j=1; j<=aNbFaces; ++j) {
|
||||||
@ -278,7 +287,14 @@ static
|
|||||||
// Connexity Block that spreads from aFP the Bound
|
// Connexity Block that spreads from aFP the Bound
|
||||||
// or till the end of the block itself
|
// or till the end of the block itself
|
||||||
aLCBF.Clear();
|
aLCBF.Clear();
|
||||||
BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aMS, aLCBF, theAllocator);
|
{
|
||||||
|
Handle(NCollection_IncAllocator) aAllocator;
|
||||||
|
aAllocator=new NCollection_IncAllocator();
|
||||||
|
//
|
||||||
|
BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aMS, aLCBF, aAllocator);
|
||||||
|
//
|
||||||
|
}
|
||||||
|
//
|
||||||
//
|
//
|
||||||
// fill states for the Connexity Block
|
// fill states for the Connexity Block
|
||||||
aItS.Initialize(aLCBF);
|
aItS.Initialize(aLCBF);
|
||||||
@ -316,7 +332,7 @@ static
|
|||||||
if (aNbFIN || bHasImage) {
|
if (aNbFIN || bHasImage) {
|
||||||
theDraftSolids.Bind(aSolid, aSolidSp);
|
theDraftSolids.Bind(aSolid, aSolidSp);
|
||||||
}
|
}
|
||||||
}// for (; aItMS.More(); aItMS.Next()) {
|
}//for (i=1; i<=aNbSolids; ++i) {
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BuildDraftSolid
|
//function : BuildDraftSolid
|
||||||
|
@ -358,6 +358,9 @@ static
|
|||||||
aIt.Initialize(myArguments);
|
aIt.Initialize(myArguments);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
const TopoDS_Shape& aS=aIt.Value();
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
if (aMSI.IsBound(aS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
aI=Append(aS);
|
aI=Append(aS);
|
||||||
aMSI.Bind(aS, aI);
|
aMSI.Bind(aS, aI);
|
||||||
//
|
//
|
||||||
@ -369,8 +372,6 @@ static
|
|||||||
i1=i2+1;
|
i1=i2+1;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//aMSI.Clear();
|
|
||||||
//
|
|
||||||
myNbSourceShapes=NbShapes();
|
myNbSourceShapes=NbShapes();
|
||||||
//
|
//
|
||||||
// 2 Bounding Boxes
|
// 2 Bounding Boxes
|
||||||
|
@ -205,7 +205,7 @@
|
|||||||
void BOPDS_Iterator::Intersect()
|
void BOPDS_Iterator::Intersect()
|
||||||
{
|
{
|
||||||
Standard_Boolean bFlag;
|
Standard_Boolean bFlag;
|
||||||
Standard_Integer aNb, i, aNbB, aNbR;
|
Standard_Integer aNb, i, aNbB, aNbR, iTi, iTj;
|
||||||
Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR;
|
Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR;
|
||||||
TopAbs_ShapeEnum aTi, aTj;
|
TopAbs_ShapeEnum aTi, aTj;
|
||||||
Handle(NCollection_IncAllocator) aAllocator;
|
Handle(NCollection_IncAllocator) aAllocator;
|
||||||
@ -283,6 +283,21 @@
|
|||||||
continue;// same range
|
continue;// same range
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
const BOPDS_ShapeInfo& aSIj=myDS->ShapeInfo(j);
|
||||||
|
aTj=aSIj.ShapeType();
|
||||||
|
iTi=BOPDS_Tools::TypeToInteger(aTi);
|
||||||
|
iTj=BOPDS_Tools::TypeToInteger(aTj);
|
||||||
|
bFlag=Standard_False;
|
||||||
|
if (iTi<iTj) {
|
||||||
|
bFlag=aSI.HasSubShape(j);
|
||||||
|
}
|
||||||
|
else if (iTj<iTi) {
|
||||||
|
bFlag=aSIj.HasSubShape(i);
|
||||||
|
}
|
||||||
|
if (bFlag) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
aPKXB.SetIds(i, j);
|
aPKXB.SetIds(i, j);
|
||||||
if (aMPKXB.Add(aPKXB)) {
|
if (aMPKXB.Add(aPKXB)) {
|
||||||
bFlag=Standard_False;// Bounding boxes are intersected
|
bFlag=Standard_False;// Bounding boxes are intersected
|
||||||
@ -291,7 +306,6 @@
|
|||||||
bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
|
bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aTj=myDS->ShapeInfo(j).ShapeType();
|
|
||||||
iX=BOPDS_Tools::TypeToInteger(aTi, aTj);
|
iX=BOPDS_Tools::TypeToInteger(aTi, aTj);
|
||||||
aPKXB.SetFlag(bFlag);
|
aPKXB.SetFlag(bFlag);
|
||||||
myLists(iX).Append(aPKXB);
|
myLists(iX).Append(aPKXB);
|
||||||
|
@ -40,6 +40,14 @@ is
|
|||||||
-- of shape <theT1>,<theT2>
|
-- of shape <theT1>,<theT2>
|
||||||
--- to the one integer value, that is returned
|
--- to the one integer value, that is returned
|
||||||
|
|
||||||
|
TypeToInteger(myclass;
|
||||||
|
theT: ShapeEnum from TopAbs)
|
||||||
|
returns Integer from Standard;
|
||||||
|
---C++: inline
|
||||||
|
---Purpose:
|
||||||
|
--- Converts the type of shape <theT>,
|
||||||
|
--- to integer value, that is returned
|
||||||
|
|
||||||
HasBRep(myclass;
|
HasBRep(myclass;
|
||||||
theT: ShapeEnum from TopAbs)
|
theT: ShapeEnum from TopAbs)
|
||||||
returns Boolean from Standard;
|
returns Boolean from Standard;
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
Standard_Integer iRet, iT1, iT2, iX;
|
Standard_Integer iRet, iT1, iT2, iX;
|
||||||
//
|
//
|
||||||
iRet=-1;
|
iRet=-1;
|
||||||
iT1=(Standard_Integer)aType1;
|
iT1=BOPDS_Tools::TypeToInteger(aType1);
|
||||||
iT2=(Standard_Integer)aType2;
|
iT2=BOPDS_Tools::TypeToInteger(aType2);
|
||||||
//
|
//
|
||||||
iX=iT2*10+iT1;
|
iX=iT2*10+iT1;
|
||||||
switch (iX) {
|
switch (iX) {
|
||||||
@ -64,3 +64,45 @@
|
|||||||
}
|
}
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : TypeToInteger
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
inline Standard_Integer BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1)
|
||||||
|
{
|
||||||
|
Standard_Integer iRet=9;
|
||||||
|
//
|
||||||
|
switch(aType1) {
|
||||||
|
case TopAbs_COMPOUND:
|
||||||
|
iRet=0;
|
||||||
|
break;
|
||||||
|
case TopAbs_COMPSOLID:
|
||||||
|
iRet=1;
|
||||||
|
break;
|
||||||
|
case TopAbs_SOLID:
|
||||||
|
iRet=2;
|
||||||
|
break;
|
||||||
|
case TopAbs_SHELL:
|
||||||
|
iRet=3;
|
||||||
|
break;
|
||||||
|
case TopAbs_FACE:
|
||||||
|
iRet=4;
|
||||||
|
break;
|
||||||
|
case TopAbs_WIRE:
|
||||||
|
iRet=5;
|
||||||
|
break;
|
||||||
|
case TopAbs_EDGE:
|
||||||
|
iRet=6;
|
||||||
|
break;
|
||||||
|
case TopAbs_VERTEX:
|
||||||
|
iRet=7;
|
||||||
|
break;
|
||||||
|
case TopAbs_SHAPE:
|
||||||
|
iRet=8;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return iRet;
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user