50#include "vtkRenderingAnnotationModule.h"
57VTK_ABI_NAMESPACE_BEGIN
89 virtual void SetPoint1(
double x,
double y,
double z);
99 virtual void SetPoint2(
double x,
double y,
double z);
109 vtkSetVector2Macro(Range,
double);
110 vtkGetVectorMacro(Range,
double, 2);
119 void SetBounds(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax);
129 vtkGetStringMacro(LabelFormat);
140 vtkSetMacro(UseTextActor3D,
bool);
141 vtkGetMacro(UseTextActor3D,
bool);
149 vtkSetMacro(MinorTicksVisible,
bool);
150 vtkGetMacro(MinorTicksVisible,
bool);
151 vtkBooleanMacro(MinorTicksVisible,
bool);
159 vtkGetMacro(Title,
std::
string);
167 vtkGetMacro(Exponent,
std::
string);
175 vtkSetMacro(MajorTickSize,
double);
176 vtkGetMacro(MajorTickSize,
double);
184 vtkSetMacro(MinorTickSize,
double);
185 vtkGetMacro(MinorTickSize,
double);
215 vtkSetMacro(AxisVisibility,
bool);
216 vtkGetMacro(AxisVisibility,
bool);
217 vtkBooleanMacro(AxisVisibility,
bool);
225 vtkSetMacro(TickVisibility,
bool);
226 vtkGetMacro(TickVisibility,
bool);
227 vtkBooleanMacro(TickVisibility,
bool);
235 vtkSetMacro(LabelVisibility,
bool);
236 vtkGetMacro(LabelVisibility,
bool);
237 vtkBooleanMacro(LabelVisibility,
bool);
245 vtkSetMacro(TitleVisibility,
bool);
246 vtkGetMacro(TitleVisibility,
bool);
247 vtkBooleanMacro(TitleVisibility,
bool);
255 vtkSetMacro(ExponentVisibility,
bool);
256 vtkGetMacro(ExponentVisibility,
bool);
257 vtkBooleanMacro(ExponentVisibility,
bool);
265 vtkSetMacro(LastMajorTickPointCorrection,
bool);
266 vtkGetMacro(LastMajorTickPointCorrection,
bool);
267 vtkBooleanMacro(LastMajorTickPointCorrection,
bool);
285 vtkGetMacro(TitleAlignLocation,
int);
295 vtkGetMacro(ExponentLocation,
int);
375 vtkSetMacro(DrawGridlines,
bool);
376 vtkGetMacro(DrawGridlines,
bool);
377 vtkBooleanMacro(DrawGridlines,
bool);
387 vtkSetMacro(DrawGridlinesOnly,
bool);
388 vtkGetMacro(DrawGridlinesOnly,
bool);
389 vtkBooleanMacro(DrawGridlinesOnly,
bool);
392 vtkSetMacro(DrawGridlinesLocation,
int);
393 vtkGetMacro(DrawGridlinesLocation,
int);
400 vtkSetMacro(DrawInnerGridlines,
bool);
401 vtkGetMacro(DrawInnerGridlines,
bool);
402 vtkBooleanMacro(DrawInnerGridlines,
bool);
410 vtkSetMacro(GridlineXLength,
double);
411 vtkGetMacro(GridlineXLength,
double);
412 vtkSetMacro(GridlineYLength,
double);
413 vtkGetMacro(GridlineYLength,
double);
414 vtkSetMacro(GridlineZLength,
double);
415 vtkGetMacro(GridlineZLength,
double);
423 vtkSetMacro(DrawGridpolys,
bool);
424 vtkGetMacro(DrawGridpolys,
bool);
425 vtkBooleanMacro(DrawGridpolys,
bool);
460 vtkSetMacro(Log,
bool);
461 vtkGetMacro(Log,
bool);
462 vtkBooleanMacro(Log,
bool);
567 vtkSetMacro(MinorRangeStart,
double);
568 vtkGetMacro(MinorRangeStart,
double);
569 vtkSetMacro(MajorRangeStart,
double);
570 vtkGetMacro(MajorRangeStart,
double);
578 vtkSetMacro(DeltaRangeMinor,
double);
579 vtkGetMacro(DeltaRangeMinor,
double);
580 vtkSetMacro(DeltaRangeMajor,
double);
581 vtkGetMacro(DeltaRangeMajor,
double);
640 vtkGetMacro(NumberOfLabelsBuilt,
int);
670 vtkSetMacro(Use2DMode,
bool);
671 vtkGetMacro(Use2DMode,
bool);
679 vtkSetMacro(VerticalOffsetXTitle2D,
double);
680 vtkGetMacro(VerticalOffsetXTitle2D,
double);
688 vtkSetMacro(HorizontalOffsetYTitle2D,
double);
689 vtkGetMacro(HorizontalOffsetYTitle2D,
double);
697 vtkSetMacro(SaveTitlePosition,
int);
698 vtkGetMacro(SaveTitlePosition,
int);
706 vtkSetVector3Macro(AxisBaseForX,
double);
707 vtkGetVector3Macro(AxisBaseForX,
double);
715 vtkSetVector3Macro(AxisBaseForY,
double);
716 vtkGetVector3Macro(AxisBaseForY,
double);
724 vtkSetVector3Macro(AxisBaseForZ,
double);
725 vtkGetVector3Macro(AxisBaseForZ,
double);
733 vtkSetMacro(AxisOnOrigin,
bool);
734 vtkGetMacro(AxisOnOrigin,
bool);
742 vtkSetMacro(ScreenSize,
double);
743 vtkGetMacro(ScreenSize,
double);
751 vtkSetMacro(LabelOffset,
double);
752 vtkGetMacro(LabelOffset,
double);
760 vtkSetMacro(ExponentOffset,
double);
761 vtkGetMacro(ExponentOffset,
double);
772 vtkSetVector2Macro(TitleOffset,
double);
773 vtkGetVector2Macro(TitleOffset,
double);
784 void TransformBounds(
vtkViewport*,
double bnds[6]);
797 void BuildTitle(
bool);
803 void BuildExponent(
bool force);
805 void BuildExponent2D(
vtkViewport* viewport,
bool force);
813 vtkViewport* viewport,
double multiplier,
double scenepos[3],
double displayPos[2]);
815 void SetAxisPointsAndLines();
817 bool BuildTickPoints(
double p1[3],
double p2[3],
bool force);
820 void BuildMajorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
823 void BuildMajorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
826 void BuildMinorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
829 void BuildMinorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
831 void BuildAxisGridLines(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
833 bool TickVisibilityChanged();
838 bool BoundsDisplayCoordinateChanged(
vtkViewport* viewport);
844 vtkProp* GetTitleActorInternal();
845 vtkProp* GetLabelActorInternal(
int index);
846 vtkProp* GetExponentActorInternal();
858 void UpdateTitleActorProperty();
859 void UpdateLabelActorProperty(
int idx);
860 void UpdateExponentActorProperty();
871 std::string Exponent;
872 char* LabelFormat =
nullptr;
873 double Range[2] = { 0.0, 1.0 };
874 double LastRange[2] = { -1.0, -1.0 };
875 bool UseTextActor3D =
false;
876 int NumberOfLabelsBuilt = 0;
877 bool MinorTicksVisible =
true;
878 bool LastMinorTicksVisible =
true;
885 int TickLocation = VTK_TICKS_INSIDE;
891 int TitleAlignLocation = VTK_ALIGN_BOTTOM;
897 int ExponentLocation = VTK_ALIGN_POINT2;
899 bool DrawGridlines =
false;
900 bool DrawGridlinesOnly =
false;
901 bool LastDrawGridlines =
false;
902 int DrawGridlinesLocation = 0;
903 int LastDrawGridlinesLocation = 0;
904 double GridlineXLength = 1.0;
905 double GridlineYLength = 1.0;
906 double GridlineZLength = 1.0;
908 bool DrawInnerGridlines =
false;
910 bool DrawGridpolys =
false;
912 bool AxisVisibility =
true;
913 bool TickVisibility =
true;
914 bool LastTickVisibility =
true;
915 bool LabelVisibility =
true;
916 bool TitleVisibility =
true;
917 bool ExponentVisibility =
false;
918 bool LastMajorTickPointCorrection =
false;
921 int AxisType = VTK_AXIS_TYPE_X;
922 int AxisPosition = VTK_AXIS_POS_MINMIN;
925 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
926 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
927 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
929 vtkNew<vtkCoordinate> Point1Coordinate;
930 vtkNew<vtkCoordinate> Point2Coordinate;
932 double MajorTickSize = 1.0;
933 double MinorTickSize = 0.5;
936 double MajorStart[3] = { 0.0, 0.0, 0.0 };
937 double DeltaMajor[3] = { 1.0, 1.0, 1.0 };
940 double MajorRangeStart = 0.0;
941 double MinorRangeStart = 0.0;
946 double DeltaRangeMinor = 1.0;
951 double DeltaRangeMajor = 1.0;
953 int LastAxisPosition = -1;
954 int LastTickLocation = -1;
956 vtkNew<vtkPoints> MinorTickPts;
957 vtkNew<vtkPoints> MajorTickPts;
958 vtkNew<vtkPoints> GridlinePts;
959 vtkNew<vtkPoints> InnerGridlinePts;
960 vtkNew<vtkPoints> GridpolyPts;
962 std::unique_ptr<vtkTextActorInterfaceInternal> TitleProp;
963 vtkSmartPointer<vtkTextProperty> TitleTextProperty;
969 std::unique_ptr<vtkTextActorInterfaceInternal> ExponentProp;
972 std::vector<std::shared_ptr<vtkTextActorInterfaceInternal>> LabelProps;
973 vtkSmartPointer<vtkTextProperty> LabelTextProperty;
976 std::vector<vtkAxisFollower*> LabelActors;
978 std::vector<vtkProp3DAxisFollower*> LabelProps3D;
981 vtkNew<vtkPolyData> AxisLines;
982 vtkNew<vtkActor> AxisLinesActor;
985 vtkNew<vtkPolyData> AxisMajorTicks, AxisMinorTicks;
986 vtkNew<vtkActor> AxisMajorTicksActor, AxisMinorTicksActor;
988 vtkNew<vtkPolyData> Gridlines;
989 vtkNew<vtkActor> GridlinesActor;
990 vtkNew<vtkPolyData> InnerGridlines;
991 vtkNew<vtkActor> InnerGridlinesActor;
992 vtkNew<vtkPolyData> Gridpolys;
993 vtkNew<vtkActor> GridpolysActor;
995 vtkSmartPointer<vtkCamera>
Camera;
997 vtkTimeStamp BuildTickPointsTime;
998 vtkTimeStamp BoundsTime;
999 vtkTimeStamp LabelBuildTime;
1000 vtkTimeStamp TitleTextTime;
1001 vtkTimeStamp ExponentTextTime;
1003 bool AxisOnOrigin =
false;
1005 bool AxisHasZeroLength =
false;
1007 bool CalculateTitleOffset =
false;
1008 bool CalculateLabelOffset =
false;
1013 bool Use2DMode =
false;
1019 double VerticalOffsetXTitle2D = -40;
1025 double HorizontalOffsetYTitle2D = -50;
1033 int SaveTitlePosition = 0;
1038 double TitleConstantPosition[2] = { 0.0, 0.0 };
1043 bool NeedBuild2D =
false;
1045 double LastMinDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1046 double LastMaxDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1047 double TickVector[3] = { 0.0, 0.0, 0.0 };
1052 double ScreenSize = 10.0;
1058 double LabelOffset = 30.0;
1059 double TitleOffset[2] = { 20.0, 20.0 };
1060 double ExponentOffset = 20.0;
1064VTK_ABI_NAMESPACE_END
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTickLocationToBoth()
void CalculateLabelOffsetOn()
Set/Get flag whether to calculate label offset.
void SetAxisPositionToMinMax()
virtual void SetPoint2(double x, double y, double z)
Specify the position of the second point defining the axis.
virtual void SetCamera(vtkCamera *)
Set/Get the camera for this axis.
void SetMinorStart(double)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
void CalculateLabelOffsetOff()
Set/Get flag whether to calculate label offset.
virtual void SetPoint2(double x[3])
Specify the position of the second point defining the axis.
void SetDeltaMajor(int axis, double value)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
void SetAxisMainLineProperty(vtkProperty *)
Get/Set main line axis actor property.
virtual double * GetPoint1()
Specify the position of the first point defining the axis.
double GetMinorStart()
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
double ComputeTitleLength()
Compute the diagonal length of the Title text.
vtkProperty * GetGridlinesProperty()
Get/Set gridlines actor property (outer grid lines).
void SetBounds(const double bounds[6])
Set or get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
int RenderOverlay(vtkViewport *viewport) override
Draw the axis.
double GetDeltaMinor()
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
vtkTypeBool HasTranslucentPolygonalGeometry() override
Draw the axis.
double ComputeMaxLabelLength(const double[3])
Compute the max diagonal lentgh of the labels.
void SetExponent(const std::string &exp)
Set/Get the common exponent of the labels values.
double GetMajorStart(int axis)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
int GetNumberOfLabelFollower3D()
Get label actors responsigle for drawing label text.
void SetGridlinesProperty(vtkProperty *)
Get/Set gridlines actor property (outer grid lines).
void SetAxisTypeToZ()
Set/Get the type of this axis.
double ComputeMaxLabelLength()
Compute the max diagonal lentgh of the labels.
void SetTitle(const std::string &title)
Set/Get the title of the axis actor.
vtkProperty * GetGridpolysProperty()
Get/Set gridPolys actor property (grid quads).
int GetNumberOfLabelFollowers()
Get label actors responsigle for drawing label text.
void CalculateTitleOffsetOn()
Set/Get flag whether to calculate title offset.
void SetLabelFormat(const char *format)
Set/Get the std::format or printf style format with which to print the labels on the axis.
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the axis labels text property.
vtkAxisFollower ** GetLabelActors()
Get label actors responsigle for drawing label text.
virtual void SetExponentLocation(int location)
Get/Set the location of the Detached Exponent related to the axis.
vtkCamera * GetCamera()
Set/Get the camera for this axis.
virtual vtkCoordinate * GetPoint2Coordinate()
Specify the position of the second point defining the axis.
vtkProperty * GetInnerGridlinesProperty()
Get/Set inner gridlines actor property.
void SetAxisPositionToMinMin()
double GetDeltaMajor(int axis)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
vtkProp3DAxisFollower * GetLabelFollower3D(int index)
Get label actors responsigle for drawing label text.
double * GetBounds() override
Set or get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkTextProperty * GetLabelTextProperty()
Set/Get the axis labels text property.
void SetLabelScale(int labelIndex, double scale)
Set scale on underlying actor.
virtual void SetPoint1(double x[3])
Specify the position of the first point defining the axis.
void SetAxisLinesProperty(vtkProperty *)
Get/Set axis actor property (axis and its ticks) (kept for compatibility).
void SetInnerGridlinesProperty(vtkProperty *)
Get/Set inner gridlines actor property.
vtkProperty * GetAxisMajorTicksProperty()
Get/Set axis actor property (axis and its ticks).
void SetAxisMajorTicksProperty(vtkProperty *)
Get/Set axis actor property (axis and its ticks).
void CalculateTitleOffsetOff()
Set/Get flag whether to calculate title offset.
void SetLabelScale(double scale)
Set scale on underlying actor.
void SetTickLocationToOutside()
void SetExponentScale(double scale)
Set scale on underlying actor.
void SetBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
Set or get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void BuildAxis(vtkViewport *viewport, bool)
virtual double * GetPoint2()
Specify the position of the second point defining the axis.
void SetAxisTypeToY()
Set/Get the type of this axis.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkAxisFollower * GetExponentActor()
Get exponent follower actor.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Draw the axis.
virtual void SetAxisType(int)
Set/Get the type of this axis.
virtual void SetAxisPosition(int)
Set/Get the position of this axis (in relation to an an assumed bounding box).
void SetAxisTypeToX()
Set/Get the type of this axis.
virtual void SetTickLocation(int)
Set/Get the location of the ticks.
void SetTitleScale(double scale)
Set scale on underlying actor.
virtual void SetTitleAlignLocation(int location)
Get/Set the alignment of the title related to the axis.
vtkProperty * GetAxisMainLineProperty()
Get/Set main line axis actor property.
vtkAxisFollower * GetTitleActor()
Get title actor and it is responsible for drawing title text.
virtual void SetTitleTextProperty(vtkTextProperty *p)
Set/Get the axis title text property.
double ComputeTitleLength(const double[3])
Compute the diagonal length of the Title text.
void SetAxisPositionToMaxMin()
virtual vtkCoordinate * GetPoint1Coordinate()
Specify the position of the first point defining the axis.
virtual int RenderTranslucentGeometry(vtkViewport *viewport)
Draw the axis.
virtual int GetNumberOfLabelsBuilt()
Get total number of labels built.
vtkProp3DAxisFollower ** GetLabelProps3D()
Get label actors responsigle for drawing label text.
void SetTickLocationToInside()
void SetLabels(vtkStringArray *labels)
vtkAxisFollower * GetLabelFollower(int index)
Get label actors responsigle for drawing label text.
vtkProperty * GetAxisMinorTicksProperty()
Get/Set axis actor property (axis and its ticks).
vtkProp3DAxisFollower * GetExponentProp3D()
Get title actor and it is responsible for drawing title text.
void SetDeltaMinor(double)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
vtkTextProperty * GetTitleTextProperty()
Set/Get the axis title text property.
void SetAxisPositionToMaxMax()
virtual void SetPoint1(double x, double y, double z)
Specify the position of the first point defining the axis.
void SetAxisMinorTicksProperty(vtkProperty *)
Get/Set axis actor property (axis and its ticks).
static vtkAxisActor * New()
Instantiate object.
void SetMajorStart(int axis, double value)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
vtkProp3DAxisFollower * GetTitleProp3D()
Get title actor and it is responsible for drawing title text.
vtkProperty * GetAxisLinesProperty()
Get/Set axis actor property (axis and its ticks) (kept for compatibility).
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Draw the axis.
void SetGridpolysProperty(vtkProperty *)
Get/Set gridPolys actor property (grid quads).
a subclass of vtkFollower that ensures that data is always parallel to the axis defined by a vtkAxisA...
a virtual camera for 3D rendering
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
represent and manipulate 3D points
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
represent surface properties of a geometric object
a vtkAbstractArray subclass for strings
An actor that displays text.
VTK Internal interface to manipulate text actors from vtkAxisActor.
An actor that displays text.
represent text properties.
abstract specification for Viewports
window superclass for vtkRenderWindow
#define VTK_DEPRECATED_IN_9_5_0(reason)
#define VTK_SIZEHINT(...)