X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshNode.cxx;h=3bd528bb766e2a5087596d7a1a5808e8605da430;hp=80bbf81c84a68f50461f0c76fe506357d3ce0d18;hb=df9cc07c95bbe75654ed43634939a133ccebe2f6;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index 80bbf81c8..3bd528bb7 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // 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 @@ -126,7 +126,7 @@ void SMDS_MeshNode::SetPosition(const SMDS_PositionPtr& aPos) const SMDS_PositionPtr& SMDS_MeshNode::GetPosition() const { - return myPosition; + return myPosition; } //======================================================================= @@ -149,30 +149,26 @@ public: SMDS_MeshNode_MyInvIterator(SMDS_Mesh *mesh, vtkIdType* cells, int ncells, SMDSAbs_ElementType type) : myMesh(mesh), myCells(cells), myNcells(ncells), myType(type), iter(0) { - //MESSAGE("SMDS_MeshNode_MyInvIterator : ncells " << myNcells); - cellList.clear(); + cellList.reserve( ncells ); if (type == SMDSAbs_All) + cellList.assign( cells, cells + ncells ); + else for (int i = 0; i < ncells; i++) - cellList.push_back(cells[i]); - else for (int i = 0; i < ncells; i++) { int vtkId = cells[i]; int smdsId = myMesh->fromVtkToSmds(vtkId); const SMDS_MeshElement* elem = myMesh->FindElement(smdsId); if (elem->GetType() == type) - { - //MESSAGE("Add element vtkId " << vtkId << " " << elem->GetType()) - cellList.push_back(vtkId); - } + { + cellList.push_back(vtkId); + } } - myCells = &cellList[0]; + myCells = cellList.empty() ? 0 : &cellList[0]; myNcells = cellList.size(); - //MESSAGE("myNcells="<