#define OFFSET_SPACING 2
//==================================================================
-vtkCxxRevisionMacro(VTKViewer_FramedTextActor, "$Revision$");
vtkStandardNewMacro(VTKViewer_FramedTextActor);
//==================================================================
myTransparency=0.;
myBar = vtkPolyData::New();
myBarMapper = vtkPolyDataMapper2D::New();
- myBarMapper->SetInput(myBar);
+ myBarMapper->SetInputData(myBar);
myBarActor = vtkActor2D::New();
myBarActor->SetMapper(myBarMapper);
myBarActor->GetProperty()->SetOpacity(1.-myTransparency);
// function : SetForegroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetForegroundColor(const vtkFloatingPointType r,
- const vtkFloatingPointType g,
- const vtkFloatingPointType b)
+void VTKViewer_FramedTextActor::SetForegroundColor(const double r,
+ const double g,
+ const double b)
{
myTextProperty->SetColor(r, g, b);
myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
// function : GetForegroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::GetForegroundColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b)
+void VTKViewer_FramedTextActor::GetForegroundColor(double& r,
+ double& g,
+ double& b)
{
- vtkFloatingPointType aColor[3];
+ double aColor[3];
myTextProperty->GetColor(aColor);
r = aColor[0];
g = aColor[1];
// function : SetBackgroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetBackgroundColor(const vtkFloatingPointType r,
- const vtkFloatingPointType g,
- const vtkFloatingPointType b)
+void VTKViewer_FramedTextActor::SetBackgroundColor(const double r,
+ const double g,
+ const double b)
{
myBarActor->GetProperty()->SetColor(r, g, b);
Modified();
// function : GetBackgroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::GetBackgroundColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b)
+void VTKViewer_FramedTextActor::GetBackgroundColor(double& r,
+ double& g,
+ double& b)
{
- vtkFloatingPointType aColor[3];
+ double aColor[3];
myBarActor->GetProperty()->GetColor(aColor);
r = aColor[0];
g = aColor[1];
// function : SetTransparency
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency)
+void VTKViewer_FramedTextActor::SetTransparency(const double theTransparency)
{
if (theTransparency>=0. && theTransparency<=1.){
myTransparency=theTransparency;
// function : GetTransparency
// purpose :
//==================================================================
-vtkFloatingPointType VTKViewer_FramedTextActor::GetTransparency()const
+double VTKViewer_FramedTextActor::GetTransparency()const
{
return myTransparency;
}
// function : SetWorldPoint
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4])
+void VTKViewer_FramedTextActor::SetWorldPoint(const double theWorldPoint[4])
{
for(int i = 0; i<4; ++i) {
myWorldPoint[i] = theWorldPoint[i];
// function : GetWorldPoint
// purpose :
//==================================================================
-const vtkFloatingPointType* VTKViewer_FramedTextActor::GetWorldPoint()const
+const double* VTKViewer_FramedTextActor::GetWorldPoint()const
{
return myWorldPoint;
}
// function : SetDistance
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance)
+void VTKViewer_FramedTextActor::SetDistance(const double theDistance)
{
myDistance=theDistance;
}
// function : GetDistance
// purpose :
//==================================================================
-vtkFloatingPointType VTKViewer_FramedTextActor::GetDistance()const
+double VTKViewer_FramedTextActor::GetDistance()const
{
return myDistance;
}
int aTextMargin = GetTextMargin();
- vtkFloatingPointType xMin = 0.0;
- vtkFloatingPointType xMax = 0.0;
- vtkFloatingPointType yMin = -aBarHeight/2 - aTextMargin;
- vtkFloatingPointType yMax = aBarHeight/2 + aTextMargin;
+ double xMin = 0.0;
+ double xMax = 0.0;
+ double yMin = -aBarHeight/2 - aTextMargin;
+ double yMax = aBarHeight/2 + aTextMargin;
int aHorizontalOffset = GetLayoutType() == Horizontal ? myHorizontalOffset : 0;
int aVerticalOffset = GetLayoutType() == Vertical ? myVerticalOffset : 0;
theViewport->SetWorldPoint(myWorldPoint);
theViewport->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
+ double aSelectionPoint[3];
theViewport->GetDisplayPoint(aSelectionPoint);
- vtkFloatingPointType u = aSelectionPoint[0];
- vtkFloatingPointType v = aSelectionPoint[1] - myDistance;
+ double u = aSelectionPoint[0];
+ double v = aSelectionPoint[1] - myDistance;
if(myMoveFrameFlag)
v -= aBarHeight/2.;
theViewport->ViewportToNormalizedViewport(u, v);
}
else // except BelowPoint, only TopLeft and TopRight modes are supported at this moment
{
- vtkFloatingPointType x = 0, xOffset = aHorizontalOffset + aTextMargin + OFFSET_SPACING;
- vtkFloatingPointType y = 0, yOffset = aVerticalOffset + aTextMargin + OFFSET_SPACING;
+ double x = 0, xOffset = aHorizontalOffset + aTextMargin + OFFSET_SPACING;
+ double y = 0, yOffset = aVerticalOffset + aTextMargin + OFFSET_SPACING;
if( myModePosition == TopLeft )
{
xMax = aTextMargin;
}
- PositionCoordinate->SetValue(x / (vtkFloatingPointType)aViewPortWidth,
- y / (vtkFloatingPointType)aViewPortHeight);
+ PositionCoordinate->SetValue(x / (double)aViewPortWidth,
+ y / (double)aViewPortHeight);
}
aPoints->SetPoint(0, xMin, yMax, 0.0);