VTK  9.3.0
vtkCubeAxesActor2D.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
37#ifndef vtkCubeAxesActor2D_h
38#define vtkCubeAxesActor2D_h
39
40#include "vtkActor2D.h"
41#include "vtkRenderingAnnotationModule.h" // For export macro
42
43VTK_ABI_NAMESPACE_BEGIN
45class vtkAxisActor2D;
46class vtkCamera;
47class vtkCubeAxesActor2DConnection;
48class vtkDataSet;
49class vtkTextProperty;
50
51class VTKRENDERINGANNOTATION_EXPORT vtkCubeAxesActor2D : public vtkActor2D
52{
53public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
63
65
68 int RenderOverlay(vtkViewport*) override;
72
77
79
85 virtual void SetInputData(vtkDataSet*);
86 virtual vtkDataSet* GetInput();
88
90
95 void SetViewProp(vtkProp* prop);
96 vtkGetObjectMacro(ViewProp, vtkProp);
98
100
106 vtkSetVector6Macro(Bounds, double);
107 double* GetBounds() VTK_SIZEHINT(6) override;
108 void GetBounds(
109 double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax);
110 void GetBounds(double bounds[6]);
112
114
119 vtkSetVector6Macro(Ranges, double);
120 double* GetRanges() VTK_SIZEHINT(6);
121 void GetRanges(
122 double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax);
123 void GetRanges(double ranges[6]);
125
127
132 vtkSetMacro(XOrigin, double);
133 vtkSetMacro(YOrigin, double);
134 vtkSetMacro(ZOrigin, double);
136
138
143 vtkSetMacro(UseRanges, vtkTypeBool);
144 vtkGetMacro(UseRanges, vtkTypeBool);
145 vtkBooleanMacro(UseRanges, vtkTypeBool);
147
149
153 virtual void SetCamera(vtkCamera*);
154 vtkGetObjectMacro(Camera, vtkCamera);
156
158 {
159 VTK_FLY_OUTER_EDGES = 0,
160 VTK_FLY_CLOSEST_TRIAD = 1,
161 VTK_FLY_NONE = 2
162 };
163
165
170 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
171 vtkGetMacro(FlyMode, int);
172 void SetFlyModeToOuterEdges() { this->SetFlyMode(VTK_FLY_OUTER_EDGES); }
173 void SetFlyModeToClosestTriad() { this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD); }
174 void SetFlyModeToNone() { this->SetFlyMode(VTK_FLY_NONE); }
176
178
184 vtkSetMacro(Scaling, vtkTypeBool);
185 vtkGetMacro(Scaling, vtkTypeBool);
186 vtkBooleanMacro(Scaling, vtkTypeBool);
188
190
195 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
196 vtkGetMacro(NumberOfLabels, int);
198
200
204 vtkSetStringMacro(XLabel);
205 vtkGetStringMacro(XLabel);
206 vtkSetStringMacro(YLabel);
207 vtkGetStringMacro(YLabel);
208 vtkSetStringMacro(ZLabel);
209 vtkGetStringMacro(ZLabel);
211
216 vtkAxisActor2D* GetXAxisActor2D() { return this->XAxis; }
217 vtkAxisActor2D* GetYAxisActor2D() { return this->YAxis; }
218 vtkAxisActor2D* GetZAxisActor2D() { return this->ZAxis; }
219
221
226 vtkGetObjectMacro(AxisTitleTextProperty, vtkTextProperty);
228
230
235 vtkGetObjectMacro(AxisLabelTextProperty, vtkTextProperty);
237
239
243 vtkSetStringMacro(LabelFormat);
244 vtkGetStringMacro(LabelFormat);
246
248
252 vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
253 vtkGetMacro(FontFactor, double);
255
257
262 vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
263 vtkGetMacro(Inertia, int);
265
267
275 vtkSetClampMacro(ShowActualBounds, int, 0, 1);
276 vtkGetMacro(ShowActualBounds, int);
278
280
285 vtkSetMacro(CornerOffset, double);
286 vtkGetMacro(CornerOffset, double);
288
295
297
300 vtkSetMacro(XAxisVisibility, vtkTypeBool);
301 vtkGetMacro(XAxisVisibility, vtkTypeBool);
302 vtkBooleanMacro(XAxisVisibility, vtkTypeBool);
303 vtkSetMacro(YAxisVisibility, vtkTypeBool);
304 vtkGetMacro(YAxisVisibility, vtkTypeBool);
305 vtkBooleanMacro(YAxisVisibility, vtkTypeBool);
306 vtkSetMacro(ZAxisVisibility, vtkTypeBool);
307 vtkGetMacro(ZAxisVisibility, vtkTypeBool);
308 vtkBooleanMacro(ZAxisVisibility, vtkTypeBool);
310
315
316protected:
319
320 vtkCubeAxesActor2DConnection* ConnectionHolder;
321
322 vtkProp* ViewProp; // Define bounds from actor/assembly, or
323 double Bounds[6]; // Define bounds explicitly
324 double Ranges[6]; // Define ranges explicitly
325 vtkTypeBool UseRanges; // Flag to use ranges or not
326
330
334
337
339
341 char* XLabel;
342 char* YLabel;
343 char* ZLabel;
344 char* Labels[3];
345
349
355 int InertiaAxes[8];
356
358
359 // Always show the actual bounds of the object
361
362 double XOrigin;
363 double YOrigin;
364 double ZOrigin;
365
366 // various helper methods
367 void TransformBounds(vtkViewport* viewport, double bounds[6], double pts[8][3]);
368 int ClipBounds(vtkViewport* viewport, double pts[8][3], double bounds[6]);
369 double EvaluatePoint(double planes[24], double x[3]);
370 double EvaluateBounds(double planes[24], double bounds[6]);
371 void AdjustAxes(double pts[8][3], double bounds[6], int idx, int xIdx, int yIdx, int zIdx,
372 int zIdx2, int xAxes, int yAxes, int zAxes, double xCoords[4], double yCoords[4],
373 double zCoords[4], double xRange[2], double yRange[2], double zRange[2]);
374
375private:
376 // hide the superclass' ShallowCopy() from the user and the compiler.
377 // NOLINTNEXTLINE(bugprone-parent-virtual-call)
378 void ShallowCopy(vtkProp* prop) override { this->vtkProp::ShallowCopy(prop); }
379
380 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&) = delete;
381 void operator=(const vtkCubeAxesActor2D&) = delete;
382};
383
384VTK_ABI_NAMESPACE_END
385#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
Proxy object to connect input/output ports.
Create an axis with tick marks and labels.
a virtual camera for 3D rendering
Definition vtkCamera.h:41
create a 2D plot of a bounding box edges - used for navigation
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderOverlay(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
void SetViewProp(vtkProp *prop)
Use the bounding box of this prop to draw the cube axes.
vtkAxisActor2D * YAxis
virtual vtkDataSet * GetInput()
Use the bounding box of this input dataset to draw the cube axes.
static vtkCubeAxesActor2D * New()
Instantiate object with bold, italic, and shadow enabled; font family set to Arial; and label format ...
virtual void SetAxisTitleTextProperty(vtkTextProperty *p)
Set/Get the title text property of all axes.
void SetFlyModeToOuterEdges()
Specify a mode to control how the axes are drawn: either outer edges or closest triad to the camera p...
vtkAxisActor2D * GetZAxisActor2D()
double EvaluatePoint(double planes[24], double x[3])
double EvaluateBounds(double planes[24], double bounds[6])
virtual void SetInputData(vtkDataSet *)
Use the bounding box of this input dataset to draw the cube axes.
int RenderOpaqueGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
virtual void SetAxisLabelTextProperty(vtkTextProperty *p)
Set/Get the labels text property of all axes.
void SetFlyModeToClosestTriad()
Specify a mode to control how the axes are drawn: either outer edges or closest triad to the camera p...
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the axes as per the vtkProp superclass' API.
void SetFlyModeToNone()
Specify a mode to control how the axes are drawn: either outer edges or closest triad to the camera p...
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6])
vtkAxisActor2D * GetYAxisActor2D()
vtkAxisActor2D * GetXAxisActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example)
vtkAxisActor2D * ZAxis
vtkTextProperty * AxisLabelTextProperty
void AdjustAxes(double pts[8][3], double bounds[6], int idx, int xIdx, int yIdx, int zIdx, int zIdx2, int xAxes, int yAxes, int zAxes, double xCoords[4], double yCoords[4], double zCoords[4], double xRange[2], double yRange[2], double zRange[2])
vtkAxisActor2D * XAxis
double * GetBounds() override
Explicitly specify the region in space around which to draw the bounds.
virtual void SetInputConnection(vtkAlgorithmOutput *)
Use the bounding box of this input dataset to draw the cube axes.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkCubeAxesActor2DConnection * ConnectionHolder
~vtkCubeAxesActor2D() override
vtkTextProperty * AxisTitleTextProperty
void TransformBounds(vtkViewport *viewport, double bounds[6], double pts[8][3])
void ShallowCopy(vtkCubeAxesActor2D *actor)
Shallow copy of a CubeAxesActor2D.
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
a simple class to control print indentation
Definition vtkIndent.h:29
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:43
virtual void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp.
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_INT_MAX
Definition vtkType.h:144
#define VTK_SIZEHINT(...)