1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <HYDROData_Pipes.h>
22 #include <TopoDS_Edge.hxx>
23 #include <TopoDS_Face.hxx>
24 #include <TopoDS_Iterator.hxx>
26 #include <BRepOffsetAPI_NormalProjection.hxx>
27 #include <BRepLib_MakeVertex.hxx>
28 #include <BRepLib_MakeEdge.hxx>
29 #include <BRepLib_MakeFace.hxx>
30 #include <BRepLib_MakeWire.hxx>
31 #include <BRepExtrema_ExtCC.hxx>
32 #include <BRepBuilderAPI_Transform.hxx>
33 #include <BRepOffsetAPI_MakePipeShell.hxx>
34 #include <BRep_Tool.hxx>
35 #include <Geom_Curve.hxx>
36 #include <Geom2d_Curve.hxx>
37 #include <Geom_Plane.hxx>
38 #include <TColStd_SequenceOfInteger.hxx>
39 #include <TColStd_ListOfReal.hxx>
40 #include <BRepAdaptor_Curve.hxx>
41 #include <GeomProjLib.hxx>
42 #include <Geom2dAPI_InterCurveCurve.hxx>
43 #include <Geom2dAPI_InterCurveCurve.hxx>
44 #include <Geom2d_Line.hxx>
45 #include <BRepLib_FindSurface.hxx>
46 #include <GProp_GProps.hxx>
47 #include <BRepGProp.hxx>
48 #include <BRepTools_WireExplorer.hxx>
49 #include <Geom2dAPI_ProjectPointOnCurve.hxx>
50 #include <gp_Circ.hxx>
51 #include <gp_Elips.hxx>
54 #include <TColStd_ListIteratorOfListOfReal.hxx>
55 #include <Geom_Circle.hxx>
56 #include <GeomAPI_ProjectPointOnCurve.hxx>
57 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
58 #include <TopTools_ListIteratorOfListOfShape.hxx>
59 #include <TopExp_Explorer.hxx>
60 #include <ShapeUpgrade_UnifySameDomain.hxx>
63 * GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm
64 * to store and compare computed solutions on edges
67 class GEOMImpl_Fillet1dPoint
73 Standard_EXPORT GEOMImpl_Fillet1dPoint(Standard_Real theParam)
76 //! Make copy of point
77 //!WARNING: Copies only field values: myParam, myV, myD, myValid
78 Standard_EXPORT GEOMImpl_Fillet1dPoint* Copy(); // warning: this is not the full copy!
81 Standard_EXPORT inline void SetParam(Standard_Real theParam)
83 Standard_EXPORT inline Standard_Real GetParam() const
85 Standard_EXPORT inline void SetParam2(const Standard_Real theParam2)
86 {myParam2 = theParam2;}
87 Standard_EXPORT inline Standard_Real GetParam2()
91 Standard_EXPORT inline Standard_Boolean IsValid(int theIndex)
92 {return (Standard_Boolean)myValid.Value(theIndex);}
95 Standard_EXPORT inline Standard_Integer GetNBValues() {return myV.Length();}
96 Standard_EXPORT inline Standard_Real GetValue(Standard_Integer theIndex)
97 {return myV.Value(theIndex);}
98 Standard_EXPORT inline Standard_Real GetDiff(Standard_Integer theIndex)
99 {return myD.Value(theIndex);}
100 Standard_EXPORT inline Standard_Integer GetNear(Standard_Integer theIndex)
101 {return myNear.Value(theIndex);}
103 //! Set/Get center point
104 Standard_EXPORT inline void SetCenter(const gp_Pnt2d thePoint)
105 {myCenter = thePoint;}
106 Standard_EXPORT inline const gp_Pnt2d GetCenter()
109 Standard_EXPORT void AddValue(Standard_Real theValue, Standard_Boolean theIsValid);
111 //! compute difference between this and given point
112 Standard_EXPORT Standard_Boolean ComputeDifference(GEOMImpl_Fillet1dPoint*);
113 Standard_EXPORT void FilterPoints(GEOMImpl_Fillet1dPoint*);
115 //! Checks if point contains solution and returns the index of it if any
116 Standard_EXPORT Standard_Integer HasSolution(Standard_Real theRadius);
117 //! Remove solution by index
118 void RemoveSolution(Standard_Integer theIndex);
123 Standard_Real myParam, myParam2;
124 TColStd_SequenceOfReal myV;
125 TColStd_SequenceOfReal myD;
126 TColStd_SequenceOfInteger myValid;
127 TColStd_SequenceOfInteger myNear;
130 class GEOMImpl_Fillet1d
134 //! The fillet 1D algorithm is initialised by two edges and plane
135 Standard_EXPORT GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1,
136 const TopoDS_Edge& theEdge2,
137 const gp_Pln& thePlane);
138 //! Makes fillet with given radius
139 //! @returns Standard_True, if at least one result computed
140 Standard_EXPORT Standard_Boolean Perform(const Standard_Real theRadius);
142 //! Returns result fillet edge and modified edges as out parameters
143 Standard_EXPORT TopoDS_Edge Result(const gp_Pnt& thePoint, TopoDS_Edge& theEdge1, TopoDS_Edge& theEdge2);
147 void fillPoint(GEOMImpl_Fillet1dPoint*);
148 void fillDiff(GEOMImpl_Fillet1dPoint*, Standard_Real, Standard_Boolean);
149 void performNewton(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*);
150 Standard_Boolean processPoint(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*, Standard_Real);
154 TopoDS_Edge myEdge1, myEdge2;
155 Handle(Geom_Plane) myPlane;
156 Handle(Geom2d_Curve) myCurve1, myCurve2;
157 Standard_Real myStart1, myEnd1, myStart2, myEnd2, myRadius;
158 TColStd_ListOfReal myResultParams;
159 TColStd_SequenceOfInteger myResultOrientation;
160 Standard_Boolean myStartSide, myEdgesExchnged;
161 Standard_Integer myDegreeOfRecursion;
164 //from GEOMImpl_Fillet1d.cxx
165 GEOMImpl_Fillet1d::GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1,
166 const TopoDS_Edge& theEdge2,
167 const gp_Pln& thePlane)
168 : myEdgesExchnged( Standard_False )
170 myPlane = new Geom_Plane(thePlane);
172 BRepAdaptor_Curve aBAC1(theEdge1);
173 BRepAdaptor_Curve aBAC2(theEdge2);
174 if (aBAC1.GetType() < aBAC2.GetType())
175 { // first curve must be more complicated
178 myEdgesExchnged = Standard_True;
186 Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1);
187 Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2);
189 myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane);
190 myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane);
192 while (myCurve1->IsPeriodic() && myStart1 >= myEnd1)
193 myEnd1 += myCurve1->Period();
194 while (myCurve2->IsPeriodic() && myStart2 >= myEnd2)
195 myEnd2 += myCurve2->Period();
197 if (aBAC1.GetType() == aBAC2.GetType())
199 if (myEnd2 - myStart2 < myEnd1 - myStart1)
200 { // first curve must be parametrically shorter
201 TopoDS_Edge anEdge = myEdge1;
204 Handle(Geom2d_Curve) aCurve = myCurve1;
207 Standard_Real a = myStart1;
213 myEdgesExchnged = Standard_True;
218 //=======================================================================
219 //function : isRadiusIntersected
220 //purpose : local function
221 //=======================================================================
222 static Standard_Boolean isRadiusIntersected(const Handle(Geom2d_Curve)& theCurve,
223 const gp_Pnt2d theStart,
224 const gp_Pnt2d theEnd,
225 const Standard_Boolean theStartConnected)
227 const Standard_Real aTol = Precision::Confusion();
228 const Standard_Real anAngTol = Precision::Angular();
229 Geom2dAPI_InterCurveCurve anInter(theCurve, new Geom2d_Line(theStart,
230 gp_Dir2d(gp_Vec2d(theStart, theEnd))), aTol);
233 for(a = anInter.NbPoints(); a > 0; a--)
235 aPoint = anInter.Point(a);
236 if ( aPoint.Distance(theStart) < aTol && !theStartConnected )
237 return Standard_True;
238 if (aPoint.Distance(theEnd) < aTol * 200)
239 return Standard_True;
240 if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol))
241 return Standard_True;
243 Handle(Geom2d_Curve) aCurve;
244 for(a = anInter.NbSegments(); a > 0; a--)
246 anInter.Segment(a, aCurve);
247 aPoint = aCurve->Value(aCurve->FirstParameter());
248 if (aPoint.Distance(theStart) < aTol)
249 if (!theStartConnected)
250 return Standard_True;
251 if (aPoint.Distance(theEnd) < aTol)
252 return Standard_True;
253 if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol))
254 return Standard_True;
255 aPoint = aCurve->Value(aCurve->LastParameter());
256 if (aPoint.Distance(theStart) < aTol)
257 if (!theStartConnected)
258 return Standard_True;
259 if (aPoint.Distance(theEnd) < aTol)
260 return Standard_True;
261 if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol))
262 return Standard_True;
264 return Standard_False;
267 //=======================================================================
268 //function : PlaneOfWire
269 //purpose : local function
270 //=======================================================================
271 static Standard_Boolean PlaneOfWire (const TopoDS_Wire& W, gp_Pln& P)
273 Standard_Boolean isplane = Standard_True;
274 BRepLib_FindSurface findPlanarSurf;
275 Handle(Geom_Surface) S;
279 BRepGProp::LinearProperties(W,GP);
280 gp_Pnt Bary = GP.CentreOfMass();
282 // shielding for particular cases : only one edge circle or ellipse
283 // on a closed wire !
284 Standard_Integer nbEdges = 0;
285 BRepTools_WireExplorer anExp;
287 Standard_Boolean wClosed = W.Closed();
289 // it is checked if the vertices are the same.
290 TopoDS_Vertex V1, V2;
291 TopExp::Vertices(W,V1,V2);
292 if ( V1.IsSame(V2)) wClosed = Standard_True;
294 TopoDS_Edge Edge = TopoDS::Edge(anExp.Current());
295 Standard_Real first, last;
297 Handle(Geom_Curve) curv;
298 curv = BRep_Tool::Curve(Edge, loc, first, last);
300 Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
302 GeomAdaptor_Curve AdC;
304 for(; anExp.More(); anExp.Next()) {
307 if ( nbEdges==1 && AdC.GetType() == GeomAbs_Circle ) {
308 Bary = AdC.Circle().Location();
310 if ( nbEdges==1 && AdC.GetType() == GeomAbs_Ellipse ) {
311 Bary = AdC.Ellipse().Location();
315 findPlanarSurf.Init(W, -1, Standard_True);
316 if ( findPlanarSurf.Found()) {
317 S = findPlanarSurf.Surface();
318 L = findPlanarSurf.Location();
319 if (!L.IsIdentity()) S = Handle(Geom_Surface)::
320 DownCast(S->Transformed(L.Transformation()));
321 P = (Handle(Geom_Plane)::DownCast(S))->Pln();
326 isplane = Standard_False;
332 //=======================================================================
333 //function : fillPoint
335 //=======================================================================
336 void GEOMImpl_Fillet1d::fillPoint(GEOMImpl_Fillet1dPoint* thePoint)
340 const Standard_Real aTol = Precision::Confusion();
341 myCurve1->D1(thePoint->GetParam(), aPoint, aVec);
342 if (aVec.SquareMagnitude() < aTol)
345 gp_Vec2d aPerp(((myStartSide)?-1:1) * aVec.Y(), ((myStartSide)?1:-1) * aVec.X());
347 aPerp.Multiply(myRadius);
348 gp_Pnt2d aCenter = aPoint.Translated(aPerp);
349 thePoint->SetCenter(aCenter);
351 // on the intersection point
352 Standard_Boolean aValid = Standard_True;
353 Geom2dAPI_ProjectPointOnCurve aProjInt(aPoint, myCurve2);
354 if (aProjInt.NbPoints() && aPoint.Distance(aProjInt.NearestPoint()) < aTol)
355 aValid = Standard_False;
357 aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True);
359 Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2);
360 Standard_Integer a, aNB = aProj.NbPoints();
361 for(a = aNB; a > 0; a--)
363 if (aPoint.Distance(aProj.Point(a)) < aTol)
366 Standard_Boolean aValid2 = aValid;
368 aValid2 = !isRadiusIntersected(myCurve1, aCenter, aProj.Point(a), Standard_False);
370 // checking the right parameter
371 Standard_Real aParam = aProj.Parameter(a);
372 while(myCurve2->IsPeriodic() && aParam < myStart2)
373 aParam += myCurve2->Period();
375 thePoint->AddValue(aProj.Distance(a) * aProj.Distance(a) - myRadius * myRadius,
376 (aParam >= myStart2 && aParam <= myEnd2 && aValid2));
377 if (fabs(fabs(aProj.Distance(a)) - myRadius) < aTol)
378 thePoint->SetParam2(aParam);
382 //=======================================================================
383 //function : fillDiff
385 //=======================================================================
386 void GEOMImpl_Fillet1d::fillDiff(GEOMImpl_Fillet1dPoint* thePoint, Standard_Real theDiffStep, Standard_Boolean theFront)
388 GEOMImpl_Fillet1dPoint* aDiff =
389 new GEOMImpl_Fillet1dPoint(thePoint->GetParam() + (theFront?(theDiffStep):(-theDiffStep)));
391 if (!thePoint->ComputeDifference(aDiff))
393 aDiff->SetParam(thePoint->GetParam() + (theFront?(-theDiffStep):(theDiffStep)));
395 thePoint->ComputeDifference(aDiff);
400 //=======================================================================
403 //=======================================================================
404 Standard_Boolean GEOMImpl_Fillet1d::Perform(const Standard_Real theRadius)
406 myDegreeOfRecursion = 0;
407 myResultParams.Clear();
408 myResultOrientation.Clear();
410 Standard_Real aNBSteps = 100;
411 Geom2dAdaptor_Curve aGAC(myCurve1);
412 switch (aGAC.GetType())
420 case GeomAbs_Ellipse:
423 case GeomAbs_BezierCurve:
424 case GeomAbs_BSplineCurve:
425 aNBSteps = 2 + aGAC.Degree() * aGAC.NbPoles();
427 default: // unknown: maximum
431 myRadius = theRadius;
432 Standard_Real aParam, aStep, aDStep;
433 aStep = (myEnd1 - myStart1) / aNBSteps;
434 aDStep = aStep/1000.;
436 Standard_Integer aCycle;
437 for(aCycle = 2, myStartSide = Standard_False; aCycle; myStartSide = !myStartSide, aCycle--)
439 GEOMImpl_Fillet1dPoint *aLeft = NULL, *aRight = NULL;
441 for(aParam = myStart1 + aStep; aParam < myEnd1 || fabs(myEnd1 - aParam) < Precision::Confusion(); aParam += aStep)
445 aLeft = new GEOMImpl_Fillet1dPoint(aParam - aStep);
447 fillDiff(aLeft, aDStep, Standard_True);
450 aRight = new GEOMImpl_Fillet1dPoint(aParam);
452 fillDiff(aRight, aDStep, Standard_False);
454 aLeft->FilterPoints(aRight);
455 performNewton(aLeft, aRight);
463 if (myResultParams.Extent())
464 return Standard_True;
466 return Standard_False;
469 //=======================================================================
470 //function : processPoint
472 //=======================================================================
473 Standard_Boolean GEOMImpl_Fillet1d::processPoint(GEOMImpl_Fillet1dPoint* theLeft,
474 GEOMImpl_Fillet1dPoint* theRight,
475 Standard_Real theParameter)
477 if (theParameter >= theLeft->GetParam() && theParameter < theRight->GetParam())
479 Standard_Real aDX = theRight->GetParam() - theLeft->GetParam();
480 if (theParameter - theLeft->GetParam() < aDX / 100.)
482 theParameter = theLeft->GetParam() + aDX / 100.;
484 if (theRight->GetParam() - theParameter < aDX / 100.)
486 theParameter = theRight->GetParam() - aDX / 100.;
489 // Protection on infinite loop.
490 myDegreeOfRecursion++;
491 Standard_Real diffx = 0.001 * aDX;
492 if (myDegreeOfRecursion > 1000)
495 if (myDegreeOfRecursion > 10000)
498 if (myDegreeOfRecursion > 100000)
500 return Standard_True;
505 GEOMImpl_Fillet1dPoint* aPoint1 = theLeft->Copy();
506 GEOMImpl_Fillet1dPoint* aPoint2 = new GEOMImpl_Fillet1dPoint(theParameter);
508 fillDiff(aPoint2, diffx, Standard_True);
510 aPoint1->FilterPoints(aPoint2);
511 performNewton(aPoint1, aPoint2);
512 aPoint2->FilterPoints(theRight);
513 performNewton(aPoint2, theRight);
517 return Standard_True;
520 return Standard_False;
523 //=======================================================================
524 //function : performNewton
526 //=======================================================================
527 void GEOMImpl_Fillet1d::performNewton(GEOMImpl_Fillet1dPoint* theLeft,
528 GEOMImpl_Fillet1dPoint* theRight)
531 // check the left: if this is solution store it and remove it from the list of researching points of theLeft
532 a = theLeft->HasSolution(myRadius);
535 if (theLeft->IsValid(a))
537 myResultParams.Append(theLeft->GetParam());
538 myResultOrientation.Append(myStartSide);
543 Standard_Real aDX = theRight->GetParam() - theLeft->GetParam();
544 if ( aDX < Precision::Confusion() / 1000000.)
546 a = theRight->HasSolution(myRadius);
548 if (theRight->IsValid(a))
550 myResultParams.Append(theRight->GetParam());
551 myResultOrientation.Append(myStartSide);
556 for(a = 1; a <= theLeft->GetNBValues(); a++)
558 Standard_Integer aNear = theLeft->GetNear(a);
560 Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX;
561 Standard_Real aB = theLeft->GetDiff(a) - aA * theLeft->GetParam();
562 Standard_Real aC = theLeft->GetValue(a) - theLeft->GetDiff(a) * theLeft->GetParam() +
563 aA * theLeft->GetParam() * theLeft->GetParam() / 2.0;
564 Standard_Real aDet = aB * aB - 2.0 * aA * aC;
566 if ( fabs(aDet) < gp::Resolution() )
569 if (fabs(aA) < Precision::Confusion())
571 if (fabs(aB) > 10e-20)
573 Standard_Real aX0 = - aC / aB; // use extremum
574 if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam())
575 processPoint(theLeft, theRight, aX0);
579 processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise
584 if (fabs(aB) > fabs(aDet * 1000000.))
585 { // possible floating point operations accuracy errors
586 processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise
593 Standard_Boolean aRes = processPoint(theLeft, theRight, (- aB + aDet) / aA);
595 aRes = processPoint(theLeft, theRight, (- aB - aDet) / aA);
597 processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise
601 Standard_Real aX0 = - aB / aA; // use extremum
602 if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam())
603 processPoint(theLeft, theRight, aX0);
605 processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise
612 //=======================================================================
615 //=======================================================================
616 TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
617 TopoDS_Edge& theEdge1,
618 TopoDS_Edge& theEdge2)
621 gp_Pnt2d aTargetPoint2d;
622 Standard_Real aX, aY;
623 ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY);
624 aTargetPoint2d.SetCoord(aX, aY);
626 // choose the nearest circle
627 Standard_Real aDistance = RealLast(), aP;
628 GEOMImpl_Fillet1dPoint *aNearest;
630 TColStd_ListIteratorOfListOfReal anIter(myResultParams);
631 for(aNearest = NULL, a = 1; anIter.More(); anIter.Next(), a++)
633 myStartSide = (myResultOrientation.Value(a)) ? Standard_True : Standard_False;
634 GEOMImpl_Fillet1dPoint *aPoint = new GEOMImpl_Fillet1dPoint(anIter.Value());
636 if (!aPoint->HasSolution(myRadius))
638 aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius);
639 if (!aNearest || aP < aDistance)
653 // create circle edge
654 gp_Pnt aCenter = ElSLib::PlaneValue(aNearest->GetCenter().X(),
655 aNearest->GetCenter().Y(),
656 myPlane->Pln().Position());
657 Handle(Geom_Circle) aCircle =
658 new Geom_Circle(gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius);
659 gp_Pnt2d aPoint2d1, aPoint2d2;
660 myCurve1->D0(aNearest->GetParam(), aPoint2d1);
661 myCurve2->D0(aNearest->GetParam2(), aPoint2d2);
662 gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(), myPlane->Pln().Position());
663 gp_Pnt aPoint2 = ElSLib::PlaneValue(aPoint2d2.X(), aPoint2d2.Y(), myPlane->Pln().Position());
665 GeomAPI_ProjectPointOnCurve aProj(thePoint, aCircle);
666 Standard_Real aTarGetParam = aProj.LowerDistanceParameter();
667 gp_Pnt aPointOnCircle = aProj.NearestPoint();
669 // Check extrema point manually, because there is a bug in Open CASCADE
670 // in calculation of nearest point to a circle near the parameter 0.0
671 gp_Pnt p0 = ElCLib::Value(0.0, aCircle->Circ());
672 if (p0.Distance(thePoint) < aPointOnCircle.Distance(thePoint))
678 aProj.Perform(aPoint1);
679 Standard_Real aParam1 = aProj.LowerDistanceParameter();
680 aProj.Perform(aPoint2);
681 Standard_Real aParam2 = aProj.LowerDistanceParameter();
682 Standard_Boolean aIsOut = ((aParam1 < aTarGetParam && aParam2 < aTarGetParam) ||
683 (aParam1 > aTarGetParam && aParam2 > aTarGetParam));
684 if (aParam1 > aParam2)
686 BRepLib_MakeEdge aBuilder(aCircle->Circ(),
687 aIsOut ? aParam2 : aParam1,
688 aIsOut? aParam1 : aParam2);
689 aResult = aBuilder.Edge();
692 Standard_Real aStart, anEnd;
693 Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd);
695 aCurve->D1(aNearest->GetParam(), aPoint1, aDir);
698 aCircle->D1(aParam1, aPoint1, aCircleDir);
699 if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ^ aIsOut)
700 aStart = aNearest->GetParam();
702 anEnd = aNearest->GetParam();
704 if (fabs(aStart - anEnd) > Precision::Confusion())
707 BRepLib_MakeEdge aDivider1(aCurve, aStart, anEnd);
709 theEdge2 = aDivider1.Edge();
711 theEdge1 = aDivider1.Edge();
714 aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd);
715 aCurve->D1(aNearest->GetParam2(), aPoint2, aDir);
717 aCircle->D1(aParam2, aPoint2, aCircleDir);
718 if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ^ (!aIsOut))
719 aStart = aNearest->GetParam2();
721 anEnd = aNearest->GetParam2();
723 if (fabs(aStart - anEnd) > Precision::Confusion())
725 BRepLib_MakeEdge aDivider2(aCurve, aStart, anEnd);
727 theEdge1 = aDivider2.Edge();
729 theEdge2 = aDivider2.Edge();
736 //=======================================================================
737 //function : AddValue
739 //=======================================================================
740 void GEOMImpl_Fillet1dPoint::AddValue(Standard_Real theValue, Standard_Boolean theValid)
743 for(a = 1; a <= myV.Length(); a++)
745 if (theValue < myV.Value(a))
747 myV.InsertBefore(a, theValue);
748 myValid.InsertBefore(a, (Standard_Integer)theValid);
752 myV.Append(theValue);
753 myValid.Append((Standard_Integer)theValid);
756 //=======================================================================
757 //function : ComputeDifference
759 //=======================================================================
760 Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint* thePoint)
763 Standard_Boolean aDiffsSet = (myD.Length() != 0);
764 Standard_Real aDX = thePoint->GetParam() - myParam, aDY = RealLast(); //???
765 if (thePoint->myV.Length() == myV.Length())
766 { // absolutely the same points
767 for(a = 1; a <= myV.Length(); a++)
769 aDY = thePoint->myV.Value(a) - myV.Value(a);
771 myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0);
773 myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0);
775 return Standard_True;
777 // between the diffeerent points searching for nearest analogs
779 for(a = 1; a <= myV.Length(); a++)
781 for(b = 1; b <= thePoint->myV.Length(); b++)
783 if (b == 1 || fabs(thePoint->myV.Value(b) - myV.Value(a)) < fabs(aDY))
784 aDY = thePoint->myV.Value(b) - myV.Value(a);
788 if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a)))
789 myD.SetValue(a, aDY / aDX);
795 myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0);
799 return Standard_False;
802 //=======================================================================
803 //function : FilterPoints
805 //=======================================================================
806 void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint* thePoint)
808 Standard_Integer a, b;
809 TColStd_SequenceOfReal aDiffs;
810 Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam;
811 for(a = 1; a <= myV.Length(); a++)
813 // searching for near point from thePoint
814 Standard_Integer aNear = 0;
815 Standard_Real aDiff = aDX * 10000.;
816 aY = myV.Value(a) + myD.Value(a) * aDX;
817 for(b = 1; b <= thePoint->myV.Length(); b++)
819 // calculate hypothesis value of the Y2 with the constant first and second derivative
820 aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0;
821 if (aNear == 0 || fabs(aY2 - thePoint->myV.Value(b)) < fabs(aDiff))
824 aDiff = aY2 - thePoint->myV.Value(b);
830 if (myV.Value(a) * thePoint->myV.Value(aNear) > 0)
831 {// the same sign at the same sides of the interval
832 if (myV.Value(a) * myD.Value(a) > 0)
834 if (fabs(myD.Value(a)) > Precision::Confusion())
839 if (fabs(myV.Value(a)) > fabs(thePoint->myV.Value(aNear)))
840 if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 &&
841 fabs(thePoint->myD.Value(aNear)) > Precision::Confusion())
851 if (myV.Value(a) * thePoint->myV.Value(aNear) > 0)
853 if ((myV.Value(a) + myD.Value(a) * aDX) * myV.Value(a) > Precision::Confusion() &&
854 (thePoint->myV.Value(aNear) + thePoint->myD.Value(aNear) * aDX) * thePoint->myV.Value(aNear) > Precision::Confusion())
863 if ( fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7)
870 { // there is no near: remove it from the list
878 Standard_Boolean aFound = Standard_False;
879 for(b = 1; b <= myNear.Length(); b++)
881 if (myNear.Value(b) == aNear)
883 if (fabs(aDiffs.Value(b)) < fabs(aDiff))
884 { // return this 'near'
885 aFound = Standard_True;
893 { // remove the old 'near'
906 myNear.Append(aNear);
907 aDiffs.Append(aDiff);
913 //=======================================================================
916 //=======================================================================
917 GEOMImpl_Fillet1dPoint* GEOMImpl_Fillet1dPoint::Copy()
919 GEOMImpl_Fillet1dPoint* aCopy = new GEOMImpl_Fillet1dPoint(myParam);
921 for(a = 1; a <= myV.Length(); a++)
923 aCopy->myV.Append(myV.Value(a));
924 aCopy->myD.Append(myD.Value(a));
925 aCopy->myValid.Append(myValid.Value(a));
930 //=======================================================================
931 //function : HasSolution
933 //=======================================================================
934 Standard_Integer GEOMImpl_Fillet1dPoint::HasSolution(const Standard_Real theRadius)
937 for(a = 1; a <= myV.Length(); a++)
939 if (fabs(sqrt(fabs(fabs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion() / 10.)
945 //=======================================================================
946 //function : RemoveSolution
948 //=======================================================================
949 void GEOMImpl_Fillet1dPoint::RemoveSolution(Standard_Integer theIndex)
951 myV.Remove(theIndex);
952 myD.Remove(theIndex);
953 myValid.Remove(theIndex);
954 myNear.Remove(theIndex);
960 //=======================================================================
961 //function : addEdgeRelation
962 //purpose : local function to remember relation between initial and modified edge
963 //=======================================================================
964 static void addEdgeRelation(TopTools_DataMapOfShapeShape& theMap,
965 const TopoDS_Edge& theInitE,
966 const TopoDS_Edge& theResE)
968 if ( theMap.IsBound( theInitE ) )
969 theMap.ChangeFind( theInitE ) = theResE;
971 theMap.Bind( theInitE, theResE );
974 HYDROData_Canal3dAnd2d::HYDROData_Canal3dAnd2d(const TopoDS_Wire& Profile,
975 const TopoDS_Wire& Guideline)
976 : myProfile(Profile), myOriginalGuideline(Guideline), myStatus(0)
978 TopExp::Vertices(myProfile, myLeftVertex, myRightVertex);
979 gp_Pnt LeftPoint = BRep_Tool::Pnt(myLeftVertex);
980 gp_Pnt RightPoint = BRep_Tool::Pnt(myRightVertex);
981 myFilletRadius = (LeftPoint.Distance(RightPoint))/2. * 1.5;
984 MakeSharpVertexList();
985 if (!mySharpVertexList.IsEmpty())
988 myGuideline = myOriginalGuideline;
992 if (ProjectWireOntoXOY(myGuideline, myProjectedGuideline))
1001 void HYDROData_Canal3dAnd2d::MakeSharpVertexList()
1003 TopTools_IndexedDataMapOfShapeListOfShape VEmap;
1004 TopExp::MapShapesAndAncestors(myOriginalGuideline, TopAbs_VERTEX, TopAbs_EDGE, VEmap);
1006 for (Standard_Integer i = 1; i <= VEmap.Extent(); i++)
1008 const TopTools_ListOfShape& Elist = VEmap(i);
1009 if (Elist.Extent() < 2)
1012 const TopoDS_Vertex& CommonVertex = TopoDS::Vertex(VEmap.FindKey(i));
1013 TopoDS_Edge E1 = TopoDS::Edge(Elist.First());
1014 TopoDS_Edge E2 = TopoDS::Edge(Elist.Last());
1015 TopoDS_Edge Edge1 = E1, Edge2 = E2;
1016 TopoDS_Vertex V1, V2;
1017 TopExp::Vertices(E1, V1, V2);
1018 if (!V2.IsSame(CommonVertex))
1019 { Edge1 = E2; Edge2 = E1; }
1020 BRepAdaptor_Curve BAC1(Edge1);
1021 BRepAdaptor_Curve BAC2(Edge2);
1024 BAC1.D1( BAC1.LastParameter(), aPoint, Vec1 );
1025 BAC2.D1( BAC2.FirstParameter(), aPoint, Vec2 );
1026 Standard_Real theAngle = Vec1.Angle(Vec2);
1027 if (theAngle > myTolAngular)
1028 mySharpVertexList.Append(CommonVertex);
1032 Standard_Boolean HYDROData_Canal3dAnd2d::MakeFillet()
1034 //Standard_Boolean isAllStepsOk = true;
1036 TopTools_DataMapOfShapeShape anEdgeToEdgeMap;
1038 //iterates on vertices, and make fillet on each couple of edges
1039 //collect result fillet edges in list
1040 TopTools_ListOfShape aListOfNewEdge;
1041 // remember relation between initial and modified map
1042 TopTools_IndexedDataMapOfShapeListOfShape aMapVToEdges;
1043 TopExp::MapShapesAndAncestors( myOriginalGuideline, TopAbs_VERTEX, TopAbs_EDGE, aMapVToEdges );
1044 TopTools_ListIteratorOfListOfShape anIt( mySharpVertexList );
1045 for ( ; anIt.More(); anIt.Next() ) {
1046 TopoDS_Vertex aV = TopoDS::Vertex( anIt.Value() );
1047 const TopTools_ListOfShape& aVertexEdges = aMapVToEdges.FindFromKey( aV );
1048 if ( aVertexEdges.Extent() != 2 )
1049 continue; // no input data to make fillet
1050 TopoDS_Edge anEdge1 = TopoDS::Edge( aVertexEdges.First() );
1051 TopoDS_Edge anEdge2 = TopoDS::Edge( aVertexEdges.Last() );
1052 // check if initial edges already modified in previous fillet operation
1053 if ( anEdgeToEdgeMap.IsBound( anEdge1 ) ) anEdge1 = TopoDS::Edge(anEdgeToEdgeMap.Find( anEdge1 ));
1054 if ( anEdgeToEdgeMap.IsBound( anEdge2 ) ) anEdge2 = TopoDS::Edge(anEdgeToEdgeMap.Find( anEdge2 ));
1055 if ( anEdge1.IsNull() || anEdge2.IsNull() || anEdge1.IsSame( anEdge2 ) )
1056 continue; //no input data to make fillet
1058 // create plane on 2 edges
1060 TopoDS_Wire LocalWire = BRepLib_MakeWire(anEdge1, anEdge2);
1061 //if ( !takePlane(anEdge1, anEdge2, aV, aPlane) )
1062 if (!PlaneOfWire(LocalWire, aPlane))
1065 return Standard_False; // seems edges does not belong to same plane or parallel (fillet can not be build)
1068 GEOMImpl_Fillet1d aFilletAlgo (anEdge1, anEdge2, aPlane);
1069 if (!aFilletAlgo.Perform(myFilletRadius)) {
1071 return Standard_False; //can not create fillet at this vertex with given radius
1074 // take fillet result in given vertex
1075 TopoDS_Edge aModifE1, aModifE2;
1076 TopoDS_Edge aNewE = aFilletAlgo.Result(BRep_Tool::Pnt(aV), aModifE1, aModifE2);
1077 if (aNewE.IsNull()) {
1079 return Standard_False; //fillet failed at this vertex
1082 // add new created edges and take modified edges
1083 aListOfNewEdge.Append(aNewE);
1085 // check if wire edges modified,
1086 // if yes, then map to original edges (from vertex-edges list), because edges can be modified before
1087 if (aModifE1.IsNull() || !anEdge1.IsSame( aModifE1 ))
1088 addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.First()), aModifE1 );
1089 if (aModifE2.IsNull() || !anEdge2.IsSame( aModifE2 ))
1090 addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.Last()), aModifE2 );
1093 if (anEdgeToEdgeMap.IsEmpty() && aListOfNewEdge.IsEmpty()) {
1095 return Standard_False; //fillet can't be computed on the given shape with the given radius
1098 // create new wire instead of original
1099 BRepLib_MakeWire MW;
1100 TopExp_Explorer anExp(myOriginalGuideline, TopAbs_EDGE);
1101 TopoDS_Edge aFirstEdge = TopoDS::Edge(anExp.Current());
1102 if (anEdgeToEdgeMap.IsBound(aFirstEdge))
1103 aFirstEdge = TopoDS::Edge(anEdgeToEdgeMap(aFirstEdge));
1106 for (anExp.Next(); anExp.More(); anExp.Next()) {
1107 TopoDS_Shape anEdge = anExp.Current();
1108 if (!anEdgeToEdgeMap.IsBound(anEdge))
1109 aListOfNewEdge.Append(anEdge);
1110 else if (!anEdgeToEdgeMap.Find(anEdge).IsNull())
1111 aListOfNewEdge.Append(anEdgeToEdgeMap.Find(anEdge));
1114 MW.Add(aListOfNewEdge);
1116 myGuideline = MW.Wire();
1118 return Standard_True;
1121 Standard_Boolean HYDROData_Canal3dAnd2d::ProjectWireOntoXOY(const TopoDS_Wire& aWire,
1122 TopoDS_Wire& ProjectedWire)
1124 gp_Pln XOY; //default plane
1125 TopoDS_Face theXOYface = BRepLib_MakeFace(XOY);
1127 BRepOffsetAPI_NormalProjection OrtProj(theXOYface);
1129 //OrtProj.SetParams(...); ???
1131 TopTools_ListOfShape Wires;
1132 OrtProj.BuildWire(Wires);
1134 if (Wires.Extent() != 1)
1137 return Standard_False;
1140 ProjectedWire = TopoDS::Wire(Wires.First());
1141 return Standard_True;
1144 TopoDS_Vertex HYDROData_Canal3dAnd2d::ProjectVertexOntoXOY(const TopoDS_Vertex& aVertex)
1146 gp_Pnt aPoint = BRep_Tool::Pnt(aVertex);
1147 gp_Pnt aProjPoint(aPoint.X(), aPoint.Y(), 0.);
1148 TopoDS_Vertex aProjVertex = BRepLib_MakeVertex(aProjPoint);
1152 void HYDROData_Canal3dAnd2d::Make2dProfile()
1154 TopoDS_Vertex ProjectedLeftVertex = ProjectVertexOntoXOY(myLeftVertex);
1155 TopoDS_Vertex ProjectedRightVertex = ProjectVertexOntoXOY(myRightVertex);
1156 TopoDS_Edge anEdge = BRepLib_MakeEdge(ProjectedLeftVertex, ProjectedRightVertex);
1157 myProjectedProfile = BRepLib_MakeWire(anEdge);
1160 void HYDROData_Canal3dAnd2d::SetMiddlePoint2d()
1162 TopoDS_Vertex V1, V2;
1163 TopExp::Vertices(myProjectedProfile, V1, V2);
1164 gp_Pnt Pnt1 = BRep_Tool::Pnt(V1);
1165 gp_Pnt Pnt2 = BRep_Tool::Pnt(V2);
1166 myMiddlePoint2d.SetXYZ(0.5*(Pnt1.XYZ() + Pnt2.XYZ()));
1169 void HYDROData_Canal3dAnd2d::SetMiddlePoint3d()
1171 gp_Lin MidLin(myMiddlePoint2d, gp::DZ());
1172 TopoDS_Edge MidEdge = BRepLib_MakeEdge(MidLin);
1173 TopoDS_Iterator itw(myProfile);
1174 for (; itw.More(); itw.Next())
1176 const TopoDS_Edge& anEdge = TopoDS::Edge(itw.Value());
1177 BRepExtrema_ExtCC ExtremaEE(MidEdge, anEdge);
1178 if (ExtremaEE.IsDone() && ExtremaEE.NbExt() != 0)
1180 for (Standard_Integer i = 1; i <= ExtremaEE.NbExt(); i++)
1182 if (ExtremaEE.SquareDistance(i) <= Precision::Confusion())
1184 myMiddlePoint3d = ExtremaEE.PointOnE1(i);
1192 TopoDS_Wire HYDROData_Canal3dAnd2d::SetTransformedProfile(const TopoDS_Wire& aProfile,
1193 const TopoDS_Wire& aGuideline,
1194 const gp_Pnt& aMiddlePoint)
1196 TopoDS_Wire aTransformedProfile;
1198 TopoDS_Iterator itw(myProjectedGuideline);
1199 TopoDS_Edge FirstEdge = TopoDS::Edge(itw.Value());
1200 Standard_Real fpar, lpar;
1201 Handle(Geom_Curve) FirstCurve = BRep_Tool::Curve(FirstEdge, fpar, lpar);
1204 FirstCurve->D1(fpar, StartPnt, StartVec);
1206 TopoDS_Vertex FirstOnGuide, LastOnGuide;
1207 TopExp::Vertices(aGuideline, FirstOnGuide, LastOnGuide);
1208 gp_Pnt StartPointOnGuide = BRep_Tool::Pnt(FirstOnGuide);
1210 //gp_Vec Offset(myMiddlePoint3d, StartPointOnGuide);
1211 gp_Trsf Translation, Rotation;
1212 Translation.SetTranslation(aMiddlePoint, StartPointOnGuide);
1213 aTransformedProfile = TopoDS::Wire(BRepBuilderAPI_Transform(aProfile, Translation, Standard_True)); //copy
1215 gp_Vec Vertical(0.,0.,1.);
1216 TopoDS_Vertex LeftVertex, RightVertex;
1217 TopExp::Vertices(aTransformedProfile, LeftVertex, RightVertex);
1218 gp_Pnt LeftPoint = BRep_Tool::Pnt(LeftVertex);
1219 gp_Pnt RightPoint = BRep_Tool::Pnt(RightVertex);
1220 gp_Vec LeftToRight(LeftPoint, RightPoint);
1221 gp_Vec NormalToProfile = Vertical ^ LeftToRight;
1223 gp_Vec AxisOfRotation = NormalToProfile ^ StartVec;
1224 if (AxisOfRotation.Magnitude() <= gp::Resolution())
1226 if (Vertical * LeftToRight < 0.)
1228 gp_Ax1 theVertical(StartPointOnGuide, gp::DZ());
1229 Rotation.SetRotation(theVertical, M_PI);
1234 gp_Ax1 theAxis(StartPointOnGuide, AxisOfRotation);
1235 Standard_Real theAngle = NormalToProfile.AngleWithRef(StartVec, AxisOfRotation);
1236 Rotation.SetRotation(theAxis, theAngle);
1239 aTransformedProfile = TopoDS::Wire(BRepBuilderAPI_Transform(aTransformedProfile, Rotation, Standard_True)); //copy
1240 return aTransformedProfile;
1243 Standard_Boolean HYDROData_Canal3dAnd2d::Create3dPresentation()
1245 myTransformedProfile3d = SetTransformedProfile(myProfile, myGuideline, myMiddlePoint3d);
1247 mySweep3d = new BRepOffsetAPI_MakePipeShell(myGuideline);
1248 mySweep3d->SetMode(gp::DZ()); //optional
1249 mySweep3d->Add(myTransformedProfile3d);
1250 //Set approx parameters
1251 mySweep3d->SetMaxDegree(14);
1252 mySweep3d->SetMaxSegments(500);
1253 ///////////////////////
1255 if (!mySweep3d->IsDone())
1258 return Standard_False;
1261 myPipe3d = mySweep3d->Shape();
1262 return Standard_True;
1265 Standard_Boolean HYDROData_Canal3dAnd2d::Create2dPresentation()
1267 myTransformedProfile2d = SetTransformedProfile(myProjectedProfile, myProjectedGuideline, myMiddlePoint2d);
1269 mySweep2d = new BRepOffsetAPI_MakePipeShell(myProjectedGuideline);
1270 mySweep2d->SetMode(gp::DZ()); //optional
1271 mySweep2d->Add(myTransformedProfile2d);
1272 //Set approx parameters
1273 mySweep2d->SetMaxDegree(14);
1274 mySweep2d->SetMaxSegments(500);
1275 ///////////////////////
1277 if (!mySweep2d->IsDone())
1280 return Standard_False;
1283 myPipe2d = mySweep2d->Shape();
1284 myUnifier.Initialize(myPipe2d);
1286 myUnifiedPipe2d = myUnifier.Shape();
1288 TopoDS_Wire OriginalInlet = TopoDS::Wire(mySweep2d->FirstShape());
1289 TopoDS_Wire OriginalOutlet = TopoDS::Wire(mySweep2d->LastShape());
1290 myInlet = CreateWireOnUnifiedPipe2d(OriginalInlet);
1291 myOutlet = CreateWireOnUnifiedPipe2d(OriginalOutlet);
1292 TopoDS_Vertex V1, V2, V3, V4;
1293 TopExp::Vertices(myTransformedProfile2d, V1, V2);
1294 TopExp::Vertices(OriginalInlet, V3, V4);
1295 gp_Pnt P1 = BRep_Tool::Pnt(V1);
1296 gp_Pnt P3 = BRep_Tool::Pnt(V3);
1297 if (P1.IsEqual(P3, Precision::Confusion()))
1298 { myLeftVertex2d = V3; myRightVertex2d = V4; }
1300 { myLeftVertex2d = V4; myRightVertex2d = V3; }
1302 return Standard_True;
1305 TopoDS_Wire HYDROData_Canal3dAnd2d::GetBank(const TopoDS_Vertex& aFreeVertex)
1309 TopTools_ListOfShape GeneratedShapes;
1310 GeneratedShapes = mySweep2d->Generated(aFreeVertex);
1311 BRepLib_MakeWire MW;
1312 MW.Add(GeneratedShapes);
1315 TopoDS_Wire aBankOnUnifiedPipe2d = CreateWireOnUnifiedPipe2d(aBank);
1317 return aBankOnUnifiedPipe2d;
1320 TopoDS_Wire HYDROData_Canal3dAnd2d::CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d)
1322 BRepLib_MakeWire MW;
1323 BRepTools_WireExplorer wexp(aWireOnPipe2d);
1324 for (; wexp.More(); wexp.Next())
1326 TopoDS_Shape anEdge = wexp.Current();
1327 TopoDS_Shape NewEdge = myUnifier.Generated(anEdge);
1328 if (!NewEdge.IsNull())
1329 MW.Add(TopoDS::Edge(NewEdge));
1334 TopoDS_Shape HYDROData_Canal3dAnd2d::Get3dPresentation()
1339 TopoDS_Face HYDROData_Canal3dAnd2d::Get2dPresentation()
1341 TopoDS_Iterator iter(myUnifiedPipe2d);
1342 return TopoDS::Face(iter.Value());
1345 TopoDS_Wire HYDROData_Canal3dAnd2d::GetInlet()
1350 TopoDS_Wire HYDROData_Canal3dAnd2d::GetOutlet()
1355 TopoDS_Wire HYDROData_Canal3dAnd2d::GetLeftBank()
1357 return GetBank(myLeftVertex2d);
1360 TopoDS_Wire HYDROData_Canal3dAnd2d::GetRightBank()
1362 return GetBank(myRightVertex2d);
1365 Standard_Integer HYDROData_Canal3dAnd2d::GetStatus()
1371 /*TopoDS_Wire HYDROData_Canal3dAnd2d::GetRoundedGuideline()
1376 TopoDS_Wire HYDROData_Canal3dAnd2d::GetProjectedRoundedGuideline()
1378 return myProjectedGuideline;