43#ifndef vtkPolarAxesActor_h
44#define vtkPolarAxesActor_h
49#include "vtkRenderingAnnotationModule.h"
56VTK_ABI_NAMESPACE_BEGIN
90 virtual void SetPole(
double,
double,
double);
91 vtkGetVector3Macro(Pole,
double);
99 vtkSetMacro(Log,
bool);
100 vtkGetMacro(Log,
bool);
101 vtkBooleanMacro(Log,
bool);
109 vtkSetClampMacro(RequestedNumberOfRadialAxes,
vtkIdType, 0, VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES);
118 vtkSetClampMacro(RequestedNumberOfPolarAxes,
vtkIdType, 0, VTK_MAXIMUM_NUMBER_OF_POLAR_AXES);
127 vtkSetVector2Macro(Range,
double);
128 vtkGetVectorMacro(Range,
double, 2);
137 vtkGetMacro(MinimumRadius,
double);
146 vtkGetMacro(MaximumRadius,
double);
155 vtkGetMacro(MinimumAngle,
double);
164 vtkGetMacro(MaximumAngle,
double);
173 vtkSetClampMacro(SmallestVisiblePolarAngle,
double, 0., 5.);
174 vtkGetMacro(SmallestVisiblePolarAngle,
double);
185 vtkGetMacro(TickLocation,
int);
192 vtkSetMacro(RadialUnits,
bool);
193 vtkGetMacro(RadialUnits,
bool);
203 vtkSetMacro(ScreenSize,
double);
204 vtkGetMacro(ScreenSize,
double);
213 vtkSetVector2Macro(PolarTitleOffset,
double);
214 vtkGetVectorMacro(PolarTitleOffset,
double, 2);
223 vtkSetVector2Macro(RadialTitleOffset,
double);
224 vtkGetVectorMacro(RadialTitleOffset,
double, 2);
232 vtkGetMacro(PolarLabelOffset,
double);
233 vtkSetMacro(PolarLabelOffset,
double);
241 vtkGetMacro(PolarExponentOffset,
double);
242 vtkSetMacro(PolarExponentOffset,
double);
259 vtkGetMacro(PolarAxisTitle, std::string);
260 vtkSetMacro(PolarAxisTitle, std::string);
267 vtkSetStringMacro(PolarLabelFormat);
268 vtkGetStringMacro(PolarLabelFormat);
273 VTK_EXPONENT_BOTTOM = 0,
274 VTK_EXPONENT_EXTERN = 1,
275 VTK_EXPONENT_LABELS = 2
292 vtkSetStringMacro(RadialAngleFormat);
293 vtkGetStringMacro(RadialAngleFormat);
308 vtkSetMacro(EnableDistanceLOD,
bool);
309 vtkGetMacro(EnableDistanceLOD,
bool);
317 vtkSetClampMacro(DistanceLODThreshold,
double, 0.0, 1.0);
318 vtkGetMacro(DistanceLODThreshold,
double);
326 vtkSetMacro(EnableViewAngleLOD,
bool);
327 vtkGetMacro(EnableViewAngleLOD,
bool);
335 vtkSetClampMacro(ViewAngleLODThreshold,
double, 0., 1.);
336 vtkGetMacro(ViewAngleLODThreshold,
double);
344 vtkSetMacro(PolarAxisVisibility,
bool);
345 vtkGetMacro(PolarAxisVisibility,
bool);
346 vtkBooleanMacro(PolarAxisVisibility,
bool);
354 vtkSetMacro(DrawRadialGridlines,
bool);
355 vtkGetMacro(DrawRadialGridlines,
bool);
356 vtkBooleanMacro(DrawRadialGridlines,
bool);
364 vtkSetMacro(DrawPolarArcsGridlines,
bool);
365 vtkGetMacro(DrawPolarArcsGridlines,
bool);
366 vtkBooleanMacro(DrawPolarArcsGridlines,
bool);
374 vtkSetMacro(PolarTitleVisibility,
bool);
375 vtkGetMacro(PolarTitleVisibility,
bool);
376 vtkBooleanMacro(PolarTitleVisibility,
bool);
381 VTK_TITLE_BOTTOM = 0,
391 vtkSetClampMacro(RadialAxisTitleLocation,
int, VTK_TITLE_BOTTOM, VTK_TITLE_EXTERN);
392 vtkGetMacro(RadialAxisTitleLocation,
int);
401 vtkSetClampMacro(PolarAxisTitleLocation,
int, VTK_TITLE_BOTTOM, VTK_TITLE_EXTERN);
402 vtkGetMacro(PolarAxisTitleLocation,
int);
410 vtkSetMacro(PolarLabelVisibility,
bool);
411 vtkGetMacro(PolarLabelVisibility,
bool);
412 vtkBooleanMacro(PolarLabelVisibility,
bool);
422 vtkSetMacro(ArcTicksOriginToPolarAxis,
bool);
423 vtkGetMacro(ArcTicksOriginToPolarAxis,
bool);
424 vtkBooleanMacro(ArcTicksOriginToPolarAxis,
bool);
434 vtkSetMacro(RadialAxesOriginToPolarAxis,
bool);
435 vtkGetMacro(RadialAxesOriginToPolarAxis,
bool);
436 vtkBooleanMacro(RadialAxesOriginToPolarAxis,
bool);
444 vtkSetMacro(PolarTickVisibility,
bool);
445 vtkGetMacro(PolarTickVisibility,
bool);
446 vtkBooleanMacro(PolarTickVisibility,
bool);
454 vtkSetMacro(AxisTickVisibility,
bool);
455 vtkGetMacro(AxisTickVisibility,
bool);
456 vtkBooleanMacro(AxisTickVisibility,
bool);
464 vtkSetMacro(AxisMinorTickVisibility,
bool);
465 vtkGetMacro(AxisMinorTickVisibility,
bool);
466 vtkBooleanMacro(AxisMinorTickVisibility,
bool);
474 vtkSetMacro(AxisTickMatchesPolarAxes,
bool);
475 vtkGetMacro(AxisTickMatchesPolarAxes,
bool);
476 vtkBooleanMacro(AxisTickMatchesPolarAxes,
bool);
484 vtkSetMacro(ArcTickVisibility,
bool);
485 vtkGetMacro(ArcTickVisibility,
bool);
486 vtkBooleanMacro(ArcTickVisibility,
bool);
494 vtkSetMacro(ArcMinorTickVisibility,
bool);
495 vtkGetMacro(ArcMinorTickVisibility,
bool);
496 vtkBooleanMacro(ArcMinorTickVisibility,
bool);
504 vtkSetMacro(ArcTickMatchesRadialAxes,
bool);
505 vtkGetMacro(ArcTickMatchesRadialAxes,
bool);
506 vtkBooleanMacro(ArcTickMatchesRadialAxes,
bool);
515 vtkSetMacro(ArcMajorTickSize,
double);
516 vtkGetMacro(ArcMajorTickSize,
double);
525 vtkSetMacro(PolarAxisMajorTickSize,
double);
526 vtkGetMacro(PolarAxisMajorTickSize,
double);
535 vtkSetMacro(LastRadialAxisMajorTickSize,
double);
536 vtkGetMacro(LastRadialAxisMajorTickSize,
double);
544 vtkSetMacro(PolarAxisTickRatioSize,
double);
545 vtkGetMacro(PolarAxisTickRatioSize,
double);
553 vtkSetMacro(LastAxisTickRatioSize,
double);
554 vtkGetMacro(LastAxisTickRatioSize,
double);
562 vtkSetMacro(ArcTickRatioSize,
double);
563 vtkGetMacro(ArcTickRatioSize,
double);
571 vtkSetMacro(TickRatioRadiusSize,
double);
572 vtkGetMacro(TickRatioRadiusSize,
double);
580 vtkSetMacro(PolarAxisMajorTickThickness,
double);
581 vtkGetMacro(PolarAxisMajorTickThickness,
double);
589 vtkSetMacro(LastRadialAxisMajorTickThickness,
double);
590 vtkGetMacro(LastRadialAxisMajorTickThickness,
double);
598 vtkSetMacro(ArcMajorTickThickness,
double);
599 vtkGetMacro(ArcMajorTickThickness,
double);
607 vtkSetMacro(PolarAxisTickRatioThickness,
double);
608 vtkGetMacro(PolarAxisTickRatioThickness,
double);
616 vtkSetMacro(LastAxisTickRatioThickness,
double);
617 vtkGetMacro(LastAxisTickRatioThickness,
double);
625 vtkSetMacro(ArcTickRatioThickness,
double);
626 vtkGetMacro(ArcTickRatioThickness,
double);
634 vtkSetMacro(DeltaRangeMajor,
double);
635 vtkGetMacro(DeltaRangeMajor,
double);
643 vtkSetMacro(DeltaRangeMinor,
double);
644 vtkGetMacro(DeltaRangeMinor,
double);
653 vtkSetMacro(RequestedDeltaRangePolarAxes,
double);
654 vtkGetMacro(RequestedDeltaRangePolarAxes,
double);
662 vtkSetMacro(DeltaAngleMajor,
double);
663 vtkGetMacro(DeltaAngleMajor,
double);
671 vtkSetMacro(DeltaAngleMinor,
double);
672 vtkGetMacro(DeltaAngleMinor,
double);
681 vtkSetMacro(RequestedDeltaAngleRadialAxes,
double);
682 vtkGetMacro(RequestedDeltaAngleRadialAxes,
double);
692 vtkSetMacro(RadialAxesVisibility,
bool);
693 vtkGetMacro(RadialAxesVisibility,
bool);
694 vtkBooleanMacro(RadialAxesVisibility,
bool);
702 vtkSetMacro(RadialTitleVisibility,
bool);
703 vtkGetMacro(RadialTitleVisibility,
bool);
704 vtkBooleanMacro(RadialTitleVisibility,
bool);
712 vtkSetMacro(PolarArcsVisibility,
bool);
713 vtkGetMacro(PolarArcsVisibility,
bool);
714 vtkBooleanMacro(PolarArcsVisibility,
bool);
805 vtkSetVector6Macro(Bounds,
double);
808 double& xmin,
double& xmax,
double& ymin,
double& ymax,
double& zmin,
double& zmax);
817 vtkSetClampMacro(Ratio,
double, 0.001, 100.0);
818 vtkGetMacro(Ratio,
double);
826 vtkSetClampMacro(PolarArcResolutionPerDegree,
double, VTK_MINIMUM_POLAR_ARC_RESOLUTION_PER_DEG,
827 VTK_MAXIMUM_POLAR_ARC_RESOLUTION_PER_DEG);
828 vtkGetMacro(PolarArcResolutionPerDegree,
double);
888 double a,
double angleEllipseRad,
double tickSize,
vtkPoints* tickPts);
951 double Pole[3] = { 0.0, 0.0, 0.0 };
956 int NumberOfRadialAxes = 0;
962 int RequestedNumberOfRadialAxes = 0;
967 int NumberOfPolarAxes = 5;
973 int RequestedNumberOfPolarAxes = 5;
983 double PolarArcResolutionPerDegree = 0.2;
988 double Range[2] = { 0.0, 10.0 };
993 double DeltaRangeMinor = 0.5;
998 double DeltaRangeMajor = 1.0;
1003 double DeltaRangePolarAxes = 0.0;
1009 double RequestedDeltaRangePolarAxes = 0.0;
1014 double DeltaAngleMinor = 22.5;
1019 double DeltaAngleMajor = 45.0;
1024 double DeltaAngleRadialAxes = 45.0;
1030 double RequestedDeltaAngleRadialAxes = 45.0;
1035 double MinimumRadius = 0.0;
1040 double MaximumRadius = 1.0;
1050 double MinimumAngle = 0.0;
1055 double MaximumAngle = 90.0;
1060 double SmallestVisiblePolarAngle = 0.5;
1089 std::vector<vtkSmartPointer<vtkAxisActor>> RadialAxes;
1096 std::string PolarAxisTitle =
"Radial Distance";
1097 char* PolarLabelFormat =
nullptr;
1103 char* RadialAngleFormat =
nullptr;
1108 bool RadialUnits =
true;
1113 bool EnableDistanceLOD =
true;
1118 double DistanceLODThreshold = 0.7;
1123 bool EnableViewAngleLOD =
true;
1129 double ViewAngleLODThreshold = 0.3;
1135 bool PolarAxisVisibility =
true;
1136 bool PolarTitleVisibility =
true;
1137 bool PolarLabelVisibility =
true;
1152 bool PolarTickVisibility =
true;
1160 bool ArcTicksOriginToPolarAxis =
true;
1168 bool RadialAxesOriginToPolarAxis =
true;
1173 bool AxisTickVisibility =
true, AxisMinorTickVisibility =
false;
1178 bool AxisTickMatchesPolarAxes =
true;
1183 bool ArcTickVisibility =
true, ArcMinorTickVisibility =
false;
1188 bool ArcTickMatchesRadialAxes =
true;
1193 double PolarAxisMajorTickSize = 0.0, LastRadialAxisMajorTickSize = 0.0, ArcMajorTickSize = 0.0;
1198 double PolarAxisTickRatioSize = 0.3, LastAxisTickRatioSize = 0.3, ArcTickRatioSize = 0.3;
1203 double TickRatioRadiusSize = 0.02;
1208 double PolarAxisMajorTickThickness = 1.0, LastRadialAxisMajorTickThickness = 1.0,
1209 ArcMajorTickThickness = 1.0;
1214 double PolarAxisTickRatioThickness = 0.5, LastAxisTickRatioThickness = 0.5,
1215 ArcTickRatioThickness = 0.5;
1221 bool RadialAxesVisibility =
true;
1222 bool RadialTitleVisibility =
true;
1228 int RadialAxisTitleLocation = VTK_TITLE_BOTTOM;
1233 int PolarAxisTitleLocation = VTK_TITLE_BOTTOM;
1239 int ExponentLocation = VTK_EXPONENT_LABELS;
1244 bool PolarArcsVisibility =
true;
1249 bool DrawRadialGridlines =
true;
1254 bool DrawPolarArcsGridlines =
true;
1317 double ScreenSize = 10.0;
1323 double PolarTitleOffset[2] = { 20.0, 10.0 }, RadialTitleOffset[2] = { 20.0, 0.0 };
1324 double PolarLabelOffset = 10.0, PolarExponentOffset = 5.0;
1327 static constexpr int VTK_MAXIMUM_NUMBER_OF_POLAR_AXES = 20;
1328 static constexpr int VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES = 50;
1329 static constexpr double VTK_MINIMUM_POLAR_ARC_RESOLUTION_PER_DEG = 0.05;
1330 static constexpr double VTK_MAXIMUM_POLAR_ARC_RESOLUTION_PER_DEG = 100.0;
1336VTK_ABI_NAMESPACE_END
represents an object (geometry & properties) in a rendered scene
Create an axis with tick marks and labels.
a virtual camera for 3D rendering
a simple class to control print indentation
Allocate and hold a VTK object.
represent and manipulate 3D points
create an actor of a polar axes -
vtkProperty * GetLastRadialAxisProperty()
Get/Set last radial axis actor properties.
virtual void SetCamera(vtkCamera *)
Set/Get the camera to perform scaling and translation of the vtkPolarAxesActor.
double * GetBounds() override
Explicitly specify the region in space around which to draw the bounds.
vtkTextProperty * GetLastRadialAxisTextProperty()
Set/Get the last radial axis text property.
virtual void SetPolarAxisProperty(vtkProperty *)
Get/Set polar axis actor properties.
void CalculateBounds()
Calculate bounds based on maximum radius and angular sector.
vtkTextProperty * GetSecondaryRadialAxesTextProperty()
Set/Get the secondary radial axes text property.
void GetBounds(double bounds[6])
Explicitly specify the region in space around which to draw the bounds.
void AutoScale(vtkViewport *viewport)
Automatically rescale titles and labels NB: Current implementation only for perspective projections.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool GetUse2DMode()
Enable/Disable labels 2D mode (always facing the camera).
virtual void SetLastRadialAxisTextProperty(vtkTextProperty *p)
Set/Get the last radial axis text property.
void BuildPolarAxisLabelsArcs()
Build polar axis labels and arcs with respect to specified pole.
virtual void SetLastRadialAxisProperty(vtkProperty *p)
Get/Set last radial axis actor properties.
virtual void SetSecondaryPolarArcsProperty(vtkProperty *p)
Get/Set secondary polar arcs actors property.
virtual void SetSecondaryRadialAxesProperty(vtkProperty *p)
Get/Set secondary radial axes actors properties.
void StoreTicksPtsFromParamEllipse(double a, double angleEllipseRad, double tickSize, vtkPoints *tickPts)
Init tick point located on an ellipse at angleEllipseRad angle and according to "a" major radius.
vtkTextProperty * GetPolarAxisTitleTextProperty()
Set/Get the polar axis title text property.
virtual void SetMinimumRadius(double)
Set/Get the minimal radius of the polar coordinates.
virtual void ComputeDeltaAngleRadialAxes(vtkIdType)
Compute delta angle of radial axes.
static vtkPolarAxesActor * New()
Instantiate object with label format "6.3g" and the number of labels per axis set to 3.
void GetBounds(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
Explicitly specify the region in space around which to draw the bounds.
vtkCamera * GetCamera()
Set/Get the camera to perform scaling and translation of the vtkPolarAxesActor.
void GetSignificantPartFromValues(vtkStringArray *valuesStr, std::list< double > &valuesList)
Yield a string array with the float part of each values.
virtual void SetMinimumAngle(double)
Set/Get the minimum radius of the polar coordinates (in degrees).
vtkProperty * GetPolarArcsProperty()
Get/Set principal polar arc actor property.
virtual void SetPole(double[3])
Explicitly specify the coordinate of the pole.
void BuildLabelsLog()
Define label values.
void BuildArcTicks()
Build Arc ticks.
void CreateRadialAxes(int axisCount)
Create requested number of type X axes.
double FSign(double, double)
Convenience methods.
void BuildRadialAxes(vtkViewport *viewport=nullptr)
Build requested number of radial axes with respect to specified pole.
double ComputeIdealStep(int subDivsRequired, double rangeLength, int maxSubDivs=1000)
return a step attempting to be as rounded as possible according to input parameters
static double ComputeEllipseAngle(double angleInDegrees, double ratio)
convert section angle to an angle applied to ellipse equation.
virtual void SetPolarAxisTitleTextProperty(vtkTextProperty *p)
Set/Get the polar axis title text property.
bool CheckMembersConsistency()
Check consistency of vtkPolarAxesActor members.
vtkProperty * GetSecondaryPolarArcsProperty()
Get/Set secondary polar arcs actors property.
void BuildPolarAxisLabelsArcsLog()
Build labels and arcs with log scale axis.
virtual void SetSecondaryRadialAxesTextProperty(vtkTextProperty *p)
Set/Get the secondary radial axes text property.
int RenderOverlay(vtkViewport *) override
Draw the polar axes.
virtual void ComputeDeltaRangePolarAxes(vtkIdType)
Compute delta range of polar axes.
void SetCommonAxisAttributes(vtkAxisActor *)
Send attributes which are common to all axes, both polar and radial.
vtkProperty * GetSecondaryRadialAxesProperty()
Get/Set secondary radial axes actors properties.
virtual void SetMaximumRadius(double)
Set/Get the maximum radius of the polar coordinates.
double FFix(double)
Convenience methods.
virtual void SetPole(double, double, double)
Explicitly specify the coordinate of the pole.
void SetUse2DMode(bool enable)
Enable/Disable labels 2D mode (always facing the camera).
int RenderOpaqueGeometry(vtkViewport *) override
Draw the polar axes.
void SetPolarAxisAttributes(vtkAxisActor *)
Set properties specific to PolarAxis.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
std::string FindExponentAndAdjustValues(std::list< double > &valuesList)
Find a common exponent for label values.
virtual void SetMaximumAngle(double)
Set/Get the maximum radius of the polar coordinates (in degrees).
vtkTextProperty * GetPolarAxisLabelTextProperty()
Set/Get the polar axis labels text property.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the polar axes.
~vtkPolarAxesActor() override
virtual void SetPolarAxisLabelTextProperty(vtkTextProperty *p)
Set/Get the polar axis labels text property.
vtkProperty * GetPolarAxisProperty()
Get/Set polar axis actor properties.
void BuildAxes(vtkViewport *)
Build the axes.
virtual void SetPolarArcsProperty(vtkProperty *p)
Get/Set principal polar arc actor property.
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
Hold a reference to a vtkObjectBase instance.
a vtkAbstractArray subclass for strings
represent text properties.
record modification and/or execution time
abstract specification for Viewports
window superclass for vtkRenderWindow