Salome HOME
Porting to VTK 6.
[modules/visu.git] / src / PIPELINE / VISU_ScalarBarActor.cxx
index 776f9aa9eca0dd550d821b03b6a673bbaf1336db..a81c5d628182b4006508df60627dc9e47fd66f91 100644 (file)
@@ -44,8 +44,6 @@
 
 using namespace std;
 
-vtkCxxRevisionMacro(VISU_ScalarBarActor, "$Revision$");
-
 vtkCxxSetObjectMacro(VISU_ScalarBarActor,LookupTable,VISU_LookupTable);
 vtkCxxSetObjectMacro(VISU_ScalarBarActor,LabelTextProperty,vtkTextProperty);
 vtkCxxSetObjectMacro(VISU_ScalarBarActor,TitleTextProperty,vtkTextProperty);
@@ -311,7 +309,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     
     // we hard code how many steps to display
     int numColors = this->MaximumNumberOfColors;
-    vtkFloatingPointType *range = lut->GetRange();
+    double *range = lut->GetRange();
 
     int numPts = 2*(numColors + 1);
     vtkPoints *pts = vtkPoints::New();
@@ -396,11 +394,11 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     this->SizeBar(barWidth, barHeight, size, viewport, range);
 
     // generate points
-    vtkFloatingPointType x[3]; x[2] = 0.0;
-    vtkFloatingPointType delta, val;
+    double x[3]; x[2] = 0.0;
+    double delta, val;
     if ( this->Orientation == VTK_ORIENT_VERTICAL )
       {
-      delta=(vtkFloatingPointType)barHeight/numColors;
+      delta=(double)barHeight/numColors;
       for (i=0; i<numPts/2; i++)
         {
         x[0] = 0;
@@ -412,7 +410,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       }
     else
       {
-      delta=(vtkFloatingPointType)barWidth/numColors;
+      delta=(double)barWidth/numColors;
       for (i=0; i<numPts/2; i++)
         {
         x[0] = i*delta;
@@ -435,12 +433,12 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       polys->InsertNextCell(4,ptIds);
 
       if ( isLogTable ){ //SALOME specific
-        vtkFloatingPointType rgbval = log10(range[0]) + 
+        double rgbval = log10(range[0]) + 
           i*(log10(range[1])-log10(range[0]))/(numColors -1);
         rgba = lut->MapValue(rgbval);
       }else{
         rgba = lut->MapValue(range[0] + (range[1] - range[0])*
-                             ((vtkFloatingPointType)i /(numColors-1.0)));
+                             ((double)i /(numColors-1.0)));
       }
 
       rgb = colors->GetPointer(3*i); //write into array directly
@@ -460,7 +458,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       
       for (i=0; i < this->NumberOfLabels; i++)
         {
-        val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight;
+        val = (double)i/(this->NumberOfLabels-1) *barHeight;
         this->TextMappers[i]->GetSize(viewport,sizeTextData);
         this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft();
         this->TextActors[i]->SetPosition(barWidth+3,
@@ -475,7 +473,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       for (i=0; i < this->NumberOfLabels; i++)
         {
         this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered();
-        val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth;
+        val = (double)i/(this->NumberOfLabels-1) * barWidth;
         this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
         }
         
@@ -589,7 +587,7 @@ void VISU_ScalarBarActor::ShallowCopy(vtkProp *prop)
 
 void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
                                               vtkViewport *viewport,
-                                              vtkFloatingPointType *range)
+                                              double *range)
 {
   labelSize[0] = labelSize[1] = 0;
 
@@ -598,7 +596,7 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
 
   char string[512];
 
-  vtkFloatingPointType val;
+  double val;
   int i;
   
   // TODO: this should be optimized, maybe by keeping a list of
@@ -615,11 +613,11 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
     this->TextMappers[i] = vtkTextMapper::New();
 
     if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific
-      vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) *
+      double lval = log10(range[0]) + (double)i/(this->NumberOfLabels-1) *
         (log10(range[1])-log10(range[0]));
       val = pow((double)10,(double)lval);
     }else{
-      val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
+      val = range[0] + (double)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
     }
     sprintf(string, this->LabelFormat, val);
     this->TextMappers[i]->SetInput(string);
@@ -784,7 +782,7 @@ void VISU_ScalarBarActor::GetRatios(int& titleRatioSize, int& labelRatioWidth,
 }
 
 void VISU_ScalarBarActor::SizeBar(int& barSizeWidth, int& barSizeHeight, int *size,
-                                  vtkViewport *viewport, vtkFloatingPointType *range)
+                                  vtkViewport *viewport, double *range)
 {
   if(BarRatioWidth == 0)
     if ( this->Orientation == VTK_ORIENT_VERTICAL )