From: eap Date: Mon, 29 Jul 2013 12:15:22 +0000 (+0000) Subject: Fix GetNodeIndex() for polygon X-Git-Tag: V7_3_0a1~242 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c17253baf7fb323aa6813115204624314e6e749c;p=modules%2Fsmesh.git Fix GetNodeIndex() for polygon --- diff --git a/src/SMDS/SMDS_VtkVolume.cxx b/src/SMDS/SMDS_VtkVolume.cxx index 22f5de67e..7acdbf37c 100644 --- a/src/SMDS/SMDS_VtkVolume.cxx +++ b/src/SMDS/SMDS_VtkVolume.cxx @@ -462,14 +462,13 @@ int SMDS_VtkVolume::GetNodeIndex( const SMDS_MeshNode* node ) const vtkIdType nFaces = 0; vtkIdType* ptIds = 0; grid->GetFaceStream(this->myVtkID, nFaces, ptIds); - int id = 0, nbPoints = 0; + int id = 0; for (int iF = 0; iF < nFaces; iF++) { int nodesInFace = ptIds[id]; for ( vtkIdType i = 0; i < nodesInFace; ++i ) - if ( ptIds[id+i] == node->getVtkId() ) + if ( ptIds[id+i+1] == node->getVtkId() ) return id+i-iF; - nbPoints += nodesInFace; id += (nodesInFace + 1); } return -1;