Salome HOME
Porting to VTK 6.
[modules/visu.git] / src / CONVERTOR / VISU_Convertor_impl.cxx
index 814acd81c62be025c17ea2e13bd8cfaad6c9c09f..a5b7250ae8f47a3dc5b67b6fa0d09a267f236b12 100644 (file)
@@ -55,7 +55,7 @@
 
 #include <memory>
 
-static vtkFloatingPointType ERR_SIZE_CALC = 1.00;
+static double ERR_SIZE_CALC = 1.00;
 
 static int MYVTKDEBUG = 0;
 
@@ -568,15 +568,15 @@ namespace
   PrintMemorySize(vtkUnstructuredGrid* theDataSet)
   {
     theDataSet->Update();
-    BEGMSG(1,"GetPoints() = "<<vtkFloatingPointType(theDataSet->GetPoints()->GetActualMemorySize()*1000)<<endl);
-    BEGMSG(1,"GetCells() = "<<vtkFloatingPointType(theDataSet->GetCells()->GetActualMemorySize()*1000)<<endl);
-    BEGMSG(1,"GetCellTypesArray() = "<<vtkFloatingPointType(theDataSet->GetCellTypesArray()->GetActualMemorySize()*1000)<<endl);
-    BEGMSG(1,"GetCellLocationsArray() = "<<vtkFloatingPointType(theDataSet->GetCellLocationsArray()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetPoints() = "<<double(theDataSet->GetPoints()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetCells() = "<<double(theDataSet->GetCells()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetCellTypesArray() = "<<double(theDataSet->GetCellTypesArray()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetCellLocationsArray() = "<<double(theDataSet->GetCellLocationsArray()->GetActualMemorySize()*1000)<<endl);
     theDataSet->BuildLinks();
-    BEGMSG(1,"GetCellLinks() = "<<vtkFloatingPointType(theDataSet->GetCellLinks()->GetActualMemorySize()*1000)<<endl);
-    BEGMSG(1,"GetPointData() = "<<vtkFloatingPointType(theDataSet->GetPointData()->GetActualMemorySize()*1000)<<endl);
-    BEGMSG(1,"GetCellData() = "<<vtkFloatingPointType(theDataSet->GetCellData()->GetActualMemorySize()*1000)<<endl);
-    BEGMSG(1,"GetActualMemorySize() = "<<vtkFloatingPointType(theDataSet->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetCellLinks() = "<<double(theDataSet->GetCellLinks()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetPointData() = "<<double(theDataSet->GetPointData()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetCellData() = "<<double(theDataSet->GetCellData()->GetActualMemorySize()*1000)<<endl);
+    BEGMSG(1,"GetActualMemorySize() = "<<double(theDataSet->GetActualMemorySize()*1000)<<endl);
   }
 }
 
@@ -984,10 +984,10 @@ VISU_Convertor_impl
         GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
         anOutput->Update();
         if(theEntity == VISU::NODE_ENTITY)
-          BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+          BEGMSG(MYVTKDEBUG,"GetPointData() = "<<double(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
         else
-          BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
-        BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
+          BEGMSG(MYVTKDEBUG,"GetCellData() = "<<double(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+        BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<double(anOutput->GetActualMemorySize()*1000)<<endl);
       }
       }
 #ifndef _DEXCEPT_
@@ -1073,10 +1073,10 @@ VISU_Convertor_impl
         GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
         anOutput->Update();
         if(theEntity == VISU::NODE_ENTITY)
-          BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+          BEGMSG(MYVTKDEBUG,"GetPointData() = "<<double(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
         else
-          BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
-        BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
+          BEGMSG(MYVTKDEBUG,"GetCellData() = "<<double(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+        BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<double(anOutput->GetActualMemorySize()*1000)<<endl);
       }
     }
 #ifndef _DEXCEPT_
@@ -1201,7 +1201,7 @@ VISU_Convertor_impl
       aResult += GetMeshOnEntitySize(aMeshName,anEntity);
     }
   }
-  MSG(MYDEBUG,"GetSize - aResult = "<<vtkFloatingPointType(aResult));
+  MSG(MYDEBUG,"GetSize - aResult = "<<double(aResult));
   return aResult;
 }
 
@@ -1225,22 +1225,22 @@ VISU_Convertor_impl
   size_t aConnectivitySize = aCellsSize*sizeof(vtkIdType);
   size_t aTypesSize = aNbCells*sizeof(char);
   size_t aLocationsSize = aNbCells*sizeof(int);
-  vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+  double aNbCellsPerPoint = aCellsSize / aNbCells - 1;
   size_t aLinksSize = aMesh->GetNbPoints() * 
     (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link));
   aLinksSize = 0;
   size_t aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
 
   MSG(MYDEBUG,"GetMeshOnEntitySize "<<
-      "- aResult = "<<vtkFloatingPointType(aResult)<<
+      "- aResult = "<<double(aResult)<<
       "; theMeshName = '"<<theMeshName<<"'"<<
       "; theEntity = "<<theEntity);
   if(MYDEBUG){
-    INITMSG(MYVTKDEBUG,"- aPointsSize = "<<vtkFloatingPointType(aPointsSize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<vtkFloatingPointType(aConnectivitySize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<vtkFloatingPointType(aTypesSize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<vtkFloatingPointType(aLocationsSize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<vtkFloatingPointType(aLinksSize)<<"\n");
+    INITMSG(MYVTKDEBUG,"- aPointsSize = "<<double(aPointsSize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<double(aConnectivitySize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<double(aTypesSize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<double(aLocationsSize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<double(aLinksSize)<<"\n");
   }
 
   aResult = size_t(aResult*ERR_SIZE_CALC);
@@ -1268,23 +1268,23 @@ VISU_Convertor_impl
   size_t aConnectivitySize = aCellsSize*sizeof(vtkIdType);
   size_t aTypesSize = aNbCells*sizeof(char);
   size_t aLocationsSize = aNbCells*sizeof(int);
-  vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+  double aNbCellsPerPoint = aCellsSize / aNbCells - 1;
   size_t aLinksSize = aMesh->GetNbPoints() * 
     (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link));
   aLinksSize = 0;
   size_t aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
 
   MSG(MYDEBUG,"GetFamilyOnEntitySize "<<
-      "- aResult = "<<vtkFloatingPointType(aResult)<<
+      "- aResult = "<<double(aResult)<<
       "; theMeshName = '"<<theMeshName<<"'"<<
       "; theEntity = "<<theEntity<<
       "; theFamilyName = '"<<theFamilyName<<"'");
   if(MYDEBUG){
-    INITMSG(MYVTKDEBUG,"- aPointsSize = "<<vtkFloatingPointType(aPointsSize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<vtkFloatingPointType(aConnectivitySize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<vtkFloatingPointType(aTypesSize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<vtkFloatingPointType(aLocationsSize)<<"\n");
-    BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<vtkFloatingPointType(aLinksSize)<<"\n");
+    INITMSG(MYVTKDEBUG,"- aPointsSize = "<<double(aPointsSize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<double(aConnectivitySize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<double(aTypesSize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<double(aLocationsSize)<<"\n");
+    BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<double(aLinksSize)<<"\n");
   }
 
   aResult = size_t(aResult*ERR_SIZE_CALC);
@@ -1324,18 +1324,18 @@ VISU_Convertor_impl
   size_t aCellsSize = aNbASizeCells.second;
   size_t aConnectivityAndTypesSize = aCellsSize*sizeof(vtkIdType);
   size_t aLocationsSize = aNbCells*sizeof(int);
-  vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+  double aNbCellsPerPoint = aCellsSize / aNbCells - 1;
   size_t aLinksSize = aMesh->GetNbPoints() * 
     (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short));
   aLinksSize = 0;
   size_t aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
   if(MYDEBUG){
-    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<<vtkFloatingPointType(aPointsSize));
-    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aConnectivityAndTypesSize = "<<vtkFloatingPointType(aConnectivityAndTypesSize));
-    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLocationsSize = "<<vtkFloatingPointType(aLocationsSize));
-    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLinksSize = "<<vtkFloatingPointType(aLinksSize));
+    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<<double(aPointsSize));
+    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aConnectivityAndTypesSize = "<<double(aConnectivityAndTypesSize));
+    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLocationsSize = "<<double(aLocationsSize));
+    MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLinksSize = "<<double(aLinksSize));
   }
-  MSG(MYDEBUG,"GetMeshOnGroupSize - aResult = "<<vtkFloatingPointType(aResult)<<"; theMeshName = '"
+  MSG(MYDEBUG,"GetMeshOnGroupSize - aResult = "<<double(aResult)<<"; theMeshName = '"
       <<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
 
   aResult = size_t(aResult*ERR_SIZE_CALC);
@@ -1394,11 +1394,11 @@ VISU_Convertor_impl
   VISU::PFieldImpl aField = boost::get<3>(aFindField);
 
   size_t aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
-  size_t aFieldOnMeshSize = size_t(aField->myDataSize*sizeof(vtkFloatingPointType)*aField->myValField.size()*ERR_SIZE_CALC);
+  size_t aFieldOnMeshSize = size_t(aField->myDataSize*sizeof(double)*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<<
+    MSG(MYVTKDEBUG,"GetFieldOnMeshSize - aFieldOnMeshSize = "<<double(aFieldOnMeshSize));
+  MSG(MYDEBUG,"GetFieldOnMeshSize - aResult = "<<double(aResult)<<"; theMeshName = '"<<theMeshName<<
       "'; theEntity = "<<theEntity<<"; theFieldName = '"<<theFieldName<<"'");
 
   return aResult;
@@ -1446,11 +1446,11 @@ VISU_Convertor_impl
   VISU::PFieldImpl aField = boost::get<3>(aFindTimeStamp);
   
   size_t aMeshSize = GetMeshOnEntitySize(theMeshName, aVTKMeshOnEntity->myEntity);
-  size_t aTimeStampSize = size_t(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC);
+  size_t aTimeStampSize = size_t(aField->myDataSize*sizeof(double) * ERR_SIZE_CALC);
   size_t aResult = aMeshSize + aTimeStampSize;
 
-  MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "<<vtkFloatingPointType(aTimeStampSize));
-  MSG(MYDEBUG,"GetTimeStampSize - aResult = "<<vtkFloatingPointType(aResult)<<
+  MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "<<double(aTimeStampSize));
+  MSG(MYDEBUG,"GetTimeStampSize - aResult = "<<double(aResult)<<
       "; theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<
       "; theFieldName = '"<<theFieldName<<"'; theStampsNum = "<<theStampsNum);