X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_Mesh0DElement.cxx;h=95438eab06489782eb060766051d2ef23861e0d2;hp=6f1c7f83f41e2cd9ec4f4fd16c3bd8bb2a41d924;hb=11bba48d41633960431c5ead19671abae3cf1d98;hpb=5d68554076bbca0e1e95fb0db215a6c2b84b6c54 diff --git a/src/SMDS/SMDS_Mesh0DElement.cxx b/src/SMDS/SMDS_Mesh0DElement.cxx index 6f1c7f83f..95438eab0 100644 --- a/src/SMDS/SMDS_Mesh0DElement.cxx +++ b/src/SMDS/SMDS_Mesh0DElement.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 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 @@ -28,6 +28,8 @@ #include "SMDS_Mesh0DElement.hxx" #include "SMDS_IteratorOfElements.hxx" #include "SMDS_MeshNode.hxx" +#include "SMDS_Mesh.hxx" + #include "utilities.h" using namespace std; @@ -139,8 +141,24 @@ const SMDS_MeshNode* SMDS_Mesh0DElement::GetNode(const int ind) const //function : ChangeNode //purpose : //======================================================================= -bool SMDS_Mesh0DElement::ChangeNode (const SMDS_MeshNode * node) +bool SMDS_Mesh0DElement::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes) { - myNode = node; - return true; + if ( nbNodes == 1 ) + { + vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); + vtkIdType npts = 0; + vtkIdType* pts = 0; + grid->GetCellPoints(myVtkID, npts, pts); + if (nbNodes != npts) + { + MESSAGE("ChangeNodes problem: not the same number of nodes " << npts << " -> " << nbNodes); + return false; + } + myNode = nodes[0]; + pts[0] = myNode->getVtkId(); + + SMDS_Mesh::_meshList[myMeshId]->setMyModified(); + return true; + } + return false; }