From e69867dda8cb507785203efa283ad21baf5ff023 Mon Sep 17 00:00:00 2001 From: akl Date: Fri, 17 May 2013 12:26:06 +0000 Subject: [PATCH] Fix to take into account qudratic edges also. --- src/OBJECT/SMESH_Object.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index c4ddc1cd0..b4fcbf6db 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -523,7 +523,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, if ( anElem == 0 ) return false; - int nbNodes = anElem->NbNodes(); + int nbNodes = anElem->NbCornerNodes(); if ( theEdgeNum < 0 || theEdgeNum > 3 || (nbNodes != 3 && nbNodes != 4) || theEdgeNum > nbNodes ) return false; @@ -531,7 +531,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, vector anIds( nbNodes ); SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); int i = 0; - while( anIter->more() ) + while( anIter->more() && i < nbNodes ) anIds[ i++ ] = anIter->next()->GetID(); if ( theEdgeNum < nbNodes - 1 ) diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index db7aafdb4..8059552fe 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -305,7 +305,7 @@ static bool findTriangles (const SMDS_MeshNode * theNode1, SMDS_ElemIteratorPtr it = theNode1->GetInverseElementIterator(); while (it->more()) { 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); } it = theNode2->GetInverseElementIterator(); -- 2.39.2