VTK  9.2.6
vtkCubeAxesActor2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCubeAxesActor2D.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
49#ifndef vtkCubeAxesActor2D_h
50#define vtkCubeAxesActor2D_h
51
52#include "vtkActor2D.h"
53#include "vtkRenderingAnnotationModule.h" // For export macro
54
56class vtkAxisActor2D;
57class vtkCamera;
58class vtkCubeAxesActor2DConnection;
59class vtkDataSet;
60class vtkTextProperty;
61
62class VTKRENDERINGANNOTATION_EXPORT vtkCubeAxesActor2D : public vtkActor2D
63{
64public:
66 void PrintSelf(ostream& os, vtkIndent indent) override;
67
74
76
79 int RenderOverlay(vtkViewport*) override;
83
88
90
96 virtual void SetInputData(vtkDataSet*);
97 virtual vtkDataSet* GetInput();
99
101
106 void SetViewProp(vtkProp* prop);
107 vtkGetObjectMacro(ViewProp, vtkProp);
109
111
117 vtkSetVector6Macro(Bounds, double);
118 double* GetBounds() VTK_SIZEHINT(6) override;
119 void GetBounds(
120 double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax);
121 void GetBounds(double bounds[6]);
123
125
130 vtkSetVector6Macro(Ranges, double);
131 double* GetRanges() VTK_SIZEHINT(6);
132 void GetRanges(
133 double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax);
134 void GetRanges(double ranges[6]);
136
138
143 vtkSetMacro(XOrigin, double);
144 vtkSetMacro(YOrigin, double);
145 vtkSetMacro(ZOrigin, double);
147
149
154 vtkSetMacro(UseRanges, vtkTypeBool);
155 vtkGetMacro(UseRanges, vtkTypeBool);
156 vtkBooleanMacro(UseRanges, vtkTypeBool);
158
160
164 virtual void SetCamera(vtkCamera*);
165 vtkGetObjectMacro(Camera, vtkCamera);
167
169 {
170 VTK_FLY_OUTER_EDGES = 0,
171 VTK_FLY_CLOSEST_TRIAD = 1,
172 VTK_FLY_NONE = 2
173 };
174
176
181 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
182 vtkGetMacro(FlyMode, int);
183 void SetFlyModeToOuterEdges() { this->SetFlyMode(VTK_FLY_OUTER_EDGES); }
184 void SetFlyModeToClosestTriad() { this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD); }
185 void SetFlyModeToNone() { this->SetFlyMode(VTK_FLY_NONE); }
187
189
195 vtkSetMacro(Scaling, vtkTypeBool);
196 vtkGetMacro(Scaling, vtkTypeBool);
197 vtkBooleanMacro(Scaling, vtkTypeBool);
199
201
206 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
207 vtkGetMacro(NumberOfLabels, int);
209
211
215 vtkSetStringMacro(XLabel);
216 vtkGetStringMacro(XLabel);
217 vtkSetStringMacro(YLabel);
218 vtkGetStringMacro(YLabel);
219 vtkSetStringMacro(ZLabel);
220 vtkGetStringMacro(ZLabel);
222
227 vtkAxisActor2D* GetXAxisActor2D() { return this->XAxis; }
228 vtkAxisActor2D* GetYAxisActor2D() { return this->YAxis; }
229 vtkAxisActor2D* GetZAxisActor2D() { return this->ZAxis; }
230
232
237 vtkGetObjectMacro(AxisTitleTextProperty, vtkTextProperty);
239
241
246 vtkGetObjectMacro(AxisLabelTextProperty, vtkTextProperty);
248
250
254 vtkSetStringMacro(LabelFormat);
255 vtkGetStringMacro(LabelFormat);
257
259
263 vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
264 vtkGetMacro(FontFactor, double);
266
268
273 vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
274 vtkGetMacro(Inertia, int);
276
278
286 vtkSetClampMacro(ShowActualBounds, int, 0, 1);
287 vtkGetMacro(ShowActualBounds, int);
289
291
296 vtkSetMacro(CornerOffset, double);
297 vtkGetMacro(CornerOffset, double);
299
306
308
311 vtkSetMacro(XAxisVisibility, vtkTypeBool);
312 vtkGetMacro(XAxisVisibility, vtkTypeBool);
313 vtkBooleanMacro(XAxisVisibility, vtkTypeBool);
314 vtkSetMacro(YAxisVisibility, vtkTypeBool);
315 vtkGetMacro(YAxisVisibility, vtkTypeBool);
316 vtkBooleanMacro(YAxisVisibility, vtkTypeBool);
317 vtkSetMacro(ZAxisVisibility, vtkTypeBool);
318 vtkGetMacro(ZAxisVisibility, vtkTypeBool);
319 vtkBooleanMacro(ZAxisVisibility, vtkTypeBool);
321
326
327protected:
330
331 vtkCubeAxesActor2DConnection* ConnectionHolder;
332
333 vtkProp* ViewProp; // Define bounds from actor/assembly, or
334 double Bounds[6]; // Define bounds explicitly
335 double Ranges[6]; // Define ranges explicitly
336 vtkTypeBool UseRanges; // Flag to use ranges or not
337
341
345
348
350
352 char* XLabel;
353 char* YLabel;
354 char* ZLabel;
355 char* Labels[3];
356
360
366 int InertiaAxes[8];
367
369
370 // Always show the actual bounds of the object
372
373 double XOrigin;
374 double YOrigin;
375 double ZOrigin;
376
377 // various helper methods
378 void TransformBounds(vtkViewport* viewport, double bounds[6], double pts[8][3]);
379 int ClipBounds(vtkViewport* viewport, double pts[8][3], double bounds[6]);
380 double EvaluatePoint(double planes[24], double x[3]);
381 double EvaluateBounds(double planes[24], double bounds[6]);
382 void AdjustAxes(double pts[8][3], double bounds[6], int idx, int xIdx, int yIdx, int zIdx,
383 int zIdx2, int xAxes, int yAxes, int zAxes, double xCoords[4], double yCoords[4],
384 double zCoords[4], double xRange[2], double yRange[2], double zRange[2]);
385
386private:
387 // hide the superclass' ShallowCopy() from the user and the compiler.
388 void ShallowCopy(vtkProp* prop) override { this->vtkProp::ShallowCopy(prop); }
389
390private:
391 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&) = delete;
392 void operator=(const vtkCubeAxesActor2D&) = delete;
393};
394
395#endif
a actor that draws 2D data
Definition vtkActor2D.h:46
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:52
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:63
a simple class to control print indentation
Definition vtkIndent.h:40
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:57
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:56
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_INT_MAX
Definition vtkType.h:155
#define VTK_SIZEHINT(...)