X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_VtkEdge.cxx;h=d3cf38655f7a4732cc333a39e18b176e5d25f1a9;hp=6cd006d51752510429018d70e5bd89c45acad1ba;hb=20c126bc220757c06b5576f71ed6f34ae85e3e40;hpb=8fa039a796957b302d86d90b22afc0a998573f83 diff --git a/src/SMDS/SMDS_VtkEdge.cxx b/src/SMDS/SMDS_VtkEdge.cxx index 6cd006d51..d3cf38655 100644 --- a/src/SMDS/SMDS_VtkEdge.cxx +++ b/src/SMDS/SMDS_VtkEdge.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2010-2012 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. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #include "SMDS_VtkEdge.hxx" #include "SMDS_MeshNode.hxx" #include "SMDS_Mesh.hxx" @@ -14,7 +33,7 @@ SMDS_VtkEdge::SMDS_VtkEdge() { } -SMDS_VtkEdge::SMDS_VtkEdge(std::vector nodeIds, SMDS_Mesh* mesh) +SMDS_VtkEdge::SMDS_VtkEdge(std::vector& nodeIds, SMDS_Mesh* mesh) { init(nodeIds, mesh); } @@ -23,10 +42,10 @@ SMDS_VtkEdge::~SMDS_VtkEdge() { } -void SMDS_VtkEdge::init(std::vector nodeIds, SMDS_Mesh* mesh) +void SMDS_VtkEdge::init(std::vector& nodeIds, SMDS_Mesh* mesh) { + SMDS_MeshEdge::init(); vtkUnstructuredGrid* grid = mesh->getGrid(); - myIdInShape = -1; myMeshId = mesh->getMeshId(); vtkIdType aType = VTK_LINE; if (nodeIds.size() == 3) @@ -115,8 +134,10 @@ vtkIdType SMDS_VtkEdge::GetVtkType() const const SMDS_MeshNode* SMDS_VtkEdge::GetNode(const int ind) const { - // TODO optimize !! - return SMDS_MeshElement::GetNode(ind); + vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); + vtkIdType npts, *pts; + grid->GetCellPoints( this->myVtkID, npts, pts ); + return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]); } bool SMDS_VtkEdge::IsQuadratic() const