]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Move GetSizeXXX methods to usage of size_t type instead of vtkFloatingPointType
authorapo <apo@opencascade.com>
Fri, 1 Dec 2006 14:59:46 +0000 (14:59 +0000)
committerapo <apo@opencascade.com>
Fri, 1 Dec 2006 14:59:46 +0000 (14:59 +0000)
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_Vectors_i.cc

index f6564a32e3566248101f39867c8adf01dd4f6d66..286a81a144c69b4e9fa810c8f2faca8c985ae189 100644 (file)
@@ -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;
index c39f28fecda312d79f99b1df6114e6eeaf3003a1..067ec8cb1ad56065d3ffd3ba203289f971348027 100644 (file)
@@ -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 = "<<vtkFloatingPointType(aFieldOnMeshSize));
   MSG(MYDEBUG,"GetFieldOnMeshSize - aResult = "<<vtkFloatingPointType(aResult)<<"; theMeshName = '"<<theMeshName<<
@@ -2599,7 +2599,7 @@ VISU_Convertor_impl
 }
 
 
-vtkFloatingPointType
+size_t
 VISU_Convertor_impl
 ::GetTimeStampSize(const std::string& theMeshName, 
                   const VISU::TEntity& theEntity,
@@ -2611,9 +2611,9 @@ VISU_Convertor_impl
   PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindTimeStamp);
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
   
-  vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
-  vtkFloatingPointType aTimeStampSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC);
-  vtkFloatingPointType aResult = aMeshSize + aTimeStampSize;
+  size_t aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
+  size_t aTimeStampSize = size_t(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC);
+  size_t aResult = aMeshSize + aTimeStampSize;
 
   MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "<<vtkFloatingPointType(aTimeStampSize));
   MSG(MYDEBUG,"GetTimeStampSize - aResult = "<<vtkFloatingPointType(aResult)<<
index 6069283339856526210bf76e02700e45f765b0f6..40b90c3234f9a9aab77c62500cbc77f39cc6d4a3 100644 (file)
@@ -815,7 +815,7 @@ public:
 
   //! Implemention of the VISU_Convertor::GetSize
   virtual 
-  vtkFloatingPointType
+  size_t
   GetSize();
 
   //! Implemention of the VISU_Convertor::GetMeshOnEntity
@@ -826,7 +826,7 @@ public:
 
   //! Implemention of the VISU_Convertor::GetMeshOnEntitySize
   virtual 
-  vtkFloatingPointType 
+  size_t 
   GetMeshOnEntitySize(const std::string& theMeshName, 
                       const VISU::TEntity& theEntity);
 
@@ -839,7 +839,7 @@ public:
 
   //! Implemention of the VISU_Convertor::GetFamilyOnEntitySize
   virtual 
-  vtkFloatingPointType 
+  size_t 
   GetFamilyOnEntitySize(const std::string& theMeshName, 
                        const VISU::TEntity& theEntity,
                        const std::string& theFamilyName);
@@ -852,7 +852,7 @@ public:
   
   //! Implemention of the VISU_Convertor::GetMeshOnGroupSize
   virtual 
-  vtkFloatingPointType 
+  size_t 
   GetMeshOnGroupSize(const std::string& theMeshName, 
                     const std::string& theGroupName);
 
@@ -866,7 +866,7 @@ public:
 
   //! Implemention of the VISU_Convertor::GetTimeStampSize
   virtual 
-  vtkFloatingPointType 
+  size_t 
   GetTimeStampSize(const std::string& theMeshName, 
                   const VISU::TEntity& theEntity,
                   const std::string& theFieldName,
@@ -882,7 +882,7 @@ public:
   
   //! Implemention of the VISU_Convertor::GetFieldOnMeshSize
   virtual 
-  vtkFloatingPointType 
+  size_t 
   GetFieldOnMeshSize(const std::string& theMeshName, 
                     const VISU::TEntity& theEntity,
                     const std::string& theFieldName);
index 24d3faee07d1e4937df2bbcdabb2afc8d99b9196..b1b2042f0860c333cbfe4d109ed7a067c8ba244f 100644 (file)
@@ -67,10 +67,10 @@ VISU::GaussPoints_i
     size_t aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false);
     if(theIsMemoryCheck && aResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
-      float aSize = anInput->GetTimeStampSize(theMeshName,
-                                             (VISU::TEntity)theEntity,
-                                             theFieldName,
-                                             theTimeStampNumber);
+      size_t aSize = anInput->GetTimeStampSize(theMeshName,
+                                              (VISU::TEntity)theEntity,
+                                              theFieldName,
+                                              theTimeStampNumber);
       aSize *= INCMEMORY;
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
       if(MYDEBUG) 
index ef12cf31e6c85f277eb1908db4b4755a6512da41..0587f81d904c4c006f3586cc7c33e5e959758bd2 100644 (file)
@@ -929,7 +929,7 @@ VISU::Result_i
 ::IsPossible()
 {
   try{
-    float aSize = myInput->GetSize();
+    size_t aSize = myInput->GetSize();
     size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
     return aResult;
index 727d703a2b593a98690cd6dd53243535f65c56cd..99e2ccb39cf17a1e13fda315222df264dd0c1f93 100644 (file)
@@ -60,10 +60,10 @@ VISU::ScalarMap_i
   try{
     if(theResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
-      float aSize = anInput->GetTimeStampSize(theMeshName,
-                                             (VISU::TEntity)theEntity,
-                                             theFieldName,
-                                             theTimeStampNumber);
+      size_t aSize = anInput->GetTimeStampSize(theMeshName,
+                                              (VISU::TEntity)theEntity,
+                                              theFieldName,
+                                              theTimeStampNumber);
       aSize *= INCMEMORY;
       aResult = 1;
       if(theIsMemoryCheck){
index fb73be755a1507d43fcfb8a239482c72498c1eeb..1e0ae1f3237a5ceab7f35f088a9da48bd28f5067 100644 (file)
@@ -63,10 +63,10 @@ VISU::Vectors_i
                                             false);
     if(theIsMemoryCheck && aResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
-      float aSize = anInput->GetTimeStampSize(theMeshName,
-                                             (VISU::TEntity)theEntity,
-                                             theFieldName,
-                                             theTimeStampNumber);
+      size_t aSize = anInput->GetTimeStampSize(theMeshName,
+                                              (VISU::TEntity)theEntity,
+                                              theFieldName,
+                                              theTimeStampNumber);
       aSize *= INCMEMORY;
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
       if(MYDEBUG)