76#ifndef vtkCubeAxesActor_h
77#define vtkCubeAxesActor_h
82#include "vtkRenderingAnnotationModule.h"
86VTK_ABI_NAMESPACE_BEGIN
120 vtkSetMacro(RebuildAxes,
bool);
121 vtkGetMacro(RebuildAxes,
bool);
131 vtkSetVector6Macro(Bounds,
double);
132 using Superclass::GetBounds;
154 vtkSetVector2Macro(XAxisRange,
double);
155 vtkSetVector2Macro(YAxisRange,
double);
156 vtkSetVector2Macro(ZAxisRange,
double);
157 vtkGetVector2Macro(XAxisRange,
double);
158 vtkGetVector2Macro(YAxisRange,
double);
169 vtkGetVector2Macro(ZAxisRange,
double);
179 vtkGetMacro(ScreenSize,
double);
188 vtkGetMacro(LabelOffset,
double);
197 void SetTitleOffset(
double titleOffsetY);
199 double GetTitleOffset();
200 void SetTitleOffset(
double titleOffset[2]);
202 void GetTitleOffset(
double& titleOffsetX,
double& titleOffsetY);
216 VTK_FLY_OUTER_EDGES = 0,
217 VTK_FLY_CLOSEST_TRIAD = 1,
218 VTK_FLY_FURTHEST_TRIAD = 2,
219 VTK_FLY_STATIC_TRIAD = 3,
220 VTK_FLY_STATIC_EDGES = 4
230 vtkSetClampMacro(
FlyMode,
int, VTK_FLY_OUTER_EDGES, VTK_FLY_STATIC_EDGES);
244 vtkSetStringMacro(XTitle);
245 vtkGetStringMacro(XTitle);
246 vtkSetStringMacro(XUnits);
247 vtkGetStringMacro(XUnits);
248 vtkSetStringMacro(YTitle);
249 vtkGetStringMacro(YTitle);
250 vtkSetStringMacro(YUnits);
251 vtkGetStringMacro(YUnits);
252 vtkSetStringMacro(ZTitle);
253 vtkGetStringMacro(ZTitle);
254 vtkSetStringMacro(ZUnits);
255 vtkGetStringMacro(ZUnits);
263 vtkSetStringMacro(XLabelFormat);
264 vtkGetStringMacro(XLabelFormat);
265 vtkSetStringMacro(YLabelFormat);
266 vtkGetStringMacro(YLabelFormat);
267 vtkSetStringMacro(ZLabelFormat);
268 vtkGetStringMacro(ZLabelFormat);
279 vtkGetMacro(Inertia,
int);
289 vtkSetMacro(CornerOffset,
double);
290 vtkGetMacro(CornerOffset,
double);
305 vtkSetMacro(EnableDistanceLOD,
bool);
306 vtkGetMacro(EnableDistanceLOD,
bool);
314 vtkSetClampMacro(DistanceLODThreshold,
double, 0.0, 1.0);
315 vtkGetMacro(DistanceLODThreshold,
double);
323 vtkSetMacro(EnableViewAngleLOD,
bool);
324 vtkGetMacro(EnableViewAngleLOD,
bool);
332 vtkSetClampMacro(ViewAngleLODThreshold,
double, 0., 1.);
333 vtkGetMacro(ViewAngleLODThreshold,
double);
341 vtkSetMacro(XAxisVisibility,
bool);
342 vtkGetMacro(XAxisVisibility,
bool);
343 vtkBooleanMacro(XAxisVisibility,
bool);
345 vtkSetMacro(YAxisVisibility,
bool);
346 vtkGetMacro(YAxisVisibility,
bool);
347 vtkBooleanMacro(YAxisVisibility,
bool);
349 vtkSetMacro(ZAxisVisibility,
bool);
350 vtkGetMacro(ZAxisVisibility,
bool);
351 vtkBooleanMacro(ZAxisVisibility,
bool);
359 vtkSetMacro(XAxisLabelVisibility,
bool);
360 vtkGetMacro(XAxisLabelVisibility,
bool);
361 vtkBooleanMacro(XAxisLabelVisibility,
bool);
363 vtkSetMacro(YAxisLabelVisibility,
bool);
364 vtkGetMacro(YAxisLabelVisibility,
bool);
365 vtkBooleanMacro(YAxisLabelVisibility,
bool);
367 vtkSetMacro(ZAxisLabelVisibility,
bool);
368 vtkGetMacro(ZAxisLabelVisibility,
bool);
369 vtkBooleanMacro(ZAxisLabelVisibility,
bool);
377 vtkSetMacro(XAxisTickVisibility,
bool);
378 vtkGetMacro(XAxisTickVisibility,
bool);
379 vtkBooleanMacro(XAxisTickVisibility,
bool);
381 vtkSetMacro(YAxisTickVisibility,
bool);
382 vtkGetMacro(YAxisTickVisibility,
bool);
383 vtkBooleanMacro(YAxisTickVisibility,
bool);
385 vtkSetMacro(ZAxisTickVisibility,
bool);
386 vtkGetMacro(ZAxisTickVisibility,
bool);
387 vtkBooleanMacro(ZAxisTickVisibility,
bool);
395 vtkSetMacro(XAxisMinorTickVisibility,
bool);
396 vtkGetMacro(XAxisMinorTickVisibility,
bool);
397 vtkBooleanMacro(XAxisMinorTickVisibility,
bool);
399 vtkSetMacro(YAxisMinorTickVisibility,
bool);
400 vtkGetMacro(YAxisMinorTickVisibility,
bool);
401 vtkBooleanMacro(YAxisMinorTickVisibility,
bool);
403 vtkSetMacro(ZAxisMinorTickVisibility,
bool);
404 vtkGetMacro(ZAxisMinorTickVisibility,
bool);
405 vtkBooleanMacro(ZAxisMinorTickVisibility,
bool);
413 vtkSetMacro(DrawXGridlines,
bool);
414 vtkGetMacro(DrawXGridlines,
bool);
415 vtkBooleanMacro(DrawXGridlines,
bool);
417 vtkSetMacro(DrawYGridlines,
bool);
418 vtkGetMacro(DrawYGridlines,
bool);
419 vtkBooleanMacro(DrawYGridlines,
bool);
421 vtkSetMacro(DrawZGridlines,
bool);
422 vtkGetMacro(DrawZGridlines,
bool);
423 vtkBooleanMacro(DrawZGridlines,
bool);
431 vtkSetMacro(DrawXInnerGridlines,
bool);
432 vtkGetMacro(DrawXInnerGridlines,
bool);
433 vtkBooleanMacro(DrawXInnerGridlines,
bool);
435 vtkSetMacro(DrawYInnerGridlines,
bool);
436 vtkGetMacro(DrawYInnerGridlines,
bool);
437 vtkBooleanMacro(DrawYInnerGridlines,
bool);
439 vtkSetMacro(DrawZInnerGridlines,
bool);
440 vtkGetMacro(DrawZInnerGridlines,
bool);
441 vtkBooleanMacro(DrawZInnerGridlines,
bool);
449 vtkSetMacro(DrawXGridpolys,
bool);
450 vtkGetMacro(DrawXGridpolys,
bool);
451 vtkBooleanMacro(DrawXGridpolys,
bool);
453 vtkSetMacro(DrawYGridpolys,
bool);
454 vtkGetMacro(DrawYGridpolys,
bool);
455 vtkBooleanMacro(DrawYGridpolys,
bool);
457 vtkSetMacro(DrawZGridpolys,
bool);
458 vtkGetMacro(DrawZGridpolys,
bool);
459 vtkBooleanMacro(DrawZGridpolys,
bool);
538 VTK_TICKS_INSIDE = 0,
539 VTK_TICKS_OUTSIDE = 1,
587 vtkSetVector6Macro(OrientedBounds,
double);
588 vtkGetVector6Macro(OrientedBounds,
double);
596 vtkSetMacro(UseOrientedBounds,
bool);
597 vtkGetMacro(UseOrientedBounds,
bool);
605 vtkSetVector3Macro(AxisBaseForX,
double);
606 vtkGetVector3Macro(AxisBaseForX,
double);
614 vtkSetVector3Macro(AxisBaseForY,
double);
615 vtkGetVector3Macro(AxisBaseForY,
double);
623 vtkSetVector3Macro(AxisBaseForZ,
double);
624 vtkGetVector3Macro(AxisBaseForZ,
double);
633 vtkSetVector3Macro(AxisOrigin,
double);
634 vtkGetVector3Macro(AxisOrigin,
double);
642 vtkSetMacro(UseAxisOrigin,
bool);
643 vtkGetMacro(UseAxisOrigin,
bool);
651 vtkSetMacro(GridLineLocation,
int);
652 vtkGetMacro(GridLineLocation,
int);
662 vtkSetMacro(StickyAxes,
bool);
663 vtkGetMacro(StickyAxes,
bool);
664 vtkBooleanMacro(StickyAxes,
bool);
676 vtkSetMacro(CenterStickyAxes,
bool);
677 vtkGetMacro(CenterStickyAxes,
bool);
678 vtkBooleanMacro(CenterStickyAxes,
bool);
683 VTK_GRID_LINES_ALL = 0,
684 VTK_GRID_LINES_CLOSEST = 1,
685 VTK_GRID_LINES_FURTHEST = 2
698 vtkViewport* viewport,
const double bounds[6],
double sphereCenter[3],
double& sphereRadius);
710 unsigned int pointIndex,
unsigned int& xBit,
unsigned int& yBit,
unsigned int& zBit);
715 static void GetBoundsPoint(
unsigned int pointIndex,
const double bounds[6],
double point[3]);
722 double MaxOf(
double,
double,
double,
double);
742 void FindBoundaryEdge(
int& indexOfAxisX,
int& indexOfAxisY,
int& indexOfAxisZ,
double pts[8][3]);
754 int GridLineLocation = VTK_GRID_LINES_ALL;
759 bool StickyAxes =
false;
764 bool CenterStickyAxes =
true;
770 bool EnableDistanceLOD =
true;
776 double DistanceLODThreshold = 0.8;
782 bool EnableViewAngleLOD =
true;
788 double ViewAngleLODThreshold = 0.2;
792 NUMBER_OF_ALIGNED_AXIS = 4
805 bool RebuildAxes =
true;
807 char* XTitle =
nullptr;
808 char* XUnits =
nullptr;
809 char* YTitle =
nullptr;
810 char* YUnits =
nullptr;
811 char* ZTitle =
nullptr;
812 char* ZUnits =
nullptr;
814 char* ActualXLabel =
nullptr;
815 char* ActualYLabel =
nullptr;
816 char* ActualZLabel =
nullptr;
820 bool XAxisVisibility =
true;
821 bool YAxisVisibility =
true;
822 bool ZAxisVisibility =
true;
824 bool XAxisTickVisibility =
true;
825 bool YAxisTickVisibility =
true;
826 bool ZAxisTickVisibility =
true;
828 bool XAxisMinorTickVisibility =
true;
829 bool YAxisMinorTickVisibility =
true;
830 bool ZAxisMinorTickVisibility =
true;
832 bool XAxisLabelVisibility =
true;
833 bool YAxisLabelVisibility =
true;
834 bool ZAxisLabelVisibility =
true;
836 bool DrawXGridlines =
false;
837 bool DrawYGridlines =
false;
838 bool DrawZGridlines =
false;
840 bool DrawXInnerGridlines =
false;
841 bool DrawYInnerGridlines =
false;
842 bool DrawZInnerGridlines =
false;
844 bool DrawXGridpolys =
false;
845 bool DrawYGridpolys =
false;
846 bool DrawZGridpolys =
false;
848 char* XLabelFormat =
nullptr;
849 char* YLabelFormat =
nullptr;
850 char* ZLabelFormat =
nullptr;
852 double CornerOffset = 0.0;
858 int InertiaLocs[3] = { -1, -1, -1 };
860 bool RenderSomething =
false;
879 double RenderedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
880 double OrientedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
881 bool UseOrientedBounds =
false;
883 double AxisOrigin[3] = { 0.0, 0.0, 0.0 };
884 bool UseAxisOrigin =
false;
886 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
887 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
888 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
894 vtkSetStringMacro(ActualXLabel);
895 vtkSetStringMacro(ActualYLabel);
896 vtkSetStringMacro(ActualZLabel);
899 bool LastUseOrientedBounds =
false;
908 bool AutoLabelScaling =
true;
910 int LastXAxisDigits = 3;
911 int LastYAxisDigits = 3;
912 int LastZAxisDigits = 3;
920 int LastFlyMode = -1;
922 int RenderAxesX[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
923 int RenderAxesY[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
924 int RenderAxesZ[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
926 int NumberOfAxesX = 1;
927 int NumberOfAxesY = 1;
928 int NumberOfAxesZ = 1;
930 bool MustAdjustXValue =
false;
931 bool MustAdjustYValue =
false;
932 bool MustAdjustZValue =
false;
934 bool ForceXLabelReset =
false;
935 bool ForceYLabelReset =
false;
936 bool ForceZLabelReset =
false;
942 double LabelScale = -1.0;
943 double TitleScale = -1.0;
945 double ScreenSize = 10.0;
946 double LabelOffset = 20.0;
947 double TitleOffset[2] = { 20.0, 20.0 };
954 double MajorStart[3] = { 0.0, 0.0, 0.0 };
955 double DeltaMajor[3] = { 0.0, 0.0, 0.0 };
958 int RenderGeometry(
bool& initialRender,
vtkViewport* viewport,
bool checkAxisVisibility,
961 void TransformBounds(
vtkViewport* viewport,
const double bounds[6],
double pts[8][3]);
962 void AdjustAxes(
double bounds[6],
double xCoords[NUMBER_OF_ALIGNED_AXIS][6],
963 double yCoords[NUMBER_OF_ALIGNED_AXIS][6],
double zCoords[NUMBER_OF_ALIGNED_AXIS][6],
964 double xRange[2],
double yRange[2],
double zRange[2]);
966 bool ComputeTickSize(
double bounds[6]);
967 void AdjustValues(
const double xRange[2],
const double yRange[2],
const double zRange[2]);
968 void AdjustRange(
const double bounds[6]);
971 void SetNonDependentAttributes();
972 void BuildLabels(
vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS]);
973 void AdjustTicksComputeRange(
974 vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS],
double rangeMin,
double rangeMax);
978 double AutoScale(
vtkViewport* viewport,
double screenSize,
double position[3]);
represents an object (geometry & properties) in a rendered scene
Create an axis with tick marks and labels.
a virtual camera for 3D rendering
create a plot of a bounding box edges - used for navigation
void FindBoundaryEdge(int &indexOfAxisX, int &indexOfAxisY, int &indexOfAxisZ, double pts[8][3])
vtkProperty * GetZAxesGridpolysProperty()
Get/Set axes gridPolys actors properties.
void SetYAxesTitleProperty(vtkTextProperty *)
Returns the text property for the title on an axis.
bool GetUseTextActor3D()
Use or not vtkTextActor3D for titles and labels.
void SetXAxesGridlinesProperty(vtkProperty *)
Get/Set axes (outer) gridlines actors properties.
void GetViewportLimitedBounds(vtkViewport *viewport, double bounds[6])
Get bounds such that the axes are entirely within a viewport.
void UpdateGridLineVisibility(int axisIndex)
This will Update AxisActors with GridVisibility when those should be dynamaic regarding the viewport.
void SetScreenSize(double screenSize)
Explicitly specify the screen size of title and label text.
int RenderOverlay(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
vtkNew< vtkProperty > ZAxesGridlinesProperty
virtual int RenderTranslucentGeometry(vtkViewport *)
Draw the axes as per the vtkProp superclass' API.
double FSign(double, double)
vtkTextProperty * GetXAxesLabelProperty()
Returns the text property for the labels on an axis.
void SetYAxesInnerGridlinesProperty(vtkProperty *)
Get/Set axes inner gridlines actors properties.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkSmartPointer< vtkCamera > Camera
void SetZAxesLabelProperty(vtkTextProperty *)
Returns the text property for the labels on an axis.
vtkProperty * GetZAxesGridlinesProperty()
Get/Set axes (outer) gridlines actors properties.
void SetFlyModeToOuterEdges()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
vtkTypeBool HasTranslucentPolygonalGeometry() override
Draw the axes as per the vtkProp superclass' API.
vtkProperty * GetXAxesLinesProperty()
Get/Set axes actors properties.
vtkTextProperty * GetYAxesLabelProperty()
Returns the text property for the labels on an axis.
vtkProperty * GetXAxesInnerGridlinesProperty()
Get/Set axes inner gridlines actors properties.
void SetXAxesGridpolysProperty(vtkProperty *)
Get/Set axes gridPolys actors properties.
vtkNew< vtkProperty > ZAxesInnerGridlinesProperty
void SetZAxesGridpolysProperty(vtkProperty *)
Get/Set axes gridPolys actors properties.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetYAxesLabelProperty(vtkTextProperty *)
Returns the text property for the labels on an axis.
void SetUse2DMode(bool enable)
Get/Set 2D mode NB: Use vtkTextActor for titles in 2D instead of vtkAxisFollower.
vtkNew< vtkProperty > YAxesGridpolysProperty
vtkTextProperty * GetZAxesLabelProperty()
Returns the text property for the labels on an axis.
double * GetBounds() override
Explicitly specify the region in space around which to draw the bounds.
void SetFlyModeToClosestTriad()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
void SetYAxesGridpolysProperty(vtkProperty *)
Get/Set axes gridPolys actors properties.
vtkNew< vtkProperty > XAxesGridlinesProperty
void SetZAxesInnerGridlinesProperty(vtkProperty *)
Get/Set axes inner gridlines actors properties.
void SetZAxesGridlinesProperty(vtkProperty *)
Get/Set axes (outer) gridlines actors properties.
~vtkCubeAxesActor() override
void SetAxisLabels(int axis, vtkStringArray *value)
Explicitly specify the axis labels along an axis as an array of strings instead of using the values.
vtkNew< vtkProperty > YAxesGridlinesProperty
static vtkCubeAxesActor * New()
Instantiate object with label format "6.3g" and the number of labels per axis set to 3.
int FindClosestAxisIndex(double pts[8][3])
int RenderOpaqueGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
void ComputeStickyAxesBoundingSphere(vtkViewport *viewport, const double bounds[6], double sphereCenter[3], double &sphereRadius)
Computes a bounding sphere used to determine the sticky bounding box.
vtkTextProperty * GetZAxesTitleProperty()
Returns the text property for the title on an axis.
static void GetBoundsPoint(unsigned int pointIndex, const double bounds[6], double point[3])
Get a point on the bounding box by point index.
vtkTextProperty * GetYAxesTitleProperty()
Returns the text property for the title on an axis.
void SetTickLocationToBoth()
void SetLabelOffset(double offset)
Explicitly specify the offset between labels and the axis.
bool GetUse2DMode()
Get/Set 2D mode NB: Use vtkTextActor for titles in 2D instead of vtkAxisFollower.
void SetUseTextActor3D(bool enable)
Use or not vtkTextActor3D for titles and labels.
vtkProperty * GetXAxesGridlinesProperty()
Get/Set axes (outer) gridlines actors properties.
void SetTickLocationToOutside()
vtkTextProperty * GetLabelTextProperty(int)
Returns the text property for the labels on an axis.
void SetZAxesLinesProperty(vtkProperty *)
Get/Set axes actors properties.
void SetFlyModeToStaticEdges()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
void SetFlyModeToStaticTriad()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
void SetYAxesLinesProperty(vtkProperty *)
Get/Set axes actors properties.
vtkStringArray * GetAxisLabels(int axis)
Explicitly specify the axis labels along an axis as an array of strings instead of using the values.
vtkNew< vtkProperty > XAxesGridpolysProperty
virtual double * GetRenderedBounds()
Method used to properly return the bounds of the cube axis itself with all its labels.
vtkProperty * GetYAxesGridlinesProperty()
Get/Set axes (outer) gridlines actors properties.
vtkProperty * GetZAxesLinesProperty()
Get/Set axes actors properties.
vtkNew< vtkProperty > YAxesInnerGridlinesProperty
void SetSaveTitlePosition(int val)
For 2D mode only: save axis title positions for later use.
vtkNew< vtkProperty > ZAxesLinesProperty
vtkTextProperty * GetTitleTextProperty(int)
Returns the text property for the title on an axis.
static void GetBoundsPointBits(unsigned int pointIndex, unsigned int &xBit, unsigned int &yBit, unsigned int &zBit)
Get the bits for a bounds point.
void SetXAxesInnerGridlinesProperty(vtkProperty *)
Get/Set axes inner gridlines actors properties.
void SetLabelScaling(bool, int, int, int)
vtkNew< vtkProperty > YAxesLinesProperty
vtkTextProperty * GetXAxesTitleProperty()
Returns the text property for the title on an axis.
vtkNew< vtkProperty > XAxesLinesProperty
int FindFurtherstAxisIndex(double pts[8][3])
vtkNew< vtkProperty > XAxesInnerGridlinesProperty
vtkProperty * GetXAxesGridpolysProperty()
Get/Set axes gridPolys actors properties.
void SetXAxesTitleProperty(vtkTextProperty *)
Returns the text property for the title on an axis.
vtkNew< vtkProperty > ZAxesGridpolysProperty
double MaxOf(double, double, double, double)
int GetNumTicks(double range, double fxt)
void SetXAxesLabelProperty(vtkTextProperty *)
Returns the text property for the labels on an axis.
void UpdateLabels(vtkAxisActor **axis, int index)
vtkProperty * GetYAxesInnerGridlinesProperty()
Get/Set axes inner gridlines actors properties.
int Digits(double min, double max)
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
vtkProperty * GetZAxesInnerGridlinesProperty()
Get/Set axes inner gridlines actors properties.
virtual void GetRenderedBounds(double rBounds[6])
Method used to properly return the bounds of the cube axis itself with all its labels.
double MaxOf(double, double)
void SetTickLocationToInside()
vtkProperty * GetYAxesLinesProperty()
Get/Set axes actors properties.
int LabelExponent(double min, double max)
void SetXAxesLinesProperty(vtkProperty *)
Get/Set axes actors properties.
void SetYAxesGridlinesProperty(vtkProperty *)
Get/Set axes (outer) gridlines actors properties.
vtkProperty * GetYAxesGridpolysProperty()
Get/Set axes gridPolys actors properties.
void SetZAxesTitleProperty(vtkTextProperty *)
Returns the text property for the title on an axis.
void SetFlyModeToFurthestTriad()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
a simple class to control print indentation
Allocate and hold a VTK object.
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
#define VTK_DEPRECATED_IN_9_3_0(reason)
#define VTK_SIZEHINT(...)