56 #ifndef vtkCubeAxesActor_h
57 #define vtkCubeAxesActor_h
62 #include "vtkRenderingAnnotationModule.h"
65 VTK_ABI_NAMESPACE_BEGIN
99 vtkSetMacro(RebuildAxes,
bool);
100 vtkGetMacro(RebuildAxes,
bool);
110 vtkSetVector6Macro(Bounds,
double);
133 vtkSetVector2Macro(XAxisRange,
double);
134 vtkSetVector2Macro(YAxisRange,
double);
135 vtkSetVector2Macro(ZAxisRange,
double);
136 vtkGetVector2Macro(XAxisRange,
double);
137 vtkGetVector2Macro(YAxisRange,
double);
148 vtkGetVector2Macro(ZAxisRange,
double);
158 vtkGetMacro(ScreenSize,
double);
167 vtkGetMacro(LabelOffset,
double);
176 void SetTitleOffset(
double titleOffsetY);
178 double GetTitleOffset();
179 void SetTitleOffset(
double titleOffset[2]);
181 void GetTitleOffset(
double& titleOffsetX,
double& titleOffsetY);
195 VTK_FLY_OUTER_EDGES = 0,
196 VTK_FLY_CLOSEST_TRIAD = 1,
197 VTK_FLY_FURTHEST_TRIAD = 2,
198 VTK_FLY_STATIC_TRIAD = 3,
199 VTK_FLY_STATIC_EDGES = 4
209 vtkSetClampMacro(
FlyMode,
int, VTK_FLY_OUTER_EDGES, VTK_FLY_STATIC_EDGES);
223 vtkSetStringMacro(XTitle);
224 vtkGetStringMacro(XTitle);
225 vtkSetStringMacro(XUnits);
226 vtkGetStringMacro(XUnits);
227 vtkSetStringMacro(YTitle);
228 vtkGetStringMacro(YTitle);
229 vtkSetStringMacro(YUnits);
230 vtkGetStringMacro(YUnits);
231 vtkSetStringMacro(ZTitle);
232 vtkGetStringMacro(ZTitle);
233 vtkSetStringMacro(ZUnits);
234 vtkGetStringMacro(ZUnits);
242 vtkSetStringMacro(XLabelFormat);
243 vtkGetStringMacro(XLabelFormat);
244 vtkSetStringMacro(YLabelFormat);
245 vtkGetStringMacro(YLabelFormat);
246 vtkSetStringMacro(ZLabelFormat);
247 vtkGetStringMacro(ZLabelFormat);
258 vtkGetMacro(Inertia,
int);
268 vtkSetMacro(CornerOffset,
double);
269 vtkGetMacro(CornerOffset,
double);
284 vtkSetMacro(EnableDistanceLOD,
bool);
285 vtkGetMacro(EnableDistanceLOD,
bool);
293 vtkSetClampMacro(DistanceLODThreshold,
double, 0.0, 1.0);
294 vtkGetMacro(DistanceLODThreshold,
double);
302 vtkSetMacro(EnableViewAngleLOD,
bool);
303 vtkGetMacro(EnableViewAngleLOD,
bool);
311 vtkSetClampMacro(ViewAngleLODThreshold,
double, 0., 1.);
312 vtkGetMacro(ViewAngleLODThreshold,
double);
320 vtkSetMacro(XAxisVisibility,
bool);
321 vtkGetMacro(XAxisVisibility,
bool);
322 vtkBooleanMacro(XAxisVisibility,
bool);
324 vtkSetMacro(YAxisVisibility,
bool);
325 vtkGetMacro(YAxisVisibility,
bool);
326 vtkBooleanMacro(YAxisVisibility,
bool);
328 vtkSetMacro(ZAxisVisibility,
bool);
329 vtkGetMacro(ZAxisVisibility,
bool);
330 vtkBooleanMacro(ZAxisVisibility,
bool);
338 vtkSetMacro(XAxisLabelVisibility,
bool);
339 vtkGetMacro(XAxisLabelVisibility,
bool);
340 vtkBooleanMacro(XAxisLabelVisibility,
bool);
342 vtkSetMacro(YAxisLabelVisibility,
bool);
343 vtkGetMacro(YAxisLabelVisibility,
bool);
344 vtkBooleanMacro(YAxisLabelVisibility,
bool);
346 vtkSetMacro(ZAxisLabelVisibility,
bool);
347 vtkGetMacro(ZAxisLabelVisibility,
bool);
348 vtkBooleanMacro(ZAxisLabelVisibility,
bool);
356 vtkSetMacro(XAxisTickVisibility,
bool);
357 vtkGetMacro(XAxisTickVisibility,
bool);
358 vtkBooleanMacro(XAxisTickVisibility,
bool);
360 vtkSetMacro(YAxisTickVisibility,
bool);
361 vtkGetMacro(YAxisTickVisibility,
bool);
362 vtkBooleanMacro(YAxisTickVisibility,
bool);
364 vtkSetMacro(ZAxisTickVisibility,
bool);
365 vtkGetMacro(ZAxisTickVisibility,
bool);
366 vtkBooleanMacro(ZAxisTickVisibility,
bool);
374 vtkSetMacro(XAxisMinorTickVisibility,
bool);
375 vtkGetMacro(XAxisMinorTickVisibility,
bool);
376 vtkBooleanMacro(XAxisMinorTickVisibility,
bool);
378 vtkSetMacro(YAxisMinorTickVisibility,
bool);
379 vtkGetMacro(YAxisMinorTickVisibility,
bool);
380 vtkBooleanMacro(YAxisMinorTickVisibility,
bool);
382 vtkSetMacro(ZAxisMinorTickVisibility,
bool);
383 vtkGetMacro(ZAxisMinorTickVisibility,
bool);
384 vtkBooleanMacro(ZAxisMinorTickVisibility,
bool);
392 vtkSetMacro(DrawXGridlines,
bool);
393 vtkGetMacro(DrawXGridlines,
bool);
394 vtkBooleanMacro(DrawXGridlines,
bool);
396 vtkSetMacro(DrawYGridlines,
bool);
397 vtkGetMacro(DrawYGridlines,
bool);
398 vtkBooleanMacro(DrawYGridlines,
bool);
400 vtkSetMacro(DrawZGridlines,
bool);
401 vtkGetMacro(DrawZGridlines,
bool);
402 vtkBooleanMacro(DrawZGridlines,
bool);
410 vtkSetMacro(DrawXInnerGridlines,
bool);
411 vtkGetMacro(DrawXInnerGridlines,
bool);
412 vtkBooleanMacro(DrawXInnerGridlines,
bool);
414 vtkSetMacro(DrawYInnerGridlines,
bool);
415 vtkGetMacro(DrawYInnerGridlines,
bool);
416 vtkBooleanMacro(DrawYInnerGridlines,
bool);
418 vtkSetMacro(DrawZInnerGridlines,
bool);
419 vtkGetMacro(DrawZInnerGridlines,
bool);
420 vtkBooleanMacro(DrawZInnerGridlines,
bool);
428 vtkSetMacro(DrawXGridpolys,
bool);
429 vtkGetMacro(DrawXGridpolys,
bool);
430 vtkBooleanMacro(DrawXGridpolys,
bool);
432 vtkSetMacro(DrawYGridpolys,
bool);
433 vtkGetMacro(DrawYGridpolys,
bool);
434 vtkBooleanMacro(DrawYGridpolys,
bool);
436 vtkSetMacro(DrawZGridpolys,
bool);
437 vtkGetMacro(DrawZGridpolys,
bool);
438 vtkBooleanMacro(DrawZGridpolys,
bool);
501 VTK_TICKS_INSIDE = 0,
502 VTK_TICKS_OUTSIDE = 1,
550 vtkSetVector6Macro(OrientedBounds,
double);
551 vtkGetVector6Macro(OrientedBounds,
double);
559 vtkSetMacro(UseOrientedBounds,
bool);
560 vtkGetMacro(UseOrientedBounds,
bool);
568 vtkSetVector3Macro(AxisBaseForX,
double);
569 vtkGetVector3Macro(AxisBaseForX,
double);
577 vtkSetVector3Macro(AxisBaseForY,
double);
578 vtkGetVector3Macro(AxisBaseForY,
double);
586 vtkSetVector3Macro(AxisBaseForZ,
double);
587 vtkGetVector3Macro(AxisBaseForZ,
double);
596 vtkSetVector3Macro(AxisOrigin,
double);
597 vtkGetVector3Macro(AxisOrigin,
double);
605 vtkSetMacro(UseAxisOrigin,
bool);
606 vtkGetMacro(UseAxisOrigin,
bool);
614 vtkSetMacro(GridLineLocation,
int);
615 vtkGetMacro(GridLineLocation,
int);
625 vtkSetMacro(StickyAxes,
bool);
626 vtkGetMacro(StickyAxes,
bool);
627 vtkBooleanMacro(StickyAxes,
bool);
639 vtkSetMacro(CenterStickyAxes,
bool);
640 vtkGetMacro(CenterStickyAxes,
bool);
641 vtkBooleanMacro(CenterStickyAxes,
bool);
646 VTK_GRID_LINES_ALL = 0,
647 VTK_GRID_LINES_CLOSEST = 1,
648 VTK_GRID_LINES_FURTHEST = 2
661 vtkViewport* viewport,
const double bounds[6],
double sphereCenter[3],
double& sphereRadius);
673 unsigned int pointIndex,
unsigned int& xBit,
unsigned int& yBit,
unsigned int& zBit);
685 double MaxOf(
double,
double,
double,
double);
705 void FindBoundaryEdge(
int& indexOfAxisX,
int& indexOfAxisY,
int& indexOfAxisZ,
double pts[8][3]);
717 int GridLineLocation = VTK_GRID_LINES_ALL;
722 bool StickyAxes =
false;
727 bool CenterStickyAxes =
true;
733 bool EnableDistanceLOD =
true;
739 double DistanceLODThreshold = 0.8;
745 bool EnableViewAngleLOD =
true;
751 double ViewAngleLODThreshold = 0.2;
755 NUMBER_OF_ALIGNED_AXIS = 4
768 bool RebuildAxes =
true;
770 char* XTitle =
nullptr;
771 char* XUnits =
nullptr;
772 char* YTitle =
nullptr;
773 char* YUnits =
nullptr;
774 char* ZTitle =
nullptr;
775 char* ZUnits =
nullptr;
777 char* ActualXLabel =
nullptr;
778 char* ActualYLabel =
nullptr;
779 char* ActualZLabel =
nullptr;
783 bool XAxisVisibility =
true;
784 bool YAxisVisibility =
true;
785 bool ZAxisVisibility =
true;
787 bool XAxisTickVisibility =
true;
788 bool YAxisTickVisibility =
true;
789 bool ZAxisTickVisibility =
true;
791 bool XAxisMinorTickVisibility =
true;
792 bool YAxisMinorTickVisibility =
true;
793 bool ZAxisMinorTickVisibility =
true;
795 bool XAxisLabelVisibility =
true;
796 bool YAxisLabelVisibility =
true;
797 bool ZAxisLabelVisibility =
true;
799 bool DrawXGridlines =
false;
800 bool DrawYGridlines =
false;
801 bool DrawZGridlines =
false;
803 bool DrawXInnerGridlines =
false;
804 bool DrawYInnerGridlines =
false;
805 bool DrawZInnerGridlines =
false;
807 bool DrawXGridpolys =
false;
808 bool DrawYGridpolys =
false;
809 bool DrawZGridpolys =
false;
811 char* XLabelFormat =
nullptr;
812 char* YLabelFormat =
nullptr;
813 char* ZLabelFormat =
nullptr;
815 double CornerOffset = 0.0;
821 int InertiaLocs[3] = { -1, -1, -1 };
823 bool RenderSomething =
false;
842 double RenderedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
843 double OrientedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
844 bool UseOrientedBounds =
false;
846 double AxisOrigin[3] = { 0.0, 0.0, 0.0 };
847 bool UseAxisOrigin =
false;
849 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
850 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
851 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
857 vtkSetStringMacro(ActualXLabel);
858 vtkSetStringMacro(ActualYLabel);
859 vtkSetStringMacro(ActualZLabel);
862 bool LastUseOrientedBounds =
false;
871 bool AutoLabelScaling =
true;
873 int LastXAxisDigits = 3;
874 int LastYAxisDigits = 3;
875 int LastZAxisDigits = 3;
883 int LastFlyMode = -1;
885 int RenderAxesX[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
886 int RenderAxesY[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
887 int RenderAxesZ[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
889 int NumberOfAxesX = 1;
890 int NumberOfAxesY = 1;
891 int NumberOfAxesZ = 1;
893 bool MustAdjustXValue =
false;
894 bool MustAdjustYValue =
false;
895 bool MustAdjustZValue =
false;
897 bool ForceXLabelReset =
false;
898 bool ForceYLabelReset =
false;
899 bool ForceZLabelReset =
false;
905 double LabelScale = -1.0;
906 double TitleScale = -1.0;
908 double ScreenSize = 10.0;
909 double LabelOffset = 20.0;
910 double TitleOffset[2] = { 20.0, 20.0 };
917 double MajorStart[3] = { 0.0, 0.0, 0.0 };
918 double DeltaMajor[3] = { 0.0, 0.0, 0.0 };
921 int RenderGeometry(
bool& initialRender,
vtkViewport* viewport,
bool checkAxisVisibility,
924 void TransformBounds(
vtkViewport* viewport,
const double bounds[6],
double pts[8][3]);
925 void AdjustAxes(
double bounds[6],
double xCoords[NUMBER_OF_ALIGNED_AXIS][6],
926 double yCoords[NUMBER_OF_ALIGNED_AXIS][6],
double zCoords[NUMBER_OF_ALIGNED_AXIS][6],
927 double xRange[2],
double yRange[2],
double zRange[2]);
929 bool ComputeTickSize(
double bounds[6]);
930 void AdjustValues(
const double xRange[2],
const double yRange[2],
const double zRange[2]);
931 void AdjustRange(
const double bounds[6]);
934 void SetNonDependentAttributes();
935 void BuildLabels(
vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS]);
936 void AdjustTicksComputeRange(
937 vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS],
double rangeMin,
double rangeMax);
944 VTK_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
create a plot of a bounding box edges - used for navigation
void FindBoundaryEdge(int &indexOfAxisX, int &indexOfAxisY, int &indexOfAxisZ, double pts[8][3])
vtkStringArray * GetAxisLabels(int axis)
Explicitly specify the axis labels along an axis as an array of strings instead of using the values.
virtual double * GetRenderedBounds()
Method used to properly return the bounds of the cube axis itself with all its labels.
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)
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
vtkProperty * GetYAxesGridpolysProperty()
Get/Set axes gridPolys 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 * GetXAxesInnerGridlinesProperty()
Get/Set axes inner gridlines actors properties.
void SetXAxesGridpolysProperty(vtkProperty *)
Get/Set axes gridPolys actors properties.
vtkProperty * GetZAxesInnerGridlinesProperty()
Get/Set axes inner gridlines 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.
vtkProperty * GetZAxesLinesProperty()
Get/Set axes actors properties.
vtkProperty * GetYAxesLinesProperty()
Get/Set axes actors properties.
static vtkCubeAxesActor * New()
Instantiate object with label format "6.3g" and the number of labels per axis set to 3.
void SetUse2DMode(bool enable)
Get/Set 2D mode NB: Use vtkTextActor for titles in 2D instead of vtkAxisFollower.
vtkNew< vtkProperty > YAxesGridpolysProperty
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
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.
static void GetBoundsPoint(unsigned int pointIndex, const double bounds[6], double point[3])
Get a point on the bounding box by point index.
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.
vtkProperty * GetYAxesGridlinesProperty()
Get/Set axes (outer) gridlines actors properties.
void SetUseTextActor3D(bool enable)
Use or not vtkTextActor3D for titles and labels.
void SetTickLocationToOutside()
double * GetBounds() override
Explicitly specify the region in space around which to draw the bounds.
void SetZAxesLinesProperty(vtkProperty *)
Get/Set axes actors properties.
vtkProperty * GetXAxesGridlinesProperty()
Get/Set axes (outer) gridlines 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.
vtkNew< vtkProperty > XAxesGridpolysProperty
vtkProperty * GetXAxesLinesProperty()
Get/Set axes actors properties.
vtkTextProperty * GetTitleTextProperty(int)
Returns the text property for the title on an axis.
vtkNew< vtkProperty > YAxesInnerGridlinesProperty
void SetSaveTitlePosition(int val)
For 2D mode only: save axis title positions for later use.
vtkNew< vtkProperty > ZAxesLinesProperty
vtkTextProperty * GetLabelTextProperty(int)
Returns the text property for the labels 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
vtkNew< vtkProperty > XAxesLinesProperty
vtkProperty * GetYAxesInnerGridlinesProperty()
Get/Set axes inner gridlines actors properties.
int FindFurtherstAxisIndex(double pts[8][3])
vtkNew< vtkProperty > XAxesInnerGridlinesProperty
vtkNew< vtkProperty > ZAxesGridpolysProperty
vtkProperty * GetXAxesGridpolysProperty()
Get/Set axes gridPolys actors properties.
double MaxOf(double, double, double, double)
vtkProperty * GetZAxesGridpolysProperty()
Get/Set axes gridPolys actors properties.
int GetNumTicks(double range, double fxt)
void UpdateLabels(vtkAxisActor **axis, int index)
int Digits(double min, double max)
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
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()
int LabelExponent(double min, double max)
vtkProperty * GetZAxesGridlinesProperty()
Get/Set axes (outer) gridlines actors properties.
void SetXAxesLinesProperty(vtkProperty *)
Get/Set axes actors properties.
void SetYAxesGridlinesProperty(vtkProperty *)
Get/Set axes (outer) gridlines actors properties.
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
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
represent surface properties of a geometric object
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(...)