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

0021762: Integration of new Boolean Operation algorithm to OCCT.

Modifications:
1. NCollection maps have been replaced by NCollection indexed maps to guarantee the constant order of sub-shapes in the result of boolean operation.
2. Test case feat featprism M9 has been fixed.
3. Test cases chl 902 E3 H3 have been fixed (corrections in the treatment of section edges).
4. Test cases caf driver B6 B7, caf named_shape F6 F7 have been modified according to the new order of sub-shapes in the result of boolean operation.
5. Test cases blend buildevol G1, blend simple K4, bcommon_complex C7, feat featprism L6 have been modified as they are improvements.
6. Test case boolean bsection A3 has been modified according to the new syntax of the bsection command.
This commit is contained in:
emv 2012-11-20 16:00:48 +04:00
parent 4e5768ce0d
commit 4b4ffdead4
41 changed files with 907 additions and 662 deletions

View File

@ -43,12 +43,11 @@
void BOPAlgo_BOP::BuildSection()
{
Standard_Integer i, aNb, nE;
Standard_Integer i, aNb, nE, aNbPB, j;
TopoDS_Shape aRC;
BRep_Builder aBB;
BOPCol_MapOfShape aME;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
//
myErrorStatus=0;
//
@ -78,11 +77,11 @@
aNb=aFIP.Extent();
for (i=0; i<aNb; ++i) {
const BOPDS_FaceInfo& aFI=aFIP(i);
const BOPDS_MapOfPaveBlock& aMPB=aFI.PaveBlocksSc();
const BOPDS_IndexedMapOfPaveBlock& aMPB=aFI.PaveBlocksSc();
//
aItMPB.Initialize(aMPB);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPB=aMPB.Extent();
for (j=1; j<=aNbPB; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPB(j);
nE=aPB->Edge();
const TopoDS_Shape& aE=myDS->Shape(nE);
if (aME.Add(aE)) {

View File

@ -67,10 +67,10 @@ static
static
void FillMap(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
BOPCol_DataMapOfShapeListOfShape& aDMSLS,
BOPCol_IndexedDataMapOfShapeListOfShape& aDMSLS,
Handle(NCollection_IncAllocator)& aAllocator);
static
void MakeBlocksCnx(const BOPCol_DataMapOfShapeListOfShape& aMILI,
void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI,
BOPCol_DataMapOfIntegerListOfShape& aMBlocks,
Handle(NCollection_IncAllocator)& aAllocator);
@ -95,13 +95,12 @@ static
void BOPAlgo_Builder::BuildSplitFaces()
{
Standard_Boolean bHasFaceInfo, bIsClosed, bIsDegenerated, bToReverse;
Standard_Integer i, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp;
Standard_Integer i, j, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp;
TopoDS_Face aFF, aFSD;
TopoDS_Edge aSp, aEE;
TopAbs_Orientation anOriF, anOriE;
TopExp_Explorer aExp;
BOPCol_ListIteratorOfListOfShape aIt;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
BOPCol_ListOfInteger aLIAV;
BOPCol_MapOfShape aMFence;
Handle(NCollection_IncAllocator) aAllocator;
@ -135,9 +134,9 @@ static
//
const BOPDS_FaceInfo& aFI=myDS->FaceInfo(i);
//
const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
const BOPDS_MapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
const BOPDS_MapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
aLIAV.Clear();
myDS->AloneVertices(i, aLIAV);
@ -226,9 +225,8 @@ static
//
//
// 1.2 In edges
aItMPB.Initialize(aMPBIn);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
for (j=1; j<=aNbPBIn; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBIn(j);
nSp=aPB->Edge();
aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp)));
//
@ -240,9 +238,8 @@ static
//
//
// 1.3 Section edges
aItMPB.Initialize(aMPBSc);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
for (j=1; j<=aNbPBSc; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBSc(j);
nSp=aPB->Edge();
aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp)));
//
@ -256,7 +253,7 @@ static
BOPAlgo_BuilderFace aBF(aAllocator);
//
aBF.SetFace(aFF);
aBF.SetContext(myContext);
//aBF.SetContext(myContext);
//
// <-DEB ft
//
@ -298,7 +295,6 @@ static
Handle(NCollection_IncAllocator) aAllocator;
BOPCol_ListIteratorOfListOfShape aItF1, aItF2;
BOPTools_ListOfCoupleOfShape aLCS;
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfShape aItBlocks;
BOPCol_ListIteratorOfListOfShape aItLS;
//
myErrorStatus=0;
@ -311,7 +307,7 @@ static
}
//-----------------------------------------------------scope f
aAllocator=new NCollection_IncAllocator();
BOPCol_DataMapOfShapeListOfShape aDMSLS(100, aAllocator);
BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS(100, aAllocator);
BOPCol_DataMapOfIntegerListOfShape aMBlocks(100, aAllocator);
BOPTools_DataMapOfShapeSet aMSST(100, aAllocator);
//
@ -403,16 +399,13 @@ static
}
} // for (i=0; i<aNbFFs; ++i) {
//
aNbS=aDMSLS.Extent();
//
// 2. Make blocks
aNbS=aDMSLS.Extent();
MakeBlocksCnx(aDMSLS, aMBlocks, aAllocator);
//
// 3. Fill same domain faces map -> aMSDF
aItBlocks.Initialize(aMBlocks);
for (; aItBlocks.More(); aItBlocks.Next()) {
const BOPCol_ListOfShape& aLSD=aItBlocks.Value();
aNbS = aMBlocks.Extent();
for (i=0; i<aNbS; ++i) {
const BOPCol_ListOfShape& aLSD=aMBlocks.Find(i);
if (aLSD.Extent()) {
const TopoDS_Shape& aFSD1=aLSD.First();
aItLS.Initialize(aLSD);
@ -565,30 +558,27 @@ static
//function : MakeBlocksCnx
//purpose :
//=======================================================================
void MakeBlocksCnx(const BOPCol_DataMapOfShapeListOfShape& aMILI,
void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI,
BOPCol_DataMapOfIntegerListOfShape& aMBlocks,
Handle(NCollection_IncAllocator)& aAllocator)
{
Standard_Integer aNbV, aNbVS, aNbVP, k;
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMILI;
BOPCol_MapIteratorOfMapOfShape aItMVP;
Standard_Integer aNbV, aNbVS, aNbVP, aNbEC, k, i, j;
BOPCol_ListIteratorOfListOfShape aItLI;
//
BOPCol_MapOfShape aMVS(100, aAllocator);
BOPCol_MapOfShape aMEC(100, aAllocator);
BOPCol_MapOfShape aMVP(100, aAllocator);
BOPCol_MapOfShape aMVAdd(100, aAllocator);
BOPCol_IndexedMapOfShape aMEC(100, aAllocator);
BOPCol_IndexedMapOfShape aMVP(100, aAllocator);
BOPCol_IndexedMapOfShape aMVAdd(100, aAllocator);
//
aNbV=aMILI.Extent();
//
aItMILI.Initialize(aMILI);
for (k=0; aItMILI.More(); aItMILI.Next()) {
for (k=0,i=1; i<=aNbV; ++i) {
aNbVS=aMVS.Extent();
if (aNbVS==aNbV) {
break;
}
//
const TopoDS_Shape& nV=aItMILI.Key();
const TopoDS_Shape& nV=aMILI.FindKey(i);
if (aMVS.Contains(nV)){
continue;
}
@ -601,10 +591,9 @@ void MakeBlocksCnx(const BOPCol_DataMapOfShapeListOfShape& aMILI,
aMVP.Add(nV);
while(1) {
aNbVP=aMVP.Extent();
aItMVP.Initialize(aMVP);
for (; aItMVP.More(); aItMVP.Next()) {
const TopoDS_Shape& nVP=aItMVP.Value();
const BOPCol_ListOfShape& aLV=aMILI.Find(nVP);
for (j=1; j<=aNbVP; ++j) {
const TopoDS_Shape& nVP=aMVP(j);
const BOPCol_ListOfShape& aLV=aMILI.FindFromKey(nVP);
aItLI.Initialize(aLV);
for (; aItLI.More(); aItLI.Next()) {
const TopoDS_Shape& nVx=aItLI.Value();
@ -624,25 +613,23 @@ void MakeBlocksCnx(const BOPCol_DataMapOfShapeListOfShape& aMILI,
}
//
aMVP.Clear();
aItMVP.Initialize(aMVAdd);
for (; aItMVP.More(); aItMVP.Next()) {
aMVP.Add(aItMVP.Value());
for (j=1; j<=aNbVP; ++j) {
aMVP.Add(aMVAdd(j));
}
aMVAdd.Clear();
}//while(1) {
//
BOPCol_ListOfShape aLIx(aAllocator);
//
//aLIx.Append(nV);
aItMVP.Initialize(aMEC);
for (; aItMVP.More(); aItMVP.Next()) {
const TopoDS_Shape& nVx=aItMVP.Value();
aNbEC = aMEC.Extent();
for (j=1; j<=aNbEC; ++j) {
const TopoDS_Shape& nVx=aMEC(j);
aLIx.Append(nVx);
}
//
aMBlocks.Bind(k, aLIx);
++k;
}//for (; aItMILI.More(); aItMILI.Next()) {
}//for (k=0,i=1; i<=aNbV; ++i)
aMVAdd.Clear();
aMVP.Clear();
aMEC.Clear();
@ -655,27 +642,27 @@ void MakeBlocksCnx(const BOPCol_DataMapOfShapeListOfShape& aMILI,
//=======================================================================
void FillMap(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
BOPCol_DataMapOfShapeListOfShape& aDMSLS,
BOPCol_IndexedDataMapOfShapeListOfShape& aDMSLS,
Handle(NCollection_IncAllocator)& aAllocator)
{
if (aDMSLS.IsBound(aS1)) {
BOPCol_ListOfShape& aLS=aDMSLS.ChangeFind(aS1);
if (aDMSLS.Contains(aS1)) {
BOPCol_ListOfShape& aLS=aDMSLS.ChangeFromKey(aS1);
aLS.Append(aS2);
}
else {
BOPCol_ListOfShape aLS(aAllocator);
aLS.Append(aS2);
aDMSLS.Bind(aS1, aLS);
aDMSLS.Add(aS1, aLS);
}
//
if (aDMSLS.IsBound(aS2)) {
BOPCol_ListOfShape& aLS=aDMSLS.ChangeFind(aS2);
if (aDMSLS.Contains(aS2)) {
BOPCol_ListOfShape& aLS=aDMSLS.ChangeFromKey(aS2);
aLS.Append(aS1);
}
else {
BOPCol_ListOfShape aLS(aAllocator);
aLS.Append(aS1);
aDMSLS.Bind(aS2, aLS);
aDMSLS.Add(aS2, aLS);
}
}
//=======================================================================
@ -689,10 +676,10 @@ Standard_Boolean HasPaveBlocksOnIn(const BOPDS_FaceInfo& aFI1,
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
//
bRet=Standard_False;
const BOPDS_MapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
const BOPDS_MapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
//
const BOPDS_MapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
aItMPB.Initialize(aMPBOn2);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -702,7 +689,7 @@ Standard_Boolean HasPaveBlocksOnIn(const BOPDS_FaceInfo& aFI1,
}
}
//
const BOPDS_MapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
aItMPB.Initialize(aMPBIn2);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();

View File

@ -105,13 +105,12 @@ static
TopoDS_Solid aSolidSp;
TopoDS_Face aFP;
BOPCol_ListIteratorOfListOfShape aItS, aItFP, aItEx;
BOPCol_MapIteratorOfMapOfShape aItMS, aItMS1;
//
BOPCol_ListOfShape aLIF(theAllocator);
BOPCol_MapOfShape aMFDone(100, theAllocator);
BOPCol_MapOfShape aMSolids(100, theAllocator);
BOPCol_MapOfShape aMFaces(100, theAllocator);
BOPCol_MapOfShape aMFIN(100, theAllocator);
BOPCol_IndexedMapOfShape aMSolids(100, theAllocator);
BOPCol_IndexedMapOfShape aMFaces(100, theAllocator);
BOPCol_IndexedMapOfShape aMFIN(100, theAllocator);
BOPCol_IndexedMapOfShape aMS(100, theAllocator);
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, theAllocator);
//
@ -153,9 +152,8 @@ static
aNbFaces=aMFaces.Extent();
aNbSolids=aMSolids.Extent();
//
aItMS.Initialize(aMSolids);
for (; aItMS.More(); aItMS.Next()) {
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aItMS.Value()));
for (i=1; i<=aNbSolids; ++i) {
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aMSolids(i)));
//
aMFDone.Clear();
aMFIN.Clear();
@ -204,9 +202,8 @@ static
BOPCol_ListOfShape aLEx(theAllocator);
//
// for all non-solid faces build EF map [ aMEFP ]
aItMS1.Initialize(aMFaces);
for (; aItMS1.More(); aItMS1.Next()) {
const TopoDS_Shape& aFace=aItMS1.Value();
for (j=1; j<=aNbFaces; ++j) {
const TopoDS_Shape& aFace=aMFaces(j);
if (!aMS.Contains(aFace)) {
BOPTools::MapShapesAndAncestors(aFace, TopAbs_EDGE, TopAbs_FACE, aMEFP);
}
@ -303,9 +300,8 @@ static
aLFIN.Clear();
aNbFIN=aMFIN.Extent();
if (aNbFIN || aNbLIF) {
aItMS1.Initialize(aMFIN);
for (; aItMS1.More(); aItMS1.Next()) {
const TopoDS_Shape& aFIn=aItMS1.Value();
for (j=1; j<=aNbFIN; ++j) {
const TopoDS_Shape& aFIn=aMFIN(j);
aLFIN.Append(aFIn);
}
//
@ -458,11 +454,18 @@ static
} //for (i=1; i<=aNbS; ++i)
//
// 1. Build solids for interferred source solids
aNbS=theDraftSolids.Extent();
aIt1.Initialize(theDraftSolids);
for (; aIt1.More(); aIt1.Next()) {
const TopoDS_Shape& aS =aIt1.Key();
const TopoDS_Shape& aSD=aIt1.Value();
for (i=0; i<aNbS; ++i) {
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
//
if (aSI.ShapeType()!=TopAbs_SOLID) {
continue;
}
//
const TopoDS_Shape& aS=aSI.Shape();
if(!theDraftSolids.IsBound(aS)) {
continue;
}
const TopoDS_Shape& aSD=theDraftSolids.Find(aS);
const BOPCol_ListOfShape& aLFIN=
(theInParts.IsBound(aS)) ? theInParts.Find(aS) : aLSEmpty;
//
@ -492,7 +495,7 @@ static
// 1.3 Build new solids
BOPAlgo_BuilderSolid aSB(theAllocator);
//
aSB.SetContext(myContext);
//aSB.SetContext(myContext);
aSB.SetShapes(aSFS);
aSB.Perform();
iErr=aSB.ErrorStatus();

View File

@ -35,8 +35,10 @@ uses
MapOfInteger from BOPCol,
ListOfInteger from BOPCol,
DataMapOfShapeInteger from BOPCol,
IndexedDataMapOfShapeInteger from BOPCol,
DataMapOfIntegerListOfInteger from BOPCol,
DataMapOfShapeListOfShape from BOPCol,
IndexedDataMapOfShapeListOfShape from BOPCol,
--
Context from BOPInt,
--
@ -47,8 +49,8 @@ uses
Iterator from BOPDS,
PIterator from BOPDS,
PaveBlock from BOPDS,
Curve from BOPDS,
DataMapOfShapeCoupleOfPaveBlocks from BOPDS,
Curve from BOPDS,
IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS,
MapOfPaveBlock from BOPDS,
ListOfPaveBlock from BOPDS,
ListOfPave from BOPDS,
@ -140,14 +142,14 @@ is
thePB:out PaveBlock from BOPDS)
is protected;
PerformVertices(me:out;
theMVCPB:out DataMapOfShapeCoupleOfPaveBlocks from BOPDS;
PerformVerticesEE(me:out;
theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theAllocator:out BaseAllocator from BOPCol)
returns Integer from Standard
is protected;
PerformVertices1(me:out;
theMVCPB:out DataMapOfShapeCoupleOfPaveBlocks from BOPDS;
PerformVerticesEF(me:out;
theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theAllocator:out BaseAllocator from BOPCol)
returns Integer from Standard
is protected;
@ -182,8 +184,7 @@ is
theTolR3D:Real from Standard;
theNC:out Curve from BOPDS;
nF1:Integer from Standard;
nF2:Integer from Standard;
aMVB:out MapOfInteger from BOPCol)
nF2:Integer from Standard)
is protected;
ExtendedTolerance(me:out;
@ -199,8 +200,7 @@ is
theTolR3D:Real from Standard;
theNC:out Curve from BOPDS;
--modified by NIZHNY-EMV Thu Mar 31 14:40:58 2011
theMVOnIn:out MapOfInteger from BOPCol;
theMVB:out MapOfInteger from BOPCol)
theMVOnIn:out MapOfInteger from BOPCol)
--modified by NIZHNY-EMV Thu Mar 31 14:41:02 2011
is protected;
@ -208,7 +208,8 @@ is
thePB:PaveBlock from BOPDS;
theNC:Curve from BOPDS;
theTolR3D:Real from Standard;
theMPB:MapOfPaveBlock from BOPDS)
theMPB:MapOfPaveBlock from BOPDS;
thePBOut:out PaveBlock from BOPDS)
returns Boolean from Standard
is protected;
@ -221,7 +222,7 @@ is
is protected;
PostTreatFF(me:out;
theMSCPB:out DataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theMSCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theMVI:out DataMapOfShapeInteger from BOPCol;
theAllocator:out BaseAllocator from BOPCol)
returns Integer from Standard
@ -305,10 +306,9 @@ is
ProcessExistingPaveBlocks(me:out;
theInt : Integer from Standard;
theMPBOnIn : MapOfPaveBlock from BOPDS;
theMV : MapOfInteger from BOPCol;
theMPB : out MapOfPaveBlock from BOPDS;
theMSCPB : out DataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theMVI : out DataMapOfShapeInteger from BOPCol)
theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theMVI : out DataMapOfShapeInteger from BOPCol;
theMPB : out MapOfPaveBlock from BOPDS)
is protected;
--modified by NIZHNY-EMV Fri Dec 23 15:40:06 2011
@ -322,8 +322,8 @@ is
--modified by NIZHNY-EMV Wed Jan 11 10:59:32 2012
TreatNewVertices(me:out;
theMVI : DataMapOfShapeInteger from BOPCol;
theImages : out DataMapOfShapeListOfShape from BOPCol)
theMVI : IndexedDataMapOfShapeInteger from BOPCol;
theImages : out IndexedDataMapOfShapeListOfShape from BOPCol)
is protected;
--modified by NIZHNY-EMV Wed Jan 11 10:59:33 2012
@ -336,15 +336,21 @@ is
--- is closed 3D-curve
--modified by NIZHNY-EMV Wed Feb 15 08:40:02 2012
IsCommonBlockOnFaces(me:out;
aPB : PaveBlock from BOPDS;
nF1 : Integer from Standard;
nF2 : Integer from Standard)
returns Boolean from Standard
PreparePostTreatFF(me:out;
aInt : Integer from Standard;
aPB : PaveBlock from BOPDS;
aMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
aMVI : out DataMapOfShapeInteger from BOPCol;
aVC : out VectorOfCurve from BOPDS)
is protected;
---Purpose:
--- Checks if the PaveBlock aPB is common block
--- for faces with indices nF1 and nF2
---Keeps data for post treatment
RefineFaceInfoOn(me:out)
is protected;
---Purpose:
--- Refines the state On for the all faces having
--- state information
fields
myArguments : ListOfShape from BOPCol is protected;

View File

@ -198,8 +198,6 @@
return;
}
//
myDS->RefineFaceInfoOn();
//
// 22
PerformFF();
if (myErrorStatus) {
@ -211,6 +209,8 @@
return;
}
//
RefineFaceInfoOn();
//
MakePCurves();
if (myErrorStatus) {
return;

View File

@ -49,7 +49,7 @@
void BOPAlgo_PaveFiller::PerformVV()
{
Standard_Boolean bWithSubShape;
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, aNbVV, j, iX;
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, aNbVV, j, iX, k, aNbBlocks;
Handle(NCollection_IncAllocator) aAllocator;
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI;
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2;
@ -73,7 +73,7 @@
//
//-----------------------------------------------------scope f
aAllocator=new NCollection_IncAllocator();
BOPCol_DataMapOfIntegerListOfInteger aMILI(100, aAllocator);
BOPCol_IndexedDataMapOfIntegerListOfInteger aMILI(100, aAllocator);
BOPCol_DataMapOfIntegerListOfInteger aMBlocks(100, aAllocator);
BOPCol_ListOfShape aLV(aAllocator);
//
@ -94,9 +94,9 @@
BOPAlgo_Tools::MakeBlocksCnx(aMILI, aMBlocks, aAllocator);
//
// 3. Make vertices
aItMILI.Initialize(aMBlocks);
for (; aItMILI.More(); aItMILI.Next()) {
const BOPCol_ListOfInteger& aLI=aItMILI.Value();
aNbBlocks=aMBlocks.Extent();
for (k=0; k<aNbBlocks; ++k) {
const BOPCol_ListOfInteger& aLI=aMBlocks.Find(k);
//
aLV.Clear();
aItLI.Initialize(aLI);
@ -124,15 +124,15 @@
//
aItLI2.Initialize(aLI);
for (j=0; aItLI2.More(); aItLI2.Next(), ++j) {
if (j>i) {
n2=aItLI2.Value();
//
myDS->AddInterf(n1, n2);
iX=aVVs.Append()-1;
BOPDS_InterfVV& aVV=aVVs(iX);
aVV.SetIndices(n1, n2);
aVV.SetIndexNew(n);
}
if (j>i) {
n2=aItLI2.Value();
//
myDS->AddInterf(n1, n2);
iX=aVVs.Append()-1;
BOPDS_InterfVV& aVV=aVVs(iX);
aVV.SetIndices(n1, n2);
aVV.SetIndexNew(n);
}
}
}
}

View File

@ -91,8 +91,8 @@
//
//-----------------------------------------------------scope f
aAllocator=new NCollection_IncAllocator();
BOPDS_DataMapOfPaveBlockListOfPaveBlock aMPBLPB(100, aAllocator);
BOPDS_DataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(100, aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
//
aDiscretize=30;
aDeflection=0.01;
@ -133,9 +133,12 @@
Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue();
if (!aPB1->HasShrunkData()) {
FillShrunkData(aPB1);
if (myErrorStatus) {
return;
if (myWarningStatus) {
continue;
}
//if (myErrorStatus) {
// return;
//}
}
aPB1->ShrunkData(aTS11, aTS12, aBB1);
//
@ -146,9 +149,12 @@
Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
if (!aPB2->HasShrunkData()) {
FillShrunkData(aPB2);
if (myErrorStatus) {
return;
if (myWarningStatus) {
continue;
}
//if (myErrorStatus) {
// return;
//}
}
aPB2->ShrunkData(aTS21, aTS22, aBB2);
//
@ -203,12 +209,12 @@
//
aNbCPrts=aCPrts.Length();
//modified by NIZHNY-EMV Wed Dec 07 14:13:15 2011
if (aNbCPrts) {
if (myWarningStatus) {
myErrorStatus = 40;
return;
}
}
//if (aNbCPrts) {
// if (myWarningStatus) {
// myErrorStatus = 40;
// continue;
// }
//}
//modified by NIZHNY-EMV Wed Dec 07 14:13:16 2011
for (i=1; i<=aNbCPrts; ++i) {
const IntTools_CommonPrt& aCPart=aCPrts(i);
@ -297,7 +303,7 @@
//
aCPB.SetPaveBlocks(aPB1, aPB2);
aCPB.SetIndexInterf(iX);
aMVCPB.Bind(aVnew, aCPB);
aMVCPB.Add(aVnew, aCPB);
}//case TopAbs_VERTEX:
break;
//
@ -339,7 +345,7 @@
// post treatment
//=========================================
BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, aAllocator);
PerformVertices(aMVCPB, aAllocator);
PerformVerticesEE(aMVCPB, aAllocator);
//-----------------------------------------------------scope t
aMPBLPB.Clear();
aMVCPB.Clear();
@ -349,8 +355,8 @@
//function : PerformVertices
//purpose :
//=======================================================================
Standard_Integer BOPAlgo_PaveFiller::PerformVertices
(BOPDS_DataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE
(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
Handle(NCollection_BaseAllocator)& theAllocator)
{
Standard_Integer aNbV, iRet;
@ -361,22 +367,19 @@
return iRet;
}
//
Standard_Integer nVx, iV, j, nE, iFlag, iX;
Standard_Integer nVx, iV, j, nE, iFlag, iX, i, aNb;
Standard_Real aT;
TopoDS_Shape aV;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItImag;
BOPDS_DataMapIteratorOfDataMapOfShapeCoupleOfPaveBlocks aItMVCPB;
BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger aItMPBLI;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
BOPDS_ShapeInfo aSI;
BOPDS_Pave aPave;
//
BOPDS_DataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
BOPCol_ListOfShape aLS(theAllocator);
BOPCol_DataMapOfShapeInteger aMVI(100, theAllocator);
BOPCol_DataMapOfShapeListOfShape aImages;
BOPCol_IndexedDataMapOfShapeInteger aMVI(100, theAllocator);
BOPCol_IndexedDataMapOfShapeListOfShape aImages;
//
aSI.SetShapeType(TopAbs_VERTEX);
BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE();
@ -384,12 +387,11 @@
// 1 prepare arguments
//
// <- DEB
aItMVCPB.Initialize(theMVCPB);
for (; aItMVCPB.More(); aItMVCPB.Next()) {
const TopoDS_Shape& aS=aItMVCPB.Key();
const BOPDS_CoupleOfPaveBlocks& aCPB=aItMVCPB.Value();
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aS=theMVCPB.FindKey(i);
const BOPDS_CoupleOfPaveBlocks& aCPB=theMVCPB.FindFromIndex(i);
iV=aCPB.IndexInterf();
aMVI.Bind(aS, iV);
aMVI.Add(aS, iV);
}
//
// 2 Fuse vertices
@ -397,10 +399,10 @@
//
// 3 Add new vertices to myDS;
// connect indices to CPB structure
aItImag.Initialize(aImages);
for (; aItImag.More(); aItImag.Next()) {
const TopoDS_Vertex& aV=(*(TopoDS_Vertex*)(&aItImag.Key()));
const BOPCol_ListOfShape& aLVSD=aItImag.Value();
aNb = aImages.Extent();
for (i=1; i<=aNb; ++i) {
const TopoDS_Vertex& aV=(*(TopoDS_Vertex*)(&aImages.FindKey(i)));
const BOPCol_ListOfShape& aLVSD=aImages.FindFromIndex(i);
//
aSI.SetShape(aV);
iV=myDS->Append(aSI);
@ -412,7 +414,7 @@
aItLS.Initialize(aLVSD);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aVx = aItLS.Value();
BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFind(aVx);
BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFromKey(aVx);
aCPB.SetIndex(iV);
// update EE interference
iX=aCPB.IndexInterf();
@ -425,20 +427,19 @@
{
Handle(BOPDS_PaveBlock) aPB[2];
//
aItMVCPB.Initialize(theMVCPB);
for (; aItMVCPB.More(); aItMVCPB.Next()) {
const BOPDS_CoupleOfPaveBlocks& aCPB=aItMVCPB.Value();
for (i=1; i<=aNbV; ++i) {
const BOPDS_CoupleOfPaveBlocks& aCPB=theMVCPB.FindFromIndex(i);
iV=aCPB.Index();
aCPB.PaveBlocks(aPB[0], aPB[1]);
for (j=0; j<2; ++j) {
if (aMPBLI.IsBound(aPB[j])) {
BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFind(aPB[j]);
if (aMPBLI.Contains(aPB[j])) {
BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB[j]);
aLI.Append(iV);
}
else {
BOPCol_ListOfInteger aLI(theAllocator);
aLI.Append(iV);
aMPBLI.Bind(aPB[j], aLI);
aMPBLI.Add(aPB[j], aLI);
}
}
}
@ -447,13 +448,13 @@
// 5
// 5.1 Compute Extra Paves and
// 5.2. Add Extra Paves to the PaveBlocks
aItMPBLI.Initialize(aMPBLI);
for (; aItMPBLI.More(); aItMPBLI.Next()) {
Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key();
aNb=aMPBLI.Extent();
for(i=1; i<=aNb; ++i) {
Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
nE=aPB->OriginalEdge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
// 1,2
const BOPCol_ListOfInteger& aLI=aItMPBLI.Value();
const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromIndex(i);
aItLI.Initialize(aLI);
for (; aItLI.More(); aItLI.Next()) {
nVx=aItLI.Value();
@ -468,9 +469,9 @@
}
}
// 6 Split PaveBlocksa
aItMPBLI.Initialize(aMPBLI);
for (; aItMPBLI.More(); aItMPBLI.Next()) {
Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key();
aNb=aMPBLI.Extent();
for(i=1; i<=aNb; ++i) {
Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
nE=aPB->OriginalEdge();
// 3
if (!aPB->IsCommonBlock()) {
@ -490,19 +491,17 @@
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::TreatNewVertices(
const BOPCol_DataMapOfShapeInteger& aMapVI,
BOPCol_DataMapOfShapeListOfShape& myImages)
const BOPCol_IndexedDataMapOfShapeInteger& aMapVI,
BOPCol_IndexedDataMapOfShapeListOfShape& myImages)
{
Standard_Integer j, i, aNbV, aNbVSD;
Standard_Real aTol;
TopoDS_Shape aVF;
TopoDS_Vertex aVnew;
BOPCol_IndexedMapOfShape aMV, aMVProcessed;
BOPCol_IndexedMapOfShape aMVProcessed;
BOPCol_ListIteratorOfListOfInteger aIt;
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItMVI;
BOPCol_DataMapOfShapeListOfShape aMVV;
BOPCol_IndexedDataMapOfShapeListOfShape aMVLV;
BOPCol_DataMapOfIntegerShape aMIS;
BOPCol_IndexedDataMapOfShapeBox aMSB;
//
@ -510,15 +509,9 @@
BOPDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aItMVI.Initialize(aMapVI);
for (; aItMVI.More(); aItMVI.Next()) {
const TopoDS_Shape& aV=aItMVI.Key();
aMV.Add(aV);
}
//
aNbV = aMV.Extent();
aNbV = aMapVI.Extent();
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMV(i);
const TopoDS_Shape& aV=aMapVI.FindKey(i);
Bnd_Box aBox;
//
aTol=BRep_Tool::Tolerance(*(TopoDS_Vertex*)(&aV));
@ -535,7 +528,7 @@
// Chains
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMV(i);
const TopoDS_Shape& aV=aMapVI.FindKey(i);
//
if (aMVProcessed.Contains(aV)) {
continue;
@ -613,37 +606,22 @@
aLVSD.Append(aVP);
aMVProcessed.Add(aVP);
}
myImages.Bind(aVF, aLVSD);
aMVLV.Add(aVF, aLVSD);
}// for (i=1; i<=aNbV; ++i) {
// Make new vertices
aMV.Clear();
aItIm.Initialize(myImages);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aV=aItIm.Key();
BOPCol_ListOfShape& aLVSD=aItIm.ChangeValue();
aNbV=aMVLV.Extent();
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMVLV.FindKey(i);
BOPCol_ListOfShape& aLVSD=aMVLV.ChangeFromIndex(i);
aNbVSD=aLVSD.Extent();
if (aNbVSD>1) {
aMV.Add(aV);
BOPTools_AlgoTools::MakeVertex(aLVSD, aVnew);
aMVV.Bind(aVnew, aLVSD);
myImages.Add(aVnew, aLVSD);
} else {
myImages.Add(aV, aLVSD);
}
}
//
// UnBind old vertices
aNbV=aMV.Extent();
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMV(i);
myImages.UnBind(aV);
}
//
// Bind new vertices
aItIm.Initialize(aMVV);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aV=aItIm.Key();
const BOPCol_ListOfShape& aLVSD=aItIm.Value();
myImages.Bind(aV, aLVSD);
}
}
//=======================================================================
@ -677,11 +655,7 @@
aSR.Perform();
iErr=aSR.ErrorStatus();
if (iErr) {
//modified by NIZHNY-EMV Wed Dec 07 14:12:10 2011
if (iErr==6) {
myWarningStatus = 1;
}
//modified by NIZHNY-EMV Wed Dec 07 14:12:12 2011
myWarningStatus = 1;
//myErrorStatus=40;
return;
}

View File

@ -91,8 +91,8 @@
aAllocator=new NCollection_IncAllocator();
BOPCol_MapOfInteger aMIEFC(100, aAllocator);
BOPDS_DataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
BOPDS_DataMapOfPaveBlockListOfInteger aMPBLI(100, aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, aAllocator);
//
aDiscretize=35;
aDeflection=0.01;
@ -118,7 +118,7 @@
const Bnd_Box& aBBF=myDS->ShapeInfo(nF).Box();
//
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
const BOPDS_MapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
//
@ -173,14 +173,6 @@
//
const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
aNbCPrts=aCPrts.Length();
//modified by NIZHNY-EMV Wed Dec 07 14:17:07 2011
/*if (aNbCPrts) {
if (myWarningStatus) {
myErrorStatus = 40;
return;
}
}*/
//modified by NIZHNY-EMV Wed Dec 07 14:17:09 2011
for (i=1; i<=aNbCPrts; ++i) {
const IntTools_CommonPrt& aCPart=aCPrts(i);
aType=aCPart.Type();
@ -275,7 +267,7 @@
//
aCPB.SetPaveBlocks(aPB, aPB);
aCPB.SetIndexInterf(iX);
aMVCPB.Bind(aVnew, aCPB);
aMVCPB.Add(aVnew, aCPB);
}
}
break;
@ -314,7 +306,7 @@
// post treatment
//=========================================
BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator);
PerformVertices1(aMVCPB, aAllocator);
PerformVerticesEF(aMVCPB, aAllocator);
//
// Update FaceInfoIn for all faces having EF common parts
BOPCol_MapIteratorOfMapOfInteger aItMI;
@ -338,8 +330,8 @@
//function : PerformVertices1
//purpose :
//=======================================================================
Standard_Integer BOPAlgo_PaveFiller::PerformVertices1
(BOPDS_DataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEF
(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
Handle(NCollection_BaseAllocator)& theAllocator)
{
Standard_Integer aNbV, iRet;
@ -350,29 +342,26 @@
return iRet;
}
//
Standard_Integer nVx, nVSD, iV, iErr, nE, iFlag, iX;
Standard_Integer nVx, nVSD, iV, iErr, nE, iFlag, iX, i, aNbPBLI;
Standard_Real aT;
TopoDS_Shape aV;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPDS_DataMapIteratorOfDataMapOfShapeCoupleOfPaveBlocks aItMVCPB;
BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger aItMPBLI;
BOPDS_PDS aPDS;
BOPDS_ShapeInfo aSI;
BOPDS_Pave aPave;
//
BOPCol_ListOfShape aLS(theAllocator);
BOPCol_DataMapOfShapeInteger aMVI(100, theAllocator);
BOPDS_DataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
BOPAlgo_PaveFiller aPF(theAllocator);
//
aSI.SetShapeType(TopAbs_VERTEX);
BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF();
//
// 1 prepare arguments
aItMVCPB.Initialize(theMVCPB);
for (; aItMVCPB.More(); aItMVCPB.Next()) {
const TopoDS_Shape& aS=aItMVCPB.Key();
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aS=theMVCPB.FindKey(i);
aLS.Append(aS);
}
//
@ -414,7 +403,7 @@
iV=aMVI.Find(aV);
}
//
BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFind(aVx);
BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFromKey(aVx);
aCPB.SetIndex(iV);
// update EF interference
iX=aCPB.IndexInterf();
@ -422,27 +411,27 @@
aEF.SetIndexNew(iV);
// map aMPBLI
const Handle(BOPDS_PaveBlock)& aPB=aCPB.PaveBlock1();
if (aMPBLI.IsBound(aPB)) {
BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFind(aPB);
if (aMPBLI.Contains(aPB)) {
BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB);
aLI.Append(iV);
}
else {
BOPCol_ListOfInteger aLI(theAllocator);
aLI.Append(iV);
aMPBLI.Bind(aPB, aLI);
aMPBLI.Add(aPB, aLI);
}
}
//
// 5
// 5.1 Compute Extra Paves and
// 5.2. Add Extra Paves to the PaveBlocks
aItMPBLI.Initialize(aMPBLI);
for (; aItMPBLI.More(); aItMPBLI.Next()) {
Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key();
aNbPBLI=aMPBLI.Extent();
for (i=1; i<=aNbPBLI; ++i) {
Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromIndex(i);
nE=aPB->OriginalEdge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
//
const BOPCol_ListOfInteger& aLI=aItMPBLI.Value();
aItLI.Initialize(aLI);
for (; aItLI.More(); aItLI.Next()) {
nVx=aItLI.Value();
@ -457,9 +446,8 @@
}
}
// 6 Split PaveBlocksa
aItMPBLI.Initialize(aMPBLI);
for (; aItMPBLI.More(); aItMPBLI.Next()) {
Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key();
for (i=1; i<=aNbPBLI; ++i) {
Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
nE=aPB->OriginalEdge();
// 3
if (!aPB->IsCommonBlock()) {

View File

@ -65,6 +65,7 @@
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_DataMapOfShapeInteger.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_IndexedMapOfInteger.hxx>
#include <BOPInt_Context.hxx>
#include <BOPInt_Tools.hxx>
@ -99,6 +100,9 @@ static void FindPaveBlocksByFirst(BOPDS_ListOfPaveBlock& aLPBC,
static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
const Handle(BOPInt_Context)& aCtx);
static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1,
const TopoDS_Face& aF2);
//=======================================================================
//function : PerformFF
//purpose :
@ -160,8 +164,12 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
if (bIsDone) {
aTolR3D=aFaceFace.TolReached3d();
aTolR2D=aFaceFace.TolReached2d();
if (aTolR3D < 1.e-7){
aTolR3D=1.e-7;
if (aTolR3D < 5.e-6){
if (!IsAnalytic(aF1, aF2)) {
aTolR3D=5.e-6;
} else if (aTolR3D < 1.e-7) {
aTolR3D=1.e-7;
}
}
if (aTolR2D < 1.e-7){
aTolR2D=1.e-7;
@ -244,12 +252,13 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
}
//
Standard_Boolean bExist, bValid2D;
Standard_Integer i, nF1, nF2, aNbC, aNbP, j, aSC;
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
Standard_Integer nV1, nV2, iFlag;
Standard_Real aTolR3D, aTolR2D, aT1, aT2;
Handle(NCollection_IncAllocator) aAllocator;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
TopoDS_Edge aES;
Handle(BOPDS_PaveBlock) aPBOut;
//
//-----------------------------------------------------scope f
aAllocator=new NCollection_IncAllocator();
@ -260,10 +269,9 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
BOPDS_MapOfPaveBlock aMPBOnIn(100, aAllocator),
aMPBAdd(100, aAllocator);
BOPDS_ListOfPaveBlock aLPB(aAllocator);
BOPDS_DataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator);
BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator);
//modified by NIZHNY-EMV Tue Sep 27 08:26:45 2011
BOPCol_MapOfInteger aMVB;
BOPCol_DataMapOfIntegerListOfInteger aMInterfs;
BOPCol_ListOfInteger aLIEF;
iFlag = 1 + 2 + 4 + 8 + 16; // 2^0 + 2^1 + 2^2 + 2^3 + 2^4
@ -300,7 +308,6 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
//
aMVOnIn.Clear();
aMPBOnIn.Clear();
aMVB.Clear();
//
myDS->VerticesOnIn(nF1, nF2, aMVOnIn, aMPBOnIn);
myDS->SharedEdges(nF1, nF2, aLSE, aAllocator);
@ -319,17 +326,14 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
//
aCPB.SetIndexInterf(i);
aCPB.SetIndex(j);
aMSCPB.Bind(aV, aCPB);
aMSCPB.Add(aV, aCPB);
}
}
//modified by NIZHNY-EMV Tue Sep 27 08:26:16 2011
//
// 2. Treat Curves
aMVStick.Clear();
aMInterfs.Clear();
GetInterfs(nF1, nF2, aMVStick, aMInterfs, iFlag);
//modified by NIZHNY-EMV Tue Sep 27 08:26:18 2011
//modified by NIZHNY-EMV Fri Sep 23 11:54:59 2011
for (j=0; j<aNbC; ++j) {
BOPDS_Curve& aNC=aVC.ChangeValue(j);
const IntTools_Curve& aIC=aNC.Curve();
@ -338,33 +342,26 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
// DEBt
aNC.InitPaveBlock1();
//
//modified by NIZHNY-EMV Tue Sep 27 09:10:52 2011
PutPaveOnCurve(aMVOnIn, aTolR3D, aNC, nF1, nF2, aMVB);
//modified by NIZHNY-EMV Fri Feb 18 16:42:19 2011
PutPaveOnCurve(aMVOnIn, aTolR3D, aNC, nF1, nF2);
//
ProcessUnUsedVertices(nF1, nF2, aNC, aMVStick);
//pkv/904/F7
if (aNbC == 1) {
aLIEF = aMInterfs(4);
ProcessUnUsedVertices(nF1, nF2, aNC, aLIEF);
}
//modified by NIZHNY-EMV Tue Sep 27 09:10:59 2011
//
if (aIC.HasBounds()) {
//modified by NIZHNY-EMV Wed Mar 16 14:11:36 2011
PutBoundPaveOnCurve(aF1, aF2, aTolR3D, aNC, aMVOnIn, aMVB);
//modified by NIZHNY-EMV Wed Mar 16 12:53:21 2011
PutBoundPaveOnCurve(aF1, aF2, aTolR3D, aNC, aMVOnIn);
}
}//for (j=0; j<aNbC; ++j) {
//
//modified by NIZHNY-EMV Wed Feb 15 10:08:58 2012
// Put closing pave if needded
for (j=0; j<aNbC; ++j) {
BOPDS_Curve& aNC=aVC.ChangeValue(j);
PutClosingPaveOnCurve (aNC);
}
//modified by NIZHNY-EMV Wed Feb 15 10:09:02 2012
aSC = 0;
//
// 3. Make section edges
for (j=0; j<aNbC; ++j) {
BOPDS_Curve& aNC=aVC.ChangeValue(j);
@ -381,20 +378,8 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
Handle(BOPDS_PaveBlock)& aPB=aItLPB.ChangeValue();
aPB->Indices(nV1, nV2);
aPB->Range (aT1, aT2);
//modified by NIZHNY-EMV Mon Apr 09 11:36:30 2012
if (fabs(aT1 - aT2) < Precision::PConfusion()) {
continue;
}
//modified by NIZHNY-EMV Mon Apr 09 11:36:31 2012
bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn);
if (bExist) {
aSC++;
continue;
}
//
bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aLSE);
if (bExist) {
aSC++;
if (fabs(aT1 - aT2) < Precision::PConfusion()) {
continue;
}
//
@ -403,6 +388,32 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
continue;
}
//
bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aLSE);
if (bExist) {
continue;
}
//
bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn, aPBOut);
if (bExist) {
if (aMPBAdd.Add(aPBOut)) {
if (!aPBOut->IsCommonBlock()) {
TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPBOut->Edge());
if (aTolR3D > BRep_Tool::Tolerance(aE)) {
BRep_Builder BB;
//
TopoDS_Vertex& aV1 = *(TopoDS_Vertex*)&myDS->Shape(aPBOut->Pave1().Index());
TopoDS_Vertex& aV2 = *(TopoDS_Vertex*)&myDS->Shape(aPBOut->Pave2().Index());
//
BB.UpdateVertex(aV1, aTolR3D);
BB.UpdateVertex(aV2, aTolR3D);
BB.UpdateEdge(aE, aTolR3D);
}
PreparePostTreatFF(i, aPBOut, aMSCPB, aMVI, aVC);
}
}
continue;
}
//
// Make Edge
const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
@ -425,19 +436,14 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
aCPB.SetIndex(j);
aCPB.SetPaveBlock1(aPB);
//
aMSCPB.Bind(aES, aCPB);
aMSCPB.Add(aES, aCPB);
aMVI.Bind(aV1, nV1);
aMVI.Bind(aV2, nV2);
aSC++;
}
//
aLPBC.RemoveFirst();
}//for (j=0; j<aNbC; ++j) {
//modified by NIZHNY-EMV Fri Dec 23 14:43:26 2011
if (aSC) {
ProcessExistingPaveBlocks(i, aMPBOnIn, aMVB, aMPBAdd, aMSCPB, aMVI);
}
//modified by NIZHNY-EMV Fri Dec 23 14:43:27 2011
ProcessExistingPaveBlocks(i, aMPBOnIn, aMSCPB, aMVI, aMPBAdd);
}//for (i=0; i<aNbFF; ++i) {
//
// post treatment
@ -459,9 +465,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
for (j=0; j<aNbC; ++j) {
BOPDS_Curve& aNC=aVNC(j);
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
//modified by NIZHNY-EMV Tue Dec 13 09:04:41 2011
UpdateExistingPaveBlocks(aLPBC, nF1, nF2);
//modified by NIZHNY-EMV Tue Dec 13 09:04:44 2011
aItLPB.Initialize(aLPBC);
for(; aItLPB.More(); aItLPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
@ -492,7 +496,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
//purpose :
//=======================================================================
Standard_Integer BOPAlgo_PaveFiller::PostTreatFF
(BOPDS_DataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI,
Handle(NCollection_BaseAllocator)& theAllocator)
{
@ -505,16 +509,13 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
}
//
Standard_Boolean bHasPaveBlocks, bOld;
Standard_Integer iErr, nSx, nVSD, iX, iP, iC, j, nV, iV, iE;
//modified by NIZHNY-EMV Tue Dec 13 15:47:08 2011
Standard_Integer iErr, nSx, nVSD, iX, iP, iC, j, nV, iV, iE, k;
Standard_Integer jx;
Standard_Real aT;
//modified by NIZHNY-EMV Tue Dec 13 15:47:14 2011
Standard_Integer aNbLPBx;
TopAbs_ShapeEnum aType;
TopoDS_Shape aV, aE;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPDS_DataMapIteratorOfDataMapOfShapeCoupleOfPaveBlocks aIt;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
BOPDS_PDS aPDS;
Handle(BOPDS_PaveBlock) aPB1;
@ -530,52 +531,48 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
//
// 0
if (aNbS==1) {
aIt.Initialize(theMSCPB);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Key();
const BOPDS_CoupleOfPaveBlocks &aCPB=aIt.Value();
const TopoDS_Shape& aS=theMSCPB.FindKey(1);
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromIndex(1);
//
aType=aS.ShapeType();
if (aType==TopAbs_VERTEX) {
aSI.SetShapeType(aType);
aSI.SetShape(aS);
iV=myDS->Append(aSI);
//
aType=aS.ShapeType();
if (aType==TopAbs_VERTEX) {
iX=aCPB.IndexInterf();
iP=aCPB.Index();
BOPDS_InterfFF& aFF=aFFs(iX);
BOPDS_VectorOfPoint& aVNP=aFF.ChangePoints();
BOPDS_Point& aNP=aVNP(iP);
aNP.SetIndex(iV);
}
else if (aType==TopAbs_EDGE) {
//modified by NIZHNY-EMV Thu Dec 15 08:32:11 2011
aPB1=aCPB.PaveBlock1();
//
if (aPB1->HasEdge()) {
BOPDS_InterfFF& aFF=aFFs(aCPB.IndexInterf());
BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves();
BOPDS_Curve& aNC=aVNC(aCPB.Index());
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
aLPBC.Clear();
} else {
aSI.SetShapeType(aType);
aSI.SetShape(aS);
iV=myDS->Append(aSI);
iE=myDS->Append(aSI);
//
iX=aCPB.IndexInterf();
iP=aCPB.Index();
BOPDS_InterfFF& aFF=aFFs(iX);
BOPDS_VectorOfPoint& aVNP=aFF.ChangePoints();
BOPDS_Point& aNP=aVNP(iP);
aNP.SetIndex(iV);
aPB1->SetEdge(iE);
}
else if (aType==TopAbs_EDGE) {
//modified by NIZHNY-EMV Thu Dec 15 08:32:11 2011
aPB1=aCPB.PaveBlock1();
//
if (aPB1->HasEdge()) {
BOPDS_InterfFF& aFF=aFFs(aCPB.IndexInterf());
BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves();
BOPDS_Curve& aNC=aVNC(aCPB.Index());
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
aLPBC.Clear();
} else {
aSI.SetShapeType(aType);
aSI.SetShape(aS);
iE=myDS->Append(aSI);
//
aPB1->SetEdge(iE);
}
//modified by NIZHNY-EMV Thu Dec 15 08:32:13 2011
}
return iRet;
//modified by NIZHNY-EMV Thu Dec 15 08:32:13 2011
}
return iRet;
}
//
// 1 prepare arguments
aIt.Initialize(theMSCPB);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Key();
for (k=1; k<=aNbS; ++k) {
const TopoDS_Shape& aS=theMSCPB.FindKey(k);
aLS.Append(aS);
}
//
@ -616,7 +613,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
iV=aMVI.Find(aV);
}
// update FF interference
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx);
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx);
iX=aCPB.IndexInterf();
iP=aCPB.Index();
BOPDS_InterfFF& aFF=aFFs(iX);
@ -628,7 +625,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
else if (aType==TopAbs_EDGE) {
bHasPaveBlocks=aPDS->HasPaveBlocks(nSx);
if (!bHasPaveBlocks) {
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx);
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx);
aPB1=aCPB.PaveBlock1();
//
if (aPB1->HasEdge()) {
@ -653,7 +650,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
}
}
else {
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx);
const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx);
iX=aCPB.IndexInterf();
iC=aCPB.Index();
aPB1=aCPB.PaveBlock1();
@ -883,7 +880,8 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
(const Handle(BOPDS_PaveBlock)& thePB,
const BOPDS_Curve& theNC,
const Standard_Real theTolR3D,
const BOPDS_MapOfPaveBlock& theMPBOnIn)
const BOPDS_MapOfPaveBlock& theMPBOnIn,
Handle(BOPDS_PaveBlock&) aPBOut)
{
Standard_Boolean bRet;
Standard_Real aT1, aT2, aTm, aTx;
@ -928,6 +926,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
if (!iFlag) {
iFlag=myContext->ComputePE(aPm, theTolR3D, aSp, aTx);
if (!iFlag) {
aPBOut = aPB;
return bRet;
}
}
@ -946,8 +945,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
const TopoDS_Face& aF2,
const Standard_Real aTolR3D,
BOPDS_Curve& aNC,
BOPCol_MapOfInteger& aMVOnIn,
BOPCol_MapOfInteger& aMVB)
BOPCol_MapOfInteger& aMVOnIn)
{
Standard_Boolean bVF;
Standard_Integer nV, iFlag, nVn, j, aNbEP;
@ -1041,7 +1039,6 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
BRepBndLib::Add(aVn, aBoxDS);
//modified by NIZHNY-EMV Wed Mar 16 13:46:01 2011
aMVOnIn.Add(nVn);
aMVB.Add(nVn);
//modified by NIZHNY-EMV Tue Apr 12 10:01:51 2011
}
}
@ -1055,8 +1052,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
const Standard_Real aTolR3D,
BOPDS_Curve& aNC,
const Standard_Integer nF1,
const Standard_Integer nF2,
BOPCol_MapOfInteger& aMVB)
const Standard_Integer nF2)
{
Standard_Boolean bIsVertexOnLine, bInBothFaces;
Standard_Integer nV;
@ -1118,8 +1114,6 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV);
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
BRepBndLib::Add(aV, aBoxDS);
//
aMVB.Add(nV);
}
//modified by NIZHNY-EMV Fri Sep 23 13:35:49 2011
}
@ -1629,23 +1623,29 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
(const Standard_Integer theInt,
const BOPDS_MapOfPaveBlock& aMPBOnIn,
const BOPCol_MapOfInteger& aMV,
BOPDS_MapOfPaveBlock& aMPB,
BOPDS_DataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI)
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI,
BOPDS_MapOfPaveBlock& aMPB)
{
Standard_Integer nV, nV1, nV2, nE, iFlag, iC;
Standard_Integer nV, nE, iFlag, aNbV, i;
Standard_Real aT;
BOPCol_MapIteratorOfMapOfInteger aIt;
BOPCol_IndexedMapOfInteger aMV;
BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItB;
BOPDS_MapIteratorOfMapOfPaveBlock aItPB;
//
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
BOPDS_InterfFF& aFF = aFFs(theInt);
BOPDS_VectorOfCurve& aVC=aFF.ChangeCurves();
//
aIt.Initialize(aMV);
for (; aIt.More(); aIt.Next()) {
nV = aIt.Value();
//get bounds
aItB.Initialize(aMVI);
for (; aItB.More(); aItB.Next()) {
aMV.Add(aItB.Value());
}
//
aNbV = aMV.Extent();
for (i=1; i<=aNbV; ++i) {
nV = aMV(i);
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
const Bnd_Box& aBoxV=aSIV.Box();
const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aSIV.Shape();
@ -1669,25 +1669,9 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
//
iFlag=myContext->ComputeVE (aV, aE, aT);
if (!iFlag) {
iC=aVC.Append()-1;
BOPDS_Curve& aNC=aVC(iC);
BOPDS_ListOfPaveBlock& aLPBC = aNC.ChangePaveBlocks();
//
aMPB.Add(aPB);
aLPBC.Append(aPB);
//
aPB->Indices(nV1, nV2);
const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
// Keep info for post treatment
BOPDS_CoupleOfPaveBlocks aCPB;
aCPB.SetIndexInterf(theInt);
aCPB.SetIndex(iC);
aCPB.SetPaveBlock1(aPB);
//
aMSCPB.Bind(aE, aCPB);
aMVI.Bind(aV1, nV1);
aMVI.Bind(aV2, nV2);
PreparePostTreatFF(theInt, aPB, aMSCPB, aMVI, aVC);
}
}
}
@ -1707,8 +1691,8 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
return;
}
//
BOPDS_MapOfPaveBlock aMPB;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
BOPDS_IndexedMapOfPaveBlock aMPB;
Standard_Integer nE;
Handle(BOPDS_PaveBlock) aPBf;
aPBf = aLPBC.First();
@ -1727,6 +1711,31 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
return;
}
//
//remove micro edges from aLPB
aIt.Initialize(aLPB);
for (aIt.Next(); aIt.More();) {
aPB = aIt.Value();
const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge());
if (IsMicroEdge(aE, myContext)) {
aLPB.Remove(aIt);
continue;
}
aIt.Next();
}
//update face info
myDS->UpdateFaceInfoOn(nF1);
//
myDS->UpdateFaceInfoOn(nF2);
//
BOPDS_FaceInfo& aFI1 = myDS->ChangeFaceInfo(nF1);
BOPDS_FaceInfo& aFI2 = myDS->ChangeFaceInfo(nF2);
//
BOPDS_IndexedMapOfPaveBlock& aMPBOn1 = aFI1.ChangePaveBlocksOn();
BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.ChangePaveBlocksIn();
BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.ChangePaveBlocksOn();
BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.ChangePaveBlocksIn();
//
//
aPBf = aLPB.First();
if (aPBf->IsCommonBlock()) {
const Handle(BOPDS_CommonBlock)& aCB1 = aPBf->CommonBlock();
@ -1790,7 +1799,14 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
for (aIt.Next(); aIt.More(); aIt.Next()) {
aPB = aIt.Value();
//
if (IsCommonBlockOnFaces(aPB, nF1, nF2)) {
Standard_Integer nF = (aMPBOn1.Contains(aPBf) ||
aMPBIn1.Contains(aPBf)) ? nF2 : nF1;
const TopoDS_Face& aF = *(TopoDS_Face*)&myDS->Shape(nF);
IntTools_Range aShrR(aPB->Pave1().Parameter(), aPB->Pave2().Parameter());
const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge());
//
Standard_Boolean bCom = BOPTools_AlgoTools::IsBlockInOnFace(aShrR, aF, aE, myContext);
if (bCom) {
aCB = new BOPDS_CommonBlock;
aCB->AddPaveBlock(aPB);
aCB->AddFace(nF1);
@ -1802,22 +1818,11 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
aLPB1.Append(aPB);
}
}
//update face info
myDS->UpdateFaceInfoOn(nF1);
//
myDS->UpdateFaceInfoOn(nF2);
//
BOPDS_FaceInfo& aFI1 = myDS->ChangeFaceInfo(nF1);
BOPDS_FaceInfo& aFI2 = myDS->ChangeFaceInfo(nF2);
//
BOPDS_MapOfPaveBlock& aMPBOn1 = aFI1.ChangePaveBlocksOn();
BOPDS_MapOfPaveBlock& aMPBIn1 = aFI1.ChangePaveBlocksIn();
BOPDS_MapOfPaveBlock& aMPBOn2 = aFI2.ChangePaveBlocksOn();
BOPDS_MapOfPaveBlock& aMPBIn2 = aFI2.ChangePaveBlocksIn();
//
aItMPB.Initialize(aMPB);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPBnew = aItMPB.Value();
Standard_Integer i, aNbPB;
aNbPB=aMPB.Extent();
for (i=1; i<=aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPBnew = aMPB(i);
if (!aMPBOn1.Contains(aPBnew)) {
aMPBIn1.Add(aPBnew);
}
@ -1887,50 +1892,38 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
//modified by NIZHNY-EMV Wed Feb 15 10:08:34 2012
//=======================================================================
// function: IsCommonOnFaces
// purpose:
//function : PreparePostTreatFF
//purpose :
//=======================================================================
Standard_Boolean BOPAlgo_PaveFiller::IsCommonBlockOnFaces(const Handle(BOPDS_PaveBlock)& aPB,
const Standard_Integer nF1,
const Standard_Integer nF2)
void BOPAlgo_PaveFiller::PreparePostTreatFF
(const Standard_Integer aInt,
const Handle(BOPDS_PaveBlock)& aPB,
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI,
BOPDS_VectorOfCurve& aVC)
{
Standard_Boolean bRet;
Standard_Integer i, j, nV1, nV2;
Standard_Real aT1, aT2, aTm, f, l;
gp_Pnt aP1, aP2, aPm;
BRep_Builder aBB;
Standard_Integer nV1, nV2;
//
Standard_Integer iC=aVC.Append()-1;
BOPDS_ListOfPaveBlock& aLPBC = aVC(iC).ChangePaveBlocks();
aLPBC.Append(aPB);
//
bRet = Standard_True;
aPB->Indices(nV1, nV2);
//
const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge());
Handle(Geom_Curve) aC3D = BRep_Tool::Curve(aE, aT1, aT2);
aTm=IntTools_Tools::IntermediatePoint (aT1, aT2);
// Keep info for post treatment
BOPDS_CoupleOfPaveBlocks aCPB;
aCPB.SetIndexInterf(aInt);
aCPB.SetIndex(iC);
aCPB.SetPaveBlock1(aPB);
//
const TopoDS_Vertex& aV1 = *(TopoDS_Vertex*)&myDS->Shape(nV1);
const TopoDS_Vertex& aV2 = *(TopoDS_Vertex*)&myDS->Shape(nV2);
aC3D->D0(aTm, aPm);
//
TopoDS_Vertex aVm = BRepBuilderAPI_MakeVertex(aPm);
aBB.UpdateVertex(aVm, BRep_Tool::Tolerance(aE));
//
TopoDS_Vertex aV[3] = {aV1, aVm, aV2};
//
const TopoDS_Face& aF1=(*(TopoDS_Face *)(&myDS->Shape(nF1)));
const TopoDS_Face& aF2=(*(TopoDS_Face *)(&myDS->Shape(nF2)));
//
for (i = 0; i < 2; ++i) {
const TopoDS_Face& aF = (i == 0) ? aF1 : aF2;
for (j = 0; j < 3; ++j) {
if (bRet) {
bRet = !myContext->ComputeVF(aV[i], aF, f, l) ? bRet : !bRet;
}
}
}
//
return bRet;
aMSCPB.Add(aE, aCPB);
aMVI.Bind(aV1, nV1);
aMVI.Bind(aV2, nV2);
}
//=======================================================================
//function : FindPaveBlocksByFirst
//purpose :
@ -1997,6 +1990,31 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
return bRet;
}
//=======================================================================
//function : IsAnalytic
//purpose : Checks if the faces have analytical surfaces
//=======================================================================
Standard_Boolean IsAnalytic(const TopoDS_Face& aF1,
const TopoDS_Face& aF2)
{
BRepAdaptor_Surface BAS1(aF1);
BRepAdaptor_Surface BAS2(aF2);
//
Standard_Boolean isAna1 = (BAS1.GetType() == GeomAbs_Plane ||
BAS1.GetType() == GeomAbs_Cylinder ||
BAS1.GetType() == GeomAbs_Cone ||
BAS1.GetType() == GeomAbs_Sphere ||
BAS1.GetType() == GeomAbs_Torus);
Standard_Boolean isAna2 = (BAS2.GetType() == GeomAbs_Plane ||
BAS2.GetType() == GeomAbs_Cylinder ||
BAS2.GetType() == GeomAbs_Cone ||
BAS2.GetType() == GeomAbs_Sphere ||
BAS2.GetType() == GeomAbs_Torus);
return (isAna1 && isAna2);
}
// DEB f
/*
{

View File

@ -113,9 +113,7 @@
const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock();
bCB=!aCB.IsNull();
if (bCB) {
//modified by NIZHNY-EMV Tue Nov 22 10:27:54 2011
myDS->SortPaveBlocks(aCB);
//modified by NIZHNY-EMV Tue Nov 22 10:27:56 2011
aPB=aCB->PaveBlock1();
}
//
@ -185,7 +183,7 @@
aF1F=(*(TopoDS_Face *)(&myDS->Shape(nF1)));
aF1F.Orientation(TopAbs_FORWARD);
// In
const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
aItMPB.Initialize(aMPBIn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -195,7 +193,7 @@
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aF1F);
}
// On
const BOPDS_MapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
aItMPB.Initialize(aMPBOn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -245,3 +243,45 @@
}
}
}
//=======================================================================
// function: RefineFaceInfoOn
// purpose:
//=======================================================================
void BOPAlgo_PaveFiller::RefineFaceInfoOn()
{
Standard_Integer aNbPBP;
//
myErrorStatus=0;
//
BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->ChangePaveBlocksPool();
aNbPBP=aPBP.Extent();
if(!aNbPBP) {
return;
}
//
Standard_Boolean bV1, bV2;
Standard_Integer i, nV1, nV2, aNbPB;
Handle(BOPDS_PaveBlock) aPB;
//
for (i=0; i<aNbPBP; ++i) {
BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
//
aNbPB=aLPB.Extent();
if (aNbPB==1) {
aPB=aLPB.First();
aPB->Indices(nV1, nV2);
bV1=myDS->IsNewShape(nV1);
bV2=myDS->IsNewShape(nV2);
//
if (!(bV1 || bV2)) {
if (!aPB->IsCommonBlock()) {
// the PB seems to be untouced
aLPB.Clear();
continue;
}
}//if (!(bV1 || bV2)) {
}//if (aNbPB==1) {
}//for (i=0; i<aNbPBP; ++i) {
myDS->RefineFaceInfoOn();
}

View File

@ -156,7 +156,7 @@ static
//
const BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
// In
const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
aItMPB.Initialize(aMPBIn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -166,7 +166,7 @@ static
}
}
// On
const BOPDS_MapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
aItMPB.Initialize(aMPBOn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -176,7 +176,7 @@ static
}
}
// Sections
const BOPDS_MapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
aItMPB.Initialize(aMPBSc);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();

View File

@ -19,14 +19,16 @@
class Tools from BOPAlgo
---Purpose:
---Purpose:
uses
BaseAllocator from BOPCol,
IndexedDataMapOfIntegerListOfInteger from BOPCol,
DataMapOfIntegerListOfInteger from BOPCol,
PaveBlock from BOPDS,
DataMapOfPaveBlockListOfPaveBlock from BOPDS,
DataMapOfPaveBlockListOfInteger from BOPDS
IndexedDataMapOfPaveBlockListOfInteger from BOPDS,
IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS,
DataMapOfIntegerListOfPaveBlock from BOPDS
--raises
is
@ -34,41 +36,41 @@ is
--- static methods
---
MakeBlocksCnx(myclass;
theMILI :DataMapOfIntegerListOfInteger from BOPCol;
theMBlocks :out DataMapOfIntegerListOfInteger from BOPCol;
theAllocator:out BaseAllocator from BOPCol);
theMILI :IndexedDataMapOfIntegerListOfInteger from BOPCol;
theMBlocks :out DataMapOfIntegerListOfInteger from BOPCol;
theAllocator:out BaseAllocator from BOPCol);
MakeBlocks(myclass;
theMILI :DataMapOfPaveBlockListOfPaveBlock from BOPDS;
theMBlocks :out DataMapOfPaveBlockListOfPaveBlock from BOPDS;
theAllocator:out BaseAllocator from BOPCol);
theMILI :IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS;
theMBlocks :out DataMapOfIntegerListOfPaveBlock from BOPDS;
theAllocator:out BaseAllocator from BOPCol);
PerformCommonBlocks(myclass;
theMBlocks :out DataMapOfPaveBlockListOfPaveBlock from BOPDS;
theAllocator:out BaseAllocator from BOPCol);
theMBlocks :out IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS;
theAllocator:out BaseAllocator from BOPCol);
FillMap(myclass;
tneN1:Integer from Standard;
tneN2:Integer from Standard;
theMILI : out IndexedDataMapOfIntegerListOfInteger from BOPCol;
theAllocator: out BaseAllocator from BOPCol);
FillMap(myclass;
tneN1:Integer from Standard;
tneN2:Integer from Standard;
theMILI : out DataMapOfIntegerListOfInteger from BOPCol;
theAllocator: out BaseAllocator from BOPCol);
tnePB1:PaveBlock from BOPDS;
tnePB2:PaveBlock from BOPDS;
theMILI : out IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS;
theAllocator: out BaseAllocator from BOPCol);
FillMap(myclass;
tnePB1:PaveBlock from BOPDS;
tnePB2:PaveBlock from BOPDS;
theMILI : out DataMapOfPaveBlockListOfPaveBlock from BOPDS;
theAllocator: out BaseAllocator from BOPCol);
FillMap(myclass;
tnePB1:PaveBlock from BOPDS;
tneF:Integer from Standard;
theMILI : out DataMapOfPaveBlockListOfInteger from BOPDS;
theAllocator: out BaseAllocator from BOPCol);
tnePB1:PaveBlock from BOPDS;
tneF:Integer from Standard;
theMILI : out IndexedDataMapOfPaveBlockListOfInteger from BOPDS;
theAllocator: out BaseAllocator from BOPCol);
PerformCommonBlocks(myclass;
theMBlocks :DataMapOfPaveBlockListOfInteger from BOPDS;
theAllocator:out BaseAllocator from BOPCol);
theMBlocks :IndexedDataMapOfPaveBlockListOfInteger from BOPDS;
theAllocator:out BaseAllocator from BOPCol);
--fields
end Tools;

View File

@ -18,37 +18,36 @@
#include <BOPAlgo_Tools.ixx>
#include <BOPDS_MapOfPaveBlock.hxx>
#include <BOPDS_IndexedMapOfPaveBlock.hxx>
#include <BOPDS_CommonBlock.hxx>
#include <BOPDS_DataMapOfPaveBlockListOfPaveBlock.hxx>
#include <BOPCol_IndexedMapOfInteger.hxx>
//=======================================================================
//function : MakeBlocksCnx
//purpose :
//=======================================================================
void BOPAlgo_Tools::MakeBlocksCnx(const BOPCol_DataMapOfIntegerListOfInteger& aMILI,
void BOPAlgo_Tools::MakeBlocksCnx(const BOPCol_IndexedDataMapOfIntegerListOfInteger& aMILI,
BOPCol_DataMapOfIntegerListOfInteger& aMBlocks,
Handle(NCollection_BaseAllocator)& aAllocator)
{
Standard_Integer aNbV, nV, aNbVS, nVP, nVx, aNbVP, k;
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI;
BOPCol_MapIteratorOfMapOfInteger aItMVP;
Standard_Integer aNbV, nV, aNbVS, nVP, nVx, aNbVP, aNbEC, k, i, j;
BOPCol_ListIteratorOfListOfInteger aItLI;
//
BOPCol_MapOfInteger aMVS(100, aAllocator);
BOPCol_MapOfInteger aMEC(100, aAllocator);
BOPCol_MapOfInteger aMVP(100, aAllocator);
BOPCol_MapOfInteger aMVAdd(100, aAllocator);
BOPCol_IndexedMapOfInteger aMEC(100, aAllocator);
BOPCol_IndexedMapOfInteger aMVP(100, aAllocator);
BOPCol_IndexedMapOfInteger aMVAdd(100, aAllocator);
//
aNbV=aMILI.Extent();
//
aItMILI.Initialize(aMILI);
for (k=0; aItMILI.More(); aItMILI.Next()) {
for (k=0,i=1; i<=aNbV; ++i) {
aNbVS=aMVS.Extent();
if (aNbVS==aNbV) {
break;
}
//
nV=aItMILI.Key();
nV = aMILI.FindKey(i);
if (aMVS.Contains(nV)){
continue;
}
@ -61,10 +60,9 @@
aMVP.Add(nV);
while(1) {
aNbVP=aMVP.Extent();
aItMVP.Initialize(aMVP);
for (; aItMVP.More(); aItMVP.Next()) {
nVP=aItMVP.Value();
const BOPCol_ListOfInteger& aLV=aMILI.Find(nVP);
for (j=1; j<=aNbVP; ++j) {
nVP=aMVP(j);
const BOPCol_ListOfInteger& aLV=aMILI.FindFromKey(nVP);
aItLI.Initialize(aLV);
for (; aItLI.More(); aItLI.Next()) {
nVx=aItLI.Value();
@ -84,25 +82,23 @@
}
//
aMVP.Clear();
aItMVP.Initialize(aMVAdd);
for (; aItMVP.More(); aItMVP.Next()) {
aMVP.Add(aItMVP.Value());
for (j=1; j<=aNbVP; ++j) {
aMVP.Add(aMVAdd(j));
}
aMVAdd.Clear();
}//while(1) {
//
BOPCol_ListOfInteger aLIx(aAllocator);
//
//aLIx.Append(nV);
aItMVP.Initialize(aMEC);
for (; aItMVP.More(); aItMVP.Next()) {
nVx=aItMVP.Value();
aNbEC = aMEC.Extent();
for (j=1; j<=aNbEC; ++j) {
nVx=aMEC(j);
aLIx.Append(nVx);
}
//
aMBlocks.Bind(k, aLIx);
++k;
}//for (; aItMILI.More(); aItMILI.Next()) {
}//for (k=0,i=1; i<=aNbV; ++i)
aMVAdd.Clear();
aMVP.Clear();
aMEC.Clear();
@ -114,26 +110,26 @@
//=======================================================================
void BOPAlgo_Tools::FillMap(const Standard_Integer n1,
const Standard_Integer n2,
BOPCol_DataMapOfIntegerListOfInteger& aMILI,
BOPCol_IndexedDataMapOfIntegerListOfInteger& aMILI,
Handle(NCollection_BaseAllocator)& aAllocator)
{
if (aMILI.IsBound(n1)) {
BOPCol_ListOfInteger& aLI=aMILI.ChangeFind(n1);
if (aMILI.Contains(n1)) {
BOPCol_ListOfInteger& aLI=aMILI.ChangeFromKey(n1);
aLI.Append(n2);
}
else {
BOPCol_ListOfInteger aLI(aAllocator);
aLI.Append(n2);
aMILI.Bind(n1, aLI);
aMILI.Add(n1, aLI);
}
if (aMILI.IsBound(n2)) {
BOPCol_ListOfInteger& aLI=aMILI.ChangeFind(n2);
if (aMILI.Contains(n2)) {
BOPCol_ListOfInteger& aLI=aMILI.ChangeFromKey(n2);
aLI.Append(n1);
}
else {
BOPCol_ListOfInteger aLI(aAllocator);
aLI.Append(n1);
aMILI.Bind(n2, aLI);
aMILI.Add(n2, aLI);
}
}
//=======================================================================
@ -142,26 +138,26 @@
//=======================================================================
void BOPAlgo_Tools::FillMap(const Handle(BOPDS_PaveBlock)& aPB1,
const Handle(BOPDS_PaveBlock)& aPB2,
BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
Handle(NCollection_BaseAllocator)& aAllocator)
{
if (aMPBLPB.IsBound(aPB1)) {
BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFind(aPB1);
if (aMPBLPB.Contains(aPB1)) {
BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFromKey(aPB1);
aLPB.Append(aPB2);
}
else {
BOPDS_ListOfPaveBlock aLPB(aAllocator);
aLPB.Append(aPB2);
aMPBLPB.Bind(aPB1, aLPB);
aMPBLPB.Add(aPB1, aLPB);
}
if (aMPBLPB.IsBound(aPB2)) {
BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFind(aPB2);
if (aMPBLPB.Contains(aPB2)) {
BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFromKey(aPB2);
aLPB.Append(aPB1);
}
else {
BOPDS_ListOfPaveBlock aLPB(aAllocator);
aLPB.Append(aPB1);
aMPBLPB.Bind(aPB2, aLPB);
aMPBLPB.Add(aPB2, aLPB);
}
}
//=======================================================================
@ -170,47 +166,44 @@
//=======================================================================
void BOPAlgo_Tools::FillMap(const Handle(BOPDS_PaveBlock)& aPB,
const Standard_Integer nF,
BOPDS_DataMapOfPaveBlockListOfInteger& aMPBLI,
BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI,
Handle(NCollection_BaseAllocator)& aAllocator)
{
if (aMPBLI.IsBound(aPB)) {
BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFind(aPB);
if (aMPBLI.Contains(aPB)) {
BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB);
aLI.Append(nF);
}
else {
BOPCol_ListOfInteger aLI(aAllocator);
aLI.Append(nF);
aMPBLI.Bind(aPB, aLI);
aMPBLI.Add(aPB, aLI);
}
}
//=======================================================================
//function : MakeBlocks
//purpose :
//=======================================================================
void BOPAlgo_Tools::MakeBlocks(const BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMILI,
BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMBlocks,
void BOPAlgo_Tools::MakeBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMILI,
BOPDS_DataMapOfIntegerListOfPaveBlock& aMBlocks,
Handle(NCollection_BaseAllocator)& aAllocator)
{
Standard_Integer aNbV, aNbVS, aNbVP, k;//nV,nVx,nVP
BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfPaveBlock aItMILI;
BOPDS_MapIteratorOfMapOfPaveBlock aItMVP;
Standard_Integer aNbV, aNbVS, aNbVP, aNbEC, k, i, j;
BOPDS_ListIteratorOfListOfPaveBlock aItLI;
//
BOPDS_MapOfPaveBlock aMVS(100, aAllocator);
BOPDS_MapOfPaveBlock aMEC(100, aAllocator);
BOPDS_MapOfPaveBlock aMVP(100, aAllocator);
BOPDS_MapOfPaveBlock aMVAdd(100, aAllocator);
BOPDS_IndexedMapOfPaveBlock aMEC(100, aAllocator);
BOPDS_IndexedMapOfPaveBlock aMVP(100, aAllocator);
BOPDS_IndexedMapOfPaveBlock aMVAdd(100, aAllocator);
//
aNbV=aMILI.Extent();
//
aItMILI.Initialize(aMILI);
for (k=0; aItMILI.More(); aItMILI.Next()) {
for (k=0, i=1; i<=aNbV; ++i) {
aNbVS=aMVS.Extent();
if (aNbVS==aNbV) {
break;
}
//
const Handle(BOPDS_PaveBlock)& nV=aItMILI.Key();
const Handle(BOPDS_PaveBlock)& nV=aMILI.FindKey(i);
if (aMVS.Contains(nV)){
continue;
}
@ -223,10 +216,9 @@
aMVP.Add(nV);
while(1) {
aNbVP=aMVP.Extent();
aItMVP.Initialize(aMVP);
for (; aItMVP.More(); aItMVP.Next()) {
const Handle(BOPDS_PaveBlock)& nVP=aItMVP.Value();
const BOPDS_ListOfPaveBlock& aLV=aMILI.Find(nVP);
for (j=1; j<=aNbVP; ++j) {
const Handle(BOPDS_PaveBlock)& nVP=aMVP(j);
const BOPDS_ListOfPaveBlock& aLV=aMILI.FindFromKey(nVP);
aItLI.Initialize(aLV);
for (; aItLI.More(); aItLI.Next()) {
const Handle(BOPDS_PaveBlock)& nVx=aItLI.Value();
@ -246,25 +238,23 @@
}
//
aMVP.Clear();
aItMVP.Initialize(aMVAdd);
for (; aItMVP.More(); aItMVP.Next()) {
aMVP.Add(aItMVP.Value());
for (j=1; j<=aNbVP; ++j) {
aMVP.Add(aMVAdd(j));
}
aMVAdd.Clear();
}//while(1) {
//
BOPDS_ListOfPaveBlock aLIx(aAllocator);
//
//aLIx.Append(nV);
aItMVP.Initialize(aMEC);
for (; aItMVP.More(); aItMVP.Next()) {
const Handle(BOPDS_PaveBlock)& nVx=aItMVP.Value();
aNbEC = aMEC.Extent();
for (j=1; j<=aNbEC; ++j) {
const Handle(BOPDS_PaveBlock)& nVx=aMEC(j);
aLIx.Append(nVx);
}
//
aMBlocks.Bind(aLIx.First(), aLIx);
aMBlocks.Bind(k, aLIx);
++k;
}//for (; aItMILI.More(); aItMILI.Next()) {
}//for (k=0, i=1; i<=aNbV; ++i)
aMVAdd.Clear();
aMVP.Clear();
aMEC.Clear();
@ -274,7 +264,7 @@
//function : PerformCommonBlocks
//purpose :
//=======================================================================
void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
Handle(NCollection_BaseAllocator)& aAllocator)
{
Standard_Integer aNbCB;
@ -284,18 +274,16 @@
return;
}
//
Standard_Integer aNbPB;
BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfPaveBlock aItMPBLPB;
Standard_Integer aNbPB, aNbBlocks, k;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
Handle(BOPDS_CommonBlock) aCB;
BOPDS_DataMapOfPaveBlockListOfPaveBlock aMBlocks(100, aAllocator);
BOPDS_DataMapOfIntegerListOfPaveBlock aMBlocks(100, aAllocator);
//
BOPAlgo_Tools::MakeBlocks(aMPBLPB, aMBlocks, aAllocator);
//
aItMPBLPB.Initialize(aMBlocks);
for (; aItMPBLPB.More(); aItMPBLPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPBLPB.Key();
const BOPDS_ListOfPaveBlock& aLPB=aItMPBLPB.Value();
aNbBlocks = aMBlocks.Extent();
for (k=0; k<aNbBlocks; ++k) {
const BOPDS_ListOfPaveBlock& aLPB=aMBlocks.Find(k);
aNbPB=aLPB.Extent();
if (aNbPB>1) {
aCB=new BOPDS_CommonBlock;
@ -318,18 +306,17 @@
//function : PerformCommonBlocks
//purpose :
//=======================================================================
void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_DataMapOfPaveBlockListOfInteger& aMPBLI,
void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI,
Handle(NCollection_BaseAllocator)& )//aAllocator)
{
Standard_Integer nF;
BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger aItMPBLI;
Standard_Integer nF, i, aNb;
BOPCol_ListIteratorOfListOfInteger aItLI;
Handle(BOPDS_PaveBlock) aPB;
Handle(BOPDS_CommonBlock) aCB;
//
aItMPBLI.Initialize(aMPBLI);
for (; aItMPBLI.More(); aItMPBLI.Next()) {
aPB=aItMPBLI.Key();
aNb=aMPBLI.Extent();
for (i=1; i<=aNb; ++i) {
aPB=aMPBLI.FindKey(i);
if (aPB->IsCommonBlock()) {
aCB=aPB->CommonBlock();
}
@ -338,7 +325,7 @@
aCB->AddPaveBlock(aPB);
}
//
const BOPCol_ListOfInteger& aLI=aItMPBLI.Value();
const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromKey(aPB);
aItLI.Initialize(aLI);
for (; aItLI.More(); aItLI.Next()) {
nF=aItLI.Value();

View File

@ -148,20 +148,18 @@
void BOPAlgo_WireSplitter::MakeConnexityBlocks()
{
Standard_Boolean bRegular, bClosed;
Standard_Integer i, j, aNbV, aNbVS, aNbVP;
Standard_Integer i, j, aNbV, aNbVS, aNbVP, k;
TopoDS_Iterator aItE;
TopoDS_Shape aER;
BOPCol_ListIteratorOfListOfShape aIt;
BOPCol_MapIteratorOfMapOfShape aItM;
//
BOPCol_IndexedDataMapOfShapeListOfShape aMVE(100, myAllocator);
BOPCol_MapOfShape aMVP(100, myAllocator);
//modified by NIZHNY-EMV Wed Oct 06 10:17:57 2010
BOPCol_IndexedMapOfShape aMVP(100, myAllocator);
BOPCol_IndexedMapOfShape aMEC(100, myAllocator);
//modified by NIZHNY-EMV Wed Oct 06 10:18:02 2010
BOPCol_MapOfShape aMER(100, myAllocator);
BOPCol_MapOfShape aMEP(100, myAllocator);
BOPCol_MapOfShape aMVAdd(100, myAllocator);
BOPCol_IndexedMapOfShape aMVAdd(100, myAllocator);
BOPCol_MapOfShape aMVS(100, myAllocator);
//
myLCB.Clear();
@ -202,16 +200,13 @@
//
while(1) {
aNbVP=aMVP.Extent();
aItM.Initialize(aMVP);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aVP=aItM.Value();
for (k=1; k<=aNbVP; ++k) {
const TopoDS_Shape& aVP=aMVP(k);
const BOPCol_ListOfShape& aLE=aMVE.FindFromKey(aVP);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
//modified by NIZHNY-EMV Wed Oct 06 10:18:19 2010
if (aMEC.Add(aE)) {
//modified by NIZHNY-EMV Wed Oct 06 10:18:25 2010
aItE.Initialize(aE);
for (; aItE.More(); aItE.Next()) {
const TopoDS_Shape& aVE=aItE.Value();
@ -230,9 +225,8 @@
//
aMVP.Clear();
//
aItM.Initialize(aMVAdd);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aVE=aItM.Value();
for (k=1; k<=aNbVP; ++k) {
const TopoDS_Shape& aVE=aMVAdd(k);
aMVP.Add(aVE);
}
aMVAdd.Clear();
@ -245,11 +239,9 @@
BOPCol_IndexedDataMapOfShapeListOfShape aMVER(100, myAllocator);
//
bRegular=Standard_True;
//modified by NIZHNY-EMV Wed Oct 06 10:18:45 2010
Standard_Integer aNbCB = aMEC.Extent();
for (j = 1; j <= aNbCB; j++) {
aER = aMEC(j);
//modified by NIZHNY-EMV Wed Oct 06 10:18:50 2010
//
if (aMER.Contains(aER)) {
aER.Orientation(TopAbs_FORWARD);

View File

@ -50,6 +50,8 @@ is
imported ListOfListOfShape from BOPCol;
imported SequenceOfShape from BOPCol;
imported SequenceOfPnt2d from BOPCol;
imported DataMapOfIntegerListOfShape from BOPCol;
imported DataMapOfIntegerListOfShape from BOPCol;
imported IndexedDataMapOfIntegerListOfInteger from BOPCol;
imported IndexedDataMapOfShapeInteger from BOPCol;
end BOPCol;

View File

@ -0,0 +1,33 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-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 BOPCol_IndexedDataMapOfIntegerListOfInteger_HeaderFile
#define BOPCol_IndexedDataMapOfIntegerListOfInteger_HeaderFile
#include <NCollection_IndexedDataMap.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <BOPCol_ListOfInteger.hxx>
typedef NCollection_IndexedDataMap<Standard_Integer, BOPCol_ListOfInteger, TColStd_MapIntegerHasher> BOPCol_IndexedDataMapOfIntegerListOfInteger;
#undef _NCollection_MapHasher
#endif

View File

@ -0,0 +1,39 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-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 BOPCol_IndexedDataMapOfShapeInteger_HeaderFile
#define BOPCol_IndexedDataMapOfShapeInteger_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#include <TopoDS_Shape.hxx>
#include <TopTools_ShapeMapHasher.hxx>
#include <NCollection_IndexedDataMap.hxx>
typedef NCollection_IndexedDataMap<TopoDS_Shape, Standard_Integer, TopTools_ShapeMapHasher> BOPCol_IndexedDataMapOfShapeInteger;
#undef _NCollection_MapHasher
#endif

View File

@ -26,3 +26,5 @@ BOPCol_BaseAllocator.hxx
BOPCol_DataMapOfIntegerListOfShape.hxx
BOPCol_SequenceOfReal.hxx
BOPCol_DataMapOfIntegerShape.hxx
BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx
BOPCol_IndexedDataMapOfShapeInteger.hxx

View File

@ -85,6 +85,11 @@ is
imported MapOfCommonBlock from BOPDS;
imported VectorOfFaceInfo from BOPDS;
imported MapOfPave from BOPDS;
imported IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS;
imported DataMapOfIntegerListOfPaveBlock from BOPDS;
imported IndexedMapOfPaveBlock from BOPDS;
imported IndexedDataMapOfPaveBlockListOfInteger from BOPDS;
imported IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
--
imported Interf from BOPDS;
imported InterfVV from BOPDS;

View File

@ -55,9 +55,10 @@ uses
VectorOfListOfPaveBlock from BOPDS,
ListOfPaveBlock from BOPDS,
ListOfPave from BOPDS,
PaveBlock from BOPDS,
PaveBlock from BOPDS,
CommonBlock from BOPDS,
MapOfPaveBlock from BOPDS,
IndexedMapOfPaveBlock from BOPDS,
VectorOfFaceInfo from BOPDS,
FaceInfo from BOPDS,
--
@ -322,7 +323,7 @@ is
FaceInfoOn(me:out;
theIndex:Integer from Standard;
theMPB:out MapOfPaveBlock from BOPDS;
theMPB:out IndexedMapOfPaveBlock from BOPDS;
theMVP:out MapOfInteger from BOPCol);
---Purpose:
--- Selector
@ -331,7 +332,7 @@ is
FaceInfoIn(me:out;
theIndex:Integer from Standard;
theMPB:out MapOfPaveBlock from BOPDS;
theMPB:out IndexedMapOfPaveBlock from BOPDS;
theMVP:out MapOfInteger from BOPCol);
---Purpose:
--- Selector

View File

@ -1058,7 +1058,7 @@ static
iRef=aSI.Reference();
BOPDS_FaceInfo &aFI=myFaceInfoPool(iRef);
//
BOPDS_MapOfPaveBlock& aMPBIn=aFI.ChangePaveBlocksIn();
BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.ChangePaveBlocksIn();
BOPCol_MapOfInteger& aMVIn=aFI.ChangeVerticesIn();
aMPBIn.Clear();
aMVIn.Clear();
@ -1078,7 +1078,7 @@ static
iRef=aSI.Reference();
BOPDS_FaceInfo &aFI=myFaceInfoPool(iRef);
//
BOPDS_MapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn();
BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn();
BOPCol_MapOfInteger& aMVOn=aFI.ChangeVerticesOn();
aMPBOn.Clear();
aMVOn.Clear();
@ -1090,7 +1090,7 @@ static
//purpose :
//=======================================================================
void BOPDS_DS::FaceInfoOn(const Standard_Integer theF,
BOPDS_MapOfPaveBlock& theMPB,
BOPDS_IndexedMapOfPaveBlock& theMPB,
BOPCol_MapOfInteger& theMI)
{
Standard_Integer nS, nSD, nV1, nV2;
@ -1135,7 +1135,7 @@ static
//purpose :
//=======================================================================
void BOPDS_DS::FaceInfoIn(const Standard_Integer theF,
BOPDS_MapOfPaveBlock& theMPB,
BOPDS_IndexedMapOfPaveBlock& theMPB,
BOPCol_MapOfInteger& theMI)
{
Standard_Integer i, aNbVF, aNbEF, nV, nE;
@ -1184,20 +1184,25 @@ static
//=======================================================================
void BOPDS_DS::RefineFaceInfoOn()
{
Standard_Integer i, aNb, nF;
BOPDS_MapIteratorOfMapOfPaveBlock aIt;
Standard_Integer i, aNb, nF, aNbPB, j;
BOPDS_IndexedMapOfPaveBlock aMPB;
//
aNb=myFaceInfoPool.Extent();
for (i=0; i<aNb; ++i) {
BOPDS_FaceInfo &aFI=myFaceInfoPool(i);
nF=aFI.Index();
UpdateFaceInfoOn(nF);
BOPDS_MapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn();
aIt.Initialize(aMPBOn);
for(; aIt.More(); aIt.Next()){
const Handle(BOPDS_PaveBlock)& aPB=aIt.Value();
if (!aPB->HasEdge()) {
aMPBOn.Remove(aPB);
BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn();
//
aMPB.Clear();
aMPB.Assign(aMPBOn);
aMPBOn.Clear();
//
aNbPB=aMPB.Extent();
for (j=1; j<=aNbPB; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPB(j);
if (aPB->HasEdge()) {
aMPBOn.Add(aPB);
}
}
}
@ -1220,7 +1225,7 @@ static
const BOPDS_FaceInfo& aFI=FaceInfo(theI);
//
for (i=0; i<2; ++i) {
const BOPDS_MapOfPaveBlock& aMPB=(!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc();
const BOPDS_IndexedMapOfPaveBlock& aMPB=(!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc();
aItMPB.Initialize(aMPB);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -1261,7 +1266,7 @@ static
const BOPDS_FaceInfo& aFI1=FaceInfo(nF1);
const BOPDS_FaceInfo& aFI2=FaceInfo(nF2);
//
const BOPDS_MapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
aItMPB.Initialize(aMPBOn1);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -1271,7 +1276,7 @@ static
aMI.Add(nV2);
}
//
const BOPDS_MapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
aItMPB.Initialize(aMPBIn1);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -1281,7 +1286,7 @@ static
aMI.Add(nV2);
}
//
const BOPDS_MapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
aItMPB.Initialize(aMPBOn2);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
@ -1291,7 +1296,7 @@ static
aMI.Add(nV2);
}
//
const BOPDS_MapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
aItMPB.Initialize(aMPBIn2);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();

View File

@ -0,0 +1,40 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 1999-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_DataMapOfIntegerListOfPaveBlock_HeaderFile
#define BOPDS_DataMapOfIntegerListOfPaveBlock_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#define _NCollection_MapHasher
#include <NCollection_DataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
typedef NCollection_DataMap<Standard_Integer, BOPDS_ListOfPaveBlock, TColStd_MapIntegerHasher> BOPDS_DataMapOfIntegerListOfPaveBlock;
#undef _NCollection_MapHasher
#endif

View File

@ -28,7 +28,7 @@ class FaceInfo from BOPDS
uses
BaseAllocator from BOPCol,
MapOfInteger from BOPCol,
MapOfPaveBlock from BOPDS
IndexedMapOfPaveBlock from BOPDS
--raises
@ -70,7 +70,7 @@ is
-- In
--
PaveBlocksIn(me)
returns MapOfPaveBlock from BOPDS;
returns IndexedMapOfPaveBlock from BOPDS;
---C++: return const &
---C++: inline
---Purpose:
@ -79,7 +79,7 @@ is
--- that have state In
ChangePaveBlocksIn(me:out)
returns MapOfPaveBlock from BOPDS;
returns IndexedMapOfPaveBlock from BOPDS;
---C++: return &
---C++: inline
---Purpose:
@ -111,7 +111,7 @@ is
-- On
--
PaveBlocksOn(me)
returns MapOfPaveBlock from BOPDS;
returns IndexedMapOfPaveBlock from BOPDS;
---C++: return const &
---C++: inline
---Purpose:
@ -120,7 +120,7 @@ is
--- that have state On
ChangePaveBlocksOn(me:out)
returns MapOfPaveBlock from BOPDS;
returns IndexedMapOfPaveBlock from BOPDS;
---C++: return &
---C++: inline
---Purpose:
@ -151,7 +151,7 @@ is
-- Sections
--
PaveBlocksSc(me)
returns MapOfPaveBlock from BOPDS;
returns IndexedMapOfPaveBlock from BOPDS;
---C++: return const &
---C++: inline
---Purpose:
@ -160,7 +160,7 @@ is
--- that are pave blocks of section edges
ChangePaveBlocksSc(me:out)
returns MapOfPaveBlock from BOPDS;
returns IndexedMapOfPaveBlock from BOPDS;
---C++: return &
---C++: inline
--- Selector/Modifier
@ -193,11 +193,11 @@ is
fields
myAllocator : BaseAllocator from BOPCol is protected;
myIndex : Integer from Standard is protected;
myPaveBlocksIn: MapOfPaveBlock from BOPDS is protected;
myPaveBlocksIn: IndexedMapOfPaveBlock from BOPDS is protected;
myVerticesIn : MapOfInteger from BOPCol is protected;
myPaveBlocksOn: MapOfPaveBlock from BOPDS is protected;
myPaveBlocksOn: IndexedMapOfPaveBlock from BOPDS is protected;
myVerticesOn : MapOfInteger from BOPCol is protected;
myPaveBlocksSc: MapOfPaveBlock from BOPDS is protected;
myPaveBlocksSc: IndexedMapOfPaveBlock from BOPDS is protected;
myVerticesSc : MapOfInteger from BOPCol is protected;
end FaceInfo;

View File

@ -90,7 +90,7 @@
//function : PaveBlockIn
//purpose :
//=======================================================================
inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksIn()const
inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksIn()const
{
return myPaveBlocksIn;
}
@ -98,7 +98,7 @@
//function : ChangePaveBlocksIn
//purpose :
//=======================================================================
inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksIn()
inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksIn()
{
return myPaveBlocksIn;
}
@ -123,7 +123,7 @@
//function : PaveBlocksOn
//purpose :
//=======================================================================
inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksOn()const
inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksOn()const
{
return myPaveBlocksOn;
}
@ -131,7 +131,7 @@
//function : ChangePaveBlocksOn
//purpose :
//=======================================================================
inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksOn()
inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksOn()
{
return myPaveBlocksOn;
}
@ -156,7 +156,7 @@
//function : PaveBlocksSc
//purpose :
//=======================================================================
inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksSc()const
inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksSc()const
{
return myPaveBlocksSc;
}
@ -164,7 +164,7 @@
//function : ChangePaveBlocksSc
//purpose :
//=======================================================================
inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksSc()
inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksSc()
{
return myPaveBlocksSc;
}

View File

@ -0,0 +1,33 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-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_IndexedDataMapOfPaveBlockListOfInteger_HeaderFile
#define BOPDS_IndexedDataMapOfPaveBlockListOfInteger_HeaderFile
#define _NCollection_MapHasher
#include <NCollection_IndexedDataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPCol_ListOfInteger.hxx>
typedef NCollection_IndexedDataMap<Handle(BOPDS_PaveBlock), BOPCol_ListOfInteger, TColStd_MapTransientHasher> BOPDS_IndexedDataMapOfPaveBlockListOfInteger;
#undef _NCollection_MapHasher
#endif

View File

@ -0,0 +1,34 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 1999-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_IndexedDataMapOfPaveBlockListOfPaveBlock_HeaderFile
#define BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock_HeaderFile
#define _NCollection_MapHasher
#include <NCollection_IndexedDataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <Handle_BOPDS_PaveBlock.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
typedef NCollection_IndexedDataMap<Handle(BOPDS_PaveBlock), BOPDS_ListOfPaveBlock, TColStd_MapTransientHasher> BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock;
#undef _NCollection_MapHasher
#endif

View File

@ -0,0 +1,33 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-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_IndexedDataMapOfShapeCoupleOfPaveBlocks_HeaderFile
#define BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks_HeaderFile
#include <BOPDS_CoupleOfPaveBlocks.hxx>
#define _NCollection_MapHasher
#include <NCollection_IndexedDataMap.hxx>
#include <TopTools_ShapeMapHasher.hxx>
typedef NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher> BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks;
#undef _NCollection_MapHasher
#endif

View File

@ -0,0 +1,33 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 1999-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_IndexedMapOfPaveBlock_HeaderFile
#define BOPDS_IndexedMapOfPaveBlock_HeaderFile
#define _NCollection_MapHasher
#include <NCollection_IndexedMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <Handle_BOPDS_PaveBlock.hxx>
typedef NCollection_IndexedMap<Handle(BOPDS_PaveBlock), TColStd_MapTransientHasher> BOPDS_IndexedMapOfPaveBlock;
#undef _NCollection_MapHasher
#endif

View File

@ -28,3 +28,8 @@ BOPDS_VectorOfCurve.hxx
BOPDS_VectorOfPoint.hxx
BOPDS_DataMapOfShapeCoupleOfPaveBlocks.hxx
BOPDS_MapOfPave.hxx
BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock.hxx
BOPDS_DataMapOfIntegerListOfPaveBlock.hxx
BOPDS_IndexedMapOfPaveBlock.hxx
BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx

View File

@ -210,7 +210,7 @@
Standard_Real ddx=aTolE;//1.e-12;
BndLib_Add3dCurve::Add (aBAC, t1C, t2C, ddx, myBndBox);
myErrorStatus=0;//6
myErrorStatus=6;//0
return;
}
}
@ -312,8 +312,7 @@
if (pri==-3) {
//modified by NIZHNY-EMV Mon Nov 28 14:55:00 2011
t1C = t1;
myErrorStatus=6;
//myErrorStatus=4;
myErrorStatus=4;
//return;
//modified by NIZHNY-EMV Mon Nov 28 14:55:03 2011
}
@ -409,8 +408,7 @@
if (pri==-3) {
//modified by NIZHNY-EMV Mon Nov 28 14:55:32 2011
t2C = t2;
myErrorStatus=6;
//myErrorStatus=5;
myErrorStatus=5;
//return;
//modified by NIZHNY-EMV Mon Nov 28 14:55:34 2011
}

View File

@ -94,15 +94,15 @@ static
const TopAbs_ShapeEnum theType2,
BOPCol_ListOfShape& theLCB)
{
Standard_Integer aNbF, aNbAdd1;
Standard_Integer aNbF, aNbAdd, aNbAdd1, i;
BRep_Builder aBB;
TopoDS_Compound aC;
TopoDS_Iterator aIt;
TopExp_Explorer aExp;
BOPCol_MapOfShape aMCB, aMAdd, aMAdd1, aMP;
BOPCol_MapOfShape aMP;
BOPCol_IndexedMapOfShape aMCB, aMAdd, aMAdd1;
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
BOPCol_ListIteratorOfListOfShape aItLF;
BOPCol_MapIteratorOfMapOfShape aItM;//, aItM1;
//
// 1. aMEF
BOPTools::MapShapesAndAncestors(theS, theType1, theType2, aMEF);
@ -122,9 +122,9 @@ static
while(1) {
aMAdd1.Clear();
//
aItM.Initialize(aMAdd);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
aNbAdd = aMAdd.Extent();
for (i=1; i<=aNbAdd; ++i) {
const TopoDS_Shape& aF=aMAdd(i);
//
aExp.Init(aF, theType1);
for (; aExp.More(); aExp.Next()) {
@ -144,7 +144,7 @@ static
}
}//for (; aExp.More(); aExp.Next()){
aMCB.Add(aF);
}// for (; aItM.More(); aItM.Next()) {
}// for (i=1; i<=aNbAdd; ++i) {
//
aNbAdd1=aMAdd1.Extent();
if (!aNbAdd1) {
@ -152,9 +152,8 @@ static
}
//
aMAdd.Clear();
aItM.Initialize(aMAdd1);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aFAdd=aItM.Key();
for (i=1; i<=aNbAdd1; ++i) {
const TopoDS_Shape& aFAdd = aMAdd1(i);
aMAdd.Add(aFAdd);
}
}//while(1) {
@ -163,9 +162,8 @@ static
if (aNbF) {
aBB.MakeCompound(aC);
//
aItM.Initialize(aMCB);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
for (i=1; i<=aNbF; ++i) {
const TopoDS_Shape& aF=aMCB(i);
aBB.Add(aC, aF);
aMP.Add(aF);
}
@ -334,14 +332,13 @@ static
BOPCol_ListOfShape& theLCB,
const Handle(NCollection_BaseAllocator)& theAllocator)
{
Standard_Integer aNbF, aNbAdd1;
Standard_Integer aNbF, aNbAdd1, aNbAdd, i;
TopExp_Explorer aExp;
BOPCol_MapIteratorOfMapOfShape aItM, aItM1;
BOPCol_ListIteratorOfListOfShape aIt;
//
BOPCol_MapOfShape aMCB(100, theAllocator);
BOPCol_MapOfShape aMAdd(100, theAllocator);
BOPCol_MapOfShape aMAdd1(100, theAllocator);
BOPCol_IndexedMapOfShape aMCB(100, theAllocator);
BOPCol_IndexedMapOfShape aMAdd(100, theAllocator);
BOPCol_IndexedMapOfShape aMAdd1(100, theAllocator);
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, theAllocator);
//
// 1. aMEF
@ -358,9 +355,9 @@ static
//
while(1) {
aMAdd1.Clear();
aItM.Initialize(aMAdd);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
aNbAdd = aMAdd.Extent();
for (i=1; i<=aNbAdd; ++i) {
const TopoDS_Shape& aF=aMAdd(i);
//
//aMAdd1.Clear();
aExp.Init(aF, TopAbs_EDGE);
@ -384,7 +381,7 @@ static
}
}//for (; aExp.More(); aExp.Next()){
aMCB.Add(aF);
}// for (; aItM.More(); aItM.Next()) {
}// for (i=1; i<=aNbAdd; ++i) {
//
aNbAdd1=aMAdd1.Extent();
if (!aNbAdd1) {
@ -392,9 +389,8 @@ static
}
//
aMAdd.Clear();
aItM1.Initialize(aMAdd1);
for (; aItM1.More(); aItM1.Next()) {
const TopoDS_Shape& aFAdd=aItM1.Key();
for (i=1; i<=aNbAdd1; ++i) {
const TopoDS_Shape& aFAdd=aMAdd1(i);
aMAdd.Add(aFAdd);
}
//
@ -402,9 +398,8 @@ static
//
aNbF=aMCB.Extent();
aItM.Initialize(aMCB);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
for (i=1; i<=aNbF; ++i) {
const TopoDS_Shape& aF=aMCB(i);
theLCB.Append(aF);
}
}

View File

@ -271,7 +271,7 @@
//=======================================================================
void BRepFeat_Builder::RebuildFaces()
{
Standard_Integer aNbS, i, iRank, nSp;
Standard_Integer aNbS, i, iRank, nSp, j;
Standard_Boolean bIsClosed, bIsDegenerated, bToReverse,
bRem, bIm, bFlagSD, bVInShapes;
TopAbs_Orientation anOriF, anOriE;
@ -334,8 +334,8 @@
aFF=aF;
aFF.Orientation(TopAbs_FORWARD);
const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
const BOPDS_MapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
aLE.Clear();
@ -378,15 +378,10 @@
} else {
bRem = Standard_True;
aME.Add(aS);
}
}
}
//
if (!bRem && !bIm) {
aLE.Append(aE);
continue;
}
//
if (bRem && !bIm) {
if (!bIm) {
aLE.Append(aE);
continue;
}
@ -449,10 +444,13 @@
}
}
Standard_Integer aNbPBIn, aNbPBSc;
aNbPBIn = aMPBIn.Extent();
aNbPBSc = aMPBSc.Extent();
//
//in edges
aItMPB.Initialize(aMPBIn);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
for (j=1; j<=aNbPBIn; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBIn(j);
nSp=aPB->Edge();
aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp)));
if (myRemoved.Contains(aSp)) {
@ -465,9 +463,8 @@
aLE.Append(aSp);
}
//section edges
aItMPB.Initialize(aMPBSc);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
for (j=1; j<=aNbPBSc; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBSc(j);
nSp=aPB->Edge();
aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp)));
if (myRemoved.Contains(aSp)) {
@ -529,6 +526,7 @@
{
Standard_Integer nE, nSp, nV1, nV2, nE1, nV, nVx, nVSD;
Standard_Integer nV11, nV21;
Standard_Boolean bOld;
Standard_Real aT11, aT21;
Standard_Real aT1, aT2;
TopoDS_Edge aSp, aE;
@ -629,6 +627,7 @@
//
aItMPB.Initialize(aMPB);
//check if it is the old pave block.
bOld = Standard_False;
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB1 = aItMPB.Value();
aPB1->Indices(nV11, nV21);
@ -637,9 +636,13 @@
aT1 == aT11 && aT2 == aT21) {
const TopoDS_Shape& aEIm = myDS->Shape(aPB1->Edge());
aLIm.Append(aEIm);
continue;
bOld = Standard_True;
break;
}
}
if (bOld) {
continue;
}
//
aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
aV1.Orientation(TopAbs_FORWARD);
@ -671,7 +674,6 @@
BOPTools_MapOfSet aMST;
BOPCol_ListOfShape aLSImNew;
BOPCol_MapOfShape aMS;
Standard_Boolean bRem;
BOPCol_ListIteratorOfListOfShape aIt;
TopExp_Explorer aExp, aExpF;
Standard_Boolean bFlagSD;
@ -743,7 +745,7 @@
//
Standard_Boolean bIsIN, bHasImage;
Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF, aNbEFP;
Standard_Integer iRank, aNbRem;
Standard_Integer aNbRem;
TopAbs_ShapeEnum aType;
TopAbs_State aState;
TopoDS_Iterator aIt, aItF;

View File

@ -1,7 +1,3 @@
puts "TODO OCC22817 All: exception.+There are no suitable edges"
puts "TODO OCC22817 All: \\*\\* Exception \\*\\*"
puts "TODO OCC22817 All: TEST INCOMPLETE"
pcylinder s1 3 10
pcylinder s2 4 16
trotate s2 0 0 0 1 0 0 80
@ -14,4 +10,4 @@ mkevol result s
updatevol s_2 0 0.3*SCALE1 1 0.5*SCALE1 2 0.3*SCALE1
buildevol
set square 0
set square 20125.9

View File

@ -1,7 +1,3 @@
puts "TODO OCC22817 All: exception.+There are no suitable edges"
puts "TODO OCC22817 All: \\*\\* Exception \\*\\*"
puts "TODO OCC22817 All: TEST INCOMPLETE"
pcylinder s1 3 10
pcylinder s2 4 16
trotate s2 0 0 0 1 0 0 80
@ -12,4 +8,4 @@ tscale s 0 0 0 SCALE1
explode s e
blend result s 0.5*SCALE1 s_2
set square 0
set square 19893.8

View File

@ -5,4 +5,4 @@ restore [locate_data_file buc60290b.rle] sol2
bcommon result sol2 sol1
set square 644559
set square 667287

View File

@ -1,5 +1,5 @@
restore [locate_data_file a2] a
restore [locate_data_file b2_bsect] b
bsection result a b
bsection result a b -n2d
set length 25.1327
set length 48.4314

View File

@ -61,7 +61,7 @@ GetShape D $Com1:2 Pr
NewCommand D
explode Pr E
AddDriver D Attach Cyl
set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment
set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
set Cyl [AddCyl D 70 515 ${Sel1}]
ComputeFun D $Cyl:1
GetShape D $Cyl:1:2 CylS

View File

@ -61,7 +61,7 @@ GetShape D $Com1:2 Pr
NewCommand D
explode Pr E
AddDriver D Attach Cyl
set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment
set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
set Cyl [AddCyl D 70 515 ${Sel1}]
ComputeFun D $Cyl:1
GetShape D $Cyl:1:2 CylS

View File

@ -84,7 +84,7 @@ GetShape D $Com1:2 Pr
NewCommand D
explode Pr E
AddDriver D Attach Cyl
set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment
set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
set Cyl [AddCyl D 70 515 ${Sel1}]
ComputeFun D $Cyl:1
GetShape D $Cyl:1:2 CylS

View File

@ -82,7 +82,7 @@ GetShape D $Com1:2 Pr
NewCommand D
explode Pr E
AddDriver D Attach Cyl
set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment
set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
set Cyl [AddCyl D 70 515 ${Sel1}]
ComputeFun D $Cyl:1
GetShape D $Cyl:1:2 CylS

View File

@ -6,9 +6,6 @@ mkplane cont cont
puts "*"
puts "TODO OCC22810 ALL:Error in featperform"
puts "TODO OCC22810 ALL:Error : The feat can not be build"
restore [locate_data_file CFE900_cts21gbs.rle] base
restore [locate_data_file cts21322_face.rle] wire
@ -24,4 +21,4 @@ if { [catch { featperform prism result } ] != 0 } {
puts "Error in featperform"
}
set square 0
set square 683.581