From: eap Date: Tue, 19 May 2009 15:16:23 +0000 (+0000) Subject: in GetNodeParamOnEdge(), take into account that nodes on vertices not X-Git-Tag: V5_1_2rc1~39 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=24f41d7b2b07230bc2df821c40caf1f4c0f05495;hp=91d01b7efe6062e93c5ad121a4d4bad58e00d2b1 in GetNodeParamOnEdge(), take into account that nodes on vertices not always present, e.g. when Composite side discretisation is used --- diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 7398cf856..c44010450 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -335,16 +335,18 @@ bool SMESH_Algo::GetNodeParamOnEdge(const SMESHDS_Mesh* theMesh, return false; const SMDS_EdgePosition* epos = static_cast(node->GetPosition().get()); - paramSet.insert( epos->GetUParameter() ); - ++nbEdgeNodes; + if ( !paramSet.insert( epos->GetUParameter() ).second ) + return false; // equal parameters } } // add vertex nodes params - Standard_Real f, l; - BRep_Tool::Range(theEdge, f, l); - paramSet.insert( f ); - paramSet.insert( l ); - if ( paramSet.size() != nbEdgeNodes + 2 ) + TopoDS_Vertex V1,V2; + TopExp::Vertices( theEdge, V1, V2); + if ( VertexNode( V1, theMesh ) && + !paramSet.insert( BRep_Tool::Parameter(V1,theEdge) ).second ) + return false; // there are equal parameters + if ( VertexNode( V2, theMesh ) && + !paramSet.insert( BRep_Tool::Parameter(V2,theEdge) ).second ) return false; // there are equal parameters // fill the vector @@ -488,7 +490,7 @@ GeomAbs_Shape SMESH_Algo::Continuity(const TopoDS_Edge & E1, //================================================================================ const SMDS_MeshNode* SMESH_Algo::VertexNode(const TopoDS_Vertex& V, - SMESHDS_Mesh* meshDS) + const SMESHDS_Mesh* meshDS) { if ( SMESHDS_SubMesh* sm = meshDS->MeshElements(V) ) { SMDS_NodeIteratorPtr nIt= sm->GetNodes();