Fix to take into account qudratic edges also.

This commit is contained in:
akl 2013-05-17 12:26:06 +00:00
parent 7c9cf53741
commit e69867dda8
2 changed files with 3 additions and 3 deletions

View File

@ -523,7 +523,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
if ( anElem == 0 ) if ( anElem == 0 )
return false; return false;
int nbNodes = anElem->NbNodes(); int nbNodes = anElem->NbCornerNodes();
if ( theEdgeNum < 0 || theEdgeNum > 3 || (nbNodes != 3 && nbNodes != 4) || theEdgeNum > nbNodes ) if ( theEdgeNum < 0 || theEdgeNum > 3 || (nbNodes != 3 && nbNodes != 4) || theEdgeNum > nbNodes )
return false; return false;
@ -531,7 +531,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
vector<int> anIds( nbNodes ); vector<int> anIds( nbNodes );
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
int i = 0; int i = 0;
while( anIter->more() ) while( anIter->more() && i < nbNodes )
anIds[ i++ ] = anIter->next()->GetID(); anIds[ i++ ] = anIter->next()->GetID();
if ( theEdgeNum < nbNodes - 1 ) if ( theEdgeNum < nbNodes - 1 )

View File

@ -305,7 +305,7 @@ static bool findTriangles (const SMDS_MeshNode * theNode1,
SMDS_ElemIteratorPtr it = theNode1->GetInverseElementIterator(); SMDS_ElemIteratorPtr it = theNode1->GetInverseElementIterator();
while (it->more()) { while (it->more()) {
const SMDS_MeshElement* elem = it->next(); const SMDS_MeshElement* elem = it->next();
if (elem->GetType() == SMDSAbs_Face && elem->NbNodes() == 3) if (elem->GetType() == SMDSAbs_Face && elem->NbCornerNodes() == 3)
emap.insert(elem); emap.insert(elem);
} }
it = theNode2->GetInverseElementIterator(); it = theNode2->GetInverseElementIterator();