24#ifndef vtkPolarAxesActor_h
25#define vtkPolarAxesActor_h
30#include "vtkRenderingAnnotationModule.h"
37VTK_ABI_NAMESPACE_BEGIN
76 virtual void SetPole(
double,
double,
double);
77 vtkGetVector3Macro(Pole,
double);
85 vtkSetMacro(Log,
bool);
86 vtkGetMacro(Log,
bool);
87 vtkBooleanMacro(Log,
bool);
95 vtkSetClampMacro(RequestedNumberOfRadialAxes,
vtkIdType, 0, VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES);
96 vtkGetMacro(RequestedNumberOfRadialAxes,
vtkIdType);
104 vtkSetClampMacro(RequestedNumberOfPolarAxes,
vtkIdType, 0, VTK_MAXIMUM_NUMBER_OF_POLAR_AXES);
113 vtkSetVector2Macro(Range,
double);
114 vtkGetVectorMacro(Range,
double, 2);
123 vtkGetMacro(MinimumRadius,
double);
132 vtkGetMacro(MaximumRadius,
double);
141 vtkGetMacro(MinimumAngle,
double);
150 vtkGetMacro(MaximumAngle,
double);
159 vtkSetClampMacro(SmallestVisiblePolarAngle,
double, 0., 5.);
160 vtkGetMacro(SmallestVisiblePolarAngle,
double);
171 vtkGetMacro(TickLocation,
int);
178 vtkSetMacro(RadialUnits,
bool);
179 vtkGetMacro(RadialUnits,
bool);
189 vtkSetMacro(ScreenSize,
double);
190 vtkGetMacro(ScreenSize,
double);
199 vtkSetVector2Macro(PolarTitleOffset,
double);
200 vtkGetVectorMacro(PolarTitleOffset,
double, 2);
209 vtkSetVector2Macro(RadialTitleOffset,
double);
210 vtkGetVectorMacro(RadialTitleOffset,
double, 2);
218 vtkGetMacro(PolarLabelOffset,
double);
219 vtkSetMacro(PolarLabelOffset,
double);
227 vtkGetMacro(PolarExponentOffset,
double);
228 vtkSetMacro(PolarExponentOffset,
double);
245 vtkGetMacro(PolarAxisTitle, std::string);
246 vtkSetMacro(PolarAxisTitle, std::string);
253 vtkSetStringMacro(PolarLabelFormat);
254 vtkGetStringMacro(PolarLabelFormat);
279 vtkSetStringMacro(RadialAngleFormat);
280 vtkGetStringMacro(RadialAngleFormat);
295 vtkSetMacro(EnableDistanceLOD,
bool);
296 vtkGetMacro(EnableDistanceLOD,
bool);
304 vtkSetClampMacro(DistanceLODThreshold,
double, 0.0, 1.0);
305 vtkGetMacro(DistanceLODThreshold,
double);
313 vtkSetMacro(EnableViewAngleLOD,
bool);
314 vtkGetMacro(EnableViewAngleLOD,
bool);
322 vtkSetClampMacro(ViewAngleLODThreshold,
double, 0., 1.);
323 vtkGetMacro(ViewAngleLODThreshold,
double);
331 vtkSetMacro(PolarAxisVisibility,
bool);
332 vtkGetMacro(PolarAxisVisibility,
bool);
333 vtkBooleanMacro(PolarAxisVisibility,
bool);
341 vtkSetMacro(DrawRadialGridlines,
bool);
342 vtkGetMacro(DrawRadialGridlines,
bool);
343 vtkBooleanMacro(DrawRadialGridlines,
bool);
351 vtkSetMacro(DrawPolarArcsGridlines,
bool);
352 vtkGetMacro(DrawPolarArcsGridlines,
bool);
353 vtkBooleanMacro(DrawPolarArcsGridlines,
bool);
361 vtkSetMacro(PolarTitleVisibility,
bool);
362 vtkGetMacro(PolarTitleVisibility,
bool);
363 vtkBooleanMacro(PolarTitleVisibility,
bool);
379 vtkGetMacro(RadialAxisTitleLocation,
int);
389 vtkGetMacro(PolarAxisTitleLocation,
int);
397 vtkSetMacro(PolarLabelVisibility,
bool);
398 vtkGetMacro(PolarLabelVisibility,
bool);
399 vtkBooleanMacro(PolarLabelVisibility,
bool);
409 vtkSetMacro(ArcTicksOriginToPolarAxis,
bool);
410 vtkGetMacro(ArcTicksOriginToPolarAxis,
bool);
411 vtkBooleanMacro(ArcTicksOriginToPolarAxis,
bool);
421 vtkSetMacro(RadialAxesOriginToPolarAxis,
bool);
422 vtkGetMacro(RadialAxesOriginToPolarAxis,
bool);
423 vtkBooleanMacro(RadialAxesOriginToPolarAxis,
bool);
431 vtkSetMacro(PolarTickVisibility,
bool);
432 vtkGetMacro(PolarTickVisibility,
bool);
433 vtkBooleanMacro(PolarTickVisibility,
bool);
441 vtkSetMacro(AxisTickVisibility,
bool);
442 vtkGetMacro(AxisTickVisibility,
bool);
443 vtkBooleanMacro(AxisTickVisibility,
bool);
451 vtkSetMacro(AxisMinorTickVisibility,
bool);
452 vtkGetMacro(AxisMinorTickVisibility,
bool);
453 vtkBooleanMacro(AxisMinorTickVisibility,
bool);
461 vtkSetMacro(AxisTickMatchesPolarAxes,
bool);
462 vtkGetMacro(AxisTickMatchesPolarAxes,
bool);
463 vtkBooleanMacro(AxisTickMatchesPolarAxes,
bool);
471 vtkSetMacro(ArcTickVisibility,
bool);
472 vtkGetMacro(ArcTickVisibility,
bool);
473 vtkBooleanMacro(ArcTickVisibility,
bool);
481 vtkSetMacro(ArcMinorTickVisibility,
bool);
482 vtkGetMacro(ArcMinorTickVisibility,
bool);
483 vtkBooleanMacro(ArcMinorTickVisibility,
bool);
491 vtkSetMacro(ArcTickMatchesRadialAxes,
bool);
492 vtkGetMacro(ArcTickMatchesRadialAxes,
bool);
493 vtkBooleanMacro(ArcTickMatchesRadialAxes,
bool);
502 vtkSetMacro(ArcMajorTickSize,
double);
503 vtkGetMacro(ArcMajorTickSize,
double);
512 vtkSetMacro(PolarAxisMajorTickSize,
double);
513 vtkGetMacro(PolarAxisMajorTickSize,
double);
522 vtkSetMacro(LastRadialAxisMajorTickSize,
double);
523 vtkGetMacro(LastRadialAxisMajorTickSize,
double);
531 vtkSetMacro(PolarAxisTickRatioSize,
double);
532 vtkGetMacro(PolarAxisTickRatioSize,
double);
540 vtkSetMacro(LastAxisTickRatioSize,
double);
541 vtkGetMacro(LastAxisTickRatioSize,
double);
549 vtkSetMacro(ArcTickRatioSize,
double);
550 vtkGetMacro(ArcTickRatioSize,
double);
558 vtkSetMacro(TickRatioRadiusSize,
double);
559 vtkGetMacro(TickRatioRadiusSize,
double);
567 vtkSetMacro(PolarAxisMajorTickThickness,
double);
568 vtkGetMacro(PolarAxisMajorTickThickness,
double);
576 vtkSetMacro(LastRadialAxisMajorTickThickness,
double);
577 vtkGetMacro(LastRadialAxisMajorTickThickness,
double);
585 vtkSetMacro(ArcMajorTickThickness,
double);
586 vtkGetMacro(ArcMajorTickThickness,
double);
594 vtkSetMacro(PolarAxisTickRatioThickness,
double);
595 vtkGetMacro(PolarAxisTickRatioThickness,
double);
603 vtkSetMacro(LastAxisTickRatioThickness,
double);
604 vtkGetMacro(LastAxisTickRatioThickness,
double);
612 vtkSetMacro(ArcTickRatioThickness,
double);
613 vtkGetMacro(ArcTickRatioThickness,
double);
621 vtkSetMacro(DeltaRangeMajor,
double);
622 vtkGetMacro(DeltaRangeMajor,
double);
630 vtkSetMacro(DeltaRangeMinor,
double);
631 vtkGetMacro(DeltaRangeMinor,
double);
640 vtkSetMacro(RequestedDeltaRangePolarAxes,
double);
641 vtkGetMacro(RequestedDeltaRangePolarAxes,
double);
649 vtkSetMacro(DeltaAngleMajor,
double);
650 vtkGetMacro(DeltaAngleMajor,
double);
658 vtkSetMacro(DeltaAngleMinor,
double);
659 vtkGetMacro(DeltaAngleMinor,
double);
668 vtkSetMacro(RequestedDeltaAngleRadialAxes,
double);
669 vtkGetMacro(RequestedDeltaAngleRadialAxes,
double);
679 vtkSetMacro(RadialAxesVisibility,
bool);
680 vtkGetMacro(RadialAxesVisibility,
bool);
681 vtkBooleanMacro(RadialAxesVisibility,
bool);
689 vtkSetMacro(RadialTitleVisibility,
bool);
690 vtkGetMacro(RadialTitleVisibility,
bool);
691 vtkBooleanMacro(RadialTitleVisibility,
bool);
699 vtkSetMacro(PolarArcsVisibility,
bool);
700 vtkGetMacro(PolarArcsVisibility,
bool);
701 vtkBooleanMacro(PolarArcsVisibility,
bool);
802 double& xmin,
double& xmax,
double& ymin,
double& ymax,
double& zmin,
double& zmax);
814 vtkSetClampMacro(Ratio,
double, 0.001, 100.0);
815 vtkGetMacro(Ratio,
double);
823 vtkSetClampMacro(PolarArcResolutionPerDegree,
double, VTK_MINIMUM_POLAR_ARC_RESOLUTION_PER_DEG,
824 VTK_MAXIMUM_POLAR_ARC_RESOLUTION_PER_DEG);
825 vtkGetMacro(PolarArcResolutionPerDegree,
double);
885 double a,
double angleEllipseRad,
double tickSize,
vtkPoints* tickPts);
948 double Pole[3] = { 0.0, 0.0, 0.0 };
953 int NumberOfRadialAxes = 0;
959 int RequestedNumberOfRadialAxes = 0;
964 int NumberOfPolarAxes = 5;
970 int RequestedNumberOfPolarAxes = 5;
980 double PolarArcResolutionPerDegree = 0.2;
985 double Range[2] = { 0.0, 10.0 };
990 double DeltaRangeMinor = 0.5;
995 double DeltaRangeMajor = 1.0;
1000 double DeltaRangePolarAxes = 0.0;
1006 double RequestedDeltaRangePolarAxes = 0.0;
1011 double DeltaAngleMinor = 22.5;
1016 double DeltaAngleMajor = 45.0;
1021 double DeltaAngleRadialAxes = 45.0;
1027 double RequestedDeltaAngleRadialAxes = 45.0;
1032 double MinimumRadius = 0.0;
1037 double MaximumRadius = 1.0;
1047 double MinimumAngle = 0.0;
1052 double MaximumAngle = 90.0;
1057 double SmallestVisiblePolarAngle = 0.5;
1060 vtkNew<vtkPolyData> PolarArcs;
1061 vtkNew<vtkPolyDataMapper> PolarArcsMapper;
1062 vtkNew<vtkActor> PolarArcsActor;
1068 vtkNew<vtkPolyData> SecondaryPolarArcs;
1069 vtkNew<vtkPolyDataMapper> SecondaryPolarArcsMapper;
1070 vtkNew<vtkActor> SecondaryPolarArcsActor;
1076 vtkSmartPointer<vtkCamera>
Camera;
1081 vtkNew<vtkAxisActor> PolarAxis;
1086 std::vector<vtkSmartPointer<vtkAxisActor>> RadialAxes;
1093 std::string PolarAxisTitle =
"Radial Distance";
1094 char* PolarLabelFormat =
nullptr;
1100 char* RadialAngleFormat =
nullptr;
1105 bool RadialUnits =
true;
1110 bool EnableDistanceLOD =
true;
1115 double DistanceLODThreshold = 0.7;
1120 bool EnableViewAngleLOD =
true;
1126 double ViewAngleLODThreshold = 0.3;
1132 bool PolarAxisVisibility =
true;
1133 bool PolarTitleVisibility =
true;
1134 bool PolarLabelVisibility =
true;
1149 bool PolarTickVisibility =
true;
1157 bool ArcTicksOriginToPolarAxis =
true;
1165 bool RadialAxesOriginToPolarAxis =
true;
1170 bool AxisTickVisibility =
true, AxisMinorTickVisibility =
false;
1175 bool AxisTickMatchesPolarAxes =
true;
1180 bool ArcTickVisibility =
true, ArcMinorTickVisibility =
false;
1185 bool ArcTickMatchesRadialAxes =
true;
1190 double PolarAxisMajorTickSize = 0.0, LastRadialAxisMajorTickSize = 0.0, ArcMajorTickSize = 0.0;
1195 double PolarAxisTickRatioSize = 0.3, LastAxisTickRatioSize = 0.3, ArcTickRatioSize = 0.3;
1200 double TickRatioRadiusSize = 0.02;
1205 double PolarAxisMajorTickThickness = 1.0, LastRadialAxisMajorTickThickness = 1.0,
1206 ArcMajorTickThickness = 1.0;
1211 double PolarAxisTickRatioThickness = 0.5, LastAxisTickRatioThickness = 0.5,
1212 ArcTickRatioThickness = 0.5;
1218 bool RadialAxesVisibility =
true;
1219 bool RadialTitleVisibility =
true;
1225 int RadialAxisTitleLocation = VTK_TITLE_BOTTOM;
1230 int PolarAxisTitleLocation = VTK_TITLE_BOTTOM;
1236 int ExponentLocation = VTK_EXPONENT_LABELS;
1241 bool PolarArcsVisibility =
true;
1246 bool DrawRadialGridlines =
true;
1251 bool DrawPolarArcsGridlines =
true;
1256 vtkNew<vtkPoints> ArcMajorTickPts;
1261 vtkNew<vtkPoints> ArcMinorTickPts;
1267 vtkNew<vtkPolyData> ArcTickPolyData;
1268 vtkNew<vtkPolyData> ArcMinorTickPolyData;
1269 vtkNew<vtkPolyDataMapper> ArcTickPolyDataMapper;
1270 vtkNew<vtkPolyDataMapper> ArcMinorTickPolyDataMapper;
1271 vtkNew<vtkActor> ArcTickActor;
1272 vtkNew<vtkActor> ArcMinorTickActor;
1279 vtkSmartPointer<vtkTextProperty> PolarAxisTitleTextProperty;
1280 vtkSmartPointer<vtkTextProperty> PolarAxisLabelTextProperty;
1286 vtkSmartPointer<vtkTextProperty> LastRadialAxisTextProperty;
1291 vtkSmartPointer<vtkTextProperty> SecondaryRadialAxesTextProperty;
1297 vtkSmartPointer<vtkProperty> PolarAxisProperty;
1302 vtkSmartPointer<vtkProperty> LastRadialAxisProperty;
1307 vtkSmartPointer<vtkProperty> SecondaryRadialAxesProperty;
1314 double ScreenSize = 10.0;
1320 double PolarTitleOffset[2] = { 20.0, 10.0 }, RadialTitleOffset[2] = { 20.0, 0.0 };
1321 double PolarLabelOffset = 10.0, PolarExponentOffset = 5.0;
1324 static constexpr int VTK_MAXIMUM_NUMBER_OF_POLAR_AXES = 20;
1325 static constexpr int VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES = 50;
1326 static constexpr double VTK_MINIMUM_POLAR_ARC_RESOLUTION_PER_DEG = 0.05;
1327 static constexpr double VTK_MAXIMUM_POLAR_ARC_RESOLUTION_PER_DEG = 100.0;
1329 vtkPolarAxesActor(
const vtkPolarAxesActor&) =
delete;
1330 void operator=(
const vtkPolarAxesActor&) =
delete;
1333VTK_ABI_NAMESPACE_END
Create an axis with tick marks and labels.
a virtual camera for 3D rendering
a simple class to control print indentation
represent and manipulate 3D points
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()
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 SetUseTextActor3D(bool enable)
Enable / Disable labels text 3D mode in underlying axes.
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.
void GetRendered3DProps(vtkPropCollection *, bool translucent)
Fill the collection with the underlying vtkProp3D in use.
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.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Draw the polar axes.
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
a vtkAbstractArray subclass for strings
represent text properties.
abstract specification for Viewports
window superclass for vtkRenderWindow