Commit 3ac3f09b authored by Philippe Pébay's avatar Philippe Pébay
Browse files

Using adjustable X and Y 2 offsets (defaults: -40 and -50)

Change-Id: I4aeb372bcefee6a953751ac20be3f8d1430ccd8b
parent a49b0e9a
...@@ -55,7 +55,9 @@ polaxes.GetPolarArcsProperty().SetColor( 1., .0, 0. ) ...@@ -55,7 +55,9 @@ polaxes.GetPolarArcsProperty().SetColor( 1., .0, 0. )
polaxes.GetPolarAxisProperty().SetColor( 0., 1., 0. ) polaxes.GetPolarAxisProperty().SetColor( 0., 1., 0. )
polaxes.GetPolarAxisTitleTextProperty().SetColor( 0., 1., 0. ) polaxes.GetPolarAxisTitleTextProperty().SetColor( 0., 1., 0. )
polaxes.GetPolarAxisLabelTextProperty().SetColor( 0., 1., 0. ) polaxes.GetPolarAxisLabelTextProperty().SetColor( 0., 1., 0. )
polaxes.SetEnableDistanceLOD( 0 )
polaxes.SetDistanceLODThreshold( .4 ) polaxes.SetDistanceLODThreshold( .4 )
polaxes.SetEnableViewAngleLOD( 0 )
polaxes.SetViewAngleLODThreshold( .2 ) polaxes.SetViewAngleLODThreshold( .2 )
polaxes.SetScreenSize( 8. ) polaxes.SetScreenSize( 8. )
...@@ -72,4 +74,8 @@ interactor.SetRenderWindow( window ) ...@@ -72,4 +74,8 @@ interactor.SetRenderWindow( window )
# Start interaction # Start interaction
window.Render() window.Render()
polaxes.SetMaximumAngle( 120. )
window.Render()
interactor.Start() interactor.Start()
...@@ -181,8 +181,8 @@ vtkAxisActor::vtkAxisActor() ...@@ -181,8 +181,8 @@ vtkAxisActor::vtkAxisActor()
this->Use2DMode = 0; this->Use2DMode = 0;
this->SaveTitlePosition = 0; this->SaveTitlePosition = 0;
this->TitleConstantPosition[0] = this->TitleConstantPosition[1] = 0.; this->TitleConstantPosition[0] = this->TitleConstantPosition[1] = 0.;
this->VerticalOffsetXTitle2D = -20.; this->VerticalOffsetXTitle2D = -40.;
this->HorizontalOffsetYTitle2D = -20.; this->HorizontalOffsetYTitle2D = -50.;
} }
// **************************************************************** // ****************************************************************
...@@ -940,11 +940,11 @@ vtkAxisActor::BuildTitle2D(vtkViewport *viewport, bool force) ...@@ -940,11 +940,11 @@ vtkAxisActor::BuildTitle2D(vtkViewport *viewport, bool force)
viewport->GetDisplayPoint(transpos); viewport->GetDisplayPoint(transpos);
if (this->AxisType == VTK_AXIS_TYPE_X) if (this->AxisType == VTK_AXIS_TYPE_X)
{ {
transpos[1] -= 12; transpos[1] += this->VerticalOffsetXTitle2D;
} }
else if (this->AxisType == VTK_AXIS_TYPE_Y) else if (this->AxisType == VTK_AXIS_TYPE_Y)
{ {
transpos[0] -= 20; transpos[0] += this->HorizontalOffsetYTitle2D;
} }
if (transpos[1] < 10.) transpos[1] = 10.; if (transpos[1] < 10.) transpos[1] = 10.;
if (transpos[0] < 10.) transpos[0] = 10.; if (transpos[0] < 10.) transpos[0] = 10.;
......
...@@ -520,7 +520,7 @@ class VTK_HYBRID_EXPORT vtkAxisActor : public vtkActor ...@@ -520,7 +520,7 @@ class VTK_HYBRID_EXPORT vtkAxisActor : public vtkActor
// Description: // Description:
// Vertical offset in display coordinates for X axis title (used in 2D mode only) // Vertical offset in display coordinates for X axis title (used in 2D mode only)
// Default: -40 // Default: -50
double HorizontalOffsetYTitle2D; double HorizontalOffsetYTitle2D;
// Description: // Description:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment