76#ifndef vtkCubeAxesActor_h
77#define vtkCubeAxesActor_h
81#include "vtkRenderingAnnotationModule.h"
85VTK_ABI_NAMESPACE_BEGIN
119 vtkSetMacro(RebuildAxes,
bool);
120 vtkGetMacro(RebuildAxes,
bool);
130 vtkSetVector6Macro(Bounds,
double);
131 using Superclass::GetBounds;
153 vtkSetVector2Macro(XAxisRange,
double);
154 vtkSetVector2Macro(YAxisRange,
double);
155 vtkSetVector2Macro(ZAxisRange,
double);
156 vtkGetVector2Macro(XAxisRange,
double);
157 vtkGetVector2Macro(YAxisRange,
double);
168 vtkGetVector2Macro(ZAxisRange,
double);
178 vtkGetMacro(ScreenSize,
double);
187 vtkGetMacro(LabelOffset,
double);
196 vtkGetVector2Macro(TitleOffset,
double);
210 VTK_FLY_OUTER_EDGES = 0,
211 VTK_FLY_CLOSEST_TRIAD = 1,
212 VTK_FLY_FURTHEST_TRIAD = 2,
213 VTK_FLY_STATIC_TRIAD = 3,
214 VTK_FLY_STATIC_EDGES = 4
224 vtkSetClampMacro(
FlyMode,
int, VTK_FLY_OUTER_EDGES, VTK_FLY_STATIC_EDGES);
238 vtkSetStringMacro(XTitle);
239 vtkGetStringMacro(XTitle);
240 vtkSetStringMacro(XUnits);
241 vtkGetStringMacro(XUnits);
242 vtkSetStringMacro(YTitle);
243 vtkGetStringMacro(YTitle);
244 vtkSetStringMacro(YUnits);
245 vtkGetStringMacro(YUnits);
246 vtkSetStringMacro(ZTitle);
247 vtkGetStringMacro(ZTitle);
248 vtkSetStringMacro(ZUnits);
249 vtkGetStringMacro(ZUnits);
257 vtkSetStringMacro(XLabelFormat);
258 vtkGetStringMacro(XLabelFormat);
259 vtkSetStringMacro(YLabelFormat);
260 vtkGetStringMacro(YLabelFormat);
261 vtkSetStringMacro(ZLabelFormat);
262 vtkGetStringMacro(ZLabelFormat);
273 vtkGetMacro(Inertia,
int);
283 vtkSetMacro(CornerOffset,
double);
284 vtkGetMacro(CornerOffset,
double);
299 vtkSetMacro(EnableDistanceLOD,
bool);
300 vtkGetMacro(EnableDistanceLOD,
bool);
308 vtkSetClampMacro(DistanceLODThreshold,
double, 0.0, 1.0);
309 vtkGetMacro(DistanceLODThreshold,
double);
317 vtkSetMacro(EnableViewAngleLOD,
bool);
318 vtkGetMacro(EnableViewAngleLOD,
bool);
326 vtkSetClampMacro(ViewAngleLODThreshold,
double, 0., 1.);
327 vtkGetMacro(ViewAngleLODThreshold,
double);
335 vtkSetMacro(XAxisVisibility,
bool);
336 vtkGetMacro(XAxisVisibility,
bool);
337 vtkBooleanMacro(XAxisVisibility,
bool);
339 vtkSetMacro(YAxisVisibility,
bool);
340 vtkGetMacro(YAxisVisibility,
bool);
341 vtkBooleanMacro(YAxisVisibility,
bool);
343 vtkSetMacro(ZAxisVisibility,
bool);
344 vtkGetMacro(ZAxisVisibility,
bool);
345 vtkBooleanMacro(ZAxisVisibility,
bool);
353 vtkSetMacro(XAxisLabelVisibility,
bool);
354 vtkGetMacro(XAxisLabelVisibility,
bool);
355 vtkBooleanMacro(XAxisLabelVisibility,
bool);
357 vtkSetMacro(YAxisLabelVisibility,
bool);
358 vtkGetMacro(YAxisLabelVisibility,
bool);
359 vtkBooleanMacro(YAxisLabelVisibility,
bool);
361 vtkSetMacro(ZAxisLabelVisibility,
bool);
362 vtkGetMacro(ZAxisLabelVisibility,
bool);
363 vtkBooleanMacro(ZAxisLabelVisibility,
bool);
371 vtkSetMacro(XAxisTickVisibility,
bool);
372 vtkGetMacro(XAxisTickVisibility,
bool);
373 vtkBooleanMacro(XAxisTickVisibility,
bool);
375 vtkSetMacro(YAxisTickVisibility,
bool);
376 vtkGetMacro(YAxisTickVisibility,
bool);
377 vtkBooleanMacro(YAxisTickVisibility,
bool);
379 vtkSetMacro(ZAxisTickVisibility,
bool);
380 vtkGetMacro(ZAxisTickVisibility,
bool);
381 vtkBooleanMacro(ZAxisTickVisibility,
bool);
389 vtkSetMacro(XAxisMinorTickVisibility,
bool);
390 vtkGetMacro(XAxisMinorTickVisibility,
bool);
391 vtkBooleanMacro(XAxisMinorTickVisibility,
bool);
393 vtkSetMacro(YAxisMinorTickVisibility,
bool);
394 vtkGetMacro(YAxisMinorTickVisibility,
bool);
395 vtkBooleanMacro(YAxisMinorTickVisibility,
bool);
397 vtkSetMacro(ZAxisMinorTickVisibility,
bool);
398 vtkGetMacro(ZAxisMinorTickVisibility,
bool);
399 vtkBooleanMacro(ZAxisMinorTickVisibility,
bool);
407 vtkSetMacro(DrawXGridlines,
bool);
408 vtkGetMacro(DrawXGridlines,
bool);
409 vtkBooleanMacro(DrawXGridlines,
bool);
411 vtkSetMacro(DrawYGridlines,
bool);
412 vtkGetMacro(DrawYGridlines,
bool);
413 vtkBooleanMacro(DrawYGridlines,
bool);
415 vtkSetMacro(DrawZGridlines,
bool);
416 vtkGetMacro(DrawZGridlines,
bool);
417 vtkBooleanMacro(DrawZGridlines,
bool);
425 vtkSetMacro(DrawXInnerGridlines,
bool);
426 vtkGetMacro(DrawXInnerGridlines,
bool);
427 vtkBooleanMacro(DrawXInnerGridlines,
bool);
429 vtkSetMacro(DrawYInnerGridlines,
bool);
430 vtkGetMacro(DrawYInnerGridlines,
bool);
431 vtkBooleanMacro(DrawYInnerGridlines,
bool);
433 vtkSetMacro(DrawZInnerGridlines,
bool);
434 vtkGetMacro(DrawZInnerGridlines,
bool);
435 vtkBooleanMacro(DrawZInnerGridlines,
bool);
443 vtkSetMacro(DrawXGridpolys,
bool);
444 vtkGetMacro(DrawXGridpolys,
bool);
445 vtkBooleanMacro(DrawXGridpolys,
bool);
447 vtkSetMacro(DrawYGridpolys,
bool);
448 vtkGetMacro(DrawYGridpolys,
bool);
449 vtkBooleanMacro(DrawYGridpolys,
bool);
451 vtkSetMacro(DrawZGridpolys,
bool);
452 vtkGetMacro(DrawZGridpolys,
bool);
453 vtkBooleanMacro(DrawZGridpolys,
bool);
532 VTK_TICKS_INSIDE = 0,
533 VTK_TICKS_OUTSIDE = 1,
581 vtkSetVector6Macro(OrientedBounds,
double);
582 vtkGetVector6Macro(OrientedBounds,
double);
590 vtkSetMacro(UseOrientedBounds,
bool);
591 vtkGetMacro(UseOrientedBounds,
bool);
599 vtkSetVector3Macro(AxisBaseForX,
double);
600 vtkGetVector3Macro(AxisBaseForX,
double);
608 vtkSetVector3Macro(AxisBaseForY,
double);
609 vtkGetVector3Macro(AxisBaseForY,
double);
617 vtkSetVector3Macro(AxisBaseForZ,
double);
618 vtkGetVector3Macro(AxisBaseForZ,
double);
627 vtkSetVector3Macro(AxisOrigin,
double);
628 vtkGetVector3Macro(AxisOrigin,
double);
636 vtkSetMacro(UseAxisOrigin,
bool);
637 vtkGetMacro(UseAxisOrigin,
bool);
645 vtkSetMacro(GridLineLocation,
int);
646 vtkGetMacro(GridLineLocation,
int);
656 vtkSetMacro(StickyAxes,
bool);
657 vtkGetMacro(StickyAxes,
bool);
658 vtkBooleanMacro(StickyAxes,
bool);
670 vtkSetMacro(CenterStickyAxes,
bool);
671 vtkGetMacro(CenterStickyAxes,
bool);
672 vtkBooleanMacro(CenterStickyAxes,
bool);
677 VTK_GRID_LINES_ALL = 0,
678 VTK_GRID_LINES_CLOSEST = 1,
679 VTK_GRID_LINES_FURTHEST = 2
692 vtkViewport* viewport,
const double bounds[6],
double sphereCenter[3],
double& sphereRadius);
704 unsigned int pointIndex,
unsigned int& xBit,
unsigned int& yBit,
unsigned int& zBit);
709 static void GetBoundsPoint(
unsigned int pointIndex,
const double bounds[6],
double point[3]);
716 double MaxOf(
double,
double,
double,
double);
736 void FindBoundaryEdge(
int& indexOfAxisX,
int& indexOfAxisY,
int& indexOfAxisZ,
double pts[8][3]);
748 int GridLineLocation = VTK_GRID_LINES_ALL;
753 bool StickyAxes =
false;
758 bool CenterStickyAxes =
true;
764 bool EnableDistanceLOD =
true;
770 double DistanceLODThreshold = 0.8;
776 bool EnableViewAngleLOD =
true;
782 double ViewAngleLODThreshold = 0.2;
786 NUMBER_OF_ALIGNED_AXIS = 4
799 bool RebuildAxes =
true;
801 char* XTitle =
nullptr;
802 char* XUnits =
nullptr;
803 char* YTitle =
nullptr;
804 char* YUnits =
nullptr;
805 char* ZTitle =
nullptr;
806 char* ZUnits =
nullptr;
808 char* ActualXLabel =
nullptr;
809 char* ActualYLabel =
nullptr;
810 char* ActualZLabel =
nullptr;
814 bool XAxisVisibility =
true;
815 bool YAxisVisibility =
true;
816 bool ZAxisVisibility =
true;
818 bool XAxisTickVisibility =
true;
819 bool YAxisTickVisibility =
true;
820 bool ZAxisTickVisibility =
true;
822 bool XAxisMinorTickVisibility =
true;
823 bool YAxisMinorTickVisibility =
true;
824 bool ZAxisMinorTickVisibility =
true;
826 bool XAxisLabelVisibility =
true;
827 bool YAxisLabelVisibility =
true;
828 bool ZAxisLabelVisibility =
true;
830 bool DrawXGridlines =
false;
831 bool DrawYGridlines =
false;
832 bool DrawZGridlines =
false;
834 bool DrawXInnerGridlines =
false;
835 bool DrawYInnerGridlines =
false;
836 bool DrawZInnerGridlines =
false;
838 bool DrawXGridpolys =
false;
839 bool DrawYGridpolys =
false;
840 bool DrawZGridpolys =
false;
842 char* XLabelFormat =
nullptr;
843 char* YLabelFormat =
nullptr;
844 char* ZLabelFormat =
nullptr;
846 double CornerOffset = 0.0;
852 int InertiaLocs[3] = { -1, -1, -1 };
854 bool RenderSomething =
false;
873 double RenderedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
874 double OrientedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
875 bool UseOrientedBounds =
false;
877 double AxisOrigin[3] = { 0.0, 0.0, 0.0 };
878 bool UseAxisOrigin =
false;
880 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
881 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
882 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
888 vtkSetStringMacro(ActualXLabel);
889 vtkSetStringMacro(ActualYLabel);
890 vtkSetStringMacro(ActualZLabel);
893 bool LastUseOrientedBounds =
false;
902 bool AutoLabelScaling =
true;
904 int LastXAxisDigits = 3;
905 int LastYAxisDigits = 3;
906 int LastZAxisDigits = 3;
914 int LastFlyMode = -1;
916 int RenderAxesX[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
917 int RenderAxesY[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
918 int RenderAxesZ[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
920 int NumberOfAxesX = 1;
921 int NumberOfAxesY = 1;
922 int NumberOfAxesZ = 1;
924 bool MustAdjustXValue =
false;
925 bool MustAdjustYValue =
false;
926 bool MustAdjustZValue =
false;
928 bool ForceXLabelReset =
false;
929 bool ForceYLabelReset =
false;
930 bool ForceZLabelReset =
false;
936 double LabelScale = -1.0;
937 double TitleScale = -1.0;
939 double ScreenSize = 10.0;
940 double LabelOffset = 20.0;
941 double TitleOffset[2] = { 20.0, 20.0 };
948 double MajorStart[3] = { 0.0, 0.0, 0.0 };
949 double DeltaMajor[3] = { 0.0, 0.0, 0.0 };
952 int RenderGeometry(
bool& initialRender,
vtkViewport* viewport,
bool checkAxisVisibility,
955 void TransformBounds(
vtkViewport* viewport,
const double bounds[6],
double pts[8][3]);
956 void AdjustAxes(
double bounds[6],
double xCoords[NUMBER_OF_ALIGNED_AXIS][6],
957 double yCoords[NUMBER_OF_ALIGNED_AXIS][6],
double zCoords[NUMBER_OF_ALIGNED_AXIS][6],
958 double xRange[2],
double yRange[2],
double zRange[2]);
960 bool ComputeTickSize(
double bounds[6]);
961 void AdjustValues(
const double xRange[2],
const double yRange[2],
const double zRange[2]);
962 void AdjustRange(
const double bounds[6]);
965 void SetNonDependentAttributes();
966 void BuildLabels(
vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS]);
967 void AdjustTicksComputeRange(
968 vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS],
double rangeMin,
double rangeMax);
972 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.
vtkCamera * GetCamera()
Set/Get the camera to perform scaling and translation of the vtkCubeAxesActor.
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 SetTitleOffset(double titleOffset[2])
Explicitly specify the offset between title and labels.
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 SetCamera(vtkCamera *)
Set/Get the camera to perform scaling and translation of the vtkCubeAxesActor.
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_SIZEHINT(...)