// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <BOPAlgo_ArgumentAnalyzer.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <BOPAlgo_CheckerSI.hxx>
#include <BOPAlgo_Operation.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_SequenceOfShape.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_MapOfPassKey.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
-
-//
// ================================================================================
// function: Constructor
// purpose:
// ================================================================================
void BOPAlgo_ArgumentAnalyzer::TestContinuity()
{
- Standard_Integer i;
+ Standard_Integer i, j, aNbS;
Standard_Real f, l;
TopExp_Explorer aExp;
- BOPCol_MapIteratorOfMapOfShape aIt;
//
for (i = 0; i < 2; ++i) {
const TopoDS_Shape& aS = !i ? myShape1 : myShape2;
continue;
}
//
- BOPCol_MapOfShape aMS;
+ BOPCol_IndexedMapOfShape aMS;
//Edges
aExp.Init(aS, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
}
//
//add shapes with continuity C0 to result
- aIt.Initialize(aMS);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aFS = aIt.Value();
+ aNbS = aMS.Extent();
+ for (j = 1; j <= aNbS; ++j) {
+ const TopoDS_Shape& aFS = aMS(j);
BOPAlgo_CheckResult aResult;
if(i == 0) {
aResult.SetShape1(myShape1);
#include <TopoDS_Shape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+typedef NCollection_IndexedDataMap
+ <BOPTools_Set,
+ TopoDS_Shape,
+ BOPTools_SetMapHasher> BOPTools_IndexedDataMapOfSetShape;
//
-typedef NCollection_DataMap
- <BOPTools_Set,
- TopoDS_Shape,
- BOPTools_SetMapHasher> BOPTools_DataMapOfSetShape;
-//
-typedef BOPTools_DataMapOfSetShape::Iterator
- BOPTools_DataMapIteratorOfDataMapOfSetShape;
-
static
TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
BOPCol_ListIteratorOfListOfShape aItLS, aItIm;
Standard_Boolean bHasInterf;
Standard_Integer iX;
- BOPTools_DataMapOfSetShape aDMSTS;
+ BOPTools_IndexedDataMapOfSetShape aDMSTS;
//
myErrorStatus=0;
//
//
aST.Add(aSIm, TopAbs_FACE);
//
- aDMSTS.Bind(aST, aSIm);
+ aDMSTS.Add(aST, aSIm);
}
}
}
//
aST.Add(aSIm, TopAbs_FACE);
//
- if (aDMSTS.IsBound(aST)) {
- const TopoDS_Shape& aSImA=aDMSTS.Find(aST);
+ if (aDMSTS.Contains(aST)) {
+ const TopoDS_Shape& aSImA=aDMSTS.FindFromKey(aST);
aBB.Add(aC, aSImA);
}
}
//
aST.Add(aSIm, TopAbs_FACE);
//
- bIsBound=aDMSTS.IsBound(aST);
+ bIsBound=aDMSTS.Contains(aST);
}
//
if (!bIsBound) {
BOPCol_ListOfShape aSFS;
BOPAlgo_BuilderSolid aSB;
BOPCol_MapOfShape aMSA, aMZ;
- BOPTools_DataMapOfSetShape aDMSTS;
- BOPTools_DataMapIteratorOfDataMapOfSetShape aItDMSTS;
+ BOPTools_IndexedDataMapOfSetShape aDMSTS;
//
myErrorStatus=0;
//
//
aST.Add(aSx, TopAbs_FACE);
//
- if (!aDMSTS.IsBound(aST)) {
- aDMSTS.Bind(aST, aSx);
+ if (!aDMSTS.Contains(aST)) {
+ aDMSTS.Add(aST, aSx);
}
continue;
aBB.Add(aRC, aSR);
}
//
- aItDMSTS.Initialize(aDMSTS);
- for (; aItDMSTS.More(); aItDMSTS.Next()) {
- const TopoDS_Shape& aSx=aItDMSTS.Value();
+ aNbSx = aDMSTS.Extent();
+ for (i = 1; i <= aNbSx; ++i) {
+ const TopoDS_Shape& aSx = aDMSTS(i);
aBB.Add(aRC, aSx);
}
//
#include <Standard_Handle.hxx>
#include <BOPCol_ListOfShape.hxx>
-#include <BOPCol_MapOfOrientedShape.hxx>
+#include <BOPCol_IndexedMapOfOrientedShape.hxx>
#include <BOPAlgo_Algo.hxx>
#include <BOPCol_BaseAllocator.hxx>
class IntTools_Context;
BOPCol_ListOfShape myLoops;
BOPCol_ListOfShape myLoopsInternal;
BOPCol_ListOfShape myAreas;
- BOPCol_MapOfOrientedShape myShapesToAvoid;
+ BOPCol_IndexedMapOfOrientedShape myShapesToAvoid;
private:
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <Bnd_Box.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <BOPAlgo_WireEdgeSet.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_MapOfOrientedShape.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
-//
-//
-//
-//
-//
-//
-//
-//
//
//
//
const TopoDS_Shape& ,
Handle(IntTools_Context)& );
static
- void MakeInternalWires(const BOPCol_MapOfShape& ,
+ void MakeInternalWires(const BOPCol_IndexedMapOfShape& ,
BOPCol_ListOfShape& );
static
void GetWire(const TopoDS_Shape& ,
myErrorStatus=0;
//
Standard_Boolean bFlag;
- Standard_Integer iErr, aNbEA;
+ Standard_Integer i, iErr, aNbEA;
BOPCol_ListIteratorOfListOfShape aIt;
- BOPCol_MapIteratorOfMapOfOrientedShape aItM;
BOPCol_IndexedDataMapOfShapeListOfShape aVEMap;
BOPCol_MapOfOrientedShape aMAdded;
TopoDS_Iterator aItW;
}
//
// b. collect all edges that are to avoid
- aItM.Initialize(myShapesToAvoid);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aE=aItM.Key();
+ aNbEA = myShapesToAvoid.Extent();
+ for (i = 1; i <= aNbEA; ++i) {
+ const TopoDS_Shape& aE = myShapesToAvoid(i);
aMEP.Add(aE);
}
//
// 2. Internal Wires
myLoopsInternal.Clear();
//
- aNbEA=myShapesToAvoid.Extent();
- aItM.Initialize(myShapesToAvoid);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aEE=aItM.Key();
+ aNbEA = myShapesToAvoid.Extent();
+ for (i = 1; i <= aNbEA; ++i) {
+ const TopoDS_Shape& aEE = myShapesToAvoid(i);
BOPTools::MapShapesAndAncestors(aEE,
TopAbs_VERTEX,
TopAbs_EDGE,
}
//
bFlag=Standard_True;
- aItM.Initialize(myShapesToAvoid);
- for (; aItM.More()&&bFlag; aItM.Next()) {
- const TopoDS_Shape& aEE=aItM.Key();
+ for (i = 1; (i <= aNbEA) && bFlag; ++i) {
+ const TopoDS_Shape& aEE = myShapesToAvoid(i);
if (!aMAdded.Add(aEE)) {
continue;
}
}//for (; aItE.More(); aItE.Next()) {
}//for (; aItW.More(); aItW.Next()) {
myLoopsInternal.Append(aW);
- }//for (; aItM.More(); aItM.Next()) {
+ }//for (i = 1; (i <= aNbEA) && bFlag; ++i) {
}
//=======================================================================
//function : PerformAreas
}
//
//Standard_Real aTol;
+ Standard_Integer i;
BRep_Builder aBB;
BOPCol_ListIteratorOfListOfShape aIt1, aIt2;
TopoDS_Iterator aIt;
- BOPCol_MapOfShape aME, aMEP;
- BOPCol_MapIteratorOfMapOfShape aItME;
+ BOPCol_IndexedMapOfShape aME1, aME2, aMEP;
BOPCol_IndexedDataMapOfShapeListOfShape aMVE;
BOPCol_ListOfShape aLSI;
//
aIt.Initialize(aWire);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
- aME.Add(aE);
+ aME1.Add(aE);
}
}
- aNbWI=aME.Extent();
//
// 2 Process faces
aIt2.Initialize(myAreas);
BOPTools::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
//
// 2.1 Separate faces to process aMEP
+ aME2.Clear();
aMEP.Clear();
- aItME.Initialize(aME);
- for (; aItME.More(); aItME.Next()) {
- const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aItME.Key()));
+ aNbWI = aME1.Extent();
+ for (i = 1; i <= aNbWI; ++i) {
+ const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aME1(i)));
if (IsInside(aE, aF, myContext)) {
aMEP.Add(aE);
}
+ else {
+ aME2.Add(aE);
+ }
}
//
// 2.2 Make Internal Wires
}
//
// 2.4 Remove faces aMFP from aMF
- aItME.Initialize(aMEP);
- for (; aItME.More(); aItME.Next()) {
- const TopoDS_Shape& aE=aItME.Key();
- aME.Remove(aE);
- }
+ aME1 = aME2;
//
- aNbWI=aME.Extent();
+ aNbWI = aME1.Extent();
if (!aNbWI) {
break;
}
//function : MakeInternalWires
//purpose :
//=======================================================================
-void MakeInternalWires(const BOPCol_MapOfShape& theME,
+void MakeInternalWires(const BOPCol_IndexedMapOfShape& theME,
BOPCol_ListOfShape& theWires)
{
- BOPCol_MapIteratorOfMapOfShape aItM;
+ Standard_Integer i, aNbE;
BOPCol_MapOfShape aAddedMap;
BOPCol_ListIteratorOfListOfShape aItE;
BOPCol_IndexedDataMapOfShapeListOfShape aMVE;
BRep_Builder aBB;
//
- aItM.Initialize(theME);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aE=aItM.Key();
+ aNbE = theME.Extent();
+ for (i = 1; i <= aNbE; ++i) {
+ const TopoDS_Shape& aE = theME(i);
BOPTools::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
}
//
- aItM.Initialize(theME);
- for (; aItM.More(); aItM.Next()) {
- TopoDS_Shape aEE=aItM.Key();
+ for (i = 1; i <= aNbE; ++i) {
+ TopoDS_Shape aEE = theME(i);
if (!aAddedMap.Add(aEE)) {
continue;
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//
-
-
#include <BOPAlgo_BuilderSolid.hxx>
#include <BOPAlgo_ShellSplitter.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
+#include <BOPCol_IndexedDataMapOfShapeShape.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfOrientedShape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
//
static
Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
const TopoDS_Shape& ,
Handle(IntTools_Context)& );
static
- void MakeInternalShells(const BOPCol_MapOfShape& ,
+ void MakeInternalShells(const BOPCol_IndexedMapOfShape& ,
BOPCol_ListOfShape& );
//=======================================================================
Handle(IntTools_Context)> BOPAlgo_FaceSolidCnt;
//
//=======================================================================
-typedef NCollection_DataMap
- <TopoDS_Shape,
- gp_Pnt,
- TopTools_ShapeMapHasher> BOPAlgo_DataMapOfShapePnt;
-typedef BOPAlgo_DataMapOfShapePnt::Iterator
- BOPAlgo_DataMapIteratorOfDataMapOfShapePnt;
-//
//=======================================================================
//function :
//purpose :
//=======================================================================
void BOPAlgo_BuilderSolid::PerformLoops()
{
- Standard_Integer iErr;
+ Standard_Integer iErr, i, aNbSh;
BOPCol_ListIteratorOfListOfShape aIt;
TopoDS_Iterator aItS;
- BOPCol_MapIteratorOfMapOfOrientedShape aItM;
Handle(NCollection_BaseAllocator) aAlr;
//
myErrorStatus=0;
}
//
// b. collect all edges that are to avoid
- aItM.Initialize(myShapesToAvoid);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aF=aItM.Key();
+ aNbSh = myShapesToAvoid.Extent();
+ for (i = 1; i <= aNbSh; ++i) {
+ const TopoDS_Shape& aF = myShapesToAvoid(i);
aMP.Add(aF);
}
//
aEFMap.Clear();
AddedFacesMap.Clear();
//
- aItM.Initialize(myShapesToAvoid);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aFF=aItM.Key();
+ aNbSh = myShapesToAvoid.Extent();
+ for (i = 1; i <= aNbSh; ++i) {
+ const TopoDS_Shape& aFF = myShapesToAvoid(i);
BOPTools::MapShapesAndAncestors(aFF,
TopAbs_EDGE, TopAbs_FACE,
aEFMap);
}
//
- aItM.Initialize(myShapesToAvoid);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aFF=aItM.Key();
+ for (i = 1; i <= aNbSh; ++i) {
+ const TopoDS_Shape& aFF = myShapesToAvoid(i);
if (!AddedFacesMap.Add(aFF)) {
continue;
}
void BOPAlgo_BuilderSolid::PerformAreas()
{
Standard_Boolean bIsGrowth, bIsHole;
- Standard_Integer k;
+ Standard_Integer i, k, aNbInOut, aNbMSH;
BRep_Builder aBB;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_ListOfShape aNewSolids, aHoleShells;
- BOPCol_DataMapOfShapeShape aInOutMap;
+ BOPCol_IndexedDataMapOfShapeShape aInOutMap;
BOPCol_IndexedMapOfShape aMHF;
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPCol_BoxBndTreeSelector aSelector;
NCollection_UBTreeFiller
<Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
BOPAlgo_DataMapOfIntegerBSSB aDMISB(100);
+ BOPCol_IndexedDataMapOfShapeListOfShape aMSH;
BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB aItDMISB;
- BOPCol_DataMapOfShapeListOfShape aMSH;
- BOPCol_DataMapIteratorOfDataMapOfShapeShape aItDMSS;
- BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
//
myErrorStatus=0;
//
continue;
}
//
- if (aInOutMap.IsBound (aHole)){
- const TopoDS_Shape& aSolidWas=aInOutMap(aHole);
+ if (aInOutMap.Contains (aHole)){
+ const TopoDS_Shape& aSolidWas = aInOutMap.FindFromKey(aHole);
if (IsInside(aSolid, aSolidWas, myContext)) {
- aInOutMap.UnBind(aHole);
- aInOutMap.Bind (aHole, aSolid);
+ aInOutMap.ChangeFromKey(aHole) = aSolid;
}
}
else{
- aInOutMap.Bind(aHole, aSolid);
+ aInOutMap.Add(aHole, aSolid);
}
}
- }//for (; aItDMISB.More(); aItDMISB.Next()) {
+ }//for (i = 1; i <= aNbDMISB; ++i) {
//
// 5. Map [Solid/Holes] -> aMSH
- aItDMSS.Initialize(aInOutMap);
- for (; aItDMSS.More(); aItDMSS.Next()) {
- const TopoDS_Shape& aHole=aItDMSS.Key();
- const TopoDS_Shape& aSolid=aItDMSS.Value();
+ aNbInOut = aInOutMap.Extent();
+ for (i = 1; i <= aNbInOut; ++i) {
+ const TopoDS_Shape& aHole = aInOutMap.FindKey(i);
+ const TopoDS_Shape& aSolid = aInOutMap(i);
//
- if (aMSH.IsBound(aSolid)) {
- BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
+ if (aMSH.Contains(aSolid)) {
+ BOPCol_ListOfShape& aLH = aMSH.ChangeFromKey(aSolid);
aLH.Append(aHole);
}
else {
BOPCol_ListOfShape aLH;
aLH.Append(aHole);
- aMSH.Bind(aSolid, aLH);
+ aMSH.Add(aSolid, aLH);
}
}
//
// 6. Add aHoles to Solids
- aItMSH.Initialize(aMSH);
- for (; aItMSH.More(); aItMSH.Next()) {
- TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&aItMSH.Key()));
+ aNbMSH = aMSH.Extent();
+ for (i = 1; i <= aNbMSH; ++i) {
+ TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&(aMSH.FindKey(i))));
+ const BOPCol_ListOfShape& aLH = aMSH(i);
//
- const BOPCol_ListOfShape& aLH=aItMSH.Value();
aItLS.Initialize(aLH);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aHole = aItLS.Value();
aItLS.Initialize(aHoleShells);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aHole = aItLS.Value();
- if (!aInOutMap.IsBound(aHole)){
+ if (!aInOutMap.Contains(aHole)){
TopoDS_Solid aSolid;
//
aBB.MakeSolid(aSolid);
TopoDS_Iterator aIt;
TopExp_Explorer aExp;
BOPCol_ListIteratorOfListOfShape aItLS;
- BOPCol_MapOfShape aMFs;
+ BOPCol_IndexedMapOfShape aMFs;
BOPCol_ListOfShape aLSI;
BOPAlgo_VectorOfFaceSolid aVFS;
BOPAlgo_VectorOfFacePnt aVFP;
for (; aIt.More(); aIt.Next()) {
const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
//
- if (aMFs.Add(aF)) {
+ if (!aMFs.Contains(aF)) {
+ aMFs.Add(aF);
+ //
gp_Pnt aP;
gp_Pnt2d aP2D;
//
//function : MakeInternalShells
//purpose :
//=======================================================================
-void MakeInternalShells(const BOPCol_MapOfShape& theMF,
+void MakeInternalShells(const BOPCol_IndexedMapOfShape& theMF,
BOPCol_ListOfShape& theShells)
{
- BOPCol_ListIteratorOfListOfShape aItF;
+ Standard_Integer i, aNbF;
BRep_Builder aBB;
- //
+ BOPCol_ListIteratorOfListOfShape aItF;
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
- BOPCol_MapIteratorOfMapOfShape aItM;
BOPCol_MapOfShape aAddedFacesMap;
//
- aItM.Initialize(theMF);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aF=aItM.Key();
+ aNbF = theMF.Extent();
+ for (i = 1; i <= aNbF; ++i) {
+ TopoDS_Shape aF = theMF(i);
BOPTools::MapShapesAndAncestors(aF,
TopAbs_EDGE, TopAbs_FACE,
aMEF);
}
//
- aItM.Initialize(theMF);
- for (; aItM.More(); aItM.Next()) {
- TopoDS_Shape aFF=aItM.Key();
+ for (i = 1; i <= aNbF; ++i) {
+ TopoDS_Shape aFF = theMF(i);
if (!aAddedFacesMap.Add(aFF)) {
continue;
}
aType=aS.ShapeType();
if (aType==theType) {
if (myImages.IsBound(aS)){
- const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
- aItIm.Initialize(aLSIm);
- for (; aItIm.More(); aItIm.Next()) {
- const TopoDS_Shape& aSIm=aItIm.Value();
- if (aM.Add(aSIm)) {
- aBB.Add(myShape, aSIm);
- }
- }
+ const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
+ aItIm.Initialize(aLSIm);
+ for (; aItIm.More(); aItIm.Next()) {
+ const TopoDS_Shape& aSIm=aItIm.Value();
+ if (aM.Add(aSIm)) {
+ aBB.Add(myShape, aSIm);
+ }
+ }
}
else {
- if (aM.Add(aS)) {
- aBB.Add(myShape, aS);
- }
+ if (aM.Add(aS)) {
+ aBB.Add(myShape, aS);
+ }
}
}
}
const BOPCol_ListOfShape& aLFIm=myImages.Find(aSX);
aItIm.Initialize(aLFIm);
for (; aItIm.More(); aItIm.Next()) {
- TopoDS_Shape aSXIm=aItIm.Value();
- aSXIm.Orientation(aOrX);
- aBB.Add(aCIm, aSXIm);
+ TopoDS_Shape aSXIm=aItIm.Value();
+ aSXIm.Orientation(aOrX);
+ aBB.Add(aCIm, aSXIm);
}
}
else {
BOPCol_MapOfShape aMFence;
Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListOfShape aLFIm(myAllocator);
- BOPCol_MapIteratorOfMapOfShape aItMS;
BOPAlgo_VectorOfBuilderFace aVBF;
//
myErrorStatus=0;
const BOPDS_FaceInfo& aFI2)
{
Standard_Boolean bRet;
- BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+ Standard_Integer i, aNbPB;
//
bRet=Standard_False;
- const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
- const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
- //
- const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
- aItMPB.Initialize(aMPBOn2);
- for (; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
- bRet=aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
+ const BOPDS_IndexedMapOfPaveBlock& aMPBOn1 = aFI1.PaveBlocksOn();
+ const BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.PaveBlocksIn();
+ //
+ const BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.PaveBlocksOn();
+ aNbPB = aMPBOn2.Extent();
+ for (i = 1; i <= aNbPB; ++i) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBOn2(i);
+ bRet = aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
if (bRet) {
return bRet;
}
}
//
- const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
- aItMPB.Initialize(aMPBIn2);
- for (; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
- bRet=aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
+ const BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.PaveBlocksIn();
+ aNbPB = aMPBIn2.Extent();
+ for (i = 1; i <= aNbPB; ++i) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBIn2(i);
+ bRet = aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
if (bRet) {
return bRet;
}
Standard_Integer i, aNbS;
TopExp_Explorer aExp;
BOPCol_ListIteratorOfListOfShape aIt;
- BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
//
Handle(NCollection_IncAllocator) aAlr0;
aAlr0=new NCollection_IncAllocator();
TopAbs_State aState;
TopoDS_Iterator aItS;
BRep_Builder aBB;
- BOPCol_MapIteratorOfMapOfShape aItM;
BOPCol_ListIteratorOfListOfShape aIt, aIt1;
//
Handle(NCollection_IncAllocator) aAllocator;
//
BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
BOPCol_IndexedMapOfShape aMx(100, aAllocator);
- BOPCol_MapOfShape aMSI(100, aAllocator);
+ BOPCol_IndexedMapOfShape aMSI(100, aAllocator);
BOPCol_MapOfShape aMFence(100, aAllocator);
BOPCol_MapOfShape aMSOr(100, aAllocator);
BOPCol_ListOfShape aLSd(aAllocator);
BOPCol_ListOfShape aLArgs(aAllocator);
BOPCol_ListOfShape aLSC(aAllocator);
+ BOPCol_ListOfShape aLSI(aAllocator);
//
// 1. Shapes to process
//
//
// 3. Some shapes of aMSI can be already tied with faces of
// split solids
- aItM.Initialize(aMSI);
- for (; aItM.More(); aItM.Next()) {
- const TopoDS_Shape& aSI=aItM.Key();
+ aNbSI = aMSI.Extent();
+ for (i = 1; i <= aNbSI; ++i) {
+ const TopoDS_Shape& aSI = aMSI(i);
if (aMSx.Contains(aSI)) {
const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
- aNbSx=aLSx.Extent();
- if (aNbSx) {
- aMSI.Remove(aSI);
+ aNbSx = aLSx.Extent();
+ if (!aNbSx) {
+ aLSI.Append(aSI);
}
}
+ else {
+ aLSI.Append(aSI);
+ }
}
//
// 4. Just check it
- aNbSI=aMSI.Extent();
+ aNbSI = aLSI.Extent();
if (!aNbSI) {
return;
}
for (; aIt.More(); aIt.Next()) {
TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
//
- aItM.Initialize(aMSI);
- for (; aItM.More(); aItM.Next()) {
- TopoDS_Shape aSI=aItM.Key();
+ aIt1.Initialize(aLSI);
+ for (; aIt1.More();) {
+ TopoDS_Shape aSI = aIt1.Value();
aSI.Orientation(TopAbs_INTERNAL);
//
aState=BOPTools_AlgoTools::ComputeStateByOnePoint
(aSI, aSd, 1.e-11, myContext);
- if (aState==TopAbs_IN) {
+ //
+ if (aState != TopAbs_IN) {
+ aIt1.Next();
+ continue;
+ }
+ //
+ if(aMSOr.Contains(aSd)) {
//
- if(aMSOr.Contains(aSd)) {
- //
- TopoDS_Solid aSdx;
- //
- aBB.MakeSolid(aSdx);
- aItS.Initialize(aSd);
- for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aSh=aItS.Value();
- aBB.Add(aSdx, aSh);
- }
- //
- aBB.Add(aSdx, aSI);
- //
- if (myImages.IsBound(aSdx)) {
- BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
- aLS.Append(aSdx);
- }
- else {
- BOPCol_ListOfShape aLS;
- aLS.Append(aSdx);
- myImages.Bind(aSd, aLS);
- }
- //
- aMSOr.Remove(aSd);
- aSd=aSdx;
+ TopoDS_Solid aSdx;
+ //
+ aBB.MakeSolid(aSdx);
+ aItS.Initialize(aSd);
+ for (; aItS.More(); aItS.Next()) {
+ const TopoDS_Shape& aSh=aItS.Value();
+ aBB.Add(aSdx, aSh);
}
+ //
+ aBB.Add(aSdx, aSI);
+ //
+ if (myImages.IsBound(aSdx)) {
+ BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
+ aLS.Append(aSdx);
+ }
else {
- aBB.Add(aSd, aSI);
+ BOPCol_ListOfShape aLS;
+ aLS.Append(aSdx);
+ myImages.Bind(aSd, aLS);
}
//
- aMSI.Remove(aSI);
- } //if (aState==TopAbs_IN) {
- }// for (; aItM.More(); aItM.Next()) {
- }//for (; aIt1.More(); aIt1.Next()) {
+ aMSOr.Remove(aSd);
+ aSd=aSdx;
+ }
+ else {
+ aBB.Add(aSd, aSI);
+ }
+ //
+ aLSI.Remove(aIt1);
+ }//for (; aIt1.More();) {
+ }//for (; aIt.More(); aIt.Next()) {
//
//-----------------------------------------------------scope t
aLArgs.Clear();
Standard_Boolean bWithSubShape;
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, k, aNbBlocks;
Handle(NCollection_IncAllocator) aAllocator;
- BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI;
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2;
TopoDS_Vertex aVn;
BOPDS_ShapeInfo aSIn;
BOPCol_IndexedMapOfShape aMVProcessed;
BOPCol_MapOfInteger aMFence;
BOPCol_ListIteratorOfListOfInteger aIt;
- BOPCol_DataMapOfShapeListOfShape aDMVLV;
- BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItDMVLV;
+ BOPCol_IndexedDataMapOfShapeListOfShape aDMVLV;
//
BOPCol_BoxBndTreeSelector aSelector;
BOPCol_BoxBndTree aBBTree;
//
Standard_Integer aIP, aNbIP1, aIP1;
BOPCol_ListOfShape aLVSD;
- BOPCol_MapIteratorOfMapOfInteger aItMI;
BOPCol_ListOfInteger aLIP, aLIP1, aLIPC;
BOPCol_ListIteratorOfListOfInteger aItLIP;
//
aLVSD.Append(aVP);
}
aVF=aLVSD.First();
- aDMVLV.Bind(aVF, aLVSD);
+ aDMVLV.Add(aVF, aLVSD);
}// for (i=1; i<=aNbV; ++i) {
// Make new vertices
- aItDMVLV.Initialize(aDMVLV);
- for(; aItDMVLV.More(); aItDMVLV.Next()) {
- const TopoDS_Shape& aV=aItDMVLV.Key();
- const BOPCol_ListOfShape& aLVSD=aItDMVLV.Value();
+ aNbV = aDMVLV.Extent();
+ for (i = 1; i <= aNbV; ++i) {
+ const TopoDS_Shape& aV = aDMVLV.FindKey(i);
+ const BOPCol_ListOfShape& aLVSD = aDMVLV(i);
if (aLVSD.IsEmpty()) {
myImages.Add(aV, aLVSD);
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <Bnd_Box.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
#include <BOPAlgo_Tools.hxx>
#include <BOPCol_DataMapOfIntegerReal.hxx>
#include <BOPCol_DataMapOfShapeInteger.hxx>
-#include <BOPCol_IndexedMapOfInteger.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfInteger.hxx>
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
-#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
#include <BOPDS_CommonBlock.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
+
static
Standard_Boolean IsBasedOnPlane(const TopoDS_Face& aF);
{
Standard_Boolean bHasPC;
Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI, nEx;
+ Standard_Integer j, aNbPBIn, aNbPBOn;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
- BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
TopoDS_Face aF1F, aF2F;
BOPAlgo_VectorOfMPC aVMPC;
//
aF1F.Orientation(TopAbs_FORWARD);
// In
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
- aItMPB.Initialize(aMPBIn);
- for(; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+ aNbPBIn = aMPBIn.Extent();
+ for (j = 1; j <= aNbPBIn; ++j) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(j);
nE=aPB->Edge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
//
//
// On
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
- aItMPB.Initialize(aMPBOn);
- for(; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+ aNbPBOn = aMPBOn.Extent();
+ for (j = 1; j <= aNbPBOn; ++j) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(j);
nE=aPB->Edge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
bHasPC=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF1F);
TopAbs_FACE
};
Standard_Boolean bJustAdd, bIsBasedOnPlane;
- Standard_Integer i, aNb, n1, nF;
+ Standard_Integer i, aNb, n1, nF, aNbF;
TopExp_Explorer aExp;
- BOPCol_MapOfShape aMF;
- BOPCol_MapIteratorOfMapOfShape aItMF;
+ BOPCol_IndexedMapOfShape aMF;
//
myErrorStatus=0;
//
}
}
//
- if (aMF.IsEmpty()) {
+ aNbF = aMF.Extent();
+ if (!aNbF) {
return;
}
//
BOPAlgo_VectorOfBPC aVBPC;
//
- aItMF.Initialize(aMF);
- for (; aItMF.More(); aItMF.Next()) {
- const TopoDS_Face& aF=*((TopoDS_Face *)&aItMF.Key());
+ for (i = 1; i <= aNbF; ++i) {
+ const TopoDS_Face& aF = *(TopoDS_Face*)&aMF(i);
aExp.Init(aF, aType[1]);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=*((TopoDS_Edge *)&aExp.Current());
const Standard_Integer nF,
BOPDS_ListOfPaveBlock& aLPBOut)
{
- Standard_Integer nV1, nV2;
- BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+ Standard_Integer i, aNbPBOn, aNbPBIn, aNbPBSc, nV1, nV2;
//
const BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
// In
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
- aItMPB.Initialize(aMPBIn);
- for(; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+ aNbPBIn = aMPBIn.Extent();
+ for (i = 1; i <= aNbPBIn; ++i) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(i);
aPB->Indices(nV1, nV2);
if (nV==nV1 || nV==nV2) {
aLPBOut.Append(aPB);
}
// On
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
- aItMPB.Initialize(aMPBOn);
- for(; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+ aNbPBOn = aMPBOn.Extent();
+ for (i = 1; i <= aNbPBOn; ++i) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(i);
aPB->Indices(nV1, nV2);
if (nV==nV1 || nV==nV2) {
aLPBOut.Append(aPB);
}
// Sections
const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
- aItMPB.Initialize(aMPBSc);
- for(; aItMPB.More(); aItMPB.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+ aNbPBSc = aMPBSc.Extent();
+ for (i = 1; i <= aNbPBSc; ++i) {
+ const Handle(BOPDS_PaveBlock)& aPB = aMPBSc(i);
aPB->Indices(nV1, nV2);
if (nV==nV1 || nV==nV2) {
aLPBOut.Append(aPB);
TopoDS_Iterator aItE;
TopoDS_Shape aER;
BOPCol_ListIteratorOfListOfShape aIt;
- BOPCol_MapIteratorOfMapOfShape aItM;
//
BOPCol_IndexedDataMapOfShapeListOfShape aMVE(100, myAllocator);
BOPCol_IndexedMapOfShape aMVP(100, myAllocator);
}
}
}
- }//for (; aItM.More(); aItM.Next()) {
+ }//for (k=1; k<=aNbVP; ++k) {
//
aNbVP=aMVAdd.Extent();
if (!aNbVP) {
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <BOPAlgo_WireEdgeSet.hxx>
#include <BOPAlgo_WireSplitter.hxx>
-#include <BOPCol_DataMapOfShapeInteger.hxx>
+#include <BOPCol_IndexedDataMapOfShapeInteger.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_ShapeMapHasher.hxx>
-
typedef NCollection_DataMap \
<TopoDS_Shape, Standard_Boolean, TopTools_ShapeMapHasher> \
BOPCol_DataMapOfShapeBoolean;
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap)
{
Standard_Integer aNb, i;
- BOPCol_DataMapOfShapeInteger aMSI;
- BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItMSI;
+ BOPCol_IndexedDataMapOfShapeInteger aMSI;
BOPCol_MapOfShape aMBE;
BOPCol_ListIteratorOfListOfShape aIt;
//
aIt.Initialize(myEdges);
for(; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
- if(aMSI.IsBound(aE)) {
- Standard_Integer& iCnt=aMSI.ChangeFind(aE);
+ if(aMSI.Contains(aE)) {
+ Standard_Integer& iCnt = aMSI.ChangeFromKey(aE);
++iCnt;
}
else {
- Standard_Integer iCnt=1;
- aMSI.Bind(aE, iCnt);
+ Standard_Integer iCnt = 1;
+ aMSI.Add(aE, iCnt);
}
}
//
- aItMSI.Initialize(aMSI);
- for(; aItMSI.More(); aItMSI.Next()) {
- Standard_Integer iCnt;
- //
- const TopoDS_Shape& aE=aItMSI.Key();
- iCnt=aItMSI.Value();
- if (iCnt==1) {
+ aNb = aMSI.Extent();
+ for (i = 1; i <= aNb; ++i) {
+ Standard_Integer iCnt = aMSI(i);
+ if (iCnt == 1) {
+ const TopoDS_Shape& aE = aMSI.FindKey(i);
aMBE.Add(aE);
}
-
}
//
aMSI.Clear();
//
- aNb=mySmartMap.Extent();
- for (i=1; i<=aNb; ++i) {
+ aNb = mySmartMap.Extent();
+ for (i = 1; i <= aNb; ++i) {
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&mySmartMap.FindKey(i));
BOPAlgo_ListOfEdgeInfo& aLEI=mySmartMap(i);
//
--- /dev/null
+// Created by: Eugeny MALTCHIKOV
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef BOPCol_IndexedDataMapOfShapeShape_HeaderFile
+#define BOPCol_IndexedDataMapOfShapeShape_HeaderFile
+
+#include <TopoDS_Shape.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+
+#include <NCollection_IndexedDataMap.hxx>
+
+typedef NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> BOPCol_IndexedDataMapOfShapeShape;
+
+#endif
--- /dev/null
+// Created by: Eugeny MALTCHIKOV
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef BOPCol_IndexedMapOfOrientedShape_HeaderFile
+#define BOPCol_IndexedMapOfOrientedShape_HeaderFile
+
+#include <TopoDS_Shape.hxx>
+#include <TopTools_OrientedShapeMapHasher.hxx>
+
+#include <NCollection_IndexedMap.hxx>
+
+typedef NCollection_IndexedMap<TopoDS_Shape, TopTools_OrientedShapeMapHasher> BOPCol_IndexedMapOfOrientedShape;
+
+#endif
BOPCol_IndexedDataMapOfShapeListOfShape.hxx
BOPCol_IndexedMapOfInteger.hxx
BOPCol_IndexedMapOfShape.hxx
+BOPCol_IndexedDataMapOfShapeShape.hxx
+BOPCol_IndexedMapOfOrientedShape.hxx
BOPCol_ListOfInteger.hxx
BOPCol_ListOfListOfShape.hxx
BOPCol_ListOfShape.hxx
if (aSx.ShapeType()==TopAbs_VERTEX){
nV=Index(aSx);
if (HasShapeSD(nV, nVSD)) {
- nV=nVSD;
+ nV=nVSD;
}
theMI.Add(nV);
}
{
if (HasFaceInfo(theI)) {
//
- Standard_Integer i, nV1, nV2, nV;
- BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+ Standard_Integer i, j, nV1, nV2, nV, aNbPB;
BOPCol_MapIteratorOfMapOfInteger aItMI;
//
BOPCol_MapOfInteger aMI(100, myAllocator);
//
const BOPDS_FaceInfo& aFI=FaceInfo(theI);
//
- for (i=0; i<2; ++i) {
+ for (i = 0; i < 2; ++i) {
const BOPDS_IndexedMapOfPaveBlock& aMPB=
(!i) ? aFI.PaveBlocksIn() : 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);
aPB->Indices(nV1, nV2);
aMI.Add(nV1);
aMI.Add(nV2);
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <Bnd_Box.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_DataMapOfIntegerInteger.hxx>
#include <BOPCol_DataMapOfIntegerListOfInteger.hxx>
#include <BOPCol_DataMapOfShapeInteger.hxx>
#include <BOPCol_IndexedDataMapOfShapeBox.hxx>
-#include <BOPCol_IndexedMapOfInteger.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_IndexRange.hxx>
TopAbs_ShapeEnum aTi, aTj;
Handle(NCollection_IncAllocator) aAllocator;
BOPCol_ListIteratorOfListOfInteger aIt;
- BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
//
//-----------------------------------------------------scope_1 f
aAllocator=new NCollection_IncAllocator();
const BOPCol_ListOfInteger& aLA=aSI.SubShapes();
aIt.Initialize(aLA);
for (; aIt.More(); aIt.Next()) {
- iX=aIt.Value();
- aPKXB.Clear();
- aPKXB.SetIds(i, iX);
- aMPA.Add(aPKXB);
+ iX=aIt.Value();
+ aPKXB.Clear();
+ aPKXB.SetIds(i, iX);
+ aMPA.Add(aPKXB);
}
}
//