69#include "vtkRenderingAnnotationModule.h"
76VTK_ABI_NAMESPACE_BEGIN
128 vtkSetVector2Macro(Range,
double);
129 vtkGetVectorMacro(Range,
double, 2);
138 void SetBounds(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax);
148 vtkGetStringMacro(LabelFormat);
159 vtkSetMacro(UseTextActor3D,
bool);
160 vtkGetMacro(UseTextActor3D,
bool);
168 vtkSetMacro(MinorTicksVisible,
bool);
169 vtkGetMacro(MinorTicksVisible,
bool);
170 vtkBooleanMacro(MinorTicksVisible,
bool);
178 vtkGetMacro(Title,
std::
string);
186 vtkGetMacro(Exponent,
std::
string);
194 vtkSetMacro(MajorTickSize,
double);
195 vtkGetMacro(MajorTickSize,
double);
203 vtkSetMacro(MinorTickSize,
double);
204 vtkGetMacro(MinorTickSize,
double);
234 vtkSetMacro(AxisVisibility,
bool);
235 vtkGetMacro(AxisVisibility,
bool);
236 vtkBooleanMacro(AxisVisibility,
bool);
244 vtkSetMacro(TickVisibility,
bool);
245 vtkGetMacro(TickVisibility,
bool);
246 vtkBooleanMacro(TickVisibility,
bool);
254 vtkSetMacro(LabelVisibility,
bool);
255 vtkGetMacro(LabelVisibility,
bool);
256 vtkBooleanMacro(LabelVisibility,
bool);
264 vtkSetMacro(TitleVisibility,
bool);
265 vtkGetMacro(TitleVisibility,
bool);
266 vtkBooleanMacro(TitleVisibility,
bool);
274 vtkSetMacro(ExponentVisibility,
bool);
275 vtkGetMacro(ExponentVisibility,
bool);
276 vtkBooleanMacro(ExponentVisibility,
bool);
284 vtkSetMacro(LastMajorTickPointCorrection,
bool);
285 vtkGetMacro(LastMajorTickPointCorrection,
bool);
286 vtkBooleanMacro(LastMajorTickPointCorrection,
bool);
304 vtkGetMacro(TitleAlignLocation,
int);
314 vtkGetMacro(ExponentLocation,
int);
394 vtkSetMacro(DrawGridlines,
bool);
395 vtkGetMacro(DrawGridlines,
bool);
396 vtkBooleanMacro(DrawGridlines,
bool);
406 vtkSetMacro(DrawGridlinesOnly,
bool);
407 vtkGetMacro(DrawGridlinesOnly,
bool);
408 vtkBooleanMacro(DrawGridlinesOnly,
bool);
411 vtkSetMacro(DrawGridlinesLocation,
int);
412 vtkGetMacro(DrawGridlinesLocation,
int);
419 vtkSetMacro(DrawInnerGridlines,
bool);
420 vtkGetMacro(DrawInnerGridlines,
bool);
421 vtkBooleanMacro(DrawInnerGridlines,
bool);
429 vtkSetMacro(GridlineXLength,
double);
430 vtkGetMacro(GridlineXLength,
double);
431 vtkSetMacro(GridlineYLength,
double);
432 vtkGetMacro(GridlineYLength,
double);
433 vtkSetMacro(GridlineZLength,
double);
434 vtkGetMacro(GridlineZLength,
double);
442 vtkSetMacro(DrawGridpolys,
bool);
443 vtkGetMacro(DrawGridpolys,
bool);
444 vtkBooleanMacro(DrawGridpolys,
bool);
479 vtkSetMacro(Log,
bool);
480 vtkGetMacro(Log,
bool);
481 vtkBooleanMacro(Log,
bool);
586 vtkSetMacro(MinorRangeStart,
double);
587 vtkGetMacro(MinorRangeStart,
double);
588 vtkSetMacro(MajorRangeStart,
double);
589 vtkGetMacro(MajorRangeStart,
double);
597 vtkSetMacro(DeltaRangeMinor,
double);
598 vtkGetMacro(DeltaRangeMinor,
double);
599 vtkSetMacro(DeltaRangeMajor,
double);
600 vtkGetMacro(DeltaRangeMajor,
double);
659 vtkGetMacro(NumberOfLabelsBuilt,
int);
689 vtkSetMacro(Use2DMode,
bool);
690 vtkGetMacro(Use2DMode,
bool);
698 vtkSetMacro(VerticalOffsetXTitle2D,
double);
699 vtkGetMacro(VerticalOffsetXTitle2D,
double);
707 vtkSetMacro(HorizontalOffsetYTitle2D,
double);
708 vtkGetMacro(HorizontalOffsetYTitle2D,
double);
716 vtkSetMacro(SaveTitlePosition,
int);
717 vtkGetMacro(SaveTitlePosition,
int);
725 vtkSetVector3Macro(AxisBaseForX,
double);
726 vtkGetVector3Macro(AxisBaseForX,
double);
734 vtkSetVector3Macro(AxisBaseForY,
double);
735 vtkGetVector3Macro(AxisBaseForY,
double);
743 vtkSetVector3Macro(AxisBaseForZ,
double);
744 vtkGetVector3Macro(AxisBaseForZ,
double);
752 vtkSetMacro(AxisOnOrigin,
bool);
753 vtkGetMacro(AxisOnOrigin,
bool);
761 vtkSetMacro(ScreenSize,
double);
762 vtkGetMacro(ScreenSize,
double);
770 vtkSetMacro(LabelOffset,
double);
771 vtkGetMacro(LabelOffset,
double);
779 vtkSetMacro(ExponentOffset,
double);
780 vtkGetMacro(ExponentOffset,
double);
791 vtkSetVector2Macro(TitleOffset,
double);
792 vtkGetVector2Macro(TitleOffset,
double);
803 void TransformBounds(
vtkViewport*,
double bnds[6]);
816 void BuildTitle(
bool);
822 void BuildExponent(
bool force);
824 void BuildExponent2D(
vtkViewport* viewport,
bool force);
832 vtkViewport* viewport,
double multiplier,
double scenepos[3],
double displayPos[2]);
834 void SetAxisPointsAndLines();
836 bool BuildTickPoints(
double p1[3],
double p2[3],
bool force);
839 void BuildMajorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
842 void BuildMajorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
845 void BuildMinorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
848 void BuildMinorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
850 void BuildAxisGridLines(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
852 bool TickVisibilityChanged();
857 bool BoundsDisplayCoordinateChanged(
vtkViewport* viewport);
863 vtkProp* GetTitleActorInternal();
864 vtkProp* GetLabelActorInternal(
int index);
865 vtkProp* GetExponentActorInternal();
877 void UpdateTitleActorProperty();
878 void UpdateLabelActorProperty(
int idx);
879 void UpdateExponentActorProperty();
890 std::string Exponent;
891 char* LabelFormat =
nullptr;
892 double Range[2] = { 0.0, 1.0 };
893 double LastRange[2] = { -1.0, -1.0 };
894 bool UseTextActor3D =
false;
895 int NumberOfLabelsBuilt = 0;
896 bool MinorTicksVisible =
true;
897 bool LastMinorTicksVisible =
true;
904 int TickLocation = VTK_TICKS_INSIDE;
910 int TitleAlignLocation = VTK_ALIGN_BOTTOM;
916 int ExponentLocation = VTK_ALIGN_POINT2;
918 bool DrawGridlines =
false;
919 bool DrawGridlinesOnly =
false;
920 bool LastDrawGridlines =
false;
921 int DrawGridlinesLocation = 0;
922 int LastDrawGridlinesLocation = 0;
923 double GridlineXLength = 1.0;
924 double GridlineYLength = 1.0;
925 double GridlineZLength = 1.0;
927 bool DrawInnerGridlines =
false;
929 bool DrawGridpolys =
false;
931 bool AxisVisibility =
true;
932 bool TickVisibility =
true;
933 bool LastTickVisibility =
true;
934 bool LabelVisibility =
true;
935 bool TitleVisibility =
true;
936 bool ExponentVisibility =
false;
937 bool LastMajorTickPointCorrection =
false;
940 int AxisType = VTK_AXIS_TYPE_X;
941 int AxisPosition = VTK_AXIS_POS_MINMIN;
944 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
945 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
946 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
948 vtkNew<vtkCoordinate> Point1Coordinate;
949 vtkNew<vtkCoordinate> Point2Coordinate;
951 double MajorTickSize = 1.0;
952 double MinorTickSize = 0.5;
955 double MajorStart[3] = { 0.0, 0.0, 0.0 };
956 double DeltaMajor[3] = { 1.0, 1.0, 1.0 };
959 double MajorRangeStart = 0.0;
960 double MinorRangeStart = 0.0;
965 double DeltaRangeMinor = 1.0;
970 double DeltaRangeMajor = 1.0;
972 int LastAxisPosition = -1;
973 int LastTickLocation = -1;
975 vtkNew<vtkPoints> MinorTickPts;
976 vtkNew<vtkPoints> MajorTickPts;
977 vtkNew<vtkPoints> GridlinePts;
978 vtkNew<vtkPoints> InnerGridlinePts;
979 vtkNew<vtkPoints> GridpolyPts;
981 std::unique_ptr<vtkTextActorInterfaceInternal> TitleProp;
982 vtkSmartPointer<vtkTextProperty> TitleTextProperty;
988 std::unique_ptr<vtkTextActorInterfaceInternal> ExponentProp;
991 std::vector<std::shared_ptr<vtkTextActorInterfaceInternal>> LabelProps;
992 vtkSmartPointer<vtkTextProperty> LabelTextProperty;
995 std::vector<vtkAxisFollower*> LabelActors;
997 std::vector<vtkProp3DAxisFollower*> LabelProps3D;
1000 vtkNew<vtkPolyData> AxisLines;
1001 vtkNew<vtkActor> AxisLinesActor;
1004 vtkNew<vtkPolyData> AxisMajorTicks, AxisMinorTicks;
1005 vtkNew<vtkActor> AxisMajorTicksActor, AxisMinorTicksActor;
1007 vtkNew<vtkPolyData> Gridlines;
1008 vtkNew<vtkActor> GridlinesActor;
1009 vtkNew<vtkPolyData> InnerGridlines;
1010 vtkNew<vtkActor> InnerGridlinesActor;
1011 vtkNew<vtkPolyData> Gridpolys;
1012 vtkNew<vtkActor> GridpolysActor;
1014 vtkSmartPointer<vtkCamera> Camera;
1015 vtkTimeStamp BuildTime;
1016 vtkTimeStamp BuildTickPointsTime;
1017 vtkTimeStamp BoundsTime;
1018 vtkTimeStamp LabelBuildTime;
1019 vtkTimeStamp TitleTextTime;
1020 vtkTimeStamp ExponentTextTime;
1022 bool AxisOnOrigin =
false;
1024 bool AxisHasZeroLength =
false;
1026 bool CalculateTitleOffset =
false;
1027 bool CalculateLabelOffset =
false;
1032 bool Use2DMode =
false;
1038 double VerticalOffsetXTitle2D = -40;
1044 double HorizontalOffsetYTitle2D = -50;
1052 int SaveTitlePosition = 0;
1057 double TitleConstantPosition[2] = { 0.0, 0.0 };
1062 bool NeedBuild2D =
false;
1064 double LastMinDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1065 double LastMaxDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1066 double TickVector[3] = { 0.0, 0.0, 0.0 };
1071 double ScreenSize = 10.0;
1077 double LabelOffset = 30.0;
1078 double TitleOffset[2] = { 20.0, 20.0 };
1079 double ExponentOffset = 20.0;
1083VTK_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 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(...)