47#ifndef vtkCubeAxesActor_h
48#define vtkCubeAxesActor_h
52#include "vtkRenderingAnnotationModule.h"
56VTK_ABI_NAMESPACE_BEGIN
124 vtkSetVector2Macro(XAxisRange,
double);
125 vtkSetVector2Macro(YAxisRange,
double);
126 vtkSetVector2Macro(ZAxisRange,
double);
127 vtkGetVector2Macro(XAxisRange,
double);
128 vtkGetVector2Macro(YAxisRange,
double);
139 vtkGetVector2Macro(ZAxisRange,
double);
149 vtkGetMacro(ScreenSize,
double);
158 vtkGetMacro(LabelOffset,
double);
167 vtkGetVector2Macro(TitleOffset,
double);
663 vtkViewport* viewport,
const double bounds[6],
double sphereCenter[3],
double& sphereRadius);
675 unsigned int pointIndex,
unsigned int& xBit,
unsigned int& yBit,
unsigned int& zBit);
680 static void GetBoundsPoint(
unsigned int pointIndex,
const double bounds[6],
double point[3]);
687 double MaxOf(
double,
double,
double,
double);
707 void FindBoundaryEdge(
int& indexOfAxisX,
int& indexOfAxisY,
int& indexOfAxisZ,
double pts[8][3]);
859 vtkSetStringMacro(ActualXLabel);
860 vtkSetStringMacro(ActualYLabel);
861 vtkSetStringMacro(ActualZLabel);
864 bool LastUseOrientedBounds =
false;
873 bool AutoLabelScaling =
true;
875 int LastXAxisDigits = 3;
876 int LastYAxisDigits = 3;
877 int LastZAxisDigits = 3;
885 int LastFlyMode = -1;
887 int RenderAxesX[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
888 int RenderAxesY[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
889 int RenderAxesZ[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
891 int NumberOfAxesX = 1;
892 int NumberOfAxesY = 1;
893 int NumberOfAxesZ = 1;
895 bool MustAdjustXValue =
false;
896 bool MustAdjustYValue =
false;
897 bool MustAdjustZValue =
false;
899 bool ForceXLabelReset =
false;
900 bool ForceYLabelReset =
false;
901 bool ForceZLabelReset =
false;
907 double LabelScale = -1.0;
908 double TitleScale = -1.0;
910 double ScreenSize = 10.0;
911 double LabelOffset = 20.0;
912 double TitleOffset[2] = { 20.0, 20.0 };
919 double MajorStart[3] = { 0.0, 0.0, 0.0 };
920 double DeltaMajor[3] = { 0.0, 0.0, 0.0 };
923 int RenderGeometry(
bool& initialRender, vtkViewport* viewport,
bool checkAxisVisibility,
924 int (vtkAxisActor::*renderMethod)(vtkViewport*));
926 void TransformBounds(vtkViewport* viewport,
const double bounds[6],
double pts[8][3]);
927 void AdjustAxes(
double bounds[6],
double xCoords[NUMBER_OF_ALIGNED_AXIS][6],
928 double yCoords[NUMBER_OF_ALIGNED_AXIS][6],
double zCoords[NUMBER_OF_ALIGNED_AXIS][6],
929 double xRange[2],
double yRange[2],
double zRange[2]);
931 bool ComputeTickSize(
double bounds[6]);
932 void AdjustValues(
const double xRange[2],
const double yRange[2],
const double zRange[2]);
933 void AdjustRange(
const double bounds[6]);
934 void BuildAxes(vtkViewport*);
935 void DetermineRenderAxes(vtkViewport*);
936 void SetNonDependentAttributes();
937 void BuildLabels(vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS]);
938 void AdjustTicksComputeRange(
939 vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS],
double rangeMin,
double rangeMax);
941 void AutoScale(vtkViewport* viewport);
942 void AutoScale(vtkViewport* viewport, vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS]);
943 double AutoScale(vtkViewport* viewport,
double screenSize,
double position[3]);
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
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.
bool XAxisLabelVisibility
vtkNew< vtkTextProperty > LabelTextProperty[3]
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.
vtkNew< vtkTextProperty > TitleTextProperty[3]
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.
bool XAxisMinorTickVisibility
vtkNew< vtkProperty > XAxesGridlinesProperty
void SetZAxesInnerGridlinesProperty(vtkProperty *)
Get/Set axes inner gridlines actors properties.
void SetZAxesGridlinesProperty(vtkProperty *)
Get/Set axes (outer) gridlines actors properties.
@ VTK_GRID_LINES_FURTHEST
double ViewAngleLODThreshold
This determines at what view angle to geometry will make the geometry not visible.
~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.
bool YAxisMinorTickVisibility
bool EnableViewAngleLOD
If enabled the actor will not be visible at a certain view angle.
int FindClosestAxisIndex(double pts[8][3])
int RenderOpaqueGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
vtkAxisActor * YAxes[NUMBER_OF_ALIGNED_AXIS]
Control variables for all axes NB: [0] always for 'Major' axis during non-static fly modes.
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()
vtkAxisActor * ZAxes[NUMBER_OF_ALIGNED_AXIS]
Control variables for all axes NB: [0] always for 'Major' axis during non-static fly modes.
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...
vtkSmartPointer< vtkStringArray > AxisLabels[3]
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.
bool ZAxisLabelVisibility
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
vtkAxisActor * XAxes[NUMBER_OF_ALIGNED_AXIS]
Control variables for all axes NB: [0] always for 'Major' axis during non-static fly modes.
vtkTextProperty * GetTitleTextProperty(int)
Returns the text property for the title on an axis.
bool StickyAxes
Flag for axes stickiness.
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
bool ZAxisMinorTickVisibility
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)
bool EnableDistanceLOD
If enabled the actor will not be visible at a certain distance from the camera.
bool CenterStickyAxes
Flag for centering sticky axes.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
vtkProperty * GetZAxesInnerGridlinesProperty()
Get/Set axes inner gridlines actors properties.
virtual void SetFlyMode(int)
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
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.
bool YAxisLabelVisibility
virtual void SetTickLocation(int)
Set/Get the location of ticks marks.
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...
double DistanceLODThreshold
Default is 0.80 This determines at what fraction of camera far clip range, actor is not visible.
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(...)