44 #ifndef vtkAxisActor_h
45 #define vtkAxisActor_h
49 #include "vtkRenderingAnnotationModule.h"
56 VTK_ABI_NAMESPACE_BEGIN
88 virtual void SetPoint1(
double x,
double y,
double z);
89 virtual double* GetPoint1();
98 virtual void SetPoint2(
double x,
double y,
double z);
99 virtual double* GetPoint2();
108 vtkSetVector2Macro(
Range,
double);
109 vtkGetVectorMacro(
Range,
double, 2);
117 void SetBounds(
const double bounds[6]);
118 void SetBounds(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax);
127 void SetLabelFormat(const
char* format);
128 vtkGetStringMacro(LabelFormat);
139 vtkSetMacro(UseTextActor3D,
bool);
140 vtkGetMacro(UseTextActor3D,
bool);
148 vtkSetMacro(MinorTicksVisible,
bool);
149 vtkGetMacro(MinorTicksVisible,
bool);
150 vtkBooleanMacro(MinorTicksVisible,
bool);
157 void SetTitle(const
std::
string&
title);
158 vtkGetMacro(Title,
std::
string);
165 void SetExponent(const
std::
string& exp);
166 vtkGetMacro(Exponent,
std::
string);
174 vtkSetMacro(MajorTickSize,
double);
175 vtkGetMacro(MajorTickSize,
double);
183 vtkSetMacro(MinorTickSize,
double);
184 vtkGetMacro(MinorTickSize,
double);
189 VTK_TICKS_INSIDE = 0,
190 VTK_TICKS_OUTSIDE = 1,
201 vtkSetClampMacro(TickLocation,
int, VTK_TICKS_INSIDE, VTK_TICKS_BOTH);
202 vtkGetMacro(TickLocation,
int);
214 vtkSetMacro(AxisVisibility,
bool);
215 vtkGetMacro(AxisVisibility,
bool);
216 vtkBooleanMacro(AxisVisibility,
bool);
224 vtkSetMacro(TickVisibility,
bool);
225 vtkGetMacro(TickVisibility,
bool);
226 vtkBooleanMacro(TickVisibility,
bool);
234 vtkSetMacro(LabelVisibility,
bool);
235 vtkGetMacro(LabelVisibility,
bool);
236 vtkBooleanMacro(LabelVisibility,
bool);
244 vtkSetMacro(TitleVisibility,
bool);
245 vtkGetMacro(TitleVisibility,
bool);
246 vtkBooleanMacro(TitleVisibility,
bool);
254 vtkSetMacro(ExponentVisibility,
bool);
255 vtkGetMacro(ExponentVisibility,
bool);
256 vtkBooleanMacro(ExponentVisibility,
bool);
264 vtkSetMacro(LastMajorTickPointCorrection,
bool);
265 vtkGetMacro(LastMajorTickPointCorrection,
bool);
266 vtkBooleanMacro(LastMajorTickPointCorrection,
bool);
272 VTK_ALIGN_BOTTOM = 1,
273 VTK_ALIGN_POINT1 = 2,
283 virtual void SetTitleAlignLocation(
int location);
284 vtkGetMacro(TitleAlignLocation,
int);
293 virtual void SetExponentLocation(
int location);
294 vtkGetMacro(ExponentLocation,
int);
374 vtkSetMacro(DrawGridlines,
bool);
375 vtkGetMacro(DrawGridlines,
bool);
376 vtkBooleanMacro(DrawGridlines,
bool);
386 vtkSetMacro(DrawGridlinesOnly,
bool);
387 vtkGetMacro(DrawGridlinesOnly,
bool);
388 vtkBooleanMacro(DrawGridlinesOnly,
bool);
391 vtkSetMacro(DrawGridlinesLocation,
int);
392 vtkGetMacro(DrawGridlinesLocation,
int);
399 vtkSetMacro(DrawInnerGridlines,
bool);
400 vtkGetMacro(DrawInnerGridlines,
bool);
401 vtkBooleanMacro(DrawInnerGridlines,
bool);
409 vtkSetMacro(GridlineXLength,
double);
410 vtkGetMacro(GridlineXLength,
double);
411 vtkSetMacro(GridlineYLength,
double);
412 vtkGetMacro(GridlineYLength,
double);
413 vtkSetMacro(GridlineZLength,
double);
414 vtkGetMacro(GridlineZLength,
double);
422 vtkSetMacro(DrawGridpolys,
bool);
423 vtkGetMacro(DrawGridpolys,
bool);
424 vtkBooleanMacro(DrawGridpolys,
bool);
439 vtkSetClampMacro(AxisType,
int, VTK_AXIS_TYPE_X, VTK_AXIS_TYPE_Z);
440 vtkGetMacro(AxisType,
int);
448 VTK_AXIS_POS_MINMIN = 0,
449 VTK_AXIS_POS_MINMAX = 1,
450 VTK_AXIS_POS_MAXMAX = 2,
451 VTK_AXIS_POS_MAXMIN = 3
459 vtkSetMacro(Log,
bool);
460 vtkGetMacro(Log,
bool);
461 vtkBooleanMacro(Log,
bool);
473 vtkSetClampMacro(AxisPosition,
int, VTK_AXIS_POS_MINMIN, VTK_AXIS_POS_MAXMIN);
474 vtkGetMacro(AxisPosition,
int);
496 virtual int RenderTranslucentGeometry(
vtkViewport* viewport);
513 double ComputeMaxLabelLength();
519 double ComputeTitleLength();
525 void SetLabelScale(
double scale);
526 void SetLabelScale(
int labelIndex,
double scale);
527 void SetTitleScale(
double scale);
528 void SetExponentScale(
double scale);
536 double GetMajorStart(
int axis);
537 void SetMajorStart(
int axis,
double value);
538 double GetDeltaMajor(
int axis);
539 void SetDeltaMajor(
int axis,
double value);
549 vtkSetMacro(MinorRangeStart,
double);
550 vtkGetMacro(MinorRangeStart,
double);
551 vtkSetMacro(MajorRangeStart,
double);
552 vtkGetMacro(MajorRangeStart,
double);
560 vtkSetMacro(DeltaRangeMinor,
double);
561 vtkGetMacro(DeltaRangeMinor,
double);
562 vtkSetMacro(DeltaRangeMajor,
double);
563 vtkGetMacro(DeltaRangeMajor,
double);
618 vtkGetMacro(NumberOfLabelsBuilt,
int);
626 vtkSetMacro(Use2DMode,
bool);
627 vtkGetMacro(Use2DMode,
bool);
635 vtkSetMacro(VerticalOffsetXTitle2D,
double);
636 vtkGetMacro(VerticalOffsetXTitle2D,
double);
644 vtkSetMacro(HorizontalOffsetYTitle2D,
double);
645 vtkGetMacro(HorizontalOffsetYTitle2D,
double);
653 vtkSetMacro(SaveTitlePosition,
int);
654 vtkGetMacro(SaveTitlePosition,
int);
662 vtkSetVector3Macro(AxisBaseForX,
double);
663 vtkGetVector3Macro(AxisBaseForX,
double);
671 vtkSetVector3Macro(AxisBaseForY,
double);
672 vtkGetVector3Macro(AxisBaseForY,
double);
680 vtkSetVector3Macro(AxisBaseForZ,
double);
681 vtkGetVector3Macro(AxisBaseForZ,
double);
689 vtkSetMacro(AxisOnOrigin,
bool);
690 vtkGetMacro(AxisOnOrigin,
bool);
698 vtkSetMacro(ScreenSize,
double);
699 vtkGetMacro(ScreenSize,
double);
707 vtkSetMacro(LabelOffset,
double);
708 vtkGetMacro(LabelOffset,
double);
716 vtkSetMacro(ExponentOffset,
double);
717 vtkGetMacro(ExponentOffset,
double);
728 vtkSetVector2Macro(TitleOffset,
double);
729 vtkGetVector2Macro(TitleOffset,
double);
740 void TransformBounds(
vtkViewport*,
double bnds[6]);
753 void BuildTitle(
bool);
759 void BuildExponent(
bool force);
761 void BuildExponent2D(
vtkViewport* viewport,
bool force);
769 vtkViewport* viewport,
double multiplier,
double scenepos[3],
double displayPos[2]);
771 void SetAxisPointsAndLines();
773 bool BuildTickPoints(
double p1[3],
double p2[3],
bool force);
776 void BuildMajorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
779 void BuildMajorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
782 void BuildMinorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
785 void BuildMinorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
787 void BuildAxisGridLines(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
789 bool TickVisibilityChanged();
794 bool BoundsDisplayCoordinateChanged(
vtkViewport* viewport);
800 vtkProp* GetTitleActorInternal();
802 vtkProp* GetExponentActorInternal();
813 void UpdateTitleActorProperty();
815 void UpdateLabelActorProperty(
int idx);
816 void UpdateExponentActorProperty();
828 char* LabelFormat =
nullptr;
829 double Range[2] = { 0.0, 1.0 };
830 double LastRange[2] = { -1.0, -1.0 };
831 bool UseTextActor3D =
false;
832 int NumberOfLabelsBuilt = 0;
833 bool MinorTicksVisible =
true;
834 bool LastMinorTicksVisible =
true;
841 int TickLocation = VTK_TICKS_INSIDE;
847 int TitleAlignLocation = VTK_ALIGN_BOTTOM;
853 int ExponentLocation = VTK_ALIGN_POINT2;
855 bool DrawGridlines =
false;
856 bool DrawGridlinesOnly =
false;
857 bool LastDrawGridlines =
false;
858 int DrawGridlinesLocation = 0;
859 int LastDrawGridlinesLocation = 0;
860 double GridlineXLength = 1.0;
861 double GridlineYLength = 1.0;
862 double GridlineZLength = 1.0;
864 bool DrawInnerGridlines =
false;
866 bool DrawGridpolys =
false;
868 bool AxisVisibility =
true;
869 bool TickVisibility =
true;
870 bool LastTickVisibility =
true;
871 bool LabelVisibility =
true;
872 bool TitleVisibility =
true;
873 bool ExponentVisibility =
false;
874 bool LastMajorTickPointCorrection =
false;
877 int AxisType = VTK_AXIS_TYPE_X;
878 int AxisPosition = VTK_AXIS_POS_MINMIN;
881 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
882 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
883 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
888 double MajorTickSize = 1.0;
889 double MinorTickSize = 0.5;
892 double MajorStart[3] = { 0.0, 0.0, 0.0 };
893 double DeltaMajor[3] = { 1.0, 1.0, 1.0 };
896 double MajorRangeStart = 0.0;
897 double MinorRangeStart = 0.0;
902 double DeltaRangeMinor = 1.0;
907 double DeltaRangeMajor = 1.0;
909 int LastAxisPosition = -1;
910 int LastTickLocation = -1;
918 std::unique_ptr<vtkTextActorInterfaceInternal> TitleProp;
925 std::unique_ptr<vtkTextActorInterfaceInternal> ExponentProp;
928 std::vector<std::shared_ptr<vtkTextActorInterfaceInternal>> LabelProps;
954 bool AxisOnOrigin =
false;
956 bool AxisHasZeroLength =
false;
961 bool Use2DMode =
false;
967 double VerticalOffsetXTitle2D = -40;
973 double HorizontalOffsetYTitle2D = -50;
981 int SaveTitlePosition = 0;
986 double TitleConstantPosition[2] = { 0.0, 0.0 };
991 bool NeedBuild2D =
false;
993 double LastMinDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
994 double LastMaxDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
995 double TickVector[3] = { 0.0, 0.0, 0.0 };
1000 double ScreenSize = 10.0;
1006 double LabelOffset = 30.0;
1007 double TitleOffset[2] = { 20.0, 20.0 };
1008 double ExponentOffset = 20.0;
1012 VTK_ABI_NAMESPACE_END
abstract superclass for all actors, volumes and annotations
virtual void SetPoint1(double x[3])
Specify the position of the first point defining the axis.
void SetTickLocationToInside()
void GetBounds(T a, double bds[6])
represents an object (geometry & properties) in a rendered scene
abstract specification for Viewports
represent surface properties of a geometric object
virtual void SetPoint2(double x[3])
Specify the position of the second point defining the axis.
virtual int RenderOverlay(vtkViewport *)
void SetTickLocationToBoth()
void SetAxisTypeToY()
Set/Get the type of this axis.
record modification and/or execution time
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 SetAxisPositionToMinMax()
a vtkAbstractArray subclass for strings
VTK Internal interface to manipulate text actors from vtkAxisActor.
concrete dataset represents vertices, lines, polygons, and triangle strips
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,1,1) visibility=1 pickable=1 dragable=1 orientation=(0,0,0).
void SetAxisTypeToX()
Set/Get the type of this axis.
void SetAxisPositionToMaxMax()
void SetAxisPositionToMinMin()
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
window superclass for vtkRenderWindow
auto Range(IterablePtr iterable, Options &&...opts) -> typename detail::IterableTraits< typename detail::StripPointers< IterablePtr >::type >::RangeType
Generate an iterable STL proxy object for a VTK container.
An actor that displays text.
a simple class to control print indentation
a virtual camera for 3D rendering
int GetNumberOfLabelFollower3D()
Get label actors responsigle for drawing label text.
void SetTickLocationToOutside()
An actor that displays text.
#define VTK_SIZEHINT(...)
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
a subclass of vtkFollower that ensures that data is always parallel to the axis defined by a vtkAxisA...
map vtkPolyData to graphics primitives
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
int GetNumberOfLabelFollowers()
Get label actors responsible for drawing label text.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetAxisPositionToMaxMin()
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
represent and manipulate 3D points
void SetAxisTypeToZ()
Set/Get the type of this axis.