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

Prevent conflicts between radial and polar axes title (below 2 degrees)

Change-Id: Ibd43c99073bb26ed2e57ee7b876df52fa64a0332
parent f03dd651
......@@ -36,7 +36,7 @@ polaxes.SetBounds( cylinder.GetOutput().GetBounds() )
polaxes.SetPole( pole )
polaxes.SetAutoScaleRadius( 0 )
polaxes.SetMaximumRadius( 4.5 )
polaxes.SetMinimumAngle( 45. )
polaxes.SetMinimumAngle( .1 )
polaxes.SetMaximumAngle( 270. )
polaxes.SetNumberOfRadialAxes( 10 )
polaxes.SetNumberOfPolarAxisTicks( 9 )
......
......@@ -524,12 +524,21 @@ void vtkPolarAxesActor::BuildAxes( vtkViewport *viewport )
axis->SetAxisLinesProperty( this->RadialAxesProperty );
// Set radial axis title with polar angle as title for non-polar axes
axis->SetTitleVisibility( this->RadialTitleVisibility );
axis->GetTitleTextProperty()->SetColor( this->RadialAxesProperty->GetColor() );
vtksys_ios::ostringstream title;
title << alpha
<< ( this->RadialUnits ? " deg" : "" );
axis->SetTitle( title.str().c_str() );
if ( this->PolarAxisVisibility && fabs( alpha ) < 2. )
{
// Prevent conflict between radial and polar axes titles
axis->SetTitleVisibility( false );
}
else
{
// Use polar angle as a title for the radial axis
axis->SetTitleVisibility( this->RadialTitleVisibility );
axis->GetTitleTextProperty()->SetColor( this->RadialAxesProperty->GetColor() );
vtksys_ios::ostringstream title;
title << alpha
<< ( this->RadialUnits ? " deg" : "" );
axis->SetTitle( title.str().c_str() );
}
// No labels nor ticks for radial axes
axis->SetLabelVisibility( 0 );
......
Markdown is supported
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