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 =========================================================================*/
51 #ifndef vtkCubeAxesActor2D_h
52 #define vtkCubeAxesActor2D_h
53 
54 #include "vtkRenderingAnnotationModule.h" // For export macro
55 #include "vtkActor2D.h"
56 
57 #define VTK_FLY_OUTER_EDGES 0
58 #define VTK_FLY_CLOSEST_TRIAD 1
59 #define VTK_FLY_NONE 2
60 
61 class vtkAlgorithmOutput;
62 class vtkAxisActor2D;
63 class vtkCamera;
64 class vtkCubeAxesActor2DConnection;
65 class vtkDataSet;
66 class vtkTextProperty;
67 
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent);
73 
77  static vtkCubeAxesActor2D *New();
78 
80 
85 
87  virtual int HasTranslucentPolygonalGeometry();
88 
90 
93  virtual void SetInputConnection(vtkAlgorithmOutput*);
94  virtual void SetInputData(vtkDataSet*);
95  virtual vtkDataSet* GetInput();
97 
99 
101  void SetViewProp(vtkProp* prop);
102  vtkGetObjectMacro(ViewProp, vtkProp);
104 
106 
110  vtkSetVector6Macro(Bounds,double);
111  double *GetBounds();
112  void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
113  double& zmin, double& zmax);
114  void GetBounds(double bounds[6]);
116 
118 
121  vtkSetVector6Macro(Ranges,double);
122  double *GetRanges();
123  void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax,
124  double& zmin, double& zmax);
125  void GetRanges(double ranges[6]);
127 
129 
132  vtkSetMacro( XOrigin, double );
133  vtkSetMacro( YOrigin, double );
134  vtkSetMacro( ZOrigin, double );
136 
138 
140  vtkSetMacro(UseRanges,int);
141  vtkGetMacro(UseRanges,int);
142  vtkBooleanMacro(UseRanges,int);
144 
146 
148  virtual void SetCamera(vtkCamera*);
149  vtkGetObjectMacro(Camera,vtkCamera);
151 
153 
156  vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
157  vtkGetMacro(FlyMode, int);
159  {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
161  {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
163  {this->SetFlyMode(VTK_FLY_NONE);};
165 
167 
171  vtkSetMacro(Scaling,int);
172  vtkGetMacro(Scaling,int);
173  vtkBooleanMacro(Scaling,int);
175 
177 
180  vtkSetClampMacro(NumberOfLabels, int, 0, 50);
181  vtkGetMacro(NumberOfLabels, int);
183 
185 
187  vtkSetStringMacro(XLabel);
188  vtkGetStringMacro(XLabel);
189  vtkSetStringMacro(YLabel);
190  vtkGetStringMacro(YLabel);
191  vtkSetStringMacro(ZLabel);
192  vtkGetStringMacro(ZLabel);
194 
196 
199  {return this->XAxis;}
201  {return this->YAxis;}
203  {return this->ZAxis;}
205 
207 
209  virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
210  vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
212 
214 
216  virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
217  vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
219 
221 
223  vtkSetStringMacro(LabelFormat);
224  vtkGetStringMacro(LabelFormat);
226 
228 
230  vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
231  vtkGetMacro(FontFactor, double);
233 
235 
238  vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
239  vtkGetMacro(Inertia, int);
241 
243 
249  vtkSetClampMacro(ShowActualBounds, int, 0, 1);
250  vtkGetMacro(ShowActualBounds, int);
252 
254 
257  vtkSetMacro(CornerOffset, double);
258  vtkGetMacro(CornerOffset, double);
260 
265 
267 
268  vtkSetMacro(XAxisVisibility,int);
269  vtkGetMacro(XAxisVisibility,int);
270  vtkBooleanMacro(XAxisVisibility,int);
271  vtkSetMacro(YAxisVisibility,int);
272  vtkGetMacro(YAxisVisibility,int);
273  vtkBooleanMacro(YAxisVisibility,int);
274  vtkSetMacro(ZAxisVisibility,int);
275  vtkGetMacro(ZAxisVisibility,int);
276  vtkBooleanMacro(ZAxisVisibility,int);
278 
280  void ShallowCopy(vtkCubeAxesActor2D *actor);
281 
282 protected:
285 
286  vtkCubeAxesActor2DConnection* ConnectionHolder;
287 
288  vtkProp *ViewProp; //Define bounds from actor/assembly, or
289  double Bounds[6]; //Define bounds explicitly
290  double Ranges[6]; //Define ranges explicitly
291  int UseRanges; //Flag to use ranges or not
292 
294  int FlyMode;
295  int Scaling;
296 
300 
303 
305 
307  char *XLabel;
308  char *YLabel;
309  char *ZLabel;
310  char *Labels[3];
311 
315 
316  char *LabelFormat;
317  double FontFactor;
318  double CornerOffset;
319  int Inertia;
321  int InertiaAxes[8];
322 
324 
325  // Always show the actual bounds of the object
327 
328  double XOrigin;
329  double YOrigin;
330  double ZOrigin;
331 
332  // various helper methods
333  void TransformBounds(vtkViewport *viewport, double bounds[6],
334  double pts[8][3]);
335  int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6]);
336  double EvaluatePoint(double planes[24], double x[3]);
337  double EvaluateBounds(double planes[24], double bounds[6]);
338  void AdjustAxes(double pts[8][3], double bounds[6],
339  int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
340  int xAxes, int yAxes, int zAxes,
341  double xCoords[4], double yCoords[4], double zCoords[4],
342  double xRange[2], double yRange[2], double zRange[2]);
343 
344 private:
345  // hide the superclass' ShallowCopy() from the user and the compiler.
346  void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
347 private:
348  vtkCubeAxesActor2D(const vtkCubeAxesActor2D&); // Not implemented.
349  void operator=(const vtkCubeAxesActor2D&); // Not implemented.
350 };
351 
352 
353 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkAxisActor2D * ZAxis
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
virtual void ShallowCopy(vtkProp *prop)
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:46
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
vtkAxisActor2D * GetXAxisActor2D()
#define VTK_INT_MAX
Definition: vtkType.h:132
a actor that draws 2D data
Definition: vtkActor2D.h:44
record modification and/or execution time
Definition: vtkTimeStamp.h:34
Create an axis with tick marks and labels.
#define VTKRENDERINGANNOTATION_EXPORT
Proxy object to connect input/output ports.
virtual double * GetBounds()
Definition: vtkProp.h:120
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
virtual int HasTranslucentPolygonalGeometry()
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
void PrintSelf(ostream &os, vtkIndent indent)
static vtkActor2D * New()
#define VTK_FLY_OUTER_EDGES
#define VTK_FLY_NONE
represent text properties.
create a 2D plot of a bounding box edges - used for navigation
vtkAxisActor2D * GetZAxisActor2D()
virtual void ShallowCopy(vtkProp *prop)
vtkCubeAxesActor2DConnection * ConnectionHolder
vtkTextProperty * AxisLabelTextProperty
vtkTextProperty * AxisTitleTextProperty
vtkAxisActor2D * XAxis
virtual int RenderOverlay(vtkViewport *viewport)
vtkAxisActor2D * GetYAxisActor2D()
vtkAxisActor2D * YAxis
#define VTK_FLY_CLOSEST_TRIAD