using namespace std;
-vtkCxxRevisionMacro(VISU_ScalarBarActor, "$Revision$");
-
vtkCxxSetObjectMacro(VISU_ScalarBarActor,LookupTable,VISU_LookupTable);
vtkCxxSetObjectMacro(VISU_ScalarBarActor,LabelTextProperty,vtkTextProperty);
vtkCxxSetObjectMacro(VISU_ScalarBarActor,TitleTextProperty,vtkTextProperty);
// 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();
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;
}
else
{
- delta=(vtkFloatingPointType)barWidth/numColors;
+ delta=(double)barWidth/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = i*delta;
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
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,
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]);
}
void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
vtkViewport *viewport,
- vtkFloatingPointType *range)
+ double *range)
{
labelSize[0] = labelSize[1] = 0;
char string[512];
- vtkFloatingPointType val;
+ double val;
int i;
// TODO: this should be optimized, maybe by keeping a list of
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);
}
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 )