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

Make sure that bounds are always recalculated when needed

Change-Id: I8c2bcb251fafcbdf648f58aa1dbd3e12935a2184
parent f00d05b6
......@@ -134,7 +134,7 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
this->AutoSubdividePolarAxis = true;
// Default maximum polar radius
this->MaximumRadius = VTK_DOUBLE_MAX;
this->MaximumRadius = 1.;
// Do not auto-scale radius by default
this->AutoScaleRadius = false;
......@@ -143,7 +143,7 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
this->MinimumAngle = 0.;
// Default maximum polar angle
this->MaximumAngle = VTK_DEFAULT_MAXIMUM_POLAR_ANGLE;
this->MaximumAngle = 90.;
// Default smallest radial angle distinguishable from polar axis
this->SmallestVisiblePolarAngle = .5;
......@@ -948,6 +948,58 @@ void vtkPolarAxesActor::SetPole( double x, double y, double z )
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetMaximumRadius( double r )
{
this->MaximumRadius = r > 0. ? r : 0.;
// Update bounds
this->CalculateBounds();
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetMinimumAngle( double a )
{
if ( a > 360. )
{
this->MinimumAngle = 360.;
}
else if ( a < -360. )
{
this->MinimumAngle = -360.;
}
else
{
this->MinimumAngle = a;
}
// Update bounds
this->CalculateBounds();
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetMaximumAngle( double a )
{
if ( a > 360. )
{
this->MaximumAngle = 360.;
}
else if ( a < -360. )
{
this->MaximumAngle = -360.;
}
else
{
this->MaximumAngle = a;
}
// Update bounds
this->CalculateBounds();
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetPolarAxisProperty( vtkProperty *prop )
{
......
......@@ -35,7 +35,6 @@ All rights reserve
#define VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES 50
#define VTK_DEFAULT_NUMBER_OF_RADIAL_AXES 5
#define VTK_MAXIMUM_NUMBER_OF_POLAR_AXIS_TICKS 200
#define VTK_DEFAULT_MAXIMUM_POLAR_ANGLE 90.0
#define VTK_POLAR_ARC_RESOLUTION_PER_DEG 0.2
#include "vtkActor.h"
......@@ -87,9 +86,8 @@ public:
vtkGetMacro( AutoSubdividePolarAxis, bool );
// Description:
// Set/Get the maximum radius of the polar coordinates.
// Default: VTK_DOUBLE_MAX
vtkSetClampMacro( MaximumRadius, double, 0., VTK_DOUBLE_MAX );
// Set/Get the maximum radius of the polar coordinates.
virtual void SetMaximumRadius( double );
vtkGetMacro( MaximumRadius, double );
// Description:
......@@ -100,14 +98,12 @@ public:
// Description:
// Set/Get the minimum radius of the polar coordinates (in degrees).
// Default: 0.
vtkSetClampMacro( MinimumAngle, double, -360., 360. );
virtual void SetMinimumAngle( double );
vtkGetMacro( MinimumAngle, double );
// Description:
// Set/Get the maximum radius of the polar coordinates (in degrees).
// Default: VTK_DEFAULT_MAXIMUM_POLAR_ANGLE
vtkSetClampMacro( MaximumAngle, double, -360., 360. );
virtual void SetMaximumAngle( double );
vtkGetMacro( MaximumAngle, double );
// Description:
......@@ -306,6 +302,7 @@ protected:
// Description:
// Maximum polar radius (minimum is always 0)
// Default: 1
double MaximumRadius;
// Description:
......@@ -314,10 +311,12 @@ protected:
// Description:
// Minimum polar angle
// Default: 0.
double MinimumAngle;
// Description:
// Maximum polar angle
// Default: 90.
double MaximumAngle;
// Description:
......
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