SALOME_TESTS/Grids/smesh/mesh_Projection_2D_00/A0

Fix getCorners() for a closed split EDGE
This commit is contained in:
eap 2014-04-28 17:09:09 +04:00
parent a913b7ad54
commit ba2a04ef34

View File

@ -1134,44 +1134,27 @@ FaceQuadStruct::Ptr StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh &
{ {
list< TopoDS_Edge > sideEdges; list< TopoDS_Edge > sideEdges;
TopoDS_Vertex nextSideV = corners[( iSide + 1 - nbUsedDegen ) % corners.size() ]; TopoDS_Vertex nextSideV = corners[( iSide + 1 - nbUsedDegen ) % corners.size() ];
while ( edgeIt != edges.end() && bool nextSideVReached = false;
!nextSideV.IsSame( myHelper->IthVertex( 0, *edgeIt ))) do
{ {
if ( SMESH_Algo::isDegenerated( *edgeIt ) ) const TopoDS_Edge& edge = *edgeIt;
if ( SMESH_Algo::isDegenerated( edge ) && myNeedSmooth )
{ {
if ( myNeedSmooth ) // no side on a degenerated EDGE
{
++edgeIt; // no side on the degenerated EDGE
} }
else else
{ {
if ( sideEdges.empty() ) sideEdges.push_back( edge );
{ nextSideVReached = nextSideV.IsSame( myHelper->IthVertex( 1, edge ));
++nbUsedDegen;
sideEdges.push_back( *edgeIt++ ); // a degenerated side
break;
}
else
{
break; // do not append a degenerated EDGE to a regular side
}
}
}
else
{
sideEdges.push_back( *edgeIt++ );
} }
++edgeIt;
} }
while ( edgeIt != edges.end() && !nextSideVReached );
if ( !sideEdges.empty() ) if ( !sideEdges.empty() )
{ {
quad->side.push_back( StdMeshers_FaceSide::New( F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE, quad->side.push_back
ignoreMediumNodes, myProxyMesh )); ( StdMeshers_FaceSide::New( F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
++iSide;
}
else if ( !SMESH_Algo::isDegenerated( *edgeIt ) && // closed EDGE
myHelper->IthVertex( 0, *edgeIt ).IsSame( myHelper->IthVertex( 1, *edgeIt )))
{
quad->side.push_back( StdMeshers_FaceSide::New( F, *edgeIt++, &aMesh, iSide < QUAD_TOP_SIDE,
ignoreMediumNodes, myProxyMesh )); ignoreMediumNodes, myProxyMesh ));
++iSide; ++iSide;
} }
@ -4281,7 +4264,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
if ( nbCorners == 3 ) if ( nbCorners == 3 )
vMap.Add( triaVertex ); vMap.Add( triaVertex );
multimap<double, TopoDS_Vertex>::reverse_iterator a2v = vertexByAngle.rbegin(); multimap<double, TopoDS_Vertex>::reverse_iterator a2v = vertexByAngle.rbegin();
for ( ; a2v != vertexByAngle.rend() && vMap.Extent() < nbCorners; ++a2v ) for ( int iC = 0; a2v != vertexByAngle.rend() && iC < nbCorners; ++a2v, ++iC )
vMap.Add( (*a2v).second ); vMap.Add( (*a2v).second );
// check if there are possible variations in choosing corners // check if there are possible variations in choosing corners