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 "vtkActor2D.h"
55 
56 #define VTK_FLY_OUTER_EDGES 0
57 #define VTK_FLY_CLOSEST_TRIAD 1
58 #define VTK_FLY_NONE 2
59 
60 class vtkAxisActor2D;
61 class vtkCamera;
62 class vtkDataSet;
63 class vtkTextProperty;
64 
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
74  static vtkCubeAxesActor2D *New();
75 
77 
82 
84  virtual int HasTranslucentPolygonalGeometry();
85 
87 
90  virtual void SetInput(vtkDataSet*);
91  vtkGetObjectMacro(Input, vtkDataSet);
93 
95 
97  void SetViewProp(vtkProp* prop);
98  vtkGetObjectMacro(ViewProp, vtkProp);
100 
102 
106  vtkSetVector6Macro(Bounds,double);
107  double *GetBounds();
108  void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
109  double& zmin, double& zmax);
110  void GetBounds(double bounds[6]);
112 
114 
117  vtkSetVector6Macro(Ranges,double);
118  double *GetRanges();
119  void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax,
120  double& zmin, double& zmax);
121  void GetRanges(double ranges[6]);
123 
125 
128  vtkSetMacro( XOrigin, double );
129  vtkSetMacro( YOrigin, double );
130  vtkSetMacro( ZOrigin, double );
132 
134 
136  vtkSetMacro(UseRanges,int);
137  vtkGetMacro(UseRanges,int);
138  vtkBooleanMacro(UseRanges,int);
140 
142 
144  virtual void SetCamera(vtkCamera*);
145  vtkGetObjectMacro(Camera,vtkCamera);
147 
149 
152  vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
153  vtkGetMacro(FlyMode, int);
155  {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
157  {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
159  {this->SetFlyMode(VTK_FLY_NONE);};
161 
163 
167  vtkSetMacro(Scaling,int);
168  vtkGetMacro(Scaling,int);
169  vtkBooleanMacro(Scaling,int);
171 
173 
176  vtkSetClampMacro(NumberOfLabels, int, 0, 50);
177  vtkGetMacro(NumberOfLabels, int);
179 
181 
183  vtkSetStringMacro(XLabel);
184  vtkGetStringMacro(XLabel);
185  vtkSetStringMacro(YLabel);
186  vtkGetStringMacro(YLabel);
187  vtkSetStringMacro(ZLabel);
188  vtkGetStringMacro(ZLabel);
190 
192 
195  {return this->XAxis;}
197  {return this->YAxis;}
199  {return this->ZAxis;}
201 
203 
205  virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
206  vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
208 
210 
212  virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
213  vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
215 
217 
219  vtkSetStringMacro(LabelFormat);
220  vtkGetStringMacro(LabelFormat);
222 
224 
226  vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
227  vtkGetMacro(FontFactor, double);
229 
231 
234  vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
235  vtkGetMacro(Inertia, int);
237 
239 
245  vtkSetClampMacro(ShowActualBounds, int, 0, 1);
246  vtkGetMacro(ShowActualBounds, int);
248 
250 
253  vtkSetMacro(CornerOffset, double);
254  vtkGetMacro(CornerOffset, double);
256 
261 
263 
264  vtkSetMacro(XAxisVisibility,int);
265  vtkGetMacro(XAxisVisibility,int);
266  vtkBooleanMacro(XAxisVisibility,int);
267  vtkSetMacro(YAxisVisibility,int);
268  vtkGetMacro(YAxisVisibility,int);
269  vtkBooleanMacro(YAxisVisibility,int);
270  vtkSetMacro(ZAxisVisibility,int);
271  vtkGetMacro(ZAxisVisibility,int);
272  vtkBooleanMacro(ZAxisVisibility,int);
274 
276  void ShallowCopy(vtkCubeAxesActor2D *actor);
277 
278 // Disable warnings about qualifiers on return types.
279 #if defined(_COMPILER_VERSION)
280 # pragma set woff 3303
281 #endif
282 #if defined(__INTEL_COMPILER)
283 # pragma warning (push)
284 # pragma warning (disable:858)
285 #endif
286 
287 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
288 # define SetPropA SetProp
289 # define SetPropW SetProp
290 # define GetPropA GetProp
291 # define GetPropW GetProp
292 #endif
293 
296  VTK_LEGACY(virtual void SetProp(vtkProp* prop));
297 
300  VTK_LEGACY(virtual vtkProp* GetProp());
301 
302 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
303 # undef SetPropW
304 # undef SetPropA
305 # undef GetPropW
306 # undef GetPropA
307  //BTX
308  VTK_LEGACY(virtual void SetPropA(vtkProp* prop));
309  VTK_LEGACY(virtual void SetPropW(vtkProp* prop));
310  VTK_LEGACY(virtual vtkProp* GetPropA());
311  VTK_LEGACY(virtual vtkProp* GetPropW());
312  //ETX
313 #endif
314 
315 // Reset disabled warning about qualifiers on return types.
316 #if defined(__INTEL_COMPILER)
317 # pragma warning (pop)
318 #endif
319 #if defined(_COMPILER_VERSION)
320 # pragma reset woff 3303
321 #endif
322 
323 protected:
326 
327  vtkDataSet *Input; //Define bounds from input data, or
328  vtkProp *ViewProp; //Define bounds from actor/assembly, or
329  double Bounds[6]; //Define bounds explicitly
330  double Ranges[6]; //Define ranges explicitly
331  int UseRanges; //Flag to use ranges or not
332 
334  int FlyMode;
335  int Scaling;
336 
340 
343 
345 
347  char *XLabel;
348  char *YLabel;
349  char *ZLabel;
350  char *Labels[3];
351 
355 
356  char *LabelFormat;
357  double FontFactor;
358  double CornerOffset;
359  int Inertia;
361  int InertiaAxes[8];
362 
364 
365  // Always show the actual bounds of the object
367 
368  double XOrigin;
369  double YOrigin;
370  double ZOrigin;
371 
372  // various helper methods
373  void TransformBounds(vtkViewport *viewport, double bounds[6],
374  double pts[8][3]);
375  int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6]);
376  double EvaluatePoint(double planes[24], double x[3]);
377  double EvaluateBounds(double planes[24], double bounds[6]);
378  void AdjustAxes(double pts[8][3], double bounds[6],
379  int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
380  int xAxes, int yAxes, int zAxes,
381  double xCoords[4], double yCoords[4], double zCoords[4],
382  double xRange[2], double yRange[2], double zRange[2]);
383 
384 private:
385  // hide the superclass' ShallowCopy() from the user and the compiler.
386  void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
387 private:
388  vtkCubeAxesActor2D(const vtkCubeAxesActor2D&); // Not implemented.
389  void operator=(const vtkCubeAxesActor2D&); // Not implemented.
390 };
391 
392 
393 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
vtkAxisActor2D * ZAxis
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
virtual void ShallowCopy(vtkProp *prop)
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:45
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
vtkAxisActor2D * GetXAxisActor2D()
a actor that draws 2D data
Definition: vtkActor2D.h:43
record modification and/or execution time
Definition: vtkTimeStamp.h:33
Create an axis with tick marks and labels.
virtual double * GetBounds()
Definition: vtkProp.h:113
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
virtual int HasTranslucentPolygonalGeometry()
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
a simple class to control print indentation
Definition: vtkIndent.h:37
a virtual camera for 3D rendering
Definition: vtkCamera.h:47
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)
vtkTextProperty * AxisLabelTextProperty
vtkTextProperty * AxisTitleTextProperty
vtkAxisActor2D * XAxis
virtual int RenderOverlay(vtkViewport *viewport)
vtkAxisActor2D * GetYAxisActor2D()
#define VTK_LARGE_INTEGER
Definition: vtkType.h:148
vtkAxisActor2D * YAxis
#define VTK_HYBRID_EXPORT
#define VTK_FLY_CLOSEST_TRIAD