X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_VtkCellIterator.hxx;h=d1bc214d14038cae77d7299182f6e8f19cafb84c;hb=fa95110a3b64cb8323176103200e3dd17f0ed67e;hp=92fdc17a240187f3c466e85421c76222a1d573a3;hpb=b7a7d49664daa32e1befb558280e13ed0bde37c9;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_VtkCellIterator.hxx b/src/SMDS/SMDS_VtkCellIterator.hxx index 92fdc17a2..d1bc214d1 100644 --- a/src/SMDS/SMDS_VtkCellIterator.hxx +++ b/src/SMDS/SMDS_VtkCellIterator.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2022 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 @@ -25,7 +25,8 @@ #include "SMDSAbs_ElementType.hxx" #include -#include + +typedef std::vector< vtkIdType > TVtkIdList; //-------------------------------------------------------------------------------- /*! @@ -33,15 +34,15 @@ */ struct _GetVtkNodes { - _GetVtkNodes( vtkIdList* nodeIds, SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type); + _GetVtkNodes( TVtkIdList& nodeIds, SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type); }; struct _GetVtkNodesToUNV { - _GetVtkNodesToUNV( vtkIdList* nodeIds, SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type); + _GetVtkNodesToUNV( TVtkIdList& nodeIds, SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type); }; struct _GetVtkNodesPolyh { - _GetVtkNodesPolyh( vtkIdList* nodeIds, SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type); + _GetVtkNodesPolyh( TVtkIdList& nodeIds, SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type); }; //-------------------------------------------------------------------------------- @@ -54,21 +55,21 @@ class SMDS_VtkCellIterator: public SMDS_ITERATOR public: typedef typename SMDS_ITERATOR::value_type result_type; - SMDS_VtkCellIterator(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType aType) - : _mesh(mesh), _index(0), _vtkIdList( vtkIdList::New() ) + SMDS_VtkCellIterator(SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType aType) + : _mesh(mesh), _index(0) { GET_VTK_NODES getNodes( _vtkIdList, mesh, vtkCellId, aType ); } - virtual ~SMDS_VtkCellIterator() { _vtkIdList->Delete(); } - virtual bool more() { return ( _index < _vtkIdList->GetNumberOfIds() ); } + virtual ~SMDS_VtkCellIterator() {} + virtual bool more() { return ( _index < _vtkIdList.size() ); } virtual result_type next() { - vtkIdType id = _vtkIdList->GetId( _index++ ); + vtkIdType id = _vtkIdList[ _index++ ]; return static_cast( _mesh->FindNodeVtk( id )); } protected: SMDS_Mesh* _mesh; - int _index; - vtkIdList* _vtkIdList; + size_t _index; + TVtkIdList _vtkIdList; }; //-------------------------------------------------------------------------------- @@ -77,7 +78,7 @@ class SMDS_VtkCellIteratorToUNV: public SMDS_VtkCellIterator< SMDS_ITERATOR, _Ge { typedef SMDS_VtkCellIterator< SMDS_ITERATOR, _GetVtkNodesToUNV > parent_t; public: - SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type): + SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type): parent_t( mesh, vtkCellId, type ) {} }; @@ -87,7 +88,7 @@ class SMDS_VtkCellIteratorPolyH: public SMDS_VtkCellIterator< SMDS_ITERATOR, _Ge { typedef SMDS_VtkCellIterator< SMDS_ITERATOR, _GetVtkNodesPolyh > parent_t; public: - SMDS_VtkCellIteratorPolyH(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type): + SMDS_VtkCellIteratorPolyH(SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type): parent_t( mesh, vtkCellId, type ) {} };