47 #ifndef vtkCubeAxesActor_h
48 #define vtkCubeAxesActor_h
52 #include "vtkRenderingAnnotationModule.h"
56 VTK_ABI_NAMESPACE_BEGIN
79 virtual int RenderTranslucentGeometry(
vtkViewport*);
90 vtkSetMacro(RebuildAxes,
bool);
91 vtkGetMacro(RebuildAxes,
bool);
101 vtkSetVector6Macro(Bounds,
double);
111 virtual void GetRenderedBounds(
double rBounds[6]);
112 virtual double* GetRenderedBounds();
124 vtkSetVector2Macro(XAxisRange,
double);
125 vtkSetVector2Macro(YAxisRange,
double);
126 vtkSetVector2Macro(ZAxisRange,
double);
127 vtkGetVector2Macro(XAxisRange,
double);
128 vtkGetVector2Macro(YAxisRange,
double);
139 vtkGetVector2Macro(ZAxisRange,
double);
148 void SetScreenSize(
double screenSize);
149 vtkGetMacro(ScreenSize,
double);
157 void SetLabelOffset(
double offset);
158 vtkGetMacro(LabelOffset,
double);
166 void SetTitleOffset(
double titleOffset[2]);
167 vtkGetVector2Macro(TitleOffset,
double);
181 VTK_FLY_OUTER_EDGES = 0,
182 VTK_FLY_CLOSEST_TRIAD = 1,
183 VTK_FLY_FURTHEST_TRIAD = 2,
184 VTK_FLY_STATIC_TRIAD = 3,
185 VTK_FLY_STATIC_EDGES = 4
195 vtkSetClampMacro(FlyMode,
int, VTK_FLY_OUTER_EDGES, VTK_FLY_STATIC_EDGES);
196 vtkGetMacro(FlyMode,
int);
209 vtkSetStringMacro(XTitle);
210 vtkGetStringMacro(XTitle);
211 vtkSetStringMacro(XUnits);
212 vtkGetStringMacro(XUnits);
213 vtkSetStringMacro(YTitle);
214 vtkGetStringMacro(YTitle);
215 vtkSetStringMacro(YUnits);
216 vtkGetStringMacro(YUnits);
217 vtkSetStringMacro(ZTitle);
218 vtkGetStringMacro(ZTitle);
219 vtkSetStringMacro(ZUnits);
220 vtkGetStringMacro(ZUnits);
228 vtkSetStringMacro(XLabelFormat);
229 vtkGetStringMacro(XLabelFormat);
230 vtkSetStringMacro(YLabelFormat);
231 vtkGetStringMacro(YLabelFormat);
232 vtkSetStringMacro(ZLabelFormat);
233 vtkGetStringMacro(ZLabelFormat);
244 vtkGetMacro(Inertia,
int);
254 vtkSetMacro(CornerOffset,
double);
255 vtkGetMacro(CornerOffset,
double);
270 vtkSetMacro(EnableDistanceLOD,
bool);
271 vtkGetMacro(EnableDistanceLOD,
bool);
279 vtkSetClampMacro(DistanceLODThreshold,
double, 0.0, 1.0);
280 vtkGetMacro(DistanceLODThreshold,
double);
288 vtkSetMacro(EnableViewAngleLOD,
bool);
289 vtkGetMacro(EnableViewAngleLOD,
bool);
297 vtkSetClampMacro(ViewAngleLODThreshold,
double, 0., 1.);
298 vtkGetMacro(ViewAngleLODThreshold,
double);
306 vtkSetMacro(XAxisVisibility,
bool);
307 vtkGetMacro(XAxisVisibility,
bool);
308 vtkBooleanMacro(XAxisVisibility,
bool);
310 vtkSetMacro(YAxisVisibility,
bool);
311 vtkGetMacro(YAxisVisibility,
bool);
312 vtkBooleanMacro(YAxisVisibility,
bool);
314 vtkSetMacro(ZAxisVisibility,
bool);
315 vtkGetMacro(ZAxisVisibility,
bool);
316 vtkBooleanMacro(ZAxisVisibility,
bool);
324 vtkSetMacro(XAxisLabelVisibility,
bool);
325 vtkGetMacro(XAxisLabelVisibility,
bool);
326 vtkBooleanMacro(XAxisLabelVisibility,
bool);
328 vtkSetMacro(YAxisLabelVisibility,
bool);
329 vtkGetMacro(YAxisLabelVisibility,
bool);
330 vtkBooleanMacro(YAxisLabelVisibility,
bool);
332 vtkSetMacro(ZAxisLabelVisibility,
bool);
333 vtkGetMacro(ZAxisLabelVisibility,
bool);
334 vtkBooleanMacro(ZAxisLabelVisibility,
bool);
342 vtkSetMacro(XAxisTickVisibility,
bool);
343 vtkGetMacro(XAxisTickVisibility,
bool);
344 vtkBooleanMacro(XAxisTickVisibility,
bool);
346 vtkSetMacro(YAxisTickVisibility,
bool);
347 vtkGetMacro(YAxisTickVisibility,
bool);
348 vtkBooleanMacro(YAxisTickVisibility,
bool);
350 vtkSetMacro(ZAxisTickVisibility,
bool);
351 vtkGetMacro(ZAxisTickVisibility,
bool);
352 vtkBooleanMacro(ZAxisTickVisibility,
bool);
360 vtkSetMacro(XAxisMinorTickVisibility,
bool);
361 vtkGetMacro(XAxisMinorTickVisibility,
bool);
362 vtkBooleanMacro(XAxisMinorTickVisibility,
bool);
364 vtkSetMacro(YAxisMinorTickVisibility,
bool);
365 vtkGetMacro(YAxisMinorTickVisibility,
bool);
366 vtkBooleanMacro(YAxisMinorTickVisibility,
bool);
368 vtkSetMacro(ZAxisMinorTickVisibility,
bool);
369 vtkGetMacro(ZAxisMinorTickVisibility,
bool);
370 vtkBooleanMacro(ZAxisMinorTickVisibility,
bool);
378 vtkSetMacro(DrawXGridlines,
bool);
379 vtkGetMacro(DrawXGridlines,
bool);
380 vtkBooleanMacro(DrawXGridlines,
bool);
382 vtkSetMacro(DrawYGridlines,
bool);
383 vtkGetMacro(DrawYGridlines,
bool);
384 vtkBooleanMacro(DrawYGridlines,
bool);
386 vtkSetMacro(DrawZGridlines,
bool);
387 vtkGetMacro(DrawZGridlines,
bool);
388 vtkBooleanMacro(DrawZGridlines,
bool);
396 vtkSetMacro(DrawXInnerGridlines,
bool);
397 vtkGetMacro(DrawXInnerGridlines,
bool);
398 vtkBooleanMacro(DrawXInnerGridlines,
bool);
400 vtkSetMacro(DrawYInnerGridlines,
bool);
401 vtkGetMacro(DrawYInnerGridlines,
bool);
402 vtkBooleanMacro(DrawYInnerGridlines,
bool);
404 vtkSetMacro(DrawZInnerGridlines,
bool);
405 vtkGetMacro(DrawZInnerGridlines,
bool);
406 vtkBooleanMacro(DrawZInnerGridlines,
bool);
414 vtkSetMacro(DrawXGridpolys,
bool);
415 vtkGetMacro(DrawXGridpolys,
bool);
416 vtkBooleanMacro(DrawXGridpolys,
bool);
418 vtkSetMacro(DrawYGridpolys,
bool);
419 vtkGetMacro(DrawYGridpolys,
bool);
420 vtkBooleanMacro(DrawYGridpolys,
bool);
422 vtkSetMacro(DrawZGridpolys,
bool);
423 vtkGetMacro(DrawZGridpolys,
bool);
424 vtkBooleanMacro(DrawZGridpolys,
bool);
503 VTK_TICKS_INSIDE = 0,
504 VTK_TICKS_OUTSIDE = 1,
513 vtkSetClampMacro(TickLocation,
int, VTK_TICKS_INSIDE, VTK_TICKS_BOTH);
514 vtkGetMacro(TickLocation,
int);
521 void SetLabelScaling(
bool,
int,
int,
int);
529 void SetUseTextActor3D(
bool enable);
530 bool GetUseTextActor3D();
538 void SetUse2DMode(
bool enable);
545 void SetSaveTitlePosition(
int val);
552 vtkSetVector6Macro(OrientedBounds,
double);
553 vtkGetVector6Macro(OrientedBounds,
double);
561 vtkSetMacro(UseOrientedBounds,
bool);
562 vtkGetMacro(UseOrientedBounds,
bool);
570 vtkSetVector3Macro(AxisBaseForX,
double);
571 vtkGetVector3Macro(AxisBaseForX,
double);
579 vtkSetVector3Macro(AxisBaseForY,
double);
580 vtkGetVector3Macro(AxisBaseForY,
double);
588 vtkSetVector3Macro(AxisBaseForZ,
double);
589 vtkGetVector3Macro(AxisBaseForZ,
double);
598 vtkSetVector3Macro(AxisOrigin,
double);
599 vtkGetVector3Macro(AxisOrigin,
double);
607 vtkSetMacro(UseAxisOrigin,
bool);
608 vtkGetMacro(UseAxisOrigin,
bool);
616 vtkSetMacro(GridLineLocation,
int);
617 vtkGetMacro(GridLineLocation,
int);
627 vtkSetMacro(StickyAxes,
bool);
628 vtkGetMacro(StickyAxes,
bool);
629 vtkBooleanMacro(StickyAxes,
bool);
641 vtkSetMacro(CenterStickyAxes,
bool);
642 vtkGetMacro(CenterStickyAxes,
bool);
643 vtkBooleanMacro(CenterStickyAxes,
bool);
648 VTK_GRID_LINES_ALL = 0,
649 VTK_GRID_LINES_CLOSEST = 1,
650 VTK_GRID_LINES_FURTHEST = 2
662 void ComputeStickyAxesBoundingSphere(
663 vtkViewport* viewport,
const double bounds[6],
double sphereCenter[3],
double& sphereRadius);
668 void GetViewportLimitedBounds(
vtkViewport* viewport,
double bounds[6]);
674 static void GetBoundsPointBits(
675 unsigned int pointIndex,
unsigned int& xBit,
unsigned int& yBit,
unsigned int& zBit);
680 static void GetBoundsPoint(
unsigned int pointIndex,
const double bounds[6],
double point[3]);
682 int LabelExponent(
double min,
double max);
684 int Digits(
double min,
double max);
686 double MaxOf(
double,
double);
687 double MaxOf(
double,
double,
double,
double);
690 double FSign(
double,
double);
691 int FRound(
double fnt);
692 int GetNumTicks(
double range,
double fxt);
701 int FindClosestAxisIndex(
double pts[8][3]);
704 int FindFurtherstAxisIndex(
double pts[8][3]);
707 void FindBoundaryEdge(
int& indexOfAxisX,
int& indexOfAxisY,
int& indexOfAxisZ,
double pts[8][3]);
714 void UpdateGridLineVisibility(
int axisIndex);
719 int GridLineLocation = VTK_GRID_LINES_ALL;
724 bool StickyAxes =
false;
729 bool CenterStickyAxes =
true;
735 bool EnableDistanceLOD =
true;
741 double DistanceLODThreshold = 0.8;
747 bool EnableViewAngleLOD =
true;
753 double ViewAngleLODThreshold = 0.2;
757 NUMBER_OF_ALIGNED_AXIS = 4
770 bool RebuildAxes =
true;
772 char* XTitle =
nullptr;
773 char* XUnits =
nullptr;
774 char* YTitle =
nullptr;
775 char* YUnits =
nullptr;
776 char* ZTitle =
nullptr;
777 char* ZUnits =
nullptr;
779 char* ActualXLabel =
nullptr;
780 char* ActualYLabel =
nullptr;
781 char* ActualZLabel =
nullptr;
785 bool XAxisVisibility =
true;
786 bool YAxisVisibility =
true;
787 bool ZAxisVisibility =
true;
789 bool XAxisTickVisibility =
true;
790 bool YAxisTickVisibility =
true;
791 bool ZAxisTickVisibility =
true;
793 bool XAxisMinorTickVisibility =
true;
794 bool YAxisMinorTickVisibility =
true;
795 bool ZAxisMinorTickVisibility =
true;
797 bool XAxisLabelVisibility =
true;
798 bool YAxisLabelVisibility =
true;
799 bool ZAxisLabelVisibility =
true;
801 bool DrawXGridlines =
false;
802 bool DrawYGridlines =
false;
803 bool DrawZGridlines =
false;
805 bool DrawXInnerGridlines =
false;
806 bool DrawYInnerGridlines =
false;
807 bool DrawZInnerGridlines =
false;
809 bool DrawXGridpolys =
false;
810 bool DrawYGridpolys =
false;
811 bool DrawZGridpolys =
false;
813 char* XLabelFormat =
nullptr;
814 char* YLabelFormat =
nullptr;
815 char* ZLabelFormat =
nullptr;
817 double CornerOffset = 0.0;
823 int InertiaLocs[3] = { -1, -1, -1 };
825 bool RenderSomething =
false;
844 double RenderedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
845 double OrientedBounds[6] = { -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 };
846 bool UseOrientedBounds =
false;
848 double AxisOrigin[3] = { 0.0, 0.0, 0.0 };
849 bool UseAxisOrigin =
false;
851 double AxisBaseForX[3] = { 1.0, 0.0, 0.0 };
852 double AxisBaseForY[3] = { 0.0, 1.0, 0.0 };
853 double AxisBaseForZ[3] = { 0.0, 0.0, 1.0 };
859 vtkSetStringMacro(ActualXLabel);
860 vtkSetStringMacro(ActualYLabel);
861 vtkSetStringMacro(ActualZLabel);
864 bool LastUseOrientedBounds =
false;
873 bool AutoLabelScaling =
true;
875 int LastXAxisDigits = 3;
876 int LastYAxisDigits = 3;
877 int LastZAxisDigits = 3;
885 int LastFlyMode = -1;
887 int RenderAxesX[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
888 int RenderAxesY[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
889 int RenderAxesZ[NUMBER_OF_ALIGNED_AXIS] = { 0, 1, 2, 3 };
891 int NumberOfAxesX = 1;
892 int NumberOfAxesY = 1;
893 int NumberOfAxesZ = 1;
895 bool MustAdjustXValue =
false;
896 bool MustAdjustYValue =
false;
897 bool MustAdjustZValue =
false;
899 bool ForceXLabelReset =
false;
900 bool ForceYLabelReset =
false;
901 bool ForceZLabelReset =
false;
907 double LabelScale = -1.0;
908 double TitleScale = -1.0;
910 double ScreenSize = 10.0;
911 double LabelOffset = 20.0;
912 double TitleOffset[2] = { 20.0, 20.0 };
919 double MajorStart[3] = { 0.0, 0.0, 0.0 };
920 double DeltaMajor[3] = { 0.0, 0.0, 0.0 };
923 int RenderGeometry(
bool& initialRender,
vtkViewport* viewport,
bool checkAxisVisibility,
926 void TransformBounds(
vtkViewport* viewport,
const double bounds[6],
double pts[8][3]);
927 void AdjustAxes(
double bounds[6],
double xCoords[NUMBER_OF_ALIGNED_AXIS][6],
928 double yCoords[NUMBER_OF_ALIGNED_AXIS][6],
double zCoords[NUMBER_OF_ALIGNED_AXIS][6],
929 double xRange[2],
double yRange[2],
double zRange[2]);
931 bool ComputeTickSize(
double bounds[6]);
932 void AdjustValues(
const double xRange[2],
const double yRange[2],
const double zRange[2]);
933 void AdjustRange(
const double bounds[6]);
936 void SetNonDependentAttributes();
937 void BuildLabels(
vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS]);
938 void AdjustTicksComputeRange(
939 vtkAxisActor* axes[NUMBER_OF_ALIGNED_AXIS],
double rangeMin,
double rangeMax);
946 VTK_ABI_NAMESPACE_END
vtkNew< vtkProperty > ZAxesLinesProperty
vtkNew< vtkProperty > ZAxesGridlinesProperty
vtkNew< vtkProperty > YAxesGridpolysProperty
represents an object (geometry & properties) in a rendered scene
vtkNew< vtkProperty > YAxesGridlinesProperty
void SetFlyModeToStaticEdges()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
abstract specification for Viewports
represent surface properties of a geometric object
vtkNew< vtkProperty > XAxesGridlinesProperty
virtual int RenderOverlay(vtkViewport *)
record modification and/or execution time
Create an axis with tick marks and labels.
vtkSmartPointer< vtkCamera > Camera
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetBounds() override
Explicitly specify the region in space around which to draw the bounds.
a vtkAbstractArray subclass for strings
vtkNew< vtkProperty > YAxesInnerGridlinesProperty
void SetTickLocationToBoth()
void SetFlyModeToFurthestTriad()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
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 SetFlyModeToOuterEdges()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
create a plot of a bounding box edges - used for navigation
window superclass for vtkRenderWindow
vtkNew< vtkProperty > ZAxesInnerGridlinesProperty
a simple class to control print indentation
a virtual camera for 3D rendering
void SetTickLocationToInside()
vtkNew< vtkProperty > XAxesLinesProperty
#define VTK_SIZEHINT(...)
represent text properties.
vtkNew< vtkProperty > XAxesInnerGridlinesProperty
vtkNew< vtkProperty > YAxesLinesProperty
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
void SetTickLocationToOutside()
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetFlyModeToStaticTriad()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
void SetFlyModeToClosestTriad()
Specify a mode to control how the axes are drawn: either static, closest triad, furthest triad or out...
vtkNew< vtkProperty > ZAxesGridpolysProperty
vtkNew< vtkProperty > XAxesGridpolysProperty
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.