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

Changed execution flow to allow subtle change in polar axis behavior

Change-Id: I06723e1bbbb6a089ad6dac9462daa74d87537a5c
parent 53d1549d
......@@ -45,8 +45,8 @@ polaxes.SetMaximumRadius( 4.5 )
polaxes.SetMinimumAngle( -60. )
polaxes.SetMaximumAngle( 210. )
polaxes.SetNumberOfRadialAxes( 10 )
polaxes.SetNumberOfPolarAxisTicks( 9 )
polaxes.AutoSubdividePolarAxisOff()
polaxes.SetNumberOfPolarAxisTicks( 8 )
polaxes.SetCamera( renderer.GetActiveCamera() )
polaxes.SetPolarLabelFormat( "%6.1f" )
polaxes.GetRadialAxesProperty().SetColor( .0, .0, 1. )
......@@ -73,6 +73,7 @@ interactor.SetRenderWindow( window )
# Start interaction
window.Render()
polaxes.AutoSubdividePolarAxisOn()
polaxes.SetMinimumAngle( 60. )
polaxes.SetNumberOfPolarAxisTicks( 12 )
interactor.Start()
......@@ -607,18 +607,18 @@ vtkAxisActor::BuildLabels(vtkViewport *viewport, bool force)
{
return;
}
for (int i = 0; i < this->NumberOfLabelsBuilt; i++)
{
this->LabelActors[i]->SetCamera(this->Camera);
this->LabelActors[i]->GetProperty()->SetColor(this->LabelTextProperty->GetColor());
if(!this->GetCalculateLabelOffset())
{
this->LabelActors[i]->SetAutoCenter(1);
}
}
if (force || this->BuildTime.GetMTime() < this->BoundsTime.GetMTime() ||
this->AxisPosition != this->LastAxisPosition ||
this->LastRange[0] != this->Range[0] ||
......
......@@ -324,29 +324,16 @@ vtkPolarAxesActor::~vtkPolarAxesActor()
int vtkPolarAxesActor::RenderOpaqueGeometry( vtkViewport *viewport )
{
// Initialization
static bool initialRender = true;
int renderedSomething = 0;
if ( !this->Camera )
{
vtkErrorMacro( <<"No camera!" );
this->RenderSomething = 0;
return 0;
return renderedSomething;
}
this->BuildAxes( viewport );
if ( initialRender )
{
this->PolarAxis->BuildAxis( viewport, true );
for ( int i = 0; i < this->NumberOfRadialAxes; ++ i )
{
this->RadialAxes[i]->BuildAxis( viewport, true );
}
}
initialRender = false;
int renderedSomething = 0;
// Render the polar axis
if ( this->PolarAxisVisibility )
{
......@@ -608,6 +595,9 @@ void vtkPolarAxesActor::BuildAxes( vtkViewport *viewport )
// Build polar axis labels
this->BuildPolarAxisLabelsArcs();
// Build polar axis
this->PolarAxis->BuildAxis( viewport, true );
// Scale appropriately
this->AutoScale( viewport );
......@@ -842,9 +832,10 @@ void vtkPolarAxesActor::BuildPolarAxisLabelsArcs()
sprintf( label, format, value );
labels->SetValue( i, label );
// Build polar arcs for non-zero values
if ( value > 0. )
{
// Build corresponding polar arc for non-zero values
// Compute and set polar arc parameters
double x1 = value * cosThetaMin;
double y1 = value * sinThetaMin;
double x2 = value * cosThetaMax;
......
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