#include <GeomAPI.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Circle.hxx>
+#include <Geom_Line.hxx>
#include <Geom_OffsetCurve.hxx>
#include <MAT_Arc.hxx>
#include <MAT_Node.hxx>
static void TrimEdge (const TopoDS_Edge& CurrentEdge,
const TopTools_ListOfShape& D,
- TopTools_SequenceOfShape& Sv,
- TColStd_SequenceOfReal& MapverPar,
- TopTools_SequenceOfShape& S,
- TopTools_IndexedDataMapOfShapeShape& MapVV);
+ TopTools_SequenceOfShape& Sv,
+ TColStd_SequenceOfReal& MapverPar,
+ TopTools_SequenceOfShape& S,
+ TopTools_IndexedDataMapOfShapeShape& MapVV,
+ const Standard_Integer IndOfE);
static Standard_Boolean DoubleOrNotInside (const TopTools_ListOfShape& EC,
const TopoDS_Vertex& V);
const TopoDS_Face& F,
const Standard_Real Offset,
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
- const Handle(Geom_Plane)& RefPlane);
+ const Handle(Geom_Plane)& RefPlane,
+ const Standard_Boolean IsOpenResult,
+ const TopoDS_Vertex * Ends);
E = TopoDS::Edge(exp.Current());
if (NbEdges > 1) return Standard_False;
}
- TopoDS_Vertex V1,V2;
- TopExp::Vertices(E,V1,V2);
- if (!V1.IsSame(V2)) return Standard_False;
Standard_Real f,l;
TopLoc_Location L;
C = Ct->BasisCurve();
}
+ TopoDS_Vertex V1,V2;
+ TopExp::Vertices(E,V1,V2);
+ if (!V1.IsSame(V2)) //may be case of line
+ {
+ if (!C->IsKind(STANDARD_TYPE(Geom_Line))) return Standard_False;
+ Handle(Geom_Line) LE = Handle(Geom_Line)::DownCast(C);
+ Standard_Real anOffset = myOffset;
+ if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1;
+
+ Handle(Geom2d_Curve) aPCurve;
+ Handle(Geom_Surface) aSurf;
+ TopLoc_Location aLoc;
+ BRep_Tool::CurveOnSurface(E, aPCurve, aSurf, aLoc, f, l);
+ Handle(Geom2dAdaptor_HCurve) AHC = new Geom2dAdaptor_HCurve(aPCurve, f, l);
+ Adaptor3d_OffsetCurve Off(AHC,anOffset);
+ Handle(Geom2d_Line) OLC = new Geom2d_Line(Off.Line());
+ Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurf);
+ myShape = BRepLib_MakeEdge(OLC, aPlane, f, l);
+ BRepLib::BuildCurve3d(TopoDS::Edge(myShape));
+
+ myShape.Orientation(E.Orientation());
+ myShape.Location(L);
+ if (Alt != 0.) {
+ BRepAdaptor_Surface S(mySpine,0);
+ gp_Ax1 Nor = S.Plane().Axis();
+ gp_Trsf T;
+ gp_Vec Trans(Nor.Direction());
+ Trans = Alt*Trans;
+ T.SetTranslation(Trans);
+ myShape.Move(TopLoc_Location(T));
+ }
+
+ TopTools_ListOfShape LL;
+ LL.Append(myShape);
+ myMap.Add(E,LL);
+
+ TopoDS_Edge myEdge = TopoDS::Edge(myShape);
+ myShape = BRepLib_MakeWire(myEdge);
+
+ myIsDone = Standard_True;
+ return Standard_True;
+ }
+
if (!C->IsKind(STANDARD_TYPE(Geom_Circle))) return Standard_False;
Handle(Geom_Circle) CE = Handle(Geom_Circle)::DownCast(C);
Standard_Real anOffset = myOffset;
//=======================================================================
BRepFill_OffsetWire::BRepFill_OffsetWire()
-:myIsDone(Standard_False)
+ : myIsOpenResult(Standard_False),
+ myIsDone(Standard_False)
{
}
//=======================================================================
BRepFill_OffsetWire::BRepFill_OffsetWire(const TopoDS_Face& Spine,
- const GeomAbs_JoinType Join )
+ const GeomAbs_JoinType Join,
+ const Standard_Boolean IsOpenResult)
{
- Init(Spine,Join);
+ Init(Spine,Join,IsOpenResult);
}
//=======================================================================
//=======================================================================
void BRepFill_OffsetWire::Init(const TopoDS_Face& Spine,
- const GeomAbs_JoinType Join )
+ const GeomAbs_JoinType Join,
+ const Standard_Boolean IsOpenResult)
{
Standard_NotImplemented_Raise_if(Join > GeomAbs_Arc,
"Only GeomAbs_Arc is implemented");
mySpine = TopoDS::Face(aLocalShape);
// mySpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD));
myJoinType = Join;
+ myIsOpenResult = IsOpenResult;
CheckFace(mySpine);
// static BRepMAT2d_Explorer Exp;
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 End
Exp.Perform(myWorkSpine);
- myBilo.Compute(Exp,1,MAT_Left);
+ myBilo.Compute(Exp,1,MAT_Left,myIsOpenResult);
myLink.Perform(Exp,myBilo);
}
newExp.Perform(myWorkSpine);
BRepMAT2d_BisectingLocus newBilo;
BRepMAT2d_LinkTopoBilo newLink;
- newBilo.Compute(newExp,1,MAT_Left);
+ newBilo.Compute(newExp,1,MAT_Left,myIsOpenResult);
if(!newBilo.IsDone())
{
// Modified by skv - Fri Jul 8 11:21:38 2005 OCC9145 End
// Modified by Sergey KHROMOV - Thu Mar 14 10:48:15 2002 Begin
- TopExp_Explorer anExp(myShape, TopAbs_WIRE);
-
- for (; anExp.More(); anExp.Next()) {
- const TopoDS_Shape &aWire = anExp.Current();
-
- if (!aWire.Closed()) {
- myShape.Nullify();
- myIsDone = Standard_False;
- Standard_ConstructionError::Raise("Offset wire is not closed.");
+ if (!myIsOpenResult)
+ {
+ TopExp_Explorer anExp(myShape, TopAbs_WIRE);
+
+ for (; anExp.More(); anExp.Next()) {
+ const TopoDS_Shape &aWire = anExp.Current();
+
+ if (!aWire.Closed()) {
+ myShape.Nullify();
+ myIsDone = Standard_False;
+ Standard_ConstructionError::Raise("Offset wire is not closed.");
+ }
}
}
// Modified by Sergey KHROMOV - Thu Mar 14 10:48:16 2002 End
//---------------------------------------------------------------
// Construction of Circles and OffsetCurves
//---------------------------------------------------------------
-
+
+ TopoDS_Vertex Ends [2];
+ if (myIsOpenResult)
+ {
+ TopoDS_Wire theWire;
+ TopoDS_Iterator iter(mySpine);
+ theWire = TopoDS::Wire(iter.Value());
+ TopExp::Vertices(theWire, Ends[0], Ends[1]);
+ }
+
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
TopoDS_Shape PEE = Link.GeneratingShape(Locus.BasicElt(ic,Locus.NumberOfElts(ic)));
TopoDS_Shape& PE = PEE ;
myWorkSpine,myOffset,myMap,RefPlane);
}
else {
- MakeOffset (TopoDS::Edge(SE),myWorkSpine,myOffset,myMap,RefPlane);
+ MakeOffset (TopoDS::Edge(SE),myWorkSpine,myOffset,myMap,RefPlane,
+ myIsOpenResult, Ends);
PE = SE;
}
}
if (MapBis.IsBound(CurrentEdge)) {
TopTools_SequenceOfShape S;
if (!MapBis(CurrentEdge).IsEmpty()) {
+ Standard_Integer IndOfE = 0;
+ if (myIsOpenResult)
+ {
+ if (j == 1)
+ IndOfE = 1;
+ else if (j == myMap.Extent())
+ IndOfE = -1;
+ }
TrimEdge (CurrentEdge,
Detromp (CurrentSpine),
MapBis (CurrentEdge) ,
MapVerPar(CurrentEdge) ,
- S, MapVV);
+ S, MapVV, IndOfE);
for ( k = 1; k <= S.Length(); k++) {
myMap(j).Append(S.Value(k));
}
TopExp::MapShapes(IteF.Value(), TopAbs_EDGE, EdgeMap);
Standard_Integer nbEdges = EdgeMap.Extent();
- if (nbEdges == 1)
+ if (nbEdges == 1 && !myIsOpenResult) //in case of open wire there's no need to do it
ForcedCut = 2;
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:48 2000 End
const TopoDS_Face& F,
const Standard_Real Offset,
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
- const Handle(Geom_Plane)& RefPlane)
+ const Handle(Geom_Plane)& RefPlane,
+ const Standard_Boolean IsOpenResult,
+ const TopoDS_Vertex * Ends)
{
Standard_Real f,l;
Standard_Real anOffset = Offset;
Handle(Geom2d_Curve) G2d = BRep_Tool::CurveOnSurface(E,F,f,l);
Handle(Geom2d_Curve) G2dOC;
+ Standard_Boolean ToExtendFirstPar = Standard_True;
+ Standard_Boolean ToExtendLastPar = Standard_True;
+ if (IsOpenResult)
+ {
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(E, V1, V2);
+ if (V1.IsSame(Ends[0]) ||
+ V1.IsSame(Ends[1]))
+ ToExtendFirstPar = Standard_False;
+ if (V2.IsSame(Ends[0]) ||
+ V2.IsSame(Ends[1]))
+ ToExtendLastPar = Standard_False;
+ }
+
Geom2dAdaptor_Curve AC(G2d,f,l);
if ( AC.GetType() == GeomAbs_Circle) {
// if the offset is greater otr equal to the radius and the side of the
Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle());
Standard_Real Delta = 2*M_PI - l + f;
- f -= 0.2*Delta; l += 0.2*Delta;
+ if (ToExtendFirstPar)
+ f -= 0.2*Delta;
+ if (ToExtendLastPar)
+ l += 0.2*Delta;
G2dOC = new Geom2d_TrimmedCurve(CC,f,l);
}
Adaptor3d_OffsetCurve Off(AHC,anOffset);
Handle(Geom2d_Line) CC = new Geom2d_Line(Off.Line());
Standard_Real Delta = (l - f);
- f -= Delta; l += Delta;
+ if (ToExtendFirstPar)
+ f -= Delta;
+ if (ToExtendLastPar)
+ l += Delta;
G2dOC = new Geom2d_TrimmedCurve(CC,f,l);
}
else {
void TrimEdge (const TopoDS_Edge& E,
const TopTools_ListOfShape& Detromp,
- TopTools_SequenceOfShape& TheVer,
- TColStd_SequenceOfReal& ThePar,
- TopTools_SequenceOfShape& S,
- TopTools_IndexedDataMapOfShapeShape& MapVV)
+ TopTools_SequenceOfShape& TheVer,
+ TColStd_SequenceOfReal& ThePar,
+ TopTools_SequenceOfShape& S,
+ TopTools_IndexedDataMapOfShapeShape& MapVV,
+ const Standard_Integer IndOfE)
{
Standard_Boolean Change = Standard_True;
BRep_Builder TheBuilder;
// the number of vertices should be even. The created edges
// go from a vertex with uneven index i to vertex i+1;
//-----------------------------------------------------------
- for (Standard_Integer k = 1; k < TheVer.Length(); k = k+2) {
+ if (IndOfE == 1 || IndOfE == -1) //open result and extreme edges of result
+ {
TopoDS_Shape aLocalShape = E.EmptyCopied();
TopoDS_Edge NewEdge = TopoDS::Edge(aLocalShape);
-// TopoDS_Edge NewEdge = TopoDS::Edge(E.EmptyCopied());
-
- if (NewEdge.Orientation() == TopAbs_REVERSED) {
- TheBuilder.Add (NewEdge,TheVer.Value(k) .Oriented(TopAbs_REVERSED));
- TheBuilder.Add (NewEdge,TheVer.Value(k+1).Oriented(TopAbs_FORWARD));
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(E, V1, V2);
+ Standard_Real fpar, lpar;
+ BRep_Tool::Range(E, fpar, lpar);
+ if (IndOfE == 1) //first edge of open wire
+ {
+ if (NewEdge.Orientation() == TopAbs_FORWARD)
+ {
+ TheBuilder.Add(NewEdge, V1.Oriented(TopAbs_FORWARD));
+ TheBuilder.Add(NewEdge, TheVer.First().Oriented(TopAbs_REVERSED));
+ TheBuilder.Range(NewEdge, fpar, ThePar.First());
+ }
+ else
+ {
+ //TheBuilder.Add(NewEdge, V1.Oriented(TopAbs_REVERSED));
+ //TheBuilder.Add(NewEdge, TheVer.First().Oriented(TopAbs_FORWARD));
+ TheBuilder.Add(NewEdge, TheVer.First().Oriented(TopAbs_REVERSED));
+ TheBuilder.Add(NewEdge, V2.Oriented(TopAbs_FORWARD));
+ TheBuilder.Range(NewEdge, ThePar.First(), lpar);
+ }
}
- else {
- TheBuilder.Add (NewEdge,TheVer.Value(k) .Oriented(TopAbs_FORWARD));
- TheBuilder.Add (NewEdge,TheVer.Value(k+1).Oriented(TopAbs_REVERSED));
+ else //last edge of open wire
+ {
+ if (NewEdge.Orientation() == TopAbs_FORWARD)
+ {
+ TheBuilder.Add(NewEdge, TheVer.First().Oriented(TopAbs_FORWARD));
+ TheBuilder.Add(NewEdge, V2.Oriented(TopAbs_REVERSED));
+ TheBuilder.Range(NewEdge, ThePar.First(), lpar);
+ }
+ else
+ {
+ //TheBuilder.Add(NewEdge, TheVer.First().Oriented(TopAbs_REVERSED));
+ //TheBuilder.Add(NewEdge, V2.Oriented(TopAbs_FORWARD));
+ TheBuilder.Add(NewEdge, V1.Oriented(TopAbs_REVERSED));
+ TheBuilder.Add(NewEdge, TheVer.First().Oriented(TopAbs_FORWARD));
+ TheBuilder.Range(NewEdge, fpar, ThePar.First());
+ }
}
-
-
- TheBuilder.Range(NewEdge,ThePar.Value(k),ThePar.Value(k+1));
-
+ S.Append(NewEdge);
+ }
+ else
+ {
+ for (Standard_Integer k = 1; k < TheVer.Length(); k = k+2) {
+ TopoDS_Shape aLocalShape = E.EmptyCopied();
+ TopoDS_Edge NewEdge = TopoDS::Edge(aLocalShape);
+ // TopoDS_Edge NewEdge = TopoDS::Edge(E.EmptyCopied());
+
+ if (NewEdge.Orientation() == TopAbs_REVERSED) {
+ TheBuilder.Add (NewEdge,TheVer.Value(k) .Oriented(TopAbs_REVERSED));
+ TheBuilder.Add (NewEdge,TheVer.Value(k+1).Oriented(TopAbs_FORWARD));
+ }
+ else {
+ TheBuilder.Add (NewEdge,TheVer.Value(k) .Oriented(TopAbs_FORWARD));
+ TheBuilder.Add (NewEdge,TheVer.Value(k+1).Oriented(TopAbs_REVERSED));
+ }
+
+
+ TheBuilder.Range(NewEdge,ThePar.Value(k),ThePar.Value(k+1));
+
#ifdef DRAW
- if ( AffichEdge) {
- char name[256];
- sprintf(name,"TRIMEDGE_%d",NbTRIMEDGES);
- DBRep::Set(name,NewEdge);
- }
- if (Affich2d) {
- TopLoc_Location L;
- Standard_Real f,l;
- Handle(Geom_Surface) Surf;
- Handle(Geom2d_Curve) C;
- BRep_Tool::CurveOnSurface(NewEdge,C,Surf,L,f,l);
- char name[256];
- sprintf(name,"OFFSET2d_%d",NbTRIMEDGES++);
- Handle(Geom2d_TrimmedCurve) C2d = new Geom2d_TrimmedCurve(C,f,l);
- Handle(DrawTrSurf_Curve2d) dr =
- new DrawTrSurf_Curve2d(C2d,Standard_False);
- dr->SetColor(Draw_bleu);
- Draw::Set(name,dr);
- }
+ if ( AffichEdge) {
+ char name[256];
+ sprintf(name,"TRIMEDGE_%d",NbTRIMEDGES);
+ DBRep::Set(name,NewEdge);
+ }
+ if (Affich2d) {
+ TopLoc_Location L;
+ Standard_Real f,l;
+ Handle(Geom_Surface) Surf;
+ Handle(Geom2d_Curve) C;
+ BRep_Tool::CurveOnSurface(NewEdge,C,Surf,L,f,l);
+ char name[256];
+ sprintf(name,"OFFSET2d_%d",NbTRIMEDGES++);
+ Handle(Geom2d_TrimmedCurve) C2d = new Geom2d_TrimmedCurve(C,f,l);
+ Handle(DrawTrSurf_Curve2d) dr =
+ new DrawTrSurf_Curve2d(C2d,Standard_False);
+ dr->SetColor(Draw_bleu);
+ Draw::Set(name,dr);
+ }
#endif
-
- S.Append(NewEdge);
+
+ S.Append(NewEdge);
+ }
}
}
//=======================================================================
BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset(const TopoDS_Face& Spine,
- const GeomAbs_JoinType Join)
+ const GeomAbs_JoinType Join,
+ const Standard_Boolean IsOpenResult)
{
- Init(Spine, Join);
+ Init(Spine, Join, IsOpenResult);
}
//=======================================================================
void BRepOffsetAPI_MakeOffset::Init(const TopoDS_Face& Spine,
- const GeomAbs_JoinType Join)
+ const GeomAbs_JoinType Join,
+ const Standard_Boolean IsOpenResult)
{
myFace = Spine;
myIsInitialized = Standard_True;
myJoin = Join;
+ myIsOpenResult = IsOpenResult;
TopExp_Explorer exp;
for (exp.Init(myFace,TopAbs_WIRE); exp.More();exp.Next()) {
myWires.Append(exp.Current());
//=======================================================================
BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset(const TopoDS_Wire& Spine,
- const GeomAbs_JoinType Join)
+ const GeomAbs_JoinType Join,
+ const Standard_Boolean IsOpenResult)
{
myWires.Append(Spine);
myIsInitialized = Standard_True;
myJoin = Join;
+ myIsOpenResult = IsOpenResult;
}
//=======================================================================
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakeOffset::Init(const GeomAbs_JoinType Join)
+void BRepOffsetAPI_MakeOffset::Init(const GeomAbs_JoinType Join,
+ const Standard_Boolean IsOpenResult)
{
myJoin = Join;
+ myIsOpenResult = IsOpenResult;
}
//=======================================================================
//=======================================================================
static void BuildDomains(TopoDS_Face& myFace,
- TopTools_ListOfShape& WorkWires,
- BRepFill_ListOfOffsetWire& myAlgos,
- GeomAbs_JoinType myJoin,
- Standard_Boolean isPositive)
+ TopTools_ListOfShape& WorkWires,
+ BRepFill_ListOfOffsetWire& myAlgos,
+ GeomAbs_JoinType myJoin,
+ Standard_Boolean myIsOpenResult,
+ Standard_Boolean isPositive)
{
BRepAlgo_FaceRestrictor FR;
TopoDS_Vertex VF,VL;
for ( ; itW.More(); itW.Next()) {
B.Add(F,itW.Value());
}
- BRepFill_OffsetWire Algo(F, myJoin);
+ BRepFill_OffsetWire Algo(F, myJoin, myIsOpenResult);
myAlgos.Append(Algo);
return;
}
// Creation of algorithms on each domain.
//========================================
for (itF.Initialize(Faces); itF.More(); itF.Next()) {
- BRepFill_OffsetWire Algo(TopoDS::Face(itF.Value()), myJoin);
+ BRepFill_OffsetWire Algo(TopoDS::Face(itF.Value()), myJoin, myIsOpenResult);
myAlgos.Append(Algo);
}
}
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakeOffset::Perform( const Standard_Real Offset,
- const Standard_Real Alt)
+void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
+ const Standard_Real Alt)
{
StdFail_NotDone_Raise_if ( !myIsInitialized,
"BRepOffsetAPI_MakeOffset : Perform without Init");
if( myLeft.IsEmpty() )
{
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:26 2001 Begin
- BuildDomains(myFace,myWires,myLeft,myJoin, Standard_False);
+ BuildDomains(myFace,myWires,myLeft,myJoin,myIsOpenResult, Standard_False);
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:26 2001 End
}
if (myRight.IsEmpty())
{
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:28 2001 Begin
- BuildDomains(myFace,myWires,myRight,myJoin, Standard_True);
+ BuildDomains(myFace,myWires,myRight,myJoin,myIsOpenResult, Standard_True);
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:35 2001 End
}
//function : Constructor
//purpose :
//=============================================================================
-MAT2d_Circuit::MAT2d_Circuit()
+MAT2d_Circuit::MAT2d_Circuit(const Standard_Boolean IsOpenResult)
{
+ myIsOpenResult = IsOpenResult;
}
//=============================================================================
{
Handle(Geom2d_TrimmedCurve) Curve;
Standard_Real DotProd;
-
- Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.First());
- Line.InsertBefore(1,new Geom2d_CartesianPoint(Curve->StartPoint()));
- Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Last());
- Line.Append(new Geom2d_CartesianPoint(Curve->EndPoint()));
- for ( Standard_Integer i = 2; i <= Line.Length() - 2; i++) {
+ if (!myIsOpenResult)
+ {
+ Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.First());
+ Line.InsertBefore(1,new Geom2d_CartesianPoint(Curve->StartPoint()));
+ Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Last());
+ Line.Append(new Geom2d_CartesianPoint(Curve->EndPoint()));
+ }
+
+ Standard_Integer addition = (myIsOpenResult)? 1 : 2;
+ for ( Standard_Integer i = addition; i <= Line.Length() - addition; i++) {
if ( Abs(CrossProd(Line.Value(i),Line.Value(i+1),DotProd)) > 1.E-8 ||
DotProd < 0. ) {
Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Value(i));
//--------------------------
// Completion de la ligne.
//--------------------------
- for ( i = NbItems - 1; i > 1; i--){
- Type = Line.Value(i)->DynamicType();
- if ( Type == STANDARD_TYPE(Geom2d_CartesianPoint) ){
- Line.Append(Line.Value(i));
- }
- else {
- Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Value(i)->Copy());
- Curve->Reverse();
- Line.Append(Curve);
+ if (!myIsOpenResult)
+ {
+ for ( i = NbItems - 1; i > 1; i--){
+ Type = Line.Value(i)->DynamicType();
+ if ( Type == STANDARD_TYPE(Geom2d_CartesianPoint) ){
+ Line.Append(Line.Value(i));
+ }
+ else {
+ Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Value(i)->Copy());
+ Curve->Reverse();
+ Line.Append(Curve);
+ }
}
}
ICorres++;
}
Corres(ICorres) = IndLine;
-
- for (i = 1; i < 2*NbItems - 2; i++) {
- if (Corres(i) == 0) Corres(i) = Corres(2*NbItems - i);
- }
+ if (!myIsOpenResult)
+ {
+ for (i = 1; i < 2*NbItems - 2; i++) {
+ if (Corres(i) == 0)
+ Corres(i) = Corres(2*NbItems - i);
+ }
+
#ifdef DEB
- if (AffichCircuit) {
- for (i = 1; i <= 2*NbItems - 2; i++) {
- cout<< "Correspondance "<< i<<" -> "<<Corres(i)<<endl;
+ if (AffichCircuit) {
+ for (i = 1; i <= 2*NbItems - 2; i++) {
+ cout<< "Correspondance "<< i<<" -> "<<Corres(i)<<endl;
+ }
}
- }
#endif
-
- //----------------------------
- // Mise a jour des Connexions.
- //----------------------------
- for ( i = 1; i <= NbConnexions; i++){
- CC = ConnexionFrom.ChangeValue(i);
- CC->IndexItemOnFirst(Corres(CC->IndexItemOnFirst()));
- }
-
- if (!ConnexionFather.IsNull()) {
- ConnexionFather
- ->IndexItemOnSecond(Corres(ConnexionFather->IndexItemOnSecond()));
+
+ //----------------------------
+ // Mise a jour des Connexions.
+ //----------------------------
+ for ( i = 1; i <= NbConnexions; i++){
+ CC = ConnexionFrom.ChangeValue(i);
+ CC->IndexItemOnFirst(Corres(CC->IndexItemOnFirst()));
+ }
+
+ if (!ConnexionFather.IsNull()) {
+ ConnexionFather
+ ->IndexItemOnSecond(Corres(ConnexionFather->IndexItemOnSecond()));
+ }
}
}