mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0023901: Memory leaks in tests.
1. Removed cyclic reference. Removed field myCommonBlock from BOPDS_PaveBlock; 2. Added data map myMapPBCB in BOPDS_DS. It contains pairs (PaveBlock, CommonBlock); 3. All methods about common block have been shifted from BOPDS_PaveBlock to BOPDS_DS; 4. Test case bugs moddata_2 pro19422_2 has been rewritten to build the correct result. Test case corrected (TODO removed)
This commit is contained in:
parent
6a7d83c480
commit
5a77460e4a
@ -92,14 +92,14 @@
|
||||
aItPB.Initialize(aLPB);
|
||||
for (; aItPB.More(); aItPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
|
||||
const Handle(BOPDS_PaveBlock)& aPBR=aPB->RealPaveBlock();
|
||||
const Handle(BOPDS_PaveBlock)& aPBR=myDS->RealPaveBlock(aPB);
|
||||
//
|
||||
nSpR=aPBR->Edge();
|
||||
const TopoDS_Shape& aSpR=myDS->Shape(nSpR);
|
||||
aLS.Append(aSpR);
|
||||
myOrigins.Bind(aSpR, aE);
|
||||
//
|
||||
if (aPB->IsCommonBlockOnEdge()) {
|
||||
if (myDS->IsCommonBlockOnEdge(aPB)) {
|
||||
nSp=aPB->Edge();
|
||||
const TopoDS_Shape& aSp=myDS->Shape(nSp);
|
||||
myShapesSD.Bind(aSp, aSpR);
|
||||
|
@ -327,7 +327,7 @@
|
||||
//=========================================
|
||||
// post treatment
|
||||
//=========================================
|
||||
BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, aAllocator);
|
||||
BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, aAllocator, myDS);
|
||||
PerformVerticesEE(aMVCPB, aAllocator);
|
||||
//-----------------------------------------------------scope t
|
||||
aMPBLPB.Clear();
|
||||
@ -457,11 +457,11 @@
|
||||
Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
|
||||
nE=aPB->OriginalEdge();
|
||||
// 3
|
||||
if (!aPB->IsCommonBlock()) {
|
||||
if (!myDS->IsCommonBlock(aPB)) {
|
||||
myDS->UpdatePaveBlock(aPB);
|
||||
}
|
||||
else {
|
||||
const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock();
|
||||
const Handle(BOPDS_CommonBlock)& aCB=myDS->CommonBlock(aPB);
|
||||
myDS->UpdateCommonBlock(aCB);
|
||||
}
|
||||
}//for (; aItMPBLI.More(); aItMPBLI.Next()) {
|
||||
|
@ -126,7 +126,7 @@
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
Handle(BOPDS_PaveBlock)& aPB=aIt.ChangeValue();
|
||||
//
|
||||
const Handle(BOPDS_PaveBlock) aPBR=aPB->RealPaveBlock();
|
||||
const Handle(BOPDS_PaveBlock) aPBR=myDS->RealPaveBlock(aPB);
|
||||
if (aMPBF.Contains(aPBR)) {
|
||||
continue;
|
||||
}
|
||||
@ -293,7 +293,7 @@
|
||||
//=========================================
|
||||
// post treatment
|
||||
//=========================================
|
||||
BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator);
|
||||
BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator, myDS);
|
||||
PerformVerticesEF(aMVCPB, aAllocator);
|
||||
//
|
||||
// Update FaceInfoIn for all faces having EF common parts
|
||||
@ -438,11 +438,11 @@
|
||||
Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
|
||||
nE=aPB->OriginalEdge();
|
||||
// 3
|
||||
if (!aPB->IsCommonBlock()) {
|
||||
if (!myDS->IsCommonBlock(aPB)) {
|
||||
myDS->UpdatePaveBlock(aPB);
|
||||
}
|
||||
else {
|
||||
const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock();
|
||||
const Handle(BOPDS_CommonBlock)& aCB=myDS->CommonBlock(aPB);
|
||||
myDS->UpdateCommonBlock(aCB);
|
||||
}
|
||||
}//for (; aItMPBLI.More(); aItMPBLI.Next()) {
|
||||
|
@ -386,7 +386,7 @@ static void ToleranceFF(const TopoDS_Face& aF1,
|
||||
if (bExist) {
|
||||
if (aMPBAdd.Add(aPBOut)) {
|
||||
Standard_Boolean bInBothFaces = Standard_True;
|
||||
if (!aPBOut->IsCommonBlock()) {
|
||||
if (!myDS->IsCommonBlock(aPBOut)) {
|
||||
Standard_Integer nE;
|
||||
Standard_Real aTolE;
|
||||
//
|
||||
@ -663,7 +663,7 @@ static void ToleranceFF(const TopoDS_Face& aF1,
|
||||
}
|
||||
for (; aItLPB.More(); aItLPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPBx=aItLPB.Value();
|
||||
const Handle(BOPDS_PaveBlock) aPBRx=aPBx->RealPaveBlock();
|
||||
const Handle(BOPDS_PaveBlock) aPBRx=aPDS->RealPaveBlock(aPBx);
|
||||
//
|
||||
// update vertices of paves
|
||||
aPave[0]=aPBx->Pave1();
|
||||
@ -1713,7 +1713,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
||||
BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.ChangePaveBlocksIn();
|
||||
//
|
||||
// remove old pave blocks
|
||||
const Handle(BOPDS_CommonBlock)& aCB1 = aPBf->CommonBlock();
|
||||
const Handle(BOPDS_CommonBlock)& aCB1 = myDS->CommonBlock(aPBf);
|
||||
bCB = !aCB1.IsNull();
|
||||
BOPDS_ListOfPaveBlock aLPB1;
|
||||
//
|
||||
@ -1757,7 +1757,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
||||
aPB2n->SetEdge(aPB->Edge());
|
||||
aPB2n->SetOriginalEdge(nE);
|
||||
aCB->AddPaveBlock(aPB2n);
|
||||
aPB2n->SetCommonBlock(aCB);
|
||||
myDS->SetCommonBlock(aPB2n, aCB);
|
||||
myDS->ChangePaveBlocks(nE).Append(aPB2n);
|
||||
}
|
||||
aCB->AddFaces(aFaces);
|
||||
@ -1781,7 +1781,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
||||
Standard_Boolean bCom = BOPTools_AlgoTools::IsBlockInOnFace(aShrR, aF, aE, myContext);
|
||||
if (bCom) {
|
||||
if (bCB) {
|
||||
aCB = aPB->CommonBlock();
|
||||
aCB = myDS->CommonBlock(aPB);
|
||||
aCB->AddFace(nF);
|
||||
} else {
|
||||
aCB = new BOPDS_CommonBlock;
|
||||
@ -1789,7 +1789,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
||||
aCB->AddFace(nF1);
|
||||
aCB->AddFace(nF2);
|
||||
//
|
||||
aPB->SetCommonBlock(aCB);
|
||||
myDS->SetCommonBlock(aPB, aCB);
|
||||
}
|
||||
aMPB.Add(aPB);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ static void UpdateVertices(const TopoDS_Edge& aE,
|
||||
aItPB.Initialize(aLPB);
|
||||
for (; aItPB.More(); aItPB.Next()) {
|
||||
aPB=aItPB.Value();
|
||||
const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock();
|
||||
const Handle(BOPDS_CommonBlock)& aCB=myDS->CommonBlock(aPB);
|
||||
bCB=!aCB.IsNull();
|
||||
if (bCB) {
|
||||
myDS->SortPaveBlocks(aCB);
|
||||
@ -207,7 +207,7 @@ static void UpdateVertices(const TopoDS_Edge& aE,
|
||||
aItMPB.Initialize(aMPBOn);
|
||||
for(; aItMPB.More(); aItMPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
|
||||
if (aPB->IsCommonBlockOnEdge()) {
|
||||
if (myDS->IsCommonBlockOnEdge(aPB)) {
|
||||
nE=aPB->Edge();
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
||||
//
|
||||
@ -289,7 +289,7 @@ static void UpdateVertices(const TopoDS_Edge& aE,
|
||||
bV2=myDS->IsNewShape(nV2);
|
||||
//
|
||||
if (!(bV1 || bV2)) {
|
||||
if (!aPB->IsCommonBlock()) {
|
||||
if (!myDS->IsCommonBlock(aPB)) {
|
||||
// the PB seems to be untouced
|
||||
aLPB.Clear();
|
||||
continue;
|
||||
|
@ -25,6 +25,7 @@ uses
|
||||
BaseAllocator from BOPCol,
|
||||
IndexedDataMapOfIntegerListOfInteger from BOPCol,
|
||||
DataMapOfIntegerListOfInteger from BOPCol,
|
||||
PDS from BOPDS,
|
||||
PaveBlock from BOPDS,
|
||||
IndexedDataMapOfPaveBlockListOfInteger from BOPDS,
|
||||
IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS,
|
||||
@ -47,7 +48,8 @@ is
|
||||
|
||||
PerformCommonBlocks(myclass;
|
||||
theMBlocks :out IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS;
|
||||
theAllocator:out BaseAllocator from BOPCol);
|
||||
theAllocator:out BaseAllocator from BOPCol;
|
||||
pDS: out PDS from BOPDS);
|
||||
|
||||
FillMap(myclass;
|
||||
tneN1:Integer from Standard;
|
||||
@ -70,7 +72,8 @@ is
|
||||
|
||||
PerformCommonBlocks(myclass;
|
||||
theMBlocks :IndexedDataMapOfPaveBlockListOfInteger from BOPDS;
|
||||
theAllocator:out BaseAllocator from BOPCol);
|
||||
theAllocator:out BaseAllocator from BOPCol;
|
||||
pDS: out PDS from BOPDS);
|
||||
--fields
|
||||
|
||||
end Tools;
|
||||
|
@ -17,6 +17,7 @@
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
#include <BOPAlgo_Tools.ixx>
|
||||
#include <BOPDS_DS.hxx>
|
||||
#include <BOPDS_MapOfPaveBlock.hxx>
|
||||
#include <BOPDS_IndexedMapOfPaveBlock.hxx>
|
||||
#include <BOPDS_CommonBlock.hxx>
|
||||
@ -265,7 +266,8 @@
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
|
||||
Handle(NCollection_BaseAllocator)& aAllocator)
|
||||
Handle(NCollection_BaseAllocator)& aAllocator,
|
||||
BOPDS_PDS& pDS)
|
||||
{
|
||||
Standard_Integer aNbCB;
|
||||
//
|
||||
@ -297,7 +299,7 @@
|
||||
aItLPB.Initialize(aLPB);
|
||||
for (; aItLPB.More(); aItLPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPBx=aItLPB.Value();
|
||||
aPBx->SetCommonBlock(aCB);
|
||||
pDS->SetCommonBlock(aPBx, aCB);
|
||||
}
|
||||
}//if (aNbPB>1) {
|
||||
}
|
||||
@ -307,7 +309,8 @@
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI,
|
||||
Handle(NCollection_BaseAllocator)& )//aAllocator)
|
||||
Handle(NCollection_BaseAllocator)& ,//aAllocator
|
||||
BOPDS_PDS& pDS)
|
||||
{
|
||||
Standard_Integer nF, i, aNb;
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI;
|
||||
@ -317,8 +320,8 @@
|
||||
aNb=aMPBLI.Extent();
|
||||
for (i=1; i<=aNb; ++i) {
|
||||
aPB=aMPBLI.FindKey(i);
|
||||
if (aPB->IsCommonBlock()) {
|
||||
aCB=aPB->CommonBlock();
|
||||
if (pDS->IsCommonBlock(aPB)) {
|
||||
aCB=pDS->CommonBlock(aPB);
|
||||
}
|
||||
else {
|
||||
aCB=new BOPDS_CommonBlock;
|
||||
@ -331,6 +334,6 @@
|
||||
nF=aItLI.Value();
|
||||
aCB->AddFace(nF);
|
||||
}
|
||||
aPB->SetCommonBlock(aCB);
|
||||
pDS->SetCommonBlock(aPB, aCB);
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ is
|
||||
imported IndexedMapOfPaveBlock from BOPDS;
|
||||
imported IndexedDataMapOfPaveBlockListOfInteger from BOPDS;
|
||||
imported IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
|
||||
imported DataMapOfPaveBlockCommonBlock from BOPDS;
|
||||
--
|
||||
imported Interf from BOPDS;
|
||||
imported InterfVV from BOPDS;
|
||||
|
@ -63,6 +63,7 @@ uses
|
||||
FaceInfo from BOPDS,
|
||||
--
|
||||
MapOfPassKey from BOPDS,
|
||||
DataMapOfPaveBlockCommonBlock from BOPDS,
|
||||
--
|
||||
VectorOfInterfVV from BOPDS,
|
||||
VectorOfInterfVE from BOPDS,
|
||||
@ -271,6 +272,43 @@ is
|
||||
theCB:CommonBlock from BOPDS);
|
||||
---Purpose:
|
||||
--- Update the common block theCB
|
||||
|
||||
IsCommonBlock(me;
|
||||
thePB:PaveBlock from BOPDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Query
|
||||
--- Returns true if the pave block is common block
|
||||
|
||||
CommonBlock(me;
|
||||
thePB:PaveBlock from BOPDS)
|
||||
returns CommonBlock from BOPDS;
|
||||
---C++: return const &
|
||||
---Purpose:
|
||||
--- Selector
|
||||
--- Returns the common block
|
||||
|
||||
SetCommonBlock(me:out;
|
||||
thePB:PaveBlock from BOPDS;
|
||||
theCB:CommonBlock from BOPDS);
|
||||
---Purpose:
|
||||
--- Modifier
|
||||
--- Sets the common block <theCB>
|
||||
|
||||
RealPaveBlock(me;
|
||||
thePB:PaveBlock from BOPDS)
|
||||
returns PaveBlock from BOPDS;
|
||||
---Purpose:
|
||||
--- Selector
|
||||
--- Returns the real first pave block
|
||||
|
||||
IsCommonBlockOnEdge(me;
|
||||
thePB:PaveBlock from BOPDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Query
|
||||
--- Returns true if common block contains more then one pave block
|
||||
|
||||
--
|
||||
-- face info
|
||||
--
|
||||
@ -559,6 +597,7 @@ fields
|
||||
myMapShapeIndex : DataMapOfShapeInteger from BOPCol is protected;
|
||||
--
|
||||
myPaveBlocksPool : VectorOfListOfPaveBlock from BOPDS is protected;
|
||||
myMapPBCB : DataMapOfPaveBlockCommonBlock from BOPDS is protected;
|
||||
myFaceInfoPool : VectorOfFaceInfo from BOPDS is protected;
|
||||
--
|
||||
--same domain shapes
|
||||
|
@ -83,6 +83,7 @@ static
|
||||
myPaveBlocksPool(myAllocator),
|
||||
myFaceInfoPool(myAllocator),
|
||||
myShapesSD(100, myAllocator),
|
||||
myMapPBCB(100, myAllocator),
|
||||
myInterfTB(100, myAllocator),
|
||||
myInterfVV(myAllocator),
|
||||
myInterfVE(myAllocator),
|
||||
@ -108,6 +109,7 @@ static
|
||||
myPaveBlocksPool(myAllocator),
|
||||
myFaceInfoPool(myAllocator),
|
||||
myShapesSD(100, myAllocator),
|
||||
myMapPBCB(100, myAllocator),
|
||||
myInterfTB(100, myAllocator),
|
||||
myInterfVV(myAllocator),
|
||||
myInterfVE(myAllocator),
|
||||
@ -143,6 +145,7 @@ static
|
||||
myPaveBlocksPool.Clear();
|
||||
myFaceInfoPool.Clear();
|
||||
myShapesSD.Clear();
|
||||
myMapPBCB.Clear();
|
||||
myInterfTB.Clear();
|
||||
myInterfVV.Clear();
|
||||
myInterfVE.Clear();
|
||||
@ -963,11 +966,82 @@ static
|
||||
aItPB.Initialize(aLPBxN);
|
||||
for (; aItPB.More(); aItPB.Next()) {
|
||||
aPB=aItPB.ChangeValue();
|
||||
aPB->SetCommonBlock(aCBx);
|
||||
SetCommonBlock(aPB, aCBx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: RealPaveBlock
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Handle(BOPDS_PaveBlock) BOPDS_DS::RealPaveBlock
|
||||
(const Handle(BOPDS_PaveBlock)& thePB) const
|
||||
{
|
||||
if (IsCommonBlock(thePB)) {
|
||||
const Handle(BOPDS_CommonBlock)& aCB = CommonBlock(thePB);
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aCB->PaveBlock1();
|
||||
return aPB;
|
||||
}
|
||||
return thePB;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: IsCommonBlockOnEdge
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_DS::IsCommonBlockOnEdge
|
||||
(const Handle(BOPDS_PaveBlock)& thePB) const
|
||||
{
|
||||
if (IsCommonBlock(thePB)) {
|
||||
const Handle(BOPDS_CommonBlock)& aCB = CommonBlock(thePB);
|
||||
return aCB->PaveBlocks().Extent()>1;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsCommonBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_DS::IsCommonBlock
|
||||
(const Handle(BOPDS_PaveBlock)& thePB) const
|
||||
{
|
||||
return myMapPBCB.IsBound(thePB);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CommonBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Handle(BOPDS_CommonBlock)& BOPDS_DS::CommonBlock
|
||||
(const Handle(BOPDS_PaveBlock)& thePB) const
|
||||
{
|
||||
Handle(BOPDS_CommonBlock) aNullCB;
|
||||
//
|
||||
const Handle(BOPDS_CommonBlock)& aCB =
|
||||
IsCommonBlock(thePB) ? myMapPBCB.Find(thePB) : aNullCB;
|
||||
//
|
||||
return aCB;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCommonBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_DS::SetCommonBlock(const Handle(BOPDS_PaveBlock)& thePB,
|
||||
const Handle(BOPDS_CommonBlock)& theCB)
|
||||
{
|
||||
if (IsCommonBlock(thePB)) {
|
||||
Handle(BOPDS_CommonBlock)& aCB = myMapPBCB.ChangeFind(thePB);
|
||||
aCB=theCB;
|
||||
}
|
||||
else {
|
||||
myMapPBCB.Bind(thePB, theCB);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// FaceInfo
|
||||
//
|
||||
@ -1108,14 +1182,8 @@ static
|
||||
aPB->Indices(nV1, nV2);
|
||||
theMI.Add(nV1);
|
||||
theMI.Add(nV2);
|
||||
if (aPB->IsCommonBlock()) {
|
||||
const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock();
|
||||
const Handle(BOPDS_PaveBlock)& aPB1=aCB->PaveBlock1();
|
||||
theMPB.Add(aPB1);
|
||||
}
|
||||
else {
|
||||
theMPB.Add(aPB);
|
||||
}
|
||||
Handle(BOPDS_PaveBlock) aPBR=RealPaveBlock(aPB);
|
||||
theMPB.Add(aPBR);
|
||||
}
|
||||
}//if (aSIE.ShapeType()==TopAbs_EDGE)
|
||||
else {
|
||||
@ -1162,8 +1230,8 @@ static
|
||||
aItPB.Initialize(aLPB);
|
||||
for (; aItPB.More(); aItPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
|
||||
if (aPB->IsCommonBlock()) {
|
||||
const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock();
|
||||
if (IsCommonBlock(aPB)) {
|
||||
const Handle(BOPDS_CommonBlock)& aCB=CommonBlock(aPB);
|
||||
if (aCB->Contains(theF)) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB1=aCB->PaveBlock1();
|
||||
theMPB.Add(aPB1);
|
||||
@ -1359,7 +1427,7 @@ static
|
||||
else {
|
||||
aItLPB.Initialize(aLPB);
|
||||
for (; aItLPB.More(); aItLPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock) aPB=aItLPB.Value()->RealPaveBlock();
|
||||
const Handle(BOPDS_PaveBlock) aPB=RealPaveBlock(aItLPB.Value());
|
||||
nSp=aPB->Edge();
|
||||
aMI.Add(nSp);
|
||||
}
|
||||
@ -1383,7 +1451,7 @@ static
|
||||
else {
|
||||
aItLPB.Initialize(aLPB);
|
||||
for (; aItLPB.More(); aItLPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock) aPB=aItLPB.Value()->RealPaveBlock();
|
||||
const Handle(BOPDS_PaveBlock) aPB=RealPaveBlock(aItLPB.Value());
|
||||
nSp=aPB->Edge();
|
||||
if (aMI.Contains(nSp)) {
|
||||
theLI.Append(nSp);
|
||||
|
34
src/BOPDS/BOPDS_DataMapOfPaveBlockCommonBlock.hxx
Normal file
34
src/BOPDS/BOPDS_DataMapOfPaveBlockCommonBlock.hxx
Normal file
@ -0,0 +1,34 @@
|
||||
// Created by: Eugeny MALTCHIKOV
|
||||
// Copyright (c) 2012-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef BOPDS_DataMapOfPaveBlockCommonBlock_HeaderFile
|
||||
#define BOPDS_DataMapOfPaveBlockCommonBlock_HeaderFile
|
||||
|
||||
#define _NCollection_MapHasher
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <TColStd_MapTransientHasher.hxx>
|
||||
#include <BOPDS_CommonBlock.hxx>
|
||||
|
||||
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), Handle(BOPDS_CommonBlock), TColStd_MapTransientHasher> BOPDS_DataMapOfPaveBlockCommonBlock;
|
||||
typedef BOPDS_DataMapOfPaveBlockCommonBlock::Iterator BOPDS_DataMapIteratorOfDataMapOfPaveBlockCommonBlock;
|
||||
|
||||
#undef _NCollection_MapHasher
|
||||
|
||||
|
||||
#endif
|
@ -30,8 +30,7 @@ uses
|
||||
MapOfInteger from BOPCol,
|
||||
Pave from BOPDS,
|
||||
ListOfPave from BOPDS,
|
||||
ListOfPaveBlock from BOPDS,
|
||||
CommonBlock from BOPDS
|
||||
ListOfPaveBlock from BOPDS
|
||||
|
||||
--raises
|
||||
|
||||
@ -199,40 +198,6 @@ is
|
||||
--- with given value of the parameter <thePrm>
|
||||
--- <theTol> - the value of the tolerance to compare
|
||||
|
||||
--
|
||||
-- common block
|
||||
--
|
||||
SetCommonBlock(me:mutable;
|
||||
theCB:CommonBlock from BOPDS);
|
||||
---Purpose:
|
||||
--- Modifier
|
||||
--- Sets the common block <theCB>
|
||||
|
||||
CommonBlock(me)
|
||||
returns CommonBlock from BOPDS;
|
||||
---C++: return const &
|
||||
---Purpose:
|
||||
--- Selector
|
||||
--- Returns the common block
|
||||
|
||||
IsCommonBlock(me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Query
|
||||
--- Returns true if the pave block is common block
|
||||
|
||||
IsCommonBlockOnEdge(me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Query
|
||||
--- Returns true if the pave block is common block
|
||||
--- that contains at least one pave block
|
||||
|
||||
RealPaveBlock(me)
|
||||
returns PaveBlock from BOPDS;
|
||||
---Purpose:
|
||||
--- Selector
|
||||
--- Returns the real common block
|
||||
--
|
||||
-- shrunk data
|
||||
--
|
||||
@ -275,8 +240,6 @@ fields
|
||||
myPave2 : Pave from BOPDS is protected;
|
||||
--extras
|
||||
myExtPaves : ListOfPave from BOPDS is protected;
|
||||
--common block
|
||||
myCommonBlock : CommonBlock from BOPDS is protected;
|
||||
--shrunk data
|
||||
myTS1 : Real from Standard is protected;
|
||||
myTS2 : Real from Standard is protected;
|
||||
|
@ -356,56 +356,7 @@ void SortShell(const int n, BOPDS_Pave *a)
|
||||
}//for (i=0; i<nd; ++i)
|
||||
}//while (1)
|
||||
}
|
||||
//
|
||||
// Common block
|
||||
//
|
||||
//=======================================================================
|
||||
//function : SetCommonBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_PaveBlock::SetCommonBlock(const Handle(BOPDS_CommonBlock)& theCB)
|
||||
{
|
||||
myCommonBlock=theCB;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CommonBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Handle(BOPDS_CommonBlock)& BOPDS_PaveBlock::CommonBlock()const
|
||||
{
|
||||
return myCommonBlock;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsCommonBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_PaveBlock::IsCommonBlock()const
|
||||
{
|
||||
return (!myCommonBlock.IsNull());
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsCommonBlockOnEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_PaveBlock::IsCommonBlockOnEdge()const
|
||||
{
|
||||
if (!myCommonBlock.IsNull()) {
|
||||
return (myCommonBlock->PaveBlocks().Extent()>1);
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : RealPaveBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(BOPDS_PaveBlock) BOPDS_PaveBlock::RealPaveBlock()const
|
||||
{
|
||||
if (IsCommonBlock()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB1=myCommonBlock->PaveBlock1();
|
||||
return aPB1;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// ShrunkData
|
||||
//=======================================================================
|
||||
//function : HasShrunkData
|
||||
@ -452,4 +403,3 @@ void SortShell(const int n, BOPDS_Pave *a)
|
||||
myPave2.Dump();
|
||||
printf(" }");
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ BOPDS_DataMapOfIntegerListOfPaveBlock.hxx
|
||||
BOPDS_IndexedMapOfPaveBlock.hxx
|
||||
BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx
|
||||
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx
|
||||
BOPDS_DataMapOfPaveBlockCommonBlock.hxx
|
@ -465,7 +465,7 @@ Standard_Boolean QANewModTopOpe_Tools::EdgeSectionAncestors(const BOPAlgo_PPaveF
|
||||
}
|
||||
|
||||
const Handle(BOPDS_PaveBlock)& aPB1 = aLPB1.First();
|
||||
const Handle(BOPDS_CommonBlock)& aCB=aPB1->CommonBlock();
|
||||
const Handle(BOPDS_CommonBlock)& aCB=pDS->CommonBlock(aPB1);
|
||||
if (aCB.IsNull()) {
|
||||
return Standard_False;
|
||||
}
|
||||
|
@ -6,9 +6,6 @@ puts ""
|
||||
# Problem of Memory Leak
|
||||
######################################################
|
||||
|
||||
puts "TODO ?#23901 ALL: Memory leak detected"
|
||||
puts "TODO ?#23901 ALL: TEST INCOMPLETE"
|
||||
|
||||
#
|
||||
# Result is Null shape
|
||||
#
|
||||
@ -25,7 +22,7 @@ for {set i 1} {${i} <= ${NCycles}} {incr i } {
|
||||
bopcut r
|
||||
|
||||
lappend listmem [meminfo h]
|
||||
if { [checktrend $listmem 0 1 "Memory leak detected"] } {
|
||||
if { [checktrend $listmem 0 100 "Memory leak detected"] } {
|
||||
puts "No memory leak, $i iterations"
|
||||
break
|
||||
}
|
||||
|
@ -11,8 +11,10 @@ restore [locate_data_file pro19422c.brep] shape
|
||||
checkshape shape
|
||||
restore [locate_data_file pro19422d.brep] tool
|
||||
checkshape tool
|
||||
explode tool
|
||||
bfuse tool tool_1 tool_2
|
||||
|
||||
bcut result shape tool
|
||||
|
||||
set square 2369.43
|
||||
set square 2282.26
|
||||
set 2dviewer 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user