X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_VtkFace.cxx;h=c0bf69cc766d0cde482af656c7624f613cd507ba;hp=56787bda0c232b07520ca874f95269b23a248763;hb=1821a9c35f90be93d3d55b1e1db9114902eaf6f8;hpb=c2c0a21343037194c319d5aa6674e89a22e9c7a5 diff --git a/src/SMDS/SMDS_VtkFace.cxx b/src/SMDS/SMDS_VtkFace.cxx index 56787bda0..c0bf69cc7 100644 --- a/src/SMDS/SMDS_VtkFace.cxx +++ b/src/SMDS/SMDS_VtkFace.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -161,6 +161,22 @@ SMDS_VtkFace::GetNode(const int ind) const return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]); } +/*! + * \brief Check if a node belongs to the element + * \param node - the node to check + * \retval int - node index within the element, -1 if not found + */ +int SMDS_VtkFace::GetNodeIndex( const SMDS_MeshNode* node ) const +{ + vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); + vtkIdType npts, *pts; + grid->GetCellPoints( this->myVtkID, npts, pts ); + for ( vtkIdType i = 0; i < npts; ++i ) + if ( pts[i] == node->getVtkId() ) + return i; + return -1; +} + bool SMDS_VtkFace::IsQuadratic() const { vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();