VTK
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 =========================================================================*/
52 #ifndef vtkCubeAxesActor2D_h
53 #define vtkCubeAxesActor2D_h
54 
55 #include "vtkRenderingAnnotationModule.h" // For export macro
56 #include "vtkActor2D.h"
57 
58 class vtkAlgorithmOutput;
59 class vtkAxisActor2D;
60 class vtkCamera;
61 class vtkCubeAxesActor2DConnection;
62 class vtkDataSet;
63 class vtkTextProperty;
64 
65 class VTKRENDERINGANNOTATION_EXPORT vtkCubeAxesActor2D : public vtkActor2D
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
76  static vtkCubeAxesActor2D *New();
77 
79 
86 
90  virtual int HasTranslucentPolygonalGeometry();
91 
93 
98  virtual void SetInputConnection(vtkAlgorithmOutput*);
99  virtual void SetInputData(vtkDataSet*);
100  virtual vtkDataSet* GetInput();
102 
104 
109  void SetViewProp(vtkProp* prop);
110  vtkGetObjectMacro(ViewProp, vtkProp);
112 
114 
120  vtkSetVector6Macro(Bounds,double);
121  double *GetBounds();
122  void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
123  double& zmin, double& zmax);
124  void GetBounds(double bounds[6]);
126 
128 
133  vtkSetVector6Macro(Ranges,double);
134  double *GetRanges();
135  void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax,
136  double& zmin, double& zmax);
137  void GetRanges(double ranges[6]);
139 
141 
146  vtkSetMacro( XOrigin, double );
147  vtkSetMacro( YOrigin, double );
148  vtkSetMacro( ZOrigin, double );
150 
152 
157  vtkSetMacro(UseRanges,int);
158  vtkGetMacro(UseRanges,int);
159  vtkBooleanMacro(UseRanges,int);
161 
163 
167  virtual void SetCamera(vtkCamera*);
168  vtkGetObjectMacro(Camera,vtkCamera);
170 
171  enum FlyMode
172  {
173  VTK_FLY_OUTER_EDGES = 0,
174  VTK_FLY_CLOSEST_TRIAD = 1,
175  VTK_FLY_NONE = 2
176  };
177 
179 
184  vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
185  vtkGetMacro(FlyMode, int);
187  {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
189  {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
191  {this->SetFlyMode(VTK_FLY_NONE);};
193 
195 
201  vtkSetMacro(Scaling,int);
202  vtkGetMacro(Scaling,int);
203  vtkBooleanMacro(Scaling,int);
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 
234  {return this->XAxis;}
236  {return this->YAxis;}
238  {return this->ZAxis;}
239 
241 
245  virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
246  vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
248 
250 
254  virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
255  vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
257 
259 
263  vtkSetStringMacro(LabelFormat);
264  vtkGetStringMacro(LabelFormat);
266 
268 
272  vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
273  vtkGetMacro(FontFactor, double);
275 
277 
282  vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
283  vtkGetMacro(Inertia, int);
285 
287 
295  vtkSetClampMacro(ShowActualBounds, int, 0, 1);
296  vtkGetMacro(ShowActualBounds, int);
298 
300 
305  vtkSetMacro(CornerOffset, double);
306  vtkGetMacro(CornerOffset, double);
308 
315 
317 
320  vtkSetMacro(XAxisVisibility,int);
321  vtkGetMacro(XAxisVisibility,int);
322  vtkBooleanMacro(XAxisVisibility,int);
323  vtkSetMacro(YAxisVisibility,int);
324  vtkGetMacro(YAxisVisibility,int);
325  vtkBooleanMacro(YAxisVisibility,int);
326  vtkSetMacro(ZAxisVisibility,int);
327  vtkGetMacro(ZAxisVisibility,int);
328  vtkBooleanMacro(ZAxisVisibility,int);
330 
334  void ShallowCopy(vtkCubeAxesActor2D *actor);
335 
336 protected:
339 
340  vtkCubeAxesActor2DConnection* ConnectionHolder;
341 
342  vtkProp *ViewProp; //Define bounds from actor/assembly, or
343  double Bounds[6]; //Define bounds explicitly
344  double Ranges[6]; //Define ranges explicitly
345  int UseRanges; //Flag to use ranges or not
346 
348  int FlyMode;
349  int Scaling;
350 
354 
357 
359 
361  char *XLabel;
362  char *YLabel;
363  char *ZLabel;
364  char *Labels[3];
365 
369 
370  char *LabelFormat;
371  double FontFactor;
372  double CornerOffset;
373  int Inertia;
375  int InertiaAxes[8];
376 
378 
379  // Always show the actual bounds of the object
381 
382  double XOrigin;
383  double YOrigin;
384  double ZOrigin;
385 
386  // various helper methods
387  void TransformBounds(vtkViewport *viewport, double bounds[6],
388  double pts[8][3]);
389  int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6]);
390  double EvaluatePoint(double planes[24], double x[3]);
391  double EvaluateBounds(double planes[24], double bounds[6]);
392  void AdjustAxes(double pts[8][3], double bounds[6],
393  int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
394  int xAxes, int yAxes, int zAxes,
395  double xCoords[4], double yCoords[4], double zCoords[4],
396  double xRange[2], double yRange[2], double zRange[2]);
397 
398 private:
399  // hide the superclass' ShallowCopy() from the user and the compiler.
400  void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
401 private:
402  vtkCubeAxesActor2D(const vtkCubeAxesActor2D&) VTK_DELETE_FUNCTION;
403  void operator=(const vtkCubeAxesActor2D&) VTK_DELETE_FUNCTION;
404 };
405 
406 
407 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
void SetFlyModeToOuterEdges()
Specify a mode to control how the axes are drawn: either outer edges or closest triad to the camera p...
vtkAxisActor2D * ZAxis
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Draw the axes as per the vtkProp superclass' API.
virtual void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp.
abstract specification for Viewports
Definition: vtkViewport.h:47
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkAxisActor2D * GetXAxisActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example) ...
#define VTK_INT_MAX
Definition: vtkType.h:153
a actor that draws 2D data
Definition: vtkActor2D.h:45
record modification and/or execution time
Definition: vtkTimeStamp.h:35
Create an axis with tick marks and labels.
virtual int HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
Proxy object to connect input/output ports.
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:130
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
static vtkActor2D * New()
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at la...
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
void SetFlyModeToClosestTriad()
Specify a mode to control how the axes are drawn: either outer edges or closest triad to the camera p...
represent text properties.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
create a 2D plot of a bounding box edges - used for navigation
vtkAxisActor2D * GetZAxisActor2D()
vtkCubeAxesActor2DConnection * ConnectionHolder
vtkTextProperty * AxisLabelTextProperty
vtkTextProperty * AxisTitleTextProperty
vtkAxisActor2D * XAxis
virtual int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
virtual void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
void SetFlyModeToNone()
Specify a mode to control how the axes are drawn: either outer edges or closest triad to the camera p...
virtual int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkAxisActor2D * GetYAxisActor2D()
vtkAxisActor2D * YAxis
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.