VTK  9.1.0
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=========================================================================*/
55#ifndef vtkCubeAxesActor2D_h
56#define vtkCubeAxesActor2D_h
57
58#include "vtkActor2D.h"
59#include "vtkRenderingAnnotationModule.h" // For export macro
60
62class vtkAxisActor2D;
63class vtkCamera;
64class vtkCubeAxesActor2DConnection;
65class vtkDataSet;
66class vtkTextProperty;
67
68class VTKRENDERINGANNOTATION_EXPORT vtkCubeAxesActor2D : public vtkActor2D
69{
70public:
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
80
82
85 int RenderOverlay(vtkViewport*) override;
89
94
96
102 virtual void SetInputData(vtkDataSet*);
105
107
112 void SetViewProp(vtkProp* prop);
113 vtkGetObjectMacro(ViewProp, vtkProp);
115
117
123 vtkSetVector6Macro(Bounds, double);
124 double* GetBounds() VTK_SIZEHINT(6) override;
126 double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax);
127 void GetBounds(double bounds[6]);
129
131
136 vtkSetVector6Macro(Ranges, double);
137 double* GetRanges() VTK_SIZEHINT(6);
138 void GetRanges(
139 double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax);
140 void GetRanges(double ranges[6]);
142
144
149 vtkSetMacro(XOrigin, double);
150 vtkSetMacro(YOrigin, double);
151 vtkSetMacro(ZOrigin, double);
153
155
160 vtkSetMacro(UseRanges, vtkTypeBool);
161 vtkGetMacro(UseRanges, vtkTypeBool);
162 vtkBooleanMacro(UseRanges, vtkTypeBool);
164
166
170 virtual void SetCamera(vtkCamera*);
171 vtkGetObjectMacro(Camera, vtkCamera);
173
175 {
176 VTK_FLY_OUTER_EDGES = 0,
177 VTK_FLY_CLOSEST_TRIAD = 1,
178 VTK_FLY_NONE = 2
179 };
180
182
187 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
188 vtkGetMacro(FlyMode, int);
189 void SetFlyModeToOuterEdges() { this->SetFlyMode(VTK_FLY_OUTER_EDGES); }
190 void SetFlyModeToClosestTriad() { this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD); }
191 void SetFlyModeToNone() { this->SetFlyMode(VTK_FLY_NONE); }
193
195
201 vtkSetMacro(Scaling, vtkTypeBool);
202 vtkGetMacro(Scaling, vtkTypeBool);
203 vtkBooleanMacro(Scaling, vtkTypeBool);
205
207
212 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
213 vtkGetMacro(NumberOfLabels, int);
215
217
221 vtkSetStringMacro(XLabel);
222 vtkGetStringMacro(XLabel);
223 vtkSetStringMacro(YLabel);
224 vtkGetStringMacro(YLabel);
225 vtkSetStringMacro(ZLabel);
226 vtkGetStringMacro(ZLabel);
228
233 vtkAxisActor2D* GetXAxisActor2D() { return this->XAxis; }
234 vtkAxisActor2D* GetYAxisActor2D() { return this->YAxis; }
235 vtkAxisActor2D* GetZAxisActor2D() { return this->ZAxis; }
236
238
243 vtkGetObjectMacro(AxisTitleTextProperty, vtkTextProperty);
245
247
252 vtkGetObjectMacro(AxisLabelTextProperty, vtkTextProperty);
254
256
260 vtkSetStringMacro(LabelFormat);
261 vtkGetStringMacro(LabelFormat);
263
265
269 vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
270 vtkGetMacro(FontFactor, double);
272
274
279 vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
280 vtkGetMacro(Inertia, int);
282
284
292 vtkSetClampMacro(ShowActualBounds, int, 0, 1);
293 vtkGetMacro(ShowActualBounds, int);
295
297
302 vtkSetMacro(CornerOffset, double);
303 vtkGetMacro(CornerOffset, double);
305
312
314
317 vtkSetMacro(XAxisVisibility, vtkTypeBool);
318 vtkGetMacro(XAxisVisibility, vtkTypeBool);
319 vtkBooleanMacro(XAxisVisibility, vtkTypeBool);
320 vtkSetMacro(YAxisVisibility, vtkTypeBool);
321 vtkGetMacro(YAxisVisibility, vtkTypeBool);
322 vtkBooleanMacro(YAxisVisibility, vtkTypeBool);
323 vtkSetMacro(ZAxisVisibility, vtkTypeBool);
324 vtkGetMacro(ZAxisVisibility, vtkTypeBool);
325 vtkBooleanMacro(ZAxisVisibility, vtkTypeBool);
327
332
333protected:
336
337 vtkCubeAxesActor2DConnection* ConnectionHolder;
338
339 vtkProp* ViewProp; // Define bounds from actor/assembly, or
340 double Bounds[6]; // Define bounds explicitly
341 double Ranges[6]; // Define ranges explicitly
342 vtkTypeBool UseRanges; // Flag to use ranges or not
343
347
351
354
356
358 char* XLabel;
359 char* YLabel;
360 char* ZLabel;
361 char* Labels[3];
362
366
372 int InertiaAxes[8];
373
375
376 // Always show the actual bounds of the object
378
379 double XOrigin;
380 double YOrigin;
381 double ZOrigin;
382
383 // various helper methods
384 void TransformBounds(vtkViewport* viewport, double bounds[6], double pts[8][3]);
385 int ClipBounds(vtkViewport* viewport, double pts[8][3], double bounds[6]);
386 double EvaluatePoint(double planes[24], double x[3]);
387 double EvaluateBounds(double planes[24], double bounds[6]);
388 void AdjustAxes(double pts[8][3], double bounds[6], int idx, int xIdx, int yIdx, int zIdx,
389 int zIdx2, int xAxes, int yAxes, int zAxes, double xCoords[4], double yCoords[4],
390 double zCoords[4], double xRange[2], double yRange[2], double zRange[2]);
391
392private:
393 // hide the superclass' ShallowCopy() from the user and the compiler.
394 void ShallowCopy(vtkProp* prop) override { this->vtkProp::ShallowCopy(prop); }
395
396private:
397 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&) = delete;
398 void operator=(const vtkCubeAxesActor2D&) = delete;
399};
400
401#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
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:55
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:66
a simple class to control print indentation
Definition: vtkIndent.h:43
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
Definition: vtkTimeStamp.h:42
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
void GetBounds(T a, double bds[6])
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_SIZEHINT(...)