X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshCell.hxx;h=413b1265ab6e3f729e8f6587a16de5e33e88deb1;hb=9dd045b97c68174d7ce52d592b239c6a1769e464;hp=85cc7475e1b90f8191bfd6db02e3f97a6982df32;hpb=6bac08c1a81f34d3f21c550bd92f83654b2546a5;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_MeshCell.hxx b/src/SMDS/SMDS_MeshCell.hxx index 85cc7475e..413b1265a 100644 --- a/src/SMDS/SMDS_MeshCell.hxx +++ b/src/SMDS/SMDS_MeshCell.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2016 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 @@ -33,7 +33,7 @@ public: virtual ~SMDS_MeshCell(); virtual bool ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)= 0; - virtual bool vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes) {return true; } + virtual bool vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes) { return true; } static VTKCellType toVtkType (SMDSAbs_EntityType vtkType); static SMDSAbs_EntityType toSmdsType(VTKCellType vtkType); @@ -45,18 +45,29 @@ public: static const std::vector& fromVtkOrder(VTKCellType vtkType); static const std::vector& fromVtkOrder(SMDSAbs_EntityType smdsType); - static const std::vector& reverseSmdsOrder(SMDSAbs_EntityType smdsType); - static const std::vector& interlacedSmdsOrder(SMDSAbs_EntityType smdsType); + static const std::vector& reverseSmdsOrder(SMDSAbs_EntityType smdsType, + const size_t nbNodes=0); + static const std::vector& interlacedSmdsOrder(SMDSAbs_EntityType smdsType, + const size_t nbNodes=0); - template< class VECT > + template< class VECT > // interlacedIDs[i] = smdsIDs[ indices[ i ]] static void applyInterlace( const std::vector& interlace, VECT & data) { - if ( interlace.empty() ) return; + if ( interlace.size() < data.size() ) return; VECT tmpData( data.size() ); for ( size_t i = 0; i < data.size(); ++i ) tmpData[i] = data[ interlace[i] ]; data.swap( tmpData ); } + template< class VECT > // interlacedIDs[ indices[ i ]] = smdsIDs[i] + static void applyInterlaceRev( const std::vector& interlace, VECT & data) + { + if ( interlace.size() < data.size() ) return; + VECT tmpData( data.size() ); + for ( size_t i = 0; i < data.size(); ++i ) + tmpData[ interlace[i] ] = data[i]; + data.swap( tmpData ); + } static int nbCells;