AsDes from BRepAlgo,
Offset from BRepOffset,
Face from TopoDS,
- MapOfShape from TopTools,
+ IndexedMapOfShape from TopTools,
DataMapOfShapeShape from TopTools,
Real from Standard
is
Compute(myclass ; AsDes : mutable AsDes from BRepAlgo;
F : Face from TopoDS;
- NewEdges : MapOfShape from TopTools;
+ NewEdges : IndexedMapOfShape from TopTools;
Tol : Real from Standard);
---Purpose: Computes the intersections between the edges stored
TopoDS_Vertex V = TopoDS::Vertex(itLV1.Value());
- U1 = BRep_Tool::Parameter(V,E1);
- U2 = BRep_Tool::Parameter(V,E2);
+ U1 = (BRep_Tool::Degenerated(E1))?
+ BRep_Tool::Parameter(TopoDS::Vertex(V.Oriented(TopAbs_INTERNAL)), E1) :
+ BRep_Tool::Parameter(V, E1);
+ U2 = (BRep_Tool::Degenerated(E2))?
+ BRep_Tool::Parameter(TopoDS::Vertex(V.Oriented(TopAbs_INTERNAL)), E2) :
+ BRep_Tool::Parameter(V, E2);
O1 = V.Orientation();
O2 = itLV2.Value().Orientation();
P = BRep_Tool::Pnt(V);
Standard_Real f[3],l[3];
Standard_Real MilTol2 = 1000*Tol*Tol;
- Standard_Real TolDub = 1.e-7;
+ Standard_Real TolDub = 1.e-7;
Standard_Integer i;
BRep_Tool::Range(E1, f[1], l[1]);
gp_Pnt P = ResPoints(i); //ponc1.Value();
TopoDS_Vertex aNewVertex = BRepLib_MakeVertex(P);
+ aNewVertex.Orientation(TopAbs_INTERNAL);
B.UpdateVertex( aNewVertex, aT1, E1, Tol );
B.UpdateVertex( aNewVertex, aT2, E2, Tol );
gp_Pnt P1 = CE1.Value(aT1);
Standard_Real f[3],l[3];
Standard_Real MilTol2 = 1000*Tol*Tol;
- Standard_Real TolDub = 1.e-7;
+ Standard_Real TolDub = 1.e-7;
Standard_Integer i;
//BRep_Tool::Range(E1, f[1], l[1]);
gp_Pnt P = ResPoints(i); //ponc1.Value();
TopoDS_Vertex aNewVertex = BRepLib_MakeVertex(P);
+ aNewVertex.Orientation(TopAbs_INTERNAL);
B.UpdateVertex( aNewVertex, aT1, E1, Tol );
B.UpdateVertex( aNewVertex, aT2, E2, Tol );
gp_Pnt P1 = CE1.Value(aT1);
if (!Precision::IsInfinite(f) && !Precision::IsInfinite(l))
BRepLib::SameParameter( NE, Precision::Confusion(), Standard_True );
}
- else //no 3d curve
+ else if (!BRep_Tool::Degenerated(E)) //no 3d curve
{
MinSurf = Handle(Geom_Surface)::DownCast
(MinSurf->Transformed(MinLoc.Transformation()));
//purpose :
//=======================================================================
-void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes,
- const TopoDS_Face& F,
- const TopTools_MapOfShape& NewEdges,
- const Standard_Real Tol)
+void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes,
+ const TopoDS_Face& F,
+ const TopTools_IndexedMapOfShape& NewEdges,
+ const Standard_Real Tol)
{
#ifdef DEB
NbF2d++;
Shape from TopoDS,
Face from TopoDS,
ListOfShape from TopTools,
- MapOfShape from TopTools,
+ --MapOfShape from TopTools,
+ IndexedMapOfShape from TopTools,
DataMapOfShapeShape from TopTools,
DataMapOfShapeListOfShape from TopTools,
Real from Standard,
is static;
ContextIntByInt( me : in out;
- ContextFaces : MapOfShape from TopTools;
+ ContextFaces : IndexedMapOfShape from TopTools;
ExtentContext : Boolean from Standard;
MapSF : DataMapOfShapeOffset from BRepOffset;
A : Analyse from BRepOffset;
is static;
ContextIntByArc(me : in out;
- ContextFaces : MapOfShape from TopTools;
- ExtentContext : Boolean from Standard;
- Analyse : Analyse from BRepOffset;
- InitOffsetFace : Image from BRepAlgo;
- InitOffsetEdge : in out Image from BRepAlgo)
+ ContextFaces : IndexedMapOfShape from TopTools;
+ ExtentContext : Boolean from Standard;
+ Analyse : Analyse from BRepOffset;
+ InitOffsetFace : Image from BRepAlgo;
+ InitOffsetEdge : in out Image from BRepAlgo)
is static;
AddCommonEdges(me : in out;
returns Boolean from Standard
is static;
- TouchedFaces(me : in out) returns MapOfShape from TopTools
+ TouchedFaces(me : in out) returns IndexedMapOfShape from TopTools
---C++: return &
is static;
AsDes(me) returns AsDes from BRepAlgo
is static;
- NewEdges(me : in out) returns MapOfShape from TopTools
+ NewEdges(me : in out) returns IndexedMapOfShape from TopTools
---C++: return &
is static;
fields
myAsDes : AsDes from BRepAlgo;
- myTouched : MapOfShape from TopTools;
+ myTouched : IndexedMapOfShape from TopTools;
myDone : DataMapOfShapeListOfShape from TopTools;
- myNewEdges : MapOfShape from TopTools;
+ myNewEdges : IndexedMapOfShape from TopTools;
mySide : State from TopAbs;
myTol : Real from Standard;
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <Extrema_ExtPC.hxx>
+#include <TopTools_MapOfShape.hxx>
//=======================================================================
void BRepOffset_Inter3d::ContextIntByInt
-(const TopTools_MapOfShape& ContextFaces,
- const Standard_Boolean ExtentContext,
+(const TopTools_IndexedMapOfShape& ContextFaces,
+ const Standard_Boolean ExtentContext,
const BRepOffset_DataMapOfShapeOffset& MapSF,
const BRepOffset_Analyse& Analyse,
TopTools_DataMapOfShapeShape& MES,
TopTools_ListOfShape& Failed)
{
TopTools_ListOfShape LInt1,LInt2;
- TopTools_MapIteratorOfMapOfShape itCF(ContextFaces);
TopTools_MapOfShape MV;
TopExp_Explorer exp;
TopoDS_Face OF,NF,WCF;
TopoDS_Compound C;
BRep_Builder B;
TopTools_ListIteratorOfListOfShape it;
- for (; itCF.More(); itCF.Next()) {
- const TopoDS_Face& CF = TopoDS::Face(itCF.Key());
+ Standard_Integer i;
+
+ for (i = 1; i <= ContextFaces.Extent(); i++) {
+ const TopoDS_Face& CF = TopoDS::Face(ContextFaces(i));
myTouched.Add(CF);
if (ExtentContext) {
BRepOffset_Tool::EnLargeFace(CF,NF,0,0);
}
TopAbs_State Side = TopAbs_OUT;
- for (itCF.Initialize(ContextFaces); itCF.More(); itCF.Next()) {
- const TopoDS_Face& CF = TopoDS::Face(itCF.Key());
+ for (i = 1; i <= ContextFaces.Extent(); i++) {
+ const TopoDS_Face& CF = TopoDS::Face(ContextFaces(i));
if (ExtentContext) WCF = TopoDS::Face(MES(CF));
else WCF = CF;
//purpose :
//=======================================================================
-void BRepOffset_Inter3d::ContextIntByArc(const TopTools_MapOfShape& ContextFaces,
- const Standard_Boolean InSide,
- const BRepOffset_Analyse& Analyse,
- const BRepAlgo_Image& InitOffsetFace,
- BRepAlgo_Image& InitOffsetEdge)
+void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& ContextFaces,
+ const Standard_Boolean InSide,
+ const BRepOffset_Analyse& Analyse,
+ const BRepAlgo_Image& InitOffsetFace,
+ BRepAlgo_Image& InitOffsetEdge)
{
TopTools_ListOfShape LInt1,LInt2;
- TopTools_MapIteratorOfMapOfShape it(ContextFaces);
TopTools_MapOfShape MV;
TopExp_Explorer exp;
TopoDS_Face OF1,OF2;
TopoDS_Edge OE;
BRep_Builder B;
TopoDS_Edge NullEdge;
+ Standard_Integer j;
- for (; it.More(); it.Next()) {
- const TopoDS_Face& CF = TopoDS::Face(it.Key());
+ for (j = 1; j <= ContextFaces.Extent(); j++) {
+ const TopoDS_Face& CF = TopoDS::Face(ContextFaces(j));
myTouched.Add(CF);
}
- for (it.Initialize(ContextFaces); it.More(); it.Next()) {
- const TopoDS_Face& CF = TopoDS::Face(it.Key());
+ for (j = 1; j <= ContextFaces.Extent(); j++) {
+ const TopoDS_Face& CF = TopoDS::Face(ContextFaces(j));
for (exp.Init(CF.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
//purpose :
//=======================================================================
-TopTools_MapOfShape& BRepOffset_Inter3d::TouchedFaces()
+TopTools_IndexedMapOfShape& BRepOffset_Inter3d::TouchedFaces()
{
return myTouched;
}
//purpose :
//=======================================================================
-TopTools_MapOfShape& BRepOffset_Inter3d::NewEdges()
+TopTools_IndexedMapOfShape& BRepOffset_Inter3d::NewEdges()
{
return myNewEdges;
}
Face from TopoDS,
Edge from TopoDS,
MapOfShape from TopTools,
+ IndexedMapOfShape from TopTools,
ListOfShape from TopTools,
MakeLoops from BRepOffset
ClosingFaces (me)
---Purpose: Returns the list of closing faces stores by AddFace
---C++: return const &
- returns MapOfShape from TopTools
+ returns IndexedMapOfShape from TopTools
is static;
---Category: private methods
is static private;
Intersection2D ( me : in out ;
- Modif : MapOfShape from TopTools;
- NewEdges : MapOfShape from TopTools)
+ Modif : IndexedMapOfShape from TopTools;
+ NewEdges : IndexedMapOfShape from TopTools)
is static private;
MakeLoops ( me : in out ;
- Modif : in out MapOfShape from TopTools)
+ Modif : in out IndexedMapOfShape from TopTools)
is static private;
MakeLoopsOnContext ( me : in out ;
is static private;
MakeFaces ( me : in out ;
- Modif : in out MapOfShape from TopTools)
+ Modif : in out IndexedMapOfShape from TopTools)
is static private;
MakeShells (me : in out )
myFaceOffset : DataMapOfShapeReal from TopTools;
- myFaces : MapOfShape from TopTools;
- myAnalyse : Analyse from BRepOffset;
+ myFaces : IndexedMapOfShape from TopTools;
+ myAnalyse : Analyse from BRepOffset;
myOffsetShape : Shape from TopoDS; -- Result
myInitOffsetFace : Image from BRepAlgo;
//purpose :
//=======================================================================
-static void DEBVerticesControl (const TopTools_MapOfShape& NewEdges,
- Handle(BRepAlgo_AsDes) AsDes)
+static void DEBVerticesControl (const TopTools_IndexedMapOfShape& NewEdges,
+ Handle(BRepAlgo_AsDes) AsDes)
{
Standard_Integer NVP = 0;
Standard_Integer NVM = 0;
Standard_Integer NVN = 0;
TopTools_ListOfShape LVP;
- TopTools_MapIteratorOfMapOfShape it;
+ //TopTools_MapIteratorOfMapOfShape it;
TopTools_ListIteratorOfListOfShape it1LE ;
TopTools_ListIteratorOfListOfShape it2LE ;
- for (it.Initialize(NewEdges) ; it.More(); it.Next()) {
- const TopoDS_Edge& NE = TopoDS::Edge(it.Key());
+ //for (it.Initialize(NewEdges) ; it.More(); it.Next()) {
+ Standard_Integer i;
+ for (i = 1; i <= NewEdges.Extent(); i++) {
+ const TopoDS_Edge& NE = TopoDS::Edge(NewEdges(i));
if (AsDes->HasDescendant(NE)) {
for (it1LE.Initialize(AsDes->Descendant(NE)); it1LE.More(); it1LE.Next()) {
if (AsDes->Ascendant(it1LE.Value()).Extent() < 3) {
TopTools_ListIteratorOfListOfShape it1(LVP);
Standard_Real TolConf = 1.e-5;
Standard_Real Tol = Precision::Confusion();
- Standard_Integer i = 1;
-
+ //Standard_Integer i = 1;
+
+ i = 1;
for ( ; it1.More(); it1.Next()) {
TopoDS_Shape V1 = it1.Value();
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
#endif
-static void UpdateTolerance ( TopoDS_Shape& myShape,
- const TopTools_MapOfShape& myFaces);
+static void UpdateTolerance ( TopoDS_Shape& myShape,
+ const TopTools_IndexedMapOfShape& myFaces);
static Standard_Boolean FindParameter(const TopoDS_Vertex& V,
//purpose :
//=======================================================================
-static void RemoveCorks (TopoDS_Shape& S,
- TopTools_MapOfShape& Faces)
+static void RemoveCorks (TopoDS_Shape& S,
+ TopTools_IndexedMapOfShape& Faces)
{
TopoDS_Compound SS;
BRep_Builder B;
B.Add(SS,Cork);
}
else {
- Faces.Remove (Cork);
- Faces.Add (Cork); // to reset it with proper orientation.
+ //Faces.Remove (Cork);
+ //begin instead of Remove//
+ TopoDS_Shape LastShape = Faces(Faces.Extent());
+ Faces.RemoveLast();
+ if (Faces.FindIndex(Cork) != 0)
+ Faces.Substitute(Faces.FindIndex(Cork), LastShape);
+ //end instead of Remove //
+ Faces.Add(Cork); // to reset it with proper orientation.
}
}
S = SS;
//purpose :
//=======================================================================
-static void MakeList (TopTools_ListOfShape& OffsetFaces,
- const BRepAlgo_Image& myInitOffsetFace,
- const TopTools_MapOfShape& myFaces)
+static void MakeList (TopTools_ListOfShape& OffsetFaces,
+ const BRepAlgo_Image& myInitOffsetFace,
+ const TopTools_IndexedMapOfShape& myFaces)
{
TopTools_ListIteratorOfListOfShape itLOF(myInitOffsetFace.Roots());
for ( ; itLOF.More(); itLOF.Next()) {
//-----------------
// Intersection2D
//-----------------
- TopTools_MapOfShape& Modif = Inter.TouchedFaces();
- TopTools_MapOfShape& NewEdges = Inter.NewEdges();
+ TopTools_IndexedMapOfShape& Modif = Inter.TouchedFaces();
+ TopTools_IndexedMapOfShape& NewEdges = Inter.NewEdges();
if (!Modif.IsEmpty()) Intersection2D (Modif,NewEdges);
//-------------------------------------------------------
//-----------------------------------------------------------
// Great restriction of new edges and update of AsDes.
//------------------------------------------ ----------------
- TopTools_MapOfShape NewEdges;
+ TopTools_IndexedMapOfShape NewEdges;
TopExp_Explorer Exp2,ExpC;
TopoDS_Shape NE;
TopoDS_Edge TNE;
//----------------------------------------------
// Intersections 2d on caps.
//----------------------------------------------
- TopTools_MapIteratorOfMapOfShape itCork(myFaces);
- for (; itCork.More(); itCork.Next()) {
- const TopoDS_Face& Cork = TopoDS::Face(itCork.Key());
+ Standard_Integer i;
+ for (i = 1; i <= myFaces.Extent(); i++) {
+ const TopoDS_Face& Cork = TopoDS::Face(myFaces(i));
BRepOffset_Inter2d::Compute(AsDes,Cork,NewEdges,myTol);
}
myMakeLoops.Build(LFE ,AsDes,IMOE);
#ifdef DEB
- TopTools_MapOfShape COES;
+ TopTools_IndexedMapOfShape COES;
#endif
//---------------------------
// MAJ SD. for faces //
//---------------------------
// MAJ SD. for caps
//---------------------------
- TopTools_MapOfShape View;
- for (itCork.Initialize(myFaces); itCork.More(); itCork.Next()) {
- const TopoDS_Shape& Cork = itCork.Key();
+ //TopTools_MapOfShape View;
+ for (i = 1; i <= myFaces.Extent(); i++) {
+ const TopoDS_Shape& Cork = myFaces(i);
const TopTools_ListOfShape& LE = AsDes->Descendant(Cork);
for (itLF.Initialize(LE) ; itLF.More(); itLF.Next()) {
const TopoDS_Edge& OE = TopoDS::Edge(itLF.Value());
{
TopTools_DataMapOfShapeShape Created;
TopTools_DataMapOfShapeShape MEF;
- TopTools_MapOfShape FacesToBuild;
- TopTools_MapIteratorOfMapOfShape it(myFaces);
+ TopTools_IndexedMapOfShape FacesToBuild;
TopTools_ListIteratorOfListOfShape itl;
TopExp_Explorer exp;
// if (myOffset < 0.) Side = TopAbs_OUT;
TopAbs_State Side = TopAbs_OUT;
-
- for (; it.More(); it.Next()) {
- const TopoDS_Face& CF = TopoDS::Face(it.Key());
+
+ /*
+ Standard_Integer i;
+ for (i = 1; i <= myFaces.Extent(); i++) {
+ const TopoDS_Face& CF = TopoDS::Face(myFaces(i));
for (exp.Init(CF.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
}
}
}
- //-------------------------------------------------------
+ */
+
+ //--------------------------------------------------------
// Determine the edges and faces reconstructed by
// intersection.
//---------------------------------------------------------
- for ( it.Initialize(myFaces); it.More(); it.Next()) {
- const TopoDS_Face& CF = TopoDS::Face(it.Key());
+ Standard_Integer j;
+ for (j = 1; j <= myFaces.Extent(); j++) {
+ const TopoDS_Face& CF = TopoDS::Face(myFaces(j));
for (exp.Init(CF.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
TopoDS_Shape OE,NE;
TopAbs_Orientation Or;
- for (it.Initialize(FacesToBuild); it.More(); it.Next()) {
- const TopoDS_Shape& S = it.Key();
+ for (j = 1; j <= FacesToBuild.Extent(); j++) {
+ const TopoDS_Shape& S = FacesToBuild(j);
BRepOffset_Offset BOF;
BOF = MapSF(S);
F = TopoDS::Face(BOF.Face());
//Complete.
//-------------
Inter.CompletInt (OffsetFaces,myInitOffsetFace);
- TopTools_MapOfShape& NewEdges = Inter.NewEdges();
+ TopTools_IndexedMapOfShape& NewEdges = Inter.NewEdges();
if (myJoin == GeomAbs_Intersection) {
BRepOffset_Tool::CorrectOrientation (myShape,NewEdges,myAsDes,myInitOffsetFace,myOffset);
}
//purpose :
//=======================================================================
-void BRepOffset_MakeOffset::Intersection2D(const TopTools_MapOfShape& Modif,
- const TopTools_MapOfShape& NewEdges)
+void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Modif,
+ const TopTools_IndexedMapOfShape& NewEdges)
{
#ifdef DEB
if (ChronBuild) {
//--------------------------------------------------------
// calculate intersections2d on faces concerned by
// intersection3d
- //--------------------------------------------------------
- TopTools_MapIteratorOfMapOfShape it(Modif);
+ //---------------------------------------------------------
+ //TopTools_MapIteratorOfMapOfShape it(Modif);
//-----------------------------------------------
// Intersection of edges 2 by 2.
//-----------------------------------------------
- for ( it.Initialize(Modif); it.More(); it.Next()) {
- const TopoDS_Face& F = TopoDS::Face(it.Key());
+ Standard_Integer i;
+ for (i = 1; i <= Modif.Extent(); i++) {
+ const TopoDS_Face& F = TopoDS::Face(Modif(i));
BRepOffset_Inter2d::Compute(myAsDes,F,NewEdges,myTol);
}
//purpose :
//=======================================================================
-void BRepOffset_MakeOffset::MakeLoops(TopTools_MapOfShape& Modif)
+void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
{
#ifdef DEB
if (ChronBuild) {
Clock.Start();
}
#endif
- TopTools_MapIteratorOfMapOfShape it(Modif);
+ //TopTools_MapIteratorOfMapOfShape it(Modif);
TopTools_ListOfShape LF,LC;
//-----------------------------------------
// unwinding of faces // modified.
//-----------------------------------------
- for (; it.More(); it.Next()) {
- if (!myFaces.Contains(it.Key())) LF.Append(it.Key());
+ Standard_Integer i;
+ for (i = 1; i <= Modif.Extent(); i++) {
+ if (!myFaces.Contains(Modif(i)))
+ LF.Append(Modif(i));
}
myMakeLoops.Build(LF,myAsDes,myImageOffset);
//-----------------------------------------
// unwinding of caps.
//-----------------------------------------
- for (it.Initialize(myFaces); it.More(); it.Next()) {
- LC.Append(it.Key());
- }
+ for (i = 1; i <= myFaces.Extent(); i++)
+ LC.Append(myFaces(i));
+
Standard_Boolean InSide = 1;
if (myOffset > 0 ) InSide = 0;
myMakeLoops.BuildOnContext(LC,myAnalyse,myAsDes,myImageOffset,InSide);
// share edges that were reconstructed.
//=======================================================================
-void BRepOffset_MakeOffset::MakeFaces(TopTools_MapOfShape& Modif)
+void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& Modif)
{
#ifdef DEb
if (ChronBuild) {
//purpose :
//=======================================================================
-const TopTools_MapOfShape& BRepOffset_MakeOffset::ClosingFaces () const
+const TopTools_IndexedMapOfShape& BRepOffset_MakeOffset::ClosingFaces () const
{
return myFaces;
}
//=======================================================================
static void UpdateTolerance (TopoDS_Shape& S,
- const TopTools_MapOfShape& Faces)
+ const TopTools_IndexedMapOfShape& Faces)
{
BRep_Builder B;
TopTools_MapOfShape View;
TopoDS_Vertex V[2];
// The edges of caps are not modified.
- TopTools_MapIteratorOfMapOfShape it;
- for (it.Initialize(Faces); it.More(); it.Next()) {
- const TopoDS_Shape& F = it.Key();
+ Standard_Integer j;
+ for (j = 1; j <= Faces.Extent(); j++) {
+ const TopoDS_Shape& F = Faces(j);
TopExp_Explorer Exp;
for (Exp.Init(F,TopAbs_EDGE); Exp.More(); Exp.Next()) {
View.Add(Exp.Current());
Shape from TopoDS,
Orientation from TopAbs,
MapOfShape from TopTools,
+ IndexedMapOfShape from TopTools,
DataMapOfShapeShape from TopTools,
DataMapOfShapeListOfShape from TopTools,
ListOfShape from TopTools,
CorrectOrientation (myclass ;
SI : in Shape from TopoDS;
- NewEdges : in MapOfShape from TopTools;
+ NewEdges : in IndexedMapOfShape from TopTools;
AsDes : in out AsDes from BRepAlgo;
InitOffset : in out Image from BRepAlgo;
Offset : in Real from Standard);
//=======================================================================
void BRepOffset_Tool::CorrectOrientation(const TopoDS_Shape& SI,
- const TopTools_MapOfShape& NewEdges,
+ const TopTools_IndexedMapOfShape& NewEdges,
Handle(BRepAlgo_AsDes)& AsDes,
BRepAlgo_Image& InitOffset,
const Standard_Real Offset)
myCreated : DataMapOfShapeDataMapOfShapeListOfShape from BRepFill;
myCutEdges : DataMapOfShapeListOfShape from TopTools;
- myFaces : MapOfShape from TopTools;
- myEdges : MapOfShape from TopTools;
+ myFaces : IndexedMapOfShape from TopTools;
+ myEdges : IndexedMapOfShape from TopTools;
myStopFaces : MapOfShape from TopTools;
myAnalyse : Analyse from BRepOffset;
//=======================================================================
static void Add(const TopoDS_Edge& E,
- TopTools_MapOfShape& Map,
+ TopTools_IndexedMapOfShape& Map,
const TopoDS_Shape& S,
const BRepOffset_Offset& OF,
const BRepOffset_Analyse& Analyse,
for ( ; expf.More(); expf.Next()) {
const TopoDS_Shape& F = expf.Current();
if ( myFaces.Contains(F) && Sew->IsModified(F)) {
- myFaces.Remove(F);
+ //myFaces.Remove(F);
+ TopoDS_Shape LastFace = myFaces(myFaces.Extent());
+ myFaces.RemoveLast();
+ if (myFaces.FindIndex(F) != 0)
+ myFaces.Substitute(myFaces.FindIndex(F), LastFace);
+ ////////////////////
myFaces.Add(Sew->Modified(F));
}
}
for ( ; exp.More(); exp.Next()) {
const TopoDS_Shape& F = exp.Current();
if ( myFaces.Contains(F)) {
- myFaces.Remove(F);
+ //myFaces.Remove(F);
+ TopoDS_Shape LastFace = myFaces(myFaces.Extent());
+ myFaces.RemoveLast();
+ if (myFaces.FindIndex(F) != 0)
+ myFaces.Substitute(myFaces.FindIndex(F), LastFace);
+ ////////////////////
myFaces.Add(F);
}
else if ( myStopFaces.Contains(F)) {
BiTgte_DataMapOfShapeBox MapSBox;
TopTools_MapOfShape Done;
- TopTools_MapIteratorOfMapOfShape it;
+ //TopTools_MapIteratorOfMapOfShape it;
BRep_Builder B;
TopoDS_Compound Co; // to only know on which edges the tubes are made
// Calculate Sections Face/Face + Propagation
// ----------------------------------------
Standard_Boolean JenRajoute = Standard_True;
-
+ Standard_Integer i;
+
while ( JenRajoute) {
JenRajoute = Standard_False;
// locate in myFaces the Faces connected to myEdges.
// -------------------------------------------------
Fini = Standard_True;
- for (it.Initialize(myEdges); it.More(); it.Next()) {
- const TopoDS_Edge& E = TopoDS::Edge(it.Key());
+ //for (it.Initialize(myEdges); it.More(); it.Next()) {
+ for (i = 1; i <= myEdges.Extent(); i++) {
+ const TopoDS_Edge& E = TopoDS::Edge(myEdges(i));
if (BRep_Tool::Degenerated(E)) continue;
const TopTools_ListOfShape& L = myAncestors.FindFromKey(E);
// --------------------------------------------
// Construction of Offsets of all faces.
// --------------------------------------------
- for (it.Initialize(myFaces); it.More(); it.Next()) {
- const TopoDS_Shape& AS = it.Key();
+ //for (it.Initialize(myFaces); it.More(); it.Next()) {
+ for (i = 1; i <= myFaces.Extent(); i++) {
+ const TopoDS_Shape& AS = myFaces(i);
if ( myMapSF.IsBound(AS)) continue;
BRepOffset_Offset OF1;
TopoDS_Face BigF;
if (AS.ShapeType() == TopAbs_FACE) {
- const TopoDS_Face& F = TopoDS::Face(it.Key());
+ const TopoDS_Face& F = TopoDS::Face(myFaces(i));
if ( TouchedByCork.Contains(F)) {
BRepOffset_Tool::EnLargeFace(F,BigF,Standard_True);
OF1.Init(BigF,myRadius,EdgeTgt);
BRepOffset_Type OT = BRepOffset_Concave;
if (myRadius < 0.) OT = BRepOffset_Convex;
- it.Initialize(myFaces);
TopTools_ListOfShape LOF;
- for ( ; it.More(); it.Next()) {
- const TopoDS_Shape& CurS = it.Key();
+ //it.Initialize(myFaces);
+ for (i = 1; i <= myFaces.Extent(); i++) {
+ const TopoDS_Shape& CurS = myFaces(i);
// tube on free border, it is undesirable.
if ( myStopFaces.Contains(CurS)) continue;
BRepOffset_Type OT = BRepOffset_Concave;
if (myRadius < 0.) OT = BRepOffset_Convex;
- TopTools_MapIteratorOfMapOfShape ic(myEdges);
- for ( ; ic.More(); ic.Next()) {
- const TopoDS_Edge& CurE = TopoDS::Edge(ic.Key());
+ //TopTools_MapIteratorOfMapOfShape ic(myEdges);
+ Standard_Integer i;
+ for (i = 1; i <= myEdges.Extent(); i++) {
+ const TopoDS_Edge& CurE = TopoDS::Edge(myEdges(i));
const TopTools_ListOfShape& L = myAsDes->Ascendant(CurE);
if ( L.Extent() != 2) continue;