X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_UnstructuredGrid.cxx;h=52916ec724c12d491ed92982b26e50e30fae467b;hp=9d878c655810629fc6535305c1db79730fe19fdf;hb=5482b99d07dd144fd5be299e722f39a81de3b5be;hpb=b0a908c0d20341651771d0249fb10882f54b2aad diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 9d878c655..52916ec72 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-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 @@ -24,6 +24,7 @@ #include "SMDS_MeshVolume.hxx" #include "utilities.h" +#include "chrono.hxx" #include #include @@ -353,12 +354,12 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes, int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId) { - if((vtkCellId < 0) || (vtkCellId >= _cellIdToDownId.size())) - { - //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId=" - // << vtkCellId << " max="<< _cellIdToDownId.size()); - return -1; - } + if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size())) + { + //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId=" + // << vtkCellId << " max="<< _cellIdToDownId.size()); + return -1; + } return _cellIdToDownId[vtkCellId]; } @@ -370,12 +371,12 @@ void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId) void SMDS_UnstructuredGrid::CleanDownwardConnectivity() { - for (int i = 0; i < _downArray.size(); i++) - { - if (_downArray[i]) - delete _downArray[i]; - _downArray[i] = 0; - } + for (size_t i = 0; i < _downArray.size(); i++) + { + if (_downArray[i]) + delete _downArray[i]; + _downArray[i] = 0; + } _cellIdToDownId.clear(); } @@ -1081,8 +1082,11 @@ SMDS_MeshCell* SMDS_UnstructuredGrid::extrudeVolumeFromFace(int vtkVolId, double *coords = this->GetPoint(oldId); SMDS_MeshNode *newNode = _mesh->AddNode(coords[0], coords[1], coords[2]); newId = newNode->getVtkId(); - std::map emptyMap; - nodeQuadDomains[oldId] = emptyMap; + if (! nodeQuadDomains.count(oldId)) + { + std::map emptyMap; + nodeQuadDomains[oldId] = emptyMap; + } nodeQuadDomains[oldId][dom1_2] = newId; } orderedNodes.push_back(newId);