Salome HOME
Porting to VTK 6.
[modules/visu.git] / src / PIPELINE / VISU_FieldTransform.cxx
index ba2bc909cc5dc633cefac45ba1031d84c519a765..e881a36fc505032fde6b3e56f4bae648a23823f3 100644 (file)
@@ -35,7 +35,7 @@
 #include <vtkInformation.h>
 #include <vtkInformationVector.h>
 
-static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT;
+static double Tolerance = 1.0 / VTK_LARGE_FLOAT;
 
 //----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_FieldTransform);
@@ -129,7 +129,7 @@ VISU_FieldTransform
 //----------------------------------------------------------------------------
 void
 VISU_FieldTransform
-::SetScalarRange(vtkFloatingPointType theScalarRange[2]) 
+::SetScalarRange(double theScalarRange[2]) 
 {
   if(VISU::CheckIsSameRange(theScalarRange, myScalarRange))
     return;
@@ -143,18 +143,18 @@ VISU_FieldTransform
 //----------------------------------------------------------------------------
 void
 VISU_FieldTransform
-::SetScalarMin(vtkFloatingPointType theValue)
+::SetScalarMin(double theValue)
 {
-  vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
+  double aScalarRange[2] = {theValue, GetScalarRange()[1]};
   SetScalarRange(aScalarRange);
 }
 
 //----------------------------------------------------------------------------
 void
 VISU_FieldTransform
-::SetScalarMax(vtkFloatingPointType theValue)
+::SetScalarMax(double theValue)
 {
-  vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
+  double aScalarRange[2] = {GetScalarRange()[0], theValue};
   SetScalarRange(aScalarRange);
 }
 
@@ -164,7 +164,7 @@ void
 LinearTransformVectors(TValueType* theInputPtr,
                        TValueType* theOutputPtr,
                        vtkIdType theNbOfTuples,
-                       vtkFloatingPointType theScale[3])
+                       double theScale[3])
 {
   for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
     for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){
@@ -183,16 +183,16 @@ NonLinearTransformVectors(vtkDataArray *theInputVectors,
                           TValueType* theInputPtr,
                           TValueType* theOutputPtr,
                           vtkIdType theNbOfTuples,
-                          vtkFloatingPointType theScale[3],
+                          double theScale[3],
                           VISU_FieldTransform::TTransformFun theFunction,
-                          vtkFloatingPointType theModifiedScalarMin,
-                          vtkFloatingPointType theModifiedScalarDelta,
-                          vtkFloatingPointType theSourceScalarMax)
+                          double theModifiedScalarMin,
+                          double theModifiedScalarDelta,
+                          double theSourceScalarMax)
 {
   for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
-    vtkFloatingPointType anInputVector[3];
+    double anInputVector[3];
     theInputVectors->GetTuple(aTupleId, anInputVector);
-    vtkFloatingPointType aMagnification = vtkMath::Norm(anInputVector);
+    double aMagnification = vtkMath::Norm(anInputVector);
     if(aMagnification > Tolerance)
       aMagnification = 
         ((*theFunction)(aMagnification) - theModifiedScalarMin) / 
@@ -214,7 +214,7 @@ template<typename TDataSetAttributesType>
 void
 ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction,
                VTKViewer_Transform* theTransform,
-               vtkFloatingPointType theScalarRange[2], 
+               double theScalarRange[2], 
                vtkIdType theNbOfTuples,
                TDataSetAttributesType* theInputData, 
                TDataSetAttributesType* theOutputData)
@@ -223,12 +223,12 @@ ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction,
   if(!anInputVectors || theNbOfTuples < 1) 
     return;
 
-  vtkFloatingPointType aScalarRange[2];
+  double aScalarRange[2];
   aScalarRange[0] = (*theFunction)(theScalarRange[0]);
   aScalarRange[1] = (*theFunction)(theScalarRange[1]);
 
-  vtkFloatingPointType aScalarDelta = aScalarRange[1] - aScalarRange[0];
-  vtkFloatingPointType aScale[3] = {1.0, 1.0, 1.0};
+  double aScalarDelta = aScalarRange[1] - aScalarRange[0];
+  double aScale[3] = {1.0, 1.0, 1.0};
 
   if(theTransform){
     aScale[0] = theTransform->GetScale()[0];
@@ -284,10 +284,10 @@ NonLinearTransformScalars(vtkDataArray *theInputScalars,
                           TValueType* theOutputPtr,
                           vtkIdType theNbOfTuples,
                           VISU_FieldTransform::TTransformFun theFunction,
-                          vtkFloatingPointType theModifiedScalarMin)
+                          double theModifiedScalarMin)
 {
   for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
-    vtkFloatingPointType aScalar = (*theFunction)(vtkFloatingPointType(*theInputPtr));
+    double aScalar = (*theFunction)(double(*theInputPtr));
     if(aScalar < theModifiedScalarMin) 
       aScalar = theModifiedScalarMin;
     *theOutputPtr = TValueType(aScalar);
@@ -301,7 +301,7 @@ NonLinearTransformScalars(vtkDataArray *theInputScalars,
 template<typename TDataSetAttributesType> 
 void
 ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction, 
-               vtkFloatingPointType theScalarRange[2],
+               double theScalarRange[2],
                vtkIdType theNbOfTuples, 
                TDataSetAttributesType* theInputData, 
                TDataSetAttributesType* theOutputData)
@@ -310,7 +310,7 @@ ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction,
   if(!anInputScalars || theNbOfTuples < 1)
     return;
 
-  vtkFloatingPointType aScalarRange[2];
+  double aScalarRange[2];
   aScalarRange[0] = (*theFunction)(theScalarRange[0]);
   aScalarRange[1] = (*theFunction)(theScalarRange[1]);