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;
//
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)) {
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);
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;
//
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);
//
//
// 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)));
//
//
//
// 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)));
//
BOPAlgo_BuilderFace aBF(aAllocator);
//
aBF.SetFace(aFF);
- aBF.SetContext(myContext);
+ //aBF.SetContext(myContext);
//
// <-DEB ft
//
Handle(NCollection_IncAllocator) aAllocator;
BOPCol_ListIteratorOfListOfShape aItF1, aItF2;
BOPTools_ListOfCoupleOfShape aLCS;
- BOPCol_DataMapIteratorOfDataMapOfIntegerListOfShape aItBlocks;
BOPCol_ListIteratorOfListOfShape aItLS;
//
myErrorStatus=0;
}
//-----------------------------------------------------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);
//
}
} // 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);
//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;
}
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();
}
//
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();
//=======================================================================
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);
}
}
//=======================================================================
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();
}
}
//
- 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();
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);
//
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();
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);
}
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);
}
//
} //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;
//
// 1.3 Build new solids
BOPAlgo_BuilderSolid aSB(theAllocator);
//
- aSB.SetContext(myContext);
+ //aSB.SetContext(myContext);
aSB.SetShapes(aSFS);
aSB.Perform();
iErr=aSB.ErrorStatus();
MapOfInteger from BOPCol,
ListOfInteger from BOPCol,
DataMapOfShapeInteger from BOPCol,
+ IndexedDataMapOfShapeInteger from BOPCol,
DataMapOfIntegerListOfInteger from BOPCol,
DataMapOfShapeListOfShape from BOPCol,
+ IndexedDataMapOfShapeListOfShape from BOPCol,
--
Context from BOPInt,
--
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,
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;
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;
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;
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;
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
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
--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
--- 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:
+ ---Keeps data for post treatment
+
+ RefineFaceInfoOn(me:out)
is protected;
---Purpose:
- --- Checks if the PaveBlock aPB is common block
- --- for faces with indices nF1 and nF2
+ --- Refines the state On for the all faces having
+ --- state information
fields
myArguments : ListOfShape from BOPCol is protected;
return;
}
//
- myDS->RefineFaceInfoOn();
- //
// 22
PerformFF();
if (myErrorStatus) {
return;
}
//
+ RefineFaceInfoOn();
+ //
MakePCurves();
if (myErrorStatus) {
return;
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;
//
//-----------------------------------------------------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);
//
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);
//
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);
+ }
}
}
}
//
//-----------------------------------------------------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;
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);
//
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);
//
//
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);
//
aCPB.SetPaveBlocks(aPB1, aPB2);
aCPB.SetIndexInterf(iX);
- aMVCPB.Bind(aVnew, aCPB);
+ aMVCPB.Add(aVnew, aCPB);
}//case TopAbs_VERTEX:
break;
//
// post treatment
//=========================================
BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, aAllocator);
- PerformVertices(aMVCPB, aAllocator);
+ PerformVerticesEE(aMVCPB, aAllocator);
//-----------------------------------------------------scope t
aMPBLPB.Clear();
aMVCPB.Clear();
//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;
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();
// 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
//
// 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);
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();
{
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);
}
}
}
// 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();
}
}
// 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()) {
//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;
//
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));
// 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;
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);
- }
}
//=======================================================================
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;
}
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;
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();
//
//
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();
//
aCPB.SetPaveBlocks(aPB, aPB);
aCPB.SetIndexInterf(iX);
- aMVCPB.Bind(aVnew, aCPB);
+ aMVCPB.Add(aVnew, aCPB);
}
}
break;
// 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;
//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;
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);
}
//
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();
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();
}
}
// 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()) {
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_DataMapOfShapeInteger.hxx>
#include <BOPCol_ListOfInteger.hxx>
+#include <BOPCol_IndexedMapOfInteger.hxx>
#include <BOPInt_Context.hxx>
#include <BOPInt_Tools.hxx>
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 :
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;
}
//
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();
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
//
aMVOnIn.Clear();
aMPBOnIn.Clear();
- aMVB.Clear();
//
myDS->VerticesOnIn(nF1, nF2, aMVOnIn, aMPBOnIn);
myDS->SharedEdges(nF1, nF2, aLSE, aAllocator);
//
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();
// 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);
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++;
+ //
+ bValid2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTolR3D);
+ if (!bValid2D) {
continue;
}
//
bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aLSE);
if (bExist) {
- aSC++;
continue;
}
//
- bValid2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTolR3D);
- if (!bValid2D) {
+ 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;
}
//
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
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();
//purpose :
//=======================================================================
Standard_Integer BOPAlgo_PaveFiller::PostTreatFF
- (BOPDS_DataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
+ (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI,
Handle(NCollection_BaseAllocator)& theAllocator)
{
}
//
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;
//
// 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);
}
//
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);
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()) {
}
}
else {
- const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx);
+ const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx);
iX=aCPB.IndexInterf();
iC=aCPB.Index();
aPB1=aCPB.PaveBlock1();
(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;
if (!iFlag) {
iFlag=myContext->ComputePE(aPm, theTolR3D, aSp, aTx);
if (!iFlag) {
+ aPBOut = aPB;
return bRet;
}
}
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;
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
}
}
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;
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
}
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();
//
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);
}
}
}
return;
}
//
- BOPDS_MapOfPaveBlock aMPB;
- BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+ BOPDS_IndexedMapOfPaveBlock aMPB;
+
Standard_Integer nE;
Handle(BOPDS_PaveBlock) aPBf;
aPBf = aLPBC.First();
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();
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);
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);
}
//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;
//
- bRet = Standard_True;
- aPB->Indices(nV1, nV2);
+ Standard_Integer iC=aVC.Append()-1;
+ BOPDS_ListOfPaveBlock& aLPBC = aVC(iC).ChangePaveBlocks();
+ 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)));
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);
- //
- 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;
+ // Keep info for post treatment
+ BOPDS_CoupleOfPaveBlocks aCPB;
+ aCPB.SetIndexInterf(aInt);
+ aCPB.SetIndex(iC);
+ aCPB.SetPaveBlock1(aPB);
+ //
+ aMSCPB.Add(aE, aCPB);
+ aMVI.Bind(aV1, nV1);
+ aMVI.Bind(aV2, nV2);
}
+
//=======================================================================
//function : FindPaveBlocksByFirst
//purpose :
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
/*
{
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();
}
//
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();
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();
}
}
}
+
+//=======================================================================
+// 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();
+}
//
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();
}
}
// 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();
}
}
// 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();
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
--- 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 DataMapOfIntegerListOfInteger from BOPCol;
- theAllocator: out BaseAllocator from BOPCol);
-
-
+ tneN1:Integer from Standard;
+ tneN2:Integer from Standard;
+ theMILI : out IndexedDataMapOfIntegerListOfInteger from BOPCol;
+ 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);
-
+ tnePB1:PaveBlock from BOPDS;
+ tnePB2:PaveBlock from BOPDS;
+ theMILI : out IndexedDataMapOfPaveBlockListOfPaveBlock 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;
#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;
}
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();
}
//
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();
//=======================================================================
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);
}
}
//=======================================================================
//=======================================================================
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);
}
}
//=======================================================================
//=======================================================================
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;
}
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();
}
//
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();
//function : PerformCommonBlocks
//purpose :
//=======================================================================
- void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
+ void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB,
Handle(NCollection_BaseAllocator)& aAllocator)
{
Standard_Integer aNbCB;
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;
//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();
}
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();
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();
//
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();
//
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();
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);
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;
--- /dev/null
+// 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
--- /dev/null
+// 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
BOPCol_DataMapOfIntegerListOfShape.hxx
BOPCol_SequenceOfReal.hxx
BOPCol_DataMapOfIntegerShape.hxx
+BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx
+BOPCol_IndexedDataMapOfShapeInteger.hxx
\ No newline at end of file
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;
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,
--
FaceInfoOn(me:out;
theIndex:Integer from Standard;
- theMPB:out MapOfPaveBlock from BOPDS;
+ theMPB:out IndexedMapOfPaveBlock from BOPDS;
theMVP:out MapOfInteger from BOPCol);
---Purpose:
--- Selector
FaceInfoIn(me:out;
theIndex:Integer from Standard;
- theMPB:out MapOfPaveBlock from BOPDS;
+ theMPB:out IndexedMapOfPaveBlock from BOPDS;
theMVP:out MapOfInteger from BOPCol);
---Purpose:
--- Selector
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();
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();
//purpose :
//=======================================================================
void BOPDS_DS::FaceInfoOn(const Standard_Integer theF,
- BOPDS_MapOfPaveBlock& theMPB,
+ BOPDS_IndexedMapOfPaveBlock& theMPB,
BOPCol_MapOfInteger& theMI)
{
Standard_Integer nS, nSD, nV1, nV2;
//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;
//=======================================================================
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);
}
}
}
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();
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();
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();
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();
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();
--- /dev/null
+// 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
uses
BaseAllocator from BOPCol,
MapOfInteger from BOPCol,
- MapOfPaveBlock from BOPDS
+ IndexedMapOfPaveBlock from BOPDS
--raises
-- In
--
PaveBlocksIn(me)
- returns MapOfPaveBlock from BOPDS;
+ returns IndexedMapOfPaveBlock from BOPDS;
---C++: return const &
---C++: inline
---Purpose:
--- that have state In
ChangePaveBlocksIn(me:out)
- returns MapOfPaveBlock from BOPDS;
+ returns IndexedMapOfPaveBlock from BOPDS;
---C++: return &
---C++: inline
---Purpose:
-- On
--
PaveBlocksOn(me)
- returns MapOfPaveBlock from BOPDS;
+ returns IndexedMapOfPaveBlock from BOPDS;
---C++: return const &
---C++: inline
---Purpose:
--- that have state On
ChangePaveBlocksOn(me:out)
- returns MapOfPaveBlock from BOPDS;
+ returns IndexedMapOfPaveBlock from BOPDS;
---C++: return &
---C++: inline
---Purpose:
-- Sections
--
PaveBlocksSc(me)
- returns MapOfPaveBlock from BOPDS;
+ returns IndexedMapOfPaveBlock from BOPDS;
---C++: return const &
---C++: inline
---Purpose:
--- that are pave blocks of section edges
ChangePaveBlocksSc(me:out)
- returns MapOfPaveBlock from BOPDS;
+ returns IndexedMapOfPaveBlock from BOPDS;
---C++: return &
---C++: inline
--- Selector/Modifier
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;
//function : PaveBlockIn
//purpose :
//=======================================================================
- inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksIn()const
+ inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksIn()const
{
return myPaveBlocksIn;
}
//function : ChangePaveBlocksIn
//purpose :
//=======================================================================
- inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksIn()
+ inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksIn()
{
return myPaveBlocksIn;
}
//function : PaveBlocksOn
//purpose :
//=======================================================================
- inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksOn()const
+ inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksOn()const
{
return myPaveBlocksOn;
}
//function : ChangePaveBlocksOn
//purpose :
//=======================================================================
- inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksOn()
+ inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksOn()
{
return myPaveBlocksOn;
}
//function : PaveBlocksSc
//purpose :
//=======================================================================
- inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksSc()const
+ inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksSc()const
{
return myPaveBlocksSc;
}
//function : ChangePaveBlocksSc
//purpose :
//=======================================================================
- inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksSc()
+ inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksSc()
{
return myPaveBlocksSc;
}
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
BOPDS_VectorOfPoint.hxx
BOPDS_DataMapOfShapeCoupleOfPaveBlocks.hxx
BOPDS_MapOfPave.hxx
+BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock.hxx
+BOPDS_DataMapOfIntegerListOfPaveBlock.hxx
+BOPDS_IndexedMapOfPaveBlock.hxx
+BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx
+BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx
\ No newline at end of file
Standard_Real ddx=aTolE;//1.e-12;
BndLib_Add3dCurve::Add (aBAC, t1C, t2C, ddx, myBndBox);
- myErrorStatus=0;//6
+ myErrorStatus=6;//0
return;
}
}
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
}
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
}
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);
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()) {
}
}//for (; aExp.More(); aExp.Next()){
aMCB.Add(aF);
- }// for (; aItM.More(); aItM.Next()) {
+ }// for (i=1; i<=aNbAdd; ++i) {
//
aNbAdd1=aMAdd1.Extent();
if (!aNbAdd1) {
}
//
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) {
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);
}
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
//
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);
}
}//for (; aExp.More(); aExp.Next()){
aMCB.Add(aF);
- }// for (; aItM.More(); aItM.Next()) {
+ }// for (i=1; i<=aNbAdd; ++i) {
//
aNbAdd1=aMAdd1.Extent();
if (!aNbAdd1) {
}
//
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);
}
//
//
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);
}
}
//=======================================================================
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;
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();
} else {
bRem = Standard_True;
aME.Add(aS);
- }
- }
- //
- if (!bRem && !bIm) {
- aLE.Append(aE);
- continue;
+ }
}
//
- if (bRem && !bIm) {
+ if (!bIm) {
aLE.Append(aE);
continue;
}
}
}
+ 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)) {
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)) {
{
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;
//
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);
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);
BOPTools_MapOfSet aMST;
BOPCol_ListOfShape aLSImNew;
BOPCol_MapOfShape aMS;
- Standard_Boolean bRem;
BOPCol_ListIteratorOfListOfShape aIt;
TopExp_Explorer aExp, aExpF;
Standard_Boolean bFlagSD;
//
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;
-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
updatevol s_2 0 0.3*SCALE1 1 0.5*SCALE1 2 0.3*SCALE1
buildevol
-set square 0
+set square 20125.9
-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
explode s e
blend result s 0.5*SCALE1 s_2
-set square 0
+set square 19893.8
bcommon result sol2 sol1
-set square 644559
+set square 667287
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
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
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
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
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
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
puts "Error in featperform"
}
-set square 0
+set square 683.581