IPAL52438: Projection 2D fails

Merge w/o parameter check if nb of existing and new nodes is same
This commit is contained in:
eap 2014-07-03 16:09:34 +04:00
parent 6440fc57c2
commit 9e3a675848

View File

@ -4018,26 +4018,41 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh,
map< double, const SMDS_MeshNode* >::iterator u2n = ++paramsOfNodes.begin(); map< double, const SMDS_MeshNode* >::iterator u2n = ++paramsOfNodes.begin();
map< double, const SMDS_MeshNode* >::iterator u2nEnd = --paramsOfNodes.end(); map< double, const SMDS_MeshNode* >::iterator u2nEnd = --paramsOfNodes.end();
TPoint* p; TPoint* p;
const double tolFact = ( paramsOfNodes.size() == points.size() ) ? 0.3 : 0.05; if ( paramsOfNodes.size() == points.size() )
while ( u2n != u2nEnd && pItF != points.end() )
{ {
const double u = u2n->first; for ( ; u2n != u2nEnd; ++u2n )
const SMDS_MeshNode* n = u2n->second;
const double tol = ( (++u2n)->first - u ) * tolFact;
do
{ {
p = ( isForward ? *pItF : *pItR ); p = ( isForward ? *pItF : *pItR );
if ( Abs( u - p->myU ) < tol ) int pIndex = p - &myPoints[0];
{ if ( !nodesVector [ pIndex ] )
int pIndex = p - &myPoints[0]; nodesVector [ pIndex ] = u2n->second;
if ( !nodesVector [ pIndex ] ) ++pItF;
nodesVector [ pIndex ] = n; ++pItR;
++pItF; }
++pItR; }
break; else
} {
const double tolFact = 0.05;
while ( u2n != u2nEnd && pItF != points.end() )
{
const double u = u2n->first;
const SMDS_MeshNode* n = u2n->second;
const double tol = ( (++u2n)->first - u ) * tolFact;
do
{
p = ( isForward ? *pItF : *pItR );
if ( Abs( u - p->myU ) < tol )
{
int pIndex = p - &myPoints[0];
if ( !nodesVector [ pIndex ] )
nodesVector [ pIndex ] = n;
++pItF;
++pItR;
break;
}
}
while ( p->myU < u && ( ++pItF, ++pItR != points.rend() ));
} }
while ( p->myU < u && ( ++pItF, ++pItR != points.rend() ));
} }
break; break;
} }