Salome HOME
21680: EDF 2288 SMESH: creation of 0D elements from other elements
[modules/smesh.git] / src / SMDS / SMDS_VtkEdge.cxx
index d39aff052c7ddd0a921583641fc1391cf47afbfb..cb324014ec4b58fc8f1023a0542b96c28917acc1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -134,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