44 #ifndef vtkAxisActor_h
45 #define vtkAxisActor_h
50 #include "vtkRenderingAnnotationModule.h"
53 VTK_ABI_NAMESPACE_BEGIN
86 virtual void SetPoint1(
double x,
double y,
double z);
87 virtual double* GetPoint1();
96 virtual void SetPoint2(
double x,
double y,
double z);
97 virtual double* GetPoint2();
106 vtkSetVector2Macro(
Range,
double);
107 vtkGetVectorMacro(
Range,
double, 2);
115 void SetBounds(
const double bounds[6]);
116 void SetBounds(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax);
125 vtkSetStringMacro(LabelFormat);
126 vtkGetStringMacro(LabelFormat);
137 vtkSetMacro(UseTextActor3D,
bool);
138 vtkGetMacro(UseTextActor3D,
bool);
146 vtkSetMacro(MinorTicksVisible,
bool);
147 vtkGetMacro(MinorTicksVisible,
bool);
148 vtkBooleanMacro(MinorTicksVisible,
bool);
155 void SetTitle(const
char* t);
156 vtkGetStringMacro(Title);
163 void SetExponent(const
char* t);
164 vtkGetStringMacro(Exponent);
172 vtkSetMacro(MajorTickSize,
double);
173 vtkGetMacro(MajorTickSize,
double);
181 vtkSetMacro(MinorTickSize,
double);
182 vtkGetMacro(MinorTickSize,
double);
187 VTK_TICKS_INSIDE = 0,
188 VTK_TICKS_OUTSIDE = 1,
199 vtkSetClampMacro(TickLocation,
int, VTK_TICKS_INSIDE, VTK_TICKS_BOTH);
200 vtkGetMacro(TickLocation,
int);
212 vtkSetMacro(AxisVisibility,
bool);
213 vtkGetMacro(AxisVisibility,
bool);
214 vtkBooleanMacro(AxisVisibility,
bool);
222 vtkSetMacro(TickVisibility,
bool);
223 vtkGetMacro(TickVisibility,
bool);
224 vtkBooleanMacro(TickVisibility,
bool);
232 vtkSetMacro(LabelVisibility,
bool);
233 vtkGetMacro(LabelVisibility,
bool);
234 vtkBooleanMacro(LabelVisibility,
bool);
242 vtkSetMacro(TitleVisibility,
bool);
243 vtkGetMacro(TitleVisibility,
bool);
244 vtkBooleanMacro(TitleVisibility,
bool);
252 vtkSetMacro(ExponentVisibility,
bool);
253 vtkGetMacro(ExponentVisibility,
bool);
254 vtkBooleanMacro(ExponentVisibility,
bool);
262 vtkSetMacro(LastMajorTickPointCorrection,
bool);
263 vtkGetMacro(LastMajorTickPointCorrection,
bool);
264 vtkBooleanMacro(LastMajorTickPointCorrection,
bool);
270 VTK_ALIGN_BOTTOM = 1,
271 VTK_ALIGN_POINT1 = 2,
281 virtual void SetTitleAlignLocation(
int location);
282 vtkGetMacro(TitleAlignLocation,
int);
291 virtual void SetExponentLocation(
int location);
292 vtkGetMacro(ExponentLocation,
int);
372 vtkSetMacro(DrawGridlines,
bool);
373 vtkGetMacro(DrawGridlines,
bool);
374 vtkBooleanMacro(DrawGridlines,
bool);
384 vtkSetMacro(DrawGridlinesOnly,
bool);
385 vtkGetMacro(DrawGridlinesOnly,
bool);
386 vtkBooleanMacro(DrawGridlinesOnly,
bool);
389 vtkSetMacro(DrawGridlinesLocation,
int);
390 vtkGetMacro(DrawGridlinesLocation,
int);
397 vtkSetMacro(DrawInnerGridlines,
bool);
398 vtkGetMacro(DrawInnerGridlines,
bool);
399 vtkBooleanMacro(DrawInnerGridlines,
bool);
407 vtkSetMacro(GridlineXLength,
double);
408 vtkGetMacro(GridlineXLength,
double);
409 vtkSetMacro(GridlineYLength,
double);
410 vtkGetMacro(GridlineYLength,
double);
411 vtkSetMacro(GridlineZLength,
double);
412 vtkGetMacro(GridlineZLength,
double);
420 vtkSetMacro(DrawGridpolys,
bool);
421 vtkGetMacro(DrawGridpolys,
bool);
422 vtkBooleanMacro(DrawGridpolys,
bool);
437 vtkSetClampMacro(AxisType,
int, VTK_AXIS_TYPE_X, VTK_AXIS_TYPE_Z);
438 vtkGetMacro(AxisType,
int);
446 VTK_AXIS_POS_MINMIN = 0,
447 VTK_AXIS_POS_MINMAX = 1,
448 VTK_AXIS_POS_MAXMAX = 2,
449 VTK_AXIS_POS_MAXMIN = 3
457 vtkSetMacro(Log,
bool);
458 vtkGetMacro(Log,
bool);
459 vtkBooleanMacro(Log,
bool);
471 vtkSetClampMacro(AxisPosition,
int, VTK_AXIS_POS_MINMIN, VTK_AXIS_POS_MAXMIN);
472 vtkGetMacro(AxisPosition,
int);
494 virtual int RenderTranslucentGeometry(
vtkViewport* viewport);
507 double ComputeMaxLabelLength(
const double[3]);
508 double ComputeTitleLength(
const double[3]);
510 void SetLabelScale(
double scale);
511 void SetLabelScale(
int labelIndex,
double scale);
512 void SetTitleScale(
double scale);
519 vtkSetMacro(MinorStart,
double);
520 vtkGetMacro(MinorStart,
double);
521 double GetMajorStart(
int axis);
522 void SetMajorStart(
int axis,
double value);
523 vtkSetMacro(DeltaMinor,
double);
524 vtkGetMacro(DeltaMinor,
double);
525 double GetDeltaMajor(
int axis);
526 void SetDeltaMajor(
int axis,
double value);
536 vtkSetMacro(MinorRangeStart,
double);
537 vtkGetMacro(MinorRangeStart,
double);
538 vtkSetMacro(MajorRangeStart,
double);
539 vtkGetMacro(MajorRangeStart,
double);
547 vtkSetMacro(DeltaRangeMinor,
double);
548 vtkGetMacro(DeltaRangeMinor,
double);
549 vtkSetMacro(DeltaRangeMajor,
double);
550 vtkGetMacro(DeltaRangeMajor,
double);
603 vtkGetMacro(NumberOfLabelsBuilt,
int);
611 vtkSetMacro(CalculateTitleOffset,
bool);
612 vtkGetMacro(CalculateTitleOffset,
bool);
613 vtkBooleanMacro(CalculateTitleOffset,
bool);
621 vtkSetMacro(CalculateLabelOffset,
bool);
622 vtkGetMacro(CalculateLabelOffset,
bool);
623 vtkBooleanMacro(CalculateLabelOffset,
bool);
631 vtkSetMacro(Use2DMode,
bool);
632 vtkGetMacro(Use2DMode,
bool);
640 vtkSetMacro(VerticalOffsetXTitle2D,
double);
641 vtkGetMacro(VerticalOffsetXTitle2D,
double);
649 vtkSetMacro(HorizontalOffsetYTitle2D,
double);
650 vtkGetMacro(HorizontalOffsetYTitle2D,
double);
658 vtkSetMacro(SaveTitlePosition,
int);
659 vtkGetMacro(SaveTitlePosition,
int);
667 vtkSetVector3Macro(AxisBaseForX,
double);
668 vtkGetVector3Macro(AxisBaseForX,
double);
676 vtkSetVector3Macro(AxisBaseForY,
double);
677 vtkGetVector3Macro(AxisBaseForY,
double);
685 vtkSetVector3Macro(AxisBaseForZ,
double);
686 vtkGetVector3Macro(AxisBaseForZ,
double);
694 vtkSetMacro(AxisOnOrigin,
bool);
695 vtkGetMacro(AxisOnOrigin,
bool);
703 vtkSetMacro(ScreenSize,
double);
704 vtkGetMacro(ScreenSize,
double);
712 vtkSetMacro(LabelOffset,
double);
713 vtkGetMacro(LabelOffset,
double);
721 vtkSetMacro(ExponentOffset,
double);
722 vtkGetMacro(ExponentOffset,
double);
734 void SetTitleOffset(
double titleOffsetY);
736 double GetTitleOffset();
737 vtkSetVector2Macro(TitleOffset,
double);
739 void GetTitleOffset(
double& titleOffsetX,
double& titleOffsetY);
744 ~vtkAxisActor() override;
746 char* Title =
nullptr;
747 char* Exponent =
nullptr;
748 char* LabelFormat =
nullptr;
750 double LastRange[2] = { -1.0, -1.0 };
751 bool UseTextActor3D =
false;
752 int NumberOfLabelsBuilt = 0;
753 bool MinorTicksVisible =
true;
754 bool LastMinorTicksVisible =
true;
767 int TitleAlignLocation = VTK_ALIGN_BOTTOM;
773 int ExponentLocation = VTK_ALIGN_POINT2;
775 bool DrawGridlines =
false;
776 bool DrawGridlinesOnly =
false;
777 bool LastDrawGridlines =
false;
778 int DrawGridlinesLocation = 0;
779 int LastDrawGridlinesLocation = 0;
780 double GridlineXLength = 1.0;
781 double GridlineYLength = 1.0;
782 double GridlineZLength = 1.0;
784 bool DrawInnerGridlines =
false;
785 bool LastDrawInnerGridlines =
false;
787 bool DrawGridpolys =
false;
788 bool LastDrawGridpolys =
false;
790 bool AxisVisibility =
true;
791 bool TickVisibility =
true;
792 bool LastTickVisibility =
true;
793 bool LabelVisibility =
true;
794 bool TitleVisibility =
true;
795 bool ExponentVisibility =
false;
796 bool LastMajorTickPointCorrection =
false;
803 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
804 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
805 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
811 void TransformBounds(
vtkViewport*,
double bnds[6]);
822 void RotateActor2DFromAxisProjection(
vtkTextActor* pActor2D);
840 void BuildTitle(
bool);
846 void BuildExponent(
bool force);
848 void BuildExponent2D(
vtkViewport* viewport,
bool force);
852 void SetAxisPointsAndLines();
854 bool BuildTickPoints(
double p1[3],
double p2[3],
bool force);
857 void BuildMajorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
860 void BuildMajorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
863 void BuildMinorTicks(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
866 void BuildMinorTicksLog(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
868 void BuildAxisGridLines(
double p1[3],
double p2[3],
double localCoordSys[3][3]);
870 bool TickVisibilityChanged();
875 bool BoundsDisplayCoordinateChanged(
vtkViewport* viewport);
880 double MajorTickSize = 1.0;
881 double MinorTickSize = 0.5;
884 double MajorStart[3] = { 0.0, 0.0, 0.0 };
885 double DeltaMajor[3] = { 1.0, 1.0, 1.0 };
886 double MinorStart = 0.0;
887 double DeltaMinor = 1.0;
890 double MajorRangeStart = 0.0;
891 double MinorRangeStart = 0.0;
896 double DeltaRangeMinor = 1.0;
901 double DeltaRangeMajor = 1.0;
903 int LastAxisPosition = -1;
904 int LastTickLocation = -1;
968 bool AxisOnOrigin =
false;
970 bool AxisHasZeroLength =
false;
972 bool CalculateTitleOffset =
false;
973 bool CalculateLabelOffset =
false;
978 bool Use2DMode =
false;
984 double VerticalOffsetXTitle2D = -40;
990 double HorizontalOffsetYTitle2D = -50;
998 int SaveTitlePosition = 0;
1003 double TitleConstantPosition[2] = { 0.0, 0.0 };
1008 bool NeedBuild2D =
false;
1010 double LastMinDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1011 double LastMaxDisplayCoordinate[3] = { 0.0, 0.0, 0.0 };
1012 double TickVector[3] = { 0.0, 0.0, 0.0 };
1017 double ScreenSize = 10.0;
1023 double LabelOffset = 30.0;
1024 double TitleOffset[2] = { 20.0, 20.0 };
1025 double ExponentOffset = 20.0;
1029 VTK_ABI_NAMESPACE_END
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()
vtkProp3DAxisFollower ** GetLabelProps3D()
Get label actors responsigle for drawing label text.
a vtkAbstractArray subclass for strings
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.
#define VTK_DEPRECATED_IN_9_3_0(reason)
a simple class to control print indentation
a virtual camera for 3D rendering
vtkAxisFollower ** GetLabelActors()
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
a subclass of actor that always faces the camera
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 RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetAxisPositionToMaxMin()
represent surface properties of a 2D image
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
represent and manipulate 3D points
void SetAxisTypeToZ()
Set/Get the type of this axis.