0021472: EDF 2080 SMESH: Projection1D2D on a Voronoi structure fails

fix GetOrderedNodes() to work if not all edges are meshed
This commit is contained in:
eap 2012-01-18 12:02:44 +00:00
parent 4f5cf5faab
commit 8a81427a0c

View File

@ -257,8 +257,8 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
}
// Put internal nodes
SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] );
if ( !sm ) continue;
if ( SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] ))
{
vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
u2nodeVec.reserve( sm->NbNodes() );
SMDS_NodeIteratorPtr nItr = sm->GetNodes();
@ -296,6 +296,7 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
}
for ( size_t j = 0; j < u2nodeVec.size(); ++j )
u2node.insert( u2node.end(), u2nodeVec[j] );
}
// Put 2nd vertex node for a last edge
if ( i+1 == myEdge.size() ) {
@ -450,8 +451,8 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes() const
}
// Put internal nodes
SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] );
if ( !sm ) continue;
if ( SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] ))
{
SMDS_NodeIteratorPtr nItr = sm->GetNodes();
double paramSize = myLast[i] - myFirst[i];
double r = myNormPar[i] - prevNormPar;
@ -466,6 +467,7 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes() const
double normPar = prevNormPar + r * ( u - myFirst[i] ) / paramSize;
u2node.insert( u2node.end(), make_pair( normPar, node ));
}
}
// Put 2nd vertex node for a last edge
if ( i+1 == myEdge.size() ) {