From 767e992ba76fc5ced468ac7b02a277c01b92cfbd Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 1 Dec 2006 14:59:46 +0000 Subject: [PATCH] Move GetSizeXXX methods to usage of size_t type instead of vtkFloatingPointType --- src/CONVERTOR/VISU_Convertor.hxx | 12 ++--- src/CONVERTOR/VISU_Convertor_impl.cxx | 68 +++++++++++++-------------- src/CONVERTOR/VISU_Convertor_impl.hxx | 12 ++--- src/VISU_I/VISU_GaussPoints_i.cc | 8 ++-- src/VISU_I/VISU_Result_i.cc | 2 +- src/VISU_I/VISU_ScalarMap_i.cc | 8 ++-- src/VISU_I/VISU_Vectors_i.cc | 8 ++-- 7 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index f6564a32..286a81a1 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -308,7 +308,7 @@ public: //! Get amount of memory to build VTK representations for all existing MED entities virtual - vtkFloatingPointType + size_t GetSize() = 0; //! Get mesh for corresponding MED ENTITY @@ -319,7 +319,7 @@ public: //! Get amount of memory to build mesh for corresponding MED ENTITY virtual - vtkFloatingPointType + size_t GetMeshOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity) = 0; @@ -332,7 +332,7 @@ public: //! Get amount of memory to build mesh for corresponding MED FAMILY virtual - vtkFloatingPointType + size_t GetFamilyOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFamilyName) = 0; @@ -345,7 +345,7 @@ public: //! Get amount of memory to build mesh for corresponding MED GROUP virtual - vtkFloatingPointType + size_t GetMeshOnGroupSize(const std::string& theMeshName, const std::string& theGroupName) = 0; @@ -367,7 +367,7 @@ public: //! Get amount of memory to build mesh for corresponding MED TIMESTAMP virtual - vtkFloatingPointType + size_t GetTimeStampSize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFieldName, @@ -375,7 +375,7 @@ public: //! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD virtual - vtkFloatingPointType + size_t GetFieldOnMeshSize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFieldName) = 0; diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index c39f28fe..067ec8cb 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -2322,11 +2322,11 @@ VISU_Convertor_impl //--------------------------------------------------------------- -vtkFloatingPointType +size_t VISU_Convertor_impl ::GetSize() { - vtkFloatingPointType aResult = 0.0; + size_t aResult = 0; const VISU::TMeshMap& aMeshMap = GetMeshMap(); VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin(); for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){ @@ -2375,26 +2375,26 @@ VISU_Convertor_impl //--------------------------------------------------------------- -vtkFloatingPointType +size_t VISU_Convertor_impl ::GetMeshOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity) { TFindMeshOnEntity aFindMeshOnEntity = - FindMeshOnEntity(theMeshName,theEntity); + FindMeshOnEntity(theMeshName, theEntity); PMeshImpl aMesh = boost::get<0>(aFindMeshOnEntity); PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity); - vtkIdType aPointsSize = 3*aMesh->myNbPoints*sizeof(VISU::TCoord); - vtkIdType aNbCells = aMeshOnEntity->myNbCells; - vtkIdType aCellsSize = aMeshOnEntity->myCellsSize; + size_t aPointsSize = 3*aMesh->myNbPoints*sizeof(VISU::TCoord); + size_t aNbCells = aMeshOnEntity->myNbCells; + size_t aCellsSize = aMeshOnEntity->myCellsSize; - vtkIdType aConnectivitySize = aCellsSize*sizeof(vtkIdType); - vtkIdType aTypesSize = aNbCells*sizeof(char); - vtkIdType aLocationsSize = aNbCells*sizeof(int); + size_t aConnectivitySize = aCellsSize*sizeof(vtkIdType); + size_t aTypesSize = aNbCells*sizeof(char); + size_t aLocationsSize = aNbCells*sizeof(int); vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1; - vtkIdType aLinksSize = aMesh->myNbPoints * + size_t aLinksSize = aMesh->myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize; @@ -2417,7 +2417,7 @@ VISU_Convertor_impl //--------------------------------------------------------------- -vtkFloatingPointType +size_t VISU_Convertor_impl ::GetFamilyOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity, @@ -2429,15 +2429,15 @@ VISU_Convertor_impl PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity); PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindFamilyOnEntity); - vtkIdType aPointsSize = 3*aMesh->myNbPoints*sizeof(VISU::TCoord); - vtkIdType aNbCells = aFamily->myNbCells; - vtkIdType aCellsSize = aFamily->myCellsSize; + size_t aPointsSize = 3*aMesh->myNbPoints*sizeof(VISU::TCoord); + size_t aNbCells = aFamily->myNbCells; + size_t aCellsSize = aFamily->myCellsSize; - vtkIdType aConnectivitySize = aCellsSize*sizeof(vtkIdType); - vtkIdType aTypesSize = aNbCells*sizeof(char); - vtkIdType aLocationsSize = aNbCells*sizeof(int); + size_t aConnectivitySize = aCellsSize*sizeof(vtkIdType); + size_t aTypesSize = aNbCells*sizeof(char); + size_t aLocationsSize = aNbCells*sizeof(int); vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1; - vtkIdType aLinksSize = aMesh->myNbPoints * + size_t aLinksSize = aMesh->myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize; @@ -2477,7 +2477,7 @@ VISU_Convertor_impl } -vtkFloatingPointType +size_t VISU_Convertor_impl ::GetMeshOnGroupSize(const std::string& theMeshName, const std::string& theGroupName) @@ -2486,14 +2486,14 @@ VISU_Convertor_impl PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup); PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup); - vtkIdType aPointsSize = 3*aMesh->myNbPoints*sizeof(VISU::TCoord); + size_t aPointsSize = 3*aMesh->myNbPoints*sizeof(VISU::TCoord); TNbASizeCells aNbASizeCells = aGroup->GetNbASizeCells(); - vtkIdType aNbCells = aNbASizeCells.first; - vtkIdType aCellsSize = aNbASizeCells.second; - vtkIdType aConnectivityAndTypesSize = aCellsSize*sizeof(vtkIdType); - vtkIdType aLocationsSize = aNbCells*sizeof(int); + size_t aNbCells = aNbASizeCells.first; + size_t aCellsSize = aNbASizeCells.second; + size_t aConnectivityAndTypesSize = aCellsSize*sizeof(vtkIdType); + size_t aLocationsSize = aNbCells*sizeof(int); vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1; - vtkIdType aLinksSize = aMesh->myNbPoints * + size_t aLinksSize = aMesh->myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize; @@ -2549,7 +2549,7 @@ VISU_Convertor_impl } -vtkFloatingPointType +size_t VISU_Convertor_impl ::GetFieldOnMeshSize(const std::string& theMeshName, const VISU::TEntity& theEntity, @@ -2559,9 +2559,9 @@ VISU_Convertor_impl PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField); PFieldImpl aField = boost::get<3>(aFindField); - vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); - vtkFloatingPointType aFieldOnMeshSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType)*aField->myValField.size()*ERR_SIZE_CALC); - vtkFloatingPointType aResult = aMeshSize + aFieldOnMeshSize; + size_t aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); + size_t aFieldOnMeshSize = size_t(aField->myDataSize*sizeof(vtkFloatingPointType)*aField->myValField.size()*ERR_SIZE_CALC); + size_t aResult = aMeshSize + aFieldOnMeshSize; if(MYDEBUG) MSG(MYVTKDEBUG,"GetFieldOnMeshSize - aFieldOnMeshSize = "<