Commit bda2e527 authored by Philippe Pebay's avatar Philippe Pebay Committed by Kitware Robot
Browse files

Merge topic 'FixScalarDetails'

c10f9577 Removed debug statements
96c72af2 Proper and independent scaling of polar axis title and labels
387ec670 Arc and label routine now linked to polar axis
d7d84072 Modified creation of radial axes to create only those within bounds
f0cc5d0a Properly initializing separate polar axis and ancillaries
8dd0c44f Created a separate handling of the polar axis from other radial axes
f97646aa Added instance variable and ancillaries for polar axis to API
3edf6f97 Now using MinimumAngle to begin angular sectors
892850d4 Added a MinimumAngle iVar to the API; set defaults
parents a24c1840 c10f9577
......@@ -36,17 +36,19 @@ polaxes.SetBounds( cylinder.GetOutput().GetBounds() )
polaxes.SetPole( pole )
polaxes.SetAutoScaleRadius( 0 )
polaxes.SetMaximumRadius( 4.5 )
polaxes.SetMinimumAngle( 45. )
polaxes.SetMaximumAngle( 270. )
polaxes.SetNumberOfRadialAxes( 10 )
polaxes.SetNumberOfPolarAxisTicks( 12 )
polaxes.SetAutoSubdividePolarAxis( 0 )
polaxes.SetCamera( camera )
polaxes.SetRadialLabelFormat( "%6.1f" )
polaxes.SetPolarLabelFormat( "%6.1f" )
polaxes.GetRadialAxesProperty().SetColor( .0, .0, 1. )
polaxes.GetPolarArcsProperty().SetColor( 1., .0, 0. )
polaxes.GetPolarAxisTitleTextProperty().SetColor( 1., 0., 0. )
polaxes.GetPolarAxisLabelTextProperty().SetColor( 1., 0., 0. )
polaxes.SetScreenSize( 9. )
polaxes.GetPolarAxisProperty().SetColor( 0., 1., 0. )
polaxes.GetPolarAxisTitleTextProperty().SetColor( 0., 1., 0. )
polaxes.GetPolarAxisLabelTextProperty().SetColor( 0., 1., 0. )
polaxes.SetScreenSize( 8. )
# Create renderer
renderer = vtkRenderer()
......
......@@ -59,12 +59,12 @@ int TestPolarAxes( int argc, char * argv [] )
vtkNew<vtkActor> outlineActor;
outlineActor->SetMapper( mapOutline.GetPointer() );
outlineActor->GetProperty()->SetColor( 0.0, 0.0, 0.0 );
outlineActor->GetProperty()->SetColor( 1., 1., 1. );
vtkNew<vtkCamera> camera;
camera->SetClippingRange( 1.0, 100.0 );
camera->SetFocalPoint( 0.9, 1.0, 0.0 );
camera->SetPosition( 2., 6., 13. );
camera->SetClippingRange( 1., 100. );
camera->SetFocalPoint( 0., .5, 0. );
camera->SetPosition( 5., 6., 14. );
vtkNew<vtkLight> light;
light->SetFocalPoint( 0.21406, 1.5, 0.0 );
......@@ -82,14 +82,16 @@ int TestPolarAxes( int argc, char * argv [] )
polaxes->SetPole( .5, 1., 3. );
polaxes->SetAutoScaleRadius( false );
polaxes->SetMaximumRadius( 3. );
polaxes->SetMaximumAngle( 210. );
polaxes->SetNumberOfRadialAxes( 8 );
polaxes->SetMinimumAngle( 30. );
polaxes->SetMaximumAngle( 270. );
polaxes->SetNumberOfRadialAxes( 9 );
polaxes->SetCamera( renderer->GetActiveCamera() );
polaxes->SetRadialLabelFormat( "%6.1f" );
polaxes->SetPolarLabelFormat( "%6.1f" );
polaxes->GetRadialAxesProperty()->SetColor( .0, .0, 1. );
polaxes->GetPolarArcsProperty()->SetColor( 1., .0, 0. );
polaxes->GetPolarAxisTitleTextProperty()->SetColor( 1., 0., 0. );
polaxes->GetPolarAxisLabelTextProperty()->SetColor( 1., 0., 0. );
polaxes->GetPolarAxisProperty()->SetColor( .2, .2, .2 );
polaxes->GetPolarAxisTitleTextProperty()->SetColor( .2, .2, .2 );
polaxes->GetPolarAxisLabelTextProperty()->SetColor( .2, .2, .2 );
polaxes->SetNumberOfPolarAxisTicks( 11 );
polaxes->SetAutoSubdividePolarAxis( false );
polaxes->SetScreenSize( 9.0 );
......
This diff is collapsed.
......@@ -98,17 +98,18 @@ public:
vtkSetMacro( AutoScaleRadius,bool );
vtkGetMacro( AutoScaleRadius,bool );
// Description:
// Set/Get the minimum radius of the polar coordinates (in degrees).
// Default: 0.
vtkSetClampMacro( MinimumAngle, double, 0., 360. );
vtkGetMacro( MinimumAngle, double );
// Description:
// Set/Get the maximum radius of the polar coordinates (in degrees).
// Default: VTK_DEFAULT_MAXIMUM_POLAR_ANGLE
vtkSetClampMacro( MaximumAngle, double, 0., 360. );
vtkGetMacro( MaximumAngle, double );
// Description:
// Set/Get the RebuildAxes flag
vtkSetMacro( RebuildAxes, bool );
vtkGetMacro( RebuildAxes, bool );
// Description: Set/Get whether angle units (degrees) are used to label radial axes
// Default: true
vtkSetMacro( RadialUnits, bool );
......@@ -135,10 +136,9 @@ public:
vtkGetStringMacro( PolarAxisTitle );
// Description:
// Set/Get the format with which to print the labels on each of the
// radial axes.
vtkSetStringMacro( RadialLabelFormat );
vtkGetStringMacro( RadialLabelFormat );
// Set/Get the format with which to print the polar axis labels
vtkSetStringMacro( PolarLabelFormat );
vtkGetStringMacro( PolarLabelFormat );
// Description:
// Release any graphics resources that are being consumed by this actor.
......@@ -147,19 +147,19 @@ public:
void ReleaseGraphicsResources( vtkWindow* );
// Description:
// Turn on and off the visibility of radial axes.
vtkSetMacro( RadialAxesVisibility,int );
vtkGetMacro( RadialAxesVisibility,int );
vtkBooleanMacro( RadialAxesVisibility,int );
// Turn on and off the visibility of the polar axis.
vtkSetMacro( PolarAxisVisibility,int );
vtkGetMacro( PolarAxisVisibility,int );
vtkBooleanMacro( PolarAxisVisibility,int );
// Description:
// Turn on and off the visibility of titles for radial axes.
vtkSetMacro( RadialTitleVisibility,int );
vtkGetMacro( RadialTitleVisibility,int );
vtkBooleanMacro( RadialTitleVisibility,int );
// Turn on and off the visibility of titles for polar axis.
vtkSetMacro( PolarTitleVisibility,int );
vtkGetMacro( PolarTitleVisibility,int );
vtkBooleanMacro( PolarTitleVisibility,int );
// Description:
// Turn on and off the visibility of labels for radial axis.
// Turn on and off the visibility of labels for polar axis.
vtkSetMacro( PolarLabelVisibility,int );
vtkGetMacro( PolarLabelVisibility,int );
vtkBooleanMacro( PolarLabelVisibility,int );
......@@ -170,6 +170,18 @@ public:
vtkGetMacro( PolarTickVisibility, int );
vtkBooleanMacro( PolarTickVisibility, int );
// Description:
// Turn on and off the visibility of non-polar radial axes.
vtkSetMacro( RadialAxesVisibility,int );
vtkGetMacro( RadialAxesVisibility,int );
vtkBooleanMacro( RadialAxesVisibility,int );
// Description:
// Turn on and off the visibility of titles for non-polar radial axes.
vtkSetMacro( RadialTitleVisibility,int );
vtkGetMacro( RadialTitleVisibility,int );
vtkBooleanMacro( RadialTitleVisibility,int );
// Description:
// Turn on and off the visibility of arcs for polar axis.
vtkSetMacro( PolarArcsVisibility, int );
......@@ -186,6 +198,11 @@ public:
virtual void SetPolarAxisLabelTextProperty(vtkTextProperty *p);
vtkGetObjectMacro(PolarAxisLabelTextProperty,vtkTextProperty);
// Description:
// Get/Set polar axis actor properties.
virtual void SetPolarAxisProperty(vtkProperty *);
vtkProperty* GetPolarAxisProperty();
// Description:
// Get/Set radial axes actors properties.
virtual void SetRadialAxesProperty(vtkProperty *);
......@@ -221,10 +238,8 @@ protected:
void BuildAxes( vtkViewport * );
// Description:
// Send attributes to each vtkAxisActor.
// Only sets those that are not dependent upon viewport changes,
// and thus do not need to be set very often.
void SetNonDependentAttributes(void );
// Send attributes which are common to all axes, both polar and radial
void SetCommonAxisAttributes( vtkAxisActor* );
// Description:
// Prepare ticks on polar axis with respect to coordinate offset
......@@ -243,8 +258,10 @@ protected:
double FFix(double );
double FSign(double, double );
void AutoScale( vtkViewport* viewport );
void AutoScale( vtkViewport* viewport, vtkAxisActor** axes );
// Description:
// Automatically rescale titles and labels
// NB: Current implementation only for perspective projections.
void AutoScale( vtkViewport* viewport );
// Description:
// Coordinates of the pole
......@@ -272,7 +289,11 @@ protected:
bool AutoScaleRadius;
// Description:
// Maximum polar angle (minimum is always 0)
// Minimum polar angle
double MinimumAngle;
// Description:
// Maximum polar angle
double MaximumAngle;
// Description:
......@@ -290,15 +311,18 @@ protected:
vtkCamera *Camera;
// Description:
// Control variables for radial axes
vtkAxisActor** RadialAxes;
// Control variables for polar axis
vtkAxisActor* PolarAxis;
bool RebuildAxes;
// Description:
// Control variables for non-polar radial axes
vtkAxisActor** RadialAxes;
// Description:
// Title to be used for the polar axis
// NB: The other axes use the polar angle value as a title
// NB: Non-polar radial axes use the polar angle as title and have no labels
char *PolarAxisTitle;
char *PolarLabelFormat;
// Description:
// Use angle units (degrees) to label radial axes
......@@ -306,17 +330,19 @@ protected:
int TickLocation;
// Visibility of polar axis and its title, labels, ticks (major only)
int PolarAxisVisibility;
int PolarTitleVisibility;
int PolarLabelVisibility;
int PolarTickVisibility;
// Visibility of radial axes and their titles
int RadialAxesVisibility;
int RadialTitleVisibility;
// Visibility of polar labels, ticks (major only), and arcs
int PolarLabelVisibility;
int PolarTickVisibility;
// Visibility of polar arcs
int PolarArcsVisibility;
char *RadialLabelFormat;
int RenderCount;
int RenderSomething;
......@@ -327,6 +353,9 @@ protected:
vtkTextProperty *PolarAxisTitleTextProperty;
vtkTextProperty *PolarAxisLabelTextProperty;
// General properties of polar axis
vtkProperty* PolarAxisProperty;
// General properties of radial axes
vtkProperty* RadialAxesProperty;
......
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