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

Have a min and max possible number of radial axes, clamp with them.

Change-Id: Ia4c7ac3578e0c17468c016bde30056ccc6f79c85
parent 20d0ca90
......@@ -109,7 +109,7 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
this->Pole[2] = VTK_DOUBLE_MAX;
// Default number of polar axes
this->NumberOfRadialAxes = VTK_DEFAULT_NUMBER_OF_RADIAL_AXES;
this->NumberOfRadialAxes = VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES;
// Default maximum polar radius
this->MaximumRadius = VTK_DOUBLE_MAX;
......@@ -145,8 +145,8 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
this->PolarAxisLabelTextProperty->SetFontFamilyToArial();
// Create and set radial axes
this->RadialAxes = new vtkAxisActor*[VTK_DEFAULT_NUMBER_OF_RADIAL_AXES];
for ( int i = 0; i < VTK_DEFAULT_NUMBER_OF_RADIAL_AXES; ++ i )
this->RadialAxes = new vtkAxisActor*[VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES];
for ( int i = 0; i < VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES; ++ i )
{
// Create axis of type X
this->RadialAxes[i] = vtkAxisActor::New();
......@@ -231,7 +231,7 @@ vtkPolarAxesActor::~vtkPolarAxesActor()
if ( this->RadialAxes )
{
for ( int i = 0; i < VTK_DEFAULT_NUMBER_OF_RADIAL_AXES; ++ i )
for ( int i = 0; i < VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES; ++ i )
{
if ( this->RadialAxes[i] )
{
......
......@@ -32,7 +32,8 @@ All rights reserve
#ifndef __vtkPolarAxesActor_h
#define __vtkPolarAxesActor_h
#define VTK_DEFAULT_NUMBER_OF_RADIAL_AXES 100
#define VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES 50
#define VTK_DEFAULT_NUMBER_OF_RADIAL_AXES 5
#define VTK_DEFAULT_MAXIMUM_POLAR_ANGLE 90.0
#include "vtkActor.h"
......@@ -66,7 +67,7 @@ public:
// Description:
// Gets/Sets the number of radial axes
// Default: VTK_DEFAULT_NUMBER_OF_RADIAL_AXES
vtkSetMacro( NumberOfRadialAxes, vtkIdType );
vtkSetClampMacro( NumberOfRadialAxes, vtkIdType, 2, VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES );
vtkGetMacro( NumberOfRadialAxes, vtkIdType );
// 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