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);
121 void GetBounds(
double bounds[6]);
128 vtkSetStringMacro(LabelFormat);
129 vtkGetStringMacro(LabelFormat);
140 vtkSetMacro(UseTextActor3D,
bool);
141 vtkGetMacro(UseTextActor3D,
bool);
149 vtkSetMacro(MinorTicksVisible,
bool);
150 vtkGetMacro(MinorTicksVisible,
bool);
151 vtkBooleanMacro(MinorTicksVisible,
bool);
158 void SetTitle(const
std::
string& title);
159 vtkGetMacro(Title,
std::
string);
166 void SetExponent(const
std::
string& exp);
167 vtkGetMacro(Exponent,
std::
string);
175 vtkSetMacro(MajorTickSize,
double);
176 vtkGetMacro(MajorTickSize,
double);
184 vtkSetMacro(MinorTickSize,
double);
185 vtkGetMacro(MinorTickSize,
double);
190 VTK_TICKS_INSIDE = 0,
191 VTK_TICKS_OUTSIDE = 1,
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);
273 VTK_ALIGN_BOTTOM = 1,
274 VTK_ALIGN_POINT1 = 2,
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);
440 vtkSetClampMacro(
AxisType,
int, VTK_AXIS_TYPE_X, VTK_AXIS_TYPE_Z);
449 VTK_AXIS_POS_MINMIN = 0,
450 VTK_AXIS_POS_MINMAX = 1,
451 VTK_AXIS_POS_MAXMAX = 2,
452 VTK_AXIS_POS_MAXMIN = 3
460 vtkSetMacro(Log,
bool);
461 vtkGetMacro(Log,
bool);
462 vtkBooleanMacro(Log,
bool);
474 vtkSetClampMacro(
AxisPosition,
int, VTK_AXIS_POS_MINMIN, VTK_AXIS_POS_MAXMIN);
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);
606 int GetNumberOfLabelFollowers() {
return this->GetNumberOfLabelsBuilt(); }
624 int GetNumberOfLabelFollower3D() {
return this->GetNumberOfLabelsBuilt(); }
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();
864 std::string Exponent;
865 char* LabelFormat =
nullptr;
866 double Range[2] = { 0.0, 1.0 };
867 double LastRange[2] = { -1.0, -1.0 };
868 bool UseTextActor3D =
false;
869 int NumberOfLabelsBuilt = 0;
870 bool MinorTicksVisible =
true;
871 bool LastMinorTicksVisible =
true;
878 int TickLocation = VTK_TICKS_INSIDE;
884 int TitleAlignLocation = VTK_ALIGN_BOTTOM;
890 int ExponentLocation = VTK_ALIGN_POINT2;
892 bool DrawGridlines =
false;
893 bool DrawGridlinesOnly =
false;
894 bool LastDrawGridlines =
false;
895 int DrawGridlinesLocation = 0;
896 int LastDrawGridlinesLocation = 0;
897 double GridlineXLength = 1.0;
898 double GridlineYLength = 1.0;
899 double GridlineZLength = 1.0;
901 bool DrawInnerGridlines =
false;
903 bool DrawGridpolys =
false;
905 bool AxisVisibility =
true;
906 bool TickVisibility =
true;
907 bool LastTickVisibility =
true;
908 bool LabelVisibility =
true;
909 bool TitleVisibility =
true;
910 bool ExponentVisibility =
false;
911 bool LastMajorTickPointCorrection =
false;
914 int AxisType = VTK_AXIS_TYPE_X;
915 int AxisPosition = VTK_AXIS_POS_MINMIN;
918 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
919 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
920 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
925 double MajorTickSize = 1.0;
926 double MinorTickSize = 0.5;
929 double MajorStart[3] = { 0.0, 0.0, 0.0 };
930 double DeltaMajor[3] = { 1.0, 1.0, 1.0 };
933 double MajorRangeStart = 0.0;
934 double MinorRangeStart = 0.0;
939 double DeltaRangeMinor = 1.0;
944 double DeltaRangeMajor = 1.0;
946 int LastAxisPosition = -1;
947 int LastTickLocation = -1;
955 std::unique_ptr<vtkTextActorInterfaceInternal> TitleProp;
962 std::unique_ptr<vtkTextActorInterfaceInternal> ExponentProp;
965 std::vector<std::shared_ptr<vtkTextActorInterfaceInternal>> LabelProps;
969 std::vector<vtkAxisFollower*> LabelActors;
971 std::vector<vtkProp3DAxisFollower*> LabelProps3D;
996 bool AxisOnOrigin =
false;
998 bool AxisHasZeroLength =
false;
1000 bool CalculateTitleOffset =
false;
1001 bool CalculateLabelOffset =
false;
1006 bool Use2DMode =
false;
1012 double VerticalOffsetXTitle2D = -40;
1018 double HorizontalOffsetYTitle2D = -50;
1026 int SaveTitlePosition = 0;
1031 double TitleConstantPosition[2] = { 0.0, 0.0 };
1036 bool NeedBuild2D =
false;
1038 double LastMinDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1039 double LastMaxDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1040 double TickVector[3] = { 0.0, 0.0, 0.0 };
1045 double ScreenSize = 10.0;
1051 double LabelOffset = 30.0;
1052 double TitleOffset[2] = { 20.0, 20.0 };
1053 double ExponentOffset = 20.0;
1057VTK_ABI_NAMESPACE_END
represents an object (geometry & properties) in a rendered scene
Create an axis with tick marks and labels.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTickLocationToBoth()
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.
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 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.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Draw the axis.
double ComputeMaxLabelLength(const double[3])
Compute the max diagonal lentgh of the labels.
double GetMajorStart(int axis)
Set/Get the starting position for minor and major tick points, and the delta values that determine th...
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.
vtkProperty * GetGridpolysProperty()
Get/Set gridPolys actor property (grid quads)
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the axis labels text property.
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...
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 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.
void SetAxisTypeToX()
Set/Get the type of this axis.
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.
void SetTickLocationToInside()
void SetLabels(vtkStringArray *labels)
vtkProperty * GetAxisMinorTicksProperty()
Get/Set axis actor property (axis and its ticks)
vtkProp3DAxisFollower * GetExponentProp3D()
Get title actor and it is responsible for drawing title text.
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
Allocate and hold a VTK object.
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...
abstract superclass for all actors, volumes and annotations
represent surface properties of a geometric object
Hold a reference to a vtkObjectBase instance.
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.
record modification and/or execution time
abstract specification for Viewports
window superclass for vtkRenderWindow
#define VTK_DEPRECATED_IN_9_5_0(reason)
#define VTK_SIZEHINT(...)