From: eap Date: Fri, 19 Nov 2010 07:15:47 +0000 (+0000) Subject: 020716: EDF 1229 SMESH : Improvement of reversed edges dialog box X-Git-Tag: tag_Before_ViscLayers_PrototypeVersion~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=39c4288807d412224554c382fb6ecaa204a95016;p=modules%2Fsmesh.git 020716: EDF 1229 SMESH : Improvement of reversed edges dialog box fix taking into account ( reversing edges + hyp propagation ) --- diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 77376ddb6..951414c53 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -974,18 +974,19 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t list< double > params; bool reversed = false; if ( theMesh.GetShapeToMesh().ShapeType() >= TopAbs_WIRE ) { + // if the shape to mesh is WIRE or EDGE reversed = ( EE.Orientation() == TopAbs_REVERSED ); } if ( !_mainEdge.IsNull() ) { + // take into account reversing the edge the hypothesis is propagated from reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED ); + int mainID = meshDS->ShapeToIndex(_mainEdge); + if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end()) + reversed = !reversed; } - else if ( _revEdgesIDs.size() > 0 ) { - for ( int i = 0; i < _revEdgesIDs.size(); i++) { - if ( _revEdgesIDs[i] == shapeID ) { - reversed = !reversed; - } - } - } + // take into account this edge reversing + if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), shapeID) != _revEdgesIDs.end()) + reversed = !reversed; BRepAdaptor_Curve C3d( E ); double length = EdgeLength( E );