1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESH : implementaion of SMESH idl descriptions
24 // File : StdMeshers_FaceSide.hxx
25 // Created : Wed Jan 31 18:41:25 2007
26 // Author : Edward AGAPOV (eap)
29 #include "StdMeshers_FaceSide.hxx"
31 #include "SMDS_EdgePosition.hxx"
32 #include "SMDS_MeshNode.hxx"
33 #include "SMESHDS_Mesh.hxx"
34 #include "SMESHDS_SubMesh.hxx"
35 #include "SMESH_Algo.hxx"
36 #include "SMESH_Mesh.hxx"
37 #include "SMESH_MesherHelper.hxx"
38 #include "SMESH_ComputeError.hxx"
39 #include "SMESH_Block.hxx"
41 #include <Adaptor2d_Curve2d.hxx>
42 #include <BRepAdaptor_CompCurve.hxx>
43 #include <BRepAdaptor_Curve.hxx>
44 #include <BRep_Builder.hxx>
45 #include <BRep_Tool.hxx>
47 #include <TopExp_Explorer.hxx>
49 #include <TopoDS_Face.hxx>
50 #include <TopoDS_Vertex.hxx>
51 #include <TopoDS_Wire.hxx>
53 #include <GCPnts_AbscissaPoint.hxx>
54 #include <Geom2dAdaptor_Curve.hxx>
58 #include "utilities.h"
60 //================================================================================
62 * \brief Constructor of a side of one edge
63 * \param theFace - the face
64 * \param theEdge - the edge
66 //================================================================================
68 StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
69 const TopoDS_Edge& theEdge,
71 const bool theIsForward,
72 const bool theIgnoreMediumNodes)
74 list<TopoDS_Edge> edges(1,theEdge);
75 *this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward, theIgnoreMediumNodes );
78 //================================================================================
80 * \brief Constructor of a side of several edges
81 * \param theFace - the face
82 * \param theEdge - the edge
84 //================================================================================
86 StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
87 list<TopoDS_Edge>& theEdges,
89 const bool theIsForward,
90 const bool theIgnoreMediumNodes)
92 int nbEdges = theEdges.size();
93 myEdge.resize( nbEdges );
94 myEdgeID.resize( nbEdges );
95 myC2d.resize( nbEdges );
96 myC3dAdaptor.resize( nbEdges );
97 myFirst.resize( nbEdges );
98 myLast.resize( nbEdges );
99 myNormPar.resize( nbEdges );
100 myEdgeLength.resize( nbEdges );
101 myIsUniform.resize( nbEdges, true );
103 myNbPonits = myNbSegments = 0;
105 myMissingVertexNodes = false;
106 myIgnoreMediumNodes = theIgnoreMediumNodes;
107 myDefaultPnt2d = gp_Pnt2d( 1e+100, 1e+100 );
108 if ( nbEdges == 0 ) return;
110 SMESHDS_Mesh* meshDS = theMesh->GetMeshDS();
113 list<TopoDS_Edge>::iterator edge = theEdges.begin();
114 TopoDS_Iterator vExp;
115 for ( int index = 0; edge != theEdges.end(); ++index, ++edge )
117 int i = theIsForward ? index : nbEdges - index - 1;
118 myEdgeLength[i] = SMESH_Algo::EdgeLength( *edge );
119 if ( myEdgeLength[i] < DBL_MIN ) nbDegen++;
120 myLength += myEdgeLength[i];
122 myEdgeID[i] = meshDS->ShapeToIndex( *edge );
123 if ( !theIsForward ) myEdge[i].Reverse();
125 if ( theFace.IsNull() )
126 BRep_Tool::Range( *edge, myFirst[i], myLast[i] );
128 myC2d[i] = BRep_Tool::CurveOnSurface( *edge, theFace, myFirst[i], myLast[i] );
129 if ( myEdge[i].Orientation() == TopAbs_REVERSED )
130 std::swap( myFirst[i], myLast[i] );
132 if ( SMESHDS_SubMesh* sm = meshDS->MeshElements( *edge )) {
133 int nbN = sm->NbNodes();
134 if ( theIgnoreMediumNodes ) {
135 SMDS_ElemIteratorPtr elemIt = sm->GetElements();
136 if ( elemIt->more() && elemIt->next()->IsQuadratic() )
137 nbN -= sm->NbElements();
140 myNbSegments += sm->NbElements();
142 // TopExp::FirstVertex() and TopExp::LastVertex() return NULL from INTERNAL edge
143 vExp.Initialize( *edge );
144 if ( vExp.Value().Orientation() == TopAbs_REVERSED ) vExp.Next();
145 if ( SMESH_Algo::VertexNode( TopoDS::Vertex( vExp.Value()), meshDS ))
146 myNbPonits += 1; // for the first end
148 myMissingVertexNodes = true;
150 // check if edge has non-uniform parametrization (issue 0020705)
151 if ( !myC2d[i].IsNull() && myEdgeLength[i] > DBL_MIN)
153 Geom2dAdaptor_Curve A2dC( myC2d[i] );
154 double p2 = myFirst[i]+(myLast[i]-myFirst[i])/2., p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.;
155 double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
156 double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );
157 //cout<<"len = "<<len<<" d2 = "<<d2<<" fabs(2*d2/len-1.0) = "<<fabs(2*d2/len-1.0)<<endl;
158 myIsUniform[i] = !( fabs(2*d2/myEdgeLength[i]-1.0) > 0.01 || fabs(2*d4/d2-1.0) > 0.01 );
159 if ( !myIsUniform[i] )
163 Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],L,fp,lp);
164 myC3dAdaptor[i].Load( C3d, fp,lp );
168 vExp.Initialize( theEdges.back() );
169 if ( vExp.Value().Orientation() != TopAbs_REVERSED ) vExp.Next();
172 if ( SMESH_Algo::VertexNode( TopoDS::Vertex( vExp.Value()), meshDS ))
173 myNbPonits++; // for the last end
175 myMissingVertexNodes = true;
177 if ( nbEdges > 1 && myLength > DBL_MIN ) {
178 const double degenNormLen = 1.e-5;
179 double totLength = myLength;
181 totLength += myLength * degenNormLen * nbDegen;
182 double prevNormPar = 0;
183 for ( int i = 0; i < nbEdges; ++i ) {
184 if ( myEdgeLength[ i ] < DBL_MIN )
185 myEdgeLength[ i ] = myLength * degenNormLen;
186 myNormPar[ i ] = prevNormPar + myEdgeLength[i]/totLength;
187 prevNormPar = myNormPar[ i ];
190 myNormPar[nbEdges-1] = 1.;
194 //================================================================================
196 * \brief Constructor of a side for vertex using data from other FaceSide
197 * \param theVertex - the vertex
198 * \param theSide - the side
200 //================================================================================
202 StdMeshers_FaceSide::StdMeshers_FaceSide(const SMDS_MeshNode* theNode,
203 const gp_Pnt2d thePnt2d,
204 const StdMeshers_FaceSide* theSide)
208 myMesh = theSide->GetMesh();
209 myDefaultPnt2d = thePnt2d;
211 myPoints = theSide->GetUVPtStruct();
212 myNbPonits = myNbSegments = myPoints.size();
213 std::vector<uvPtStruct>::iterator it = myPoints.begin();
214 for(; it!=myPoints.end(); it++) {
215 (*it).u = thePnt2d.X();
216 (*it).v = thePnt2d.Y();
218 (*it).node = theNode;
222 //================================================================================
224 * \brief Return info on nodes on the side
225 * \retval UVPtStruct* - array of data structures
227 //================================================================================
229 const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
230 double constValue) const
232 if ( myPoints.empty() ) {
234 if ( NbEdges() == 0 ) return myPoints;
236 SMESHDS_Mesh* meshDS = myMesh->GetMeshDS();
237 SMESH_MesherHelper helper(*myMesh);
240 // sort nodes of all edges putting them into a map
242 map< double, const SMDS_MeshNode*> u2node;
244 for ( int i = 0; i < myEdge.size(); ++i )
246 // Put 1st vertex node of a current edge
247 TopoDS_Vertex VV[2]; // TopExp::FirstVertex() returns NULL for INTERNAL edge
248 for ( TopoDS_Iterator vIt(myEdge[i]); vIt.More(); vIt.Next() )
249 VV[ VV[0].IsNull() ? 0 : 1 ] = TopoDS::Vertex(vIt.Value());
250 if ( VV[0].Orientation() == TopAbs_REVERSED ) std::swap ( VV[0], VV[1] );
251 const SMDS_MeshNode* node = SMESH_Algo::VertexNode( VV[0], meshDS );
252 double prevNormPar = ( i == 0 ? 0 : myNormPar[ i-1 ]); // normalized param
253 if ( node ) { // internal nodes may be missing
254 u2node.insert( make_pair( prevNormPar, node ));
257 MESSAGE(" NO NODE on VERTEX" );
261 // Put internal nodes
262 SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] );
264 vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
265 u2nodeVec.reserve( sm->NbNodes() );
266 SMDS_NodeIteratorPtr nItr = sm->GetNodes();
267 double paramSize = myLast[i] - myFirst[i];
268 double r = myNormPar[i] - prevNormPar;
269 if ( !myIsUniform[i] )
270 while ( nItr->more() )
272 const SMDS_MeshNode* node = nItr->next();
273 if ( myIgnoreMediumNodes && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge ))
275 double u = helper.GetNodeU( myEdge[i], node, 0, ¶mOK );
276 double aLenU = GCPnts_AbscissaPoint::Length
277 ( const_cast<GeomAdaptor_Curve&>( myC3dAdaptor[i]), myFirst[i], u );
278 if ( myEdgeLength[i] < aLenU ) // nonregression test "3D_mesh_NETGEN/G6"
283 double normPar = prevNormPar + r*aLenU/myEdgeLength[i];
284 u2nodeVec.push_back( make_pair( normPar, node ));
286 nItr = sm->GetNodes();
287 if ( u2nodeVec.empty() )
288 while ( nItr->more() )
290 const SMDS_MeshNode* node = nItr->next();
291 if ( myIgnoreMediumNodes && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge ))
293 double u = helper.GetNodeU( myEdge[i], node, 0, ¶mOK );
295 // paramSize is signed so orientation is taken into account
296 double normPar = prevNormPar + r * ( u - myFirst[i] ) / paramSize;
297 u2nodeVec.push_back( make_pair( normPar, node ));
299 u2node.insert( u2nodeVec.begin(), u2nodeVec.end() );
301 // Put 2nd vertex node for a last edge
302 if ( i+1 == myEdge.size() ) {
303 node = SMESH_Algo::VertexNode( VV[1], meshDS );
305 MESSAGE(" NO NODE on VERTEX" );
308 u2node.insert( make_pair( 1., node ));
311 if ( u2node.size() != myNbPonits ) {
312 MESSAGE("Wrong node parameters on edges, u2node.size():"
313 <<u2node.size()<<" != myNbPonits:"<<myNbPonits);
317 // fill array of UVPtStruct
319 vector<uvPtStruct>* points = const_cast<vector<uvPtStruct>*>( &myPoints );
320 points->resize( myNbPonits );
323 double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ];
324 map< double, const SMDS_MeshNode*>::iterator u_node = u2node.begin();
325 for (int i = 0 ; u_node != u2node.end(); ++u_node, ++i ) {
326 UVPtStruct & uvPt = (*points)[i];
327 uvPt.node = u_node->second;
328 uvPt.x = uvPt.y = uvPt.normParam = u_node->first;
329 if ( isXConst ) uvPt.x = constValue;
330 else uvPt.y = constValue;
331 const SMDS_EdgePosition* epos =
332 dynamic_cast<const SMDS_EdgePosition*>(uvPt.node->GetPosition());
333 if (( myNormPar[ EdgeIndex ] < uvPt.normParam ) ||
334 ( epos && uvPt.node->getshapeId() != myEdgeID[ EdgeIndex ])) // for myMissingVertexNodes
336 prevNormPar = myNormPar[ EdgeIndex ];
339 if ( EdgeIndex >= myEdge.size() ) {
341 MESSAGE ( "WRONg EdgeIndex " << 1+EdgeIndex
342 << " myNormPar.size()="<<myNormPar.size()
343 << " myNormPar["<< EdgeIndex<<"]="<< myNormPar[ EdgeIndex ]
344 << " uvPt.normParam="<<uvPt.normParam );
347 paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
350 uvPt.param = epos->GetUParameter();
353 double r = ( uvPt.normParam - prevNormPar )/ paramSize;
354 // uvPt.param = myFirst[EdgeIndex] * ( 1 - r ) + myLast[EdgeIndex] * r;
355 uvPt.param = ( r > 0.5 ? myLast[EdgeIndex] : myFirst[EdgeIndex] );
357 if ( !myC2d[ EdgeIndex ].IsNull() ) {
358 gp_Pnt2d p = myC2d[ EdgeIndex ]->Value( uvPt.param );
363 uvPt.u = uvPt.v = 1e+100;
370 //================================================================================
372 * \brief Falsificate info on nodes
373 * \param nbSeg - nb of segments on the side
374 * \retval UVPtStruct* - array of data structures
376 //================================================================================
378 const vector<UVPtStruct>& StdMeshers_FaceSide::SimulateUVPtStruct(int nbSeg,
380 double constValue) const
382 if ( myFalsePoints.empty() ) {
384 if ( NbEdges() == 0 ) return myFalsePoints;
386 vector<uvPtStruct>* points = const_cast<vector<uvPtStruct>*>( &myFalsePoints );
387 points->resize( nbSeg+1 );
390 double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ];
391 for (int i = 0 ; i < myFalsePoints.size(); ++i ) {
392 double normPar = double(i) / double(nbSeg);
393 UVPtStruct & uvPt = (*points)[i];
395 uvPt.x = uvPt.y = uvPt.param = uvPt.normParam = normPar;
396 if ( isXConst ) uvPt.x = constValue;
397 else uvPt.y = constValue;
398 if ( myNormPar[ EdgeIndex ] < normPar ) {
399 prevNormPar = myNormPar[ EdgeIndex ];
401 paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
403 double r = ( normPar - prevNormPar )/ paramSize;
404 uvPt.param = myFirst[EdgeIndex] * ( 1 - r ) + myLast[EdgeIndex] * r;
405 if ( !myC2d[ EdgeIndex ].IsNull() ) {
406 gp_Pnt2d p = myC2d[ EdgeIndex ]->Value( uvPt.param );
411 uvPt.u = uvPt.v = 1e+100;
415 return myFalsePoints;
417 // gp_Pnt StdMeshers_FaceSide::Value(double U) const
421 //================================================================================
423 * \brief reverse order of vector elements
424 * \param vec - vector to reverse
426 //================================================================================
428 template <typename T > void reverse(vector<T> & vec)
430 for ( int f=0, r=vec.size()-1; f < r; ++f, --r )
431 std::swap( vec[f], vec[r] );
434 //================================================================================
436 * \brief Change orientation of side geometry
438 //================================================================================
440 void StdMeshers_FaceSide::Reverse()
442 int nbEdges = myEdge.size();
443 for ( int i = nbEdges-1; i >= 0; --i ) {
444 std::swap( myFirst[i], myLast[i] );
446 if ( i > 0 ) // at the first loop 1. is overwritten
447 myNormPar[i] = 1 - myNormPar[i-1];
453 reverse( myC3dAdaptor );
456 reverse( myNormPar );
457 reverse( myEdgeLength );
458 reverse( myIsUniform );
462 myNormPar[nbEdges-1]=1.;
464 myFalsePoints.clear();
468 //================================================================================
470 * \brief Show side features
472 //================================================================================
474 void StdMeshers_FaceSide::dump(const char* msg) const
477 if (msg) MESSAGE ( std::endl << msg );
478 MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
479 MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
480 for ( int i=0; i<myEdge.size(); ++i)
482 MESSAGE_ADD ( "\t"<<i+1 );
483 MESSAGE_ADD ( "\tEDGE: " );
484 if (myEdge[i].IsNull()) {
485 MESSAGE_ADD ( "NULL" );
488 TopAbs::Print(myEdge[i].Orientation(),cout)<<" "<<myEdge[i].TShape().operator->()<<endl;
489 MESSAGE_ADD ( "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
490 << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
492 MESSAGE_ADD ( "\tC2d: ");
494 if (myC2d[i].IsNull()) {
495 MESSAGE_ADD ( "NULL" );
498 MESSAGE_ADD ( myC2d[i].operator->() );
501 MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
502 MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
507 //================================================================================
509 * \brief Creates a Adaptor2d_Curve2d to be used in SMESH_Block
510 * \retval Adaptor2d_Curve2d* -
512 //================================================================================
514 struct Adaptor2dCurve2d : public Adaptor2d_Curve2d
516 const StdMeshers_FaceSide* mySide;
517 Adaptor2dCurve2d(const StdMeshers_FaceSide* faceSide):mySide(faceSide) {}
518 gp_Pnt2d Value(const Standard_Real U) const { return mySide->Value2d( U ); }
519 Standard_Real FirstParameter() const { return 0; }
520 Standard_Real LastParameter() const { return 1; }
523 Adaptor2d_Curve2d* StdMeshers_FaceSide::GetCurve2d() const
525 return new Adaptor2dCurve2d( this );
528 //================================================================================
530 * \brief Creates a fully functional Adaptor_Curve
532 //================================================================================
534 BRepAdaptor_CompCurve* StdMeshers_FaceSide::GetCurve3d() const
536 if ( myEdge.empty() )
539 // if ( myEdge.size() == 1 )
540 // return new BRepAdaptor_Curve( myEdge[0] );
543 BRep_Builder aBuilder;
544 aBuilder.MakeWire(aWire);
545 for ( int i=0; i<myEdge.size(); ++i )
546 aBuilder.Add( aWire, myEdge[i] );
547 return new BRepAdaptor_CompCurve( aWire );
551 //================================================================================
553 * \brief Return 2D point by normalized parameter
554 * \param U - normalized parameter value
555 * \retval gp_Pnt2d - point
557 //================================================================================
559 gp_Pnt2d StdMeshers_FaceSide::Value2d(double U) const
561 if ( !myC2d[0].IsNull() ) {
562 int i = EdgeIndex( U );
563 double prevU = i ? myNormPar[ i-1 ] : 0;
564 double r = ( U - prevU )/ ( myNormPar[ i ] - prevU );
566 double par = myFirst[i] * ( 1 - r ) + myLast[i] * r;
568 // check parametrization of curve
569 if( !myIsUniform[i] )
571 double aLen3dU = r * myEdgeLength[i] * ( myFirst[i]>myLast[i] ? -1. : 1.);
572 GCPnts_AbscissaPoint AbPnt
573 ( const_cast<GeomAdaptor_Curve&>( myC3dAdaptor[i]), aLen3dU, myFirst[i] );
574 if( AbPnt.IsDone() ) {
575 par = AbPnt.Parameter();
578 return myC2d[ i ]->Value(par);
581 return myDefaultPnt2d;
584 //================================================================================
586 * \brief Return wires of a face as StdMeshers_FaceSide's
588 //================================================================================
590 TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
591 SMESH_Mesh & theMesh,
592 const bool theIgnoreMediumNodes,
596 list< TopoDS_Edge > edges, internalEdges;
597 list< int > nbEdgesInWires;
598 int nbWires = SMESH_Block::GetOrderedEdges (theFace, V1, edges, nbEdgesInWires);
600 // split list of all edges into separate wires
601 TSideVector wires( nbWires );
602 list< int >::iterator nbE = nbEdgesInWires.begin();
603 list< TopoDS_Edge >::iterator from = edges.begin(), to = from;
604 for ( int iW = 0; iW < nbWires; ++iW, ++nbE )
606 std::advance( to, *nbE );
607 if ( *nbE == 0 ) // Issue 0020676
611 wires.resize( nbWires );
614 list< TopoDS_Edge > wireEdges( from, to );
615 // assure that there is a node on the first vertex
616 // as StdMeshers_FaceSide::GetUVPtStruct() requires
617 if ( wireEdges.front().Orientation() != TopAbs_INTERNAL ) // Issue 0020676
619 while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
620 theMesh.GetMeshDS()))
622 wireEdges.splice(wireEdges.end(), wireEdges,
623 wireEdges.begin(), ++wireEdges.begin());
624 if ( from->IsSame( wireEdges.front() )) {
626 ( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"No nodes on vertices"));
627 return TSideVector(0);
631 else if ( *nbE > 1 ) // Issue 0020676 (Face_pb_netgen.brep) - several internal edges in a wire
633 internalEdges.splice( internalEdges.end(), wireEdges, ++wireEdges.begin(), wireEdges.end());
636 StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
637 /*isForward=*/true, theIgnoreMediumNodes);
638 wires[ iW ] = StdMeshers_FaceSidePtr( wire );
641 while ( !internalEdges.empty() )
643 StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, internalEdges.back(), &theMesh,
644 /*isForward=*/true, theIgnoreMediumNodes);
645 wires.push_back( StdMeshers_FaceSidePtr( wire ));
646 internalEdges.pop_back();
651 //================================================================================
653 * \brief Return 1st vertex of the i-the edge
655 //================================================================================
657 TopoDS_Vertex StdMeshers_FaceSide::FirstVertex(int i) const
662 v = myEdge[i].Orientation() <= TopAbs_REVERSED ? // FORWARD || REVERSED
663 TopExp::FirstVertex( myEdge[i], 1 ) :
664 TopoDS::Vertex( TopoDS_Iterator( myEdge[i] ).Value() );
669 //================================================================================
671 * \brief Return last vertex of the i-the edge
673 //================================================================================
675 TopoDS_Vertex StdMeshers_FaceSide::LastVertex(int i) const
680 const TopoDS_Edge& edge = i<0 ? myEdge[ NbEdges() + i ] : myEdge[i];
681 if ( edge.Orientation() <= TopAbs_REVERSED ) // FORWARD || REVERSED
682 v = TopExp::LastVertex( edge, 1 );
684 for ( TopoDS_Iterator vIt( edge ); vIt.More(); vIt.Next() )
685 v = TopoDS::Vertex( vIt.Value() );