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 
78 
80 
85 
88 
90 
94  virtual void SetInputData(vtkDataSet*);
95  virtual vtkDataSet* GetInput();
97 
99 
101  void SetViewProp(vtkProp* prop);
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*);
151 
153 
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 
194 
196 
199  {return this->XAxis;}
201  {return this->YAxis;}
203  {return this->ZAxis;}
205 
207 
210  vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
212 
214 
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 
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
vtkRenderingAnnotationModule.h
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkCubeAxesActor2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkCubeAxesActor2D::AdjustAxes
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])
vtkCubeAxesActor2D::CornerOffset
double CornerOffset
Definition: vtkCubeAxesActor2D.h:318
vtkCubeAxesActor2D::Inertia
int Inertia
Definition: vtkCubeAxesActor2D.h:319
vtkCubeAxesActor2D::SetFlyModeToClosestTriad
void SetFlyModeToClosestTriad()
Definition: vtkCubeAxesActor2D.h:160
vtkCubeAxesActor2D::UseRanges
int UseRanges
Definition: vtkCubeAxesActor2D.h:291
vtkCubeAxesActor2D::FlyMode
int FlyMode
Definition: vtkCubeAxesActor2D.h:294
vtkCubeAxesActor2D::GetRanges
void GetRanges(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
vtkCubeAxesActor2D::YLabel
char * YLabel
Definition: vtkCubeAxesActor2D.h:308
vtkActor2D::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkCubeAxesActor2D::XAxis
vtkAxisActor2D * XAxis
Definition: vtkCubeAxesActor2D.h:297
vtkCubeAxesActor2D::RenderOverlay
int RenderOverlay(vtkViewport *)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkCubeAxesActor2D::RenderCount
int RenderCount
Definition: vtkCubeAxesActor2D.h:320
vtkCubeAxesActor2D::GetRanges
void GetRanges(double ranges[6])
vtkCubeAxesActor2D::GetBounds
void GetBounds(double bounds[6])
vtkCubeAxesActor2D::EvaluatePoint
double EvaluatePoint(double planes[24], double x[3])
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkCubeAxesActor2D::SetViewProp
void SetViewProp(vtkProp *prop)
vtkCubeAxesActor2D::ShallowCopy
void ShallowCopy(vtkCubeAxesActor2D *actor)
vtkCubeAxesActor2D::GetYAxisActor2D
vtkAxisActor2D * GetYAxisActor2D()
Definition: vtkCubeAxesActor2D.h:200
vtkCubeAxesActor2D::SetCamera
virtual void SetCamera(vtkCamera *)
vtkCubeAxesActor2D::YAxis
vtkAxisActor2D * YAxis
Definition: vtkCubeAxesActor2D.h:298
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkCubeAxesActor2D::XAxisVisibility
int XAxisVisibility
Definition: vtkCubeAxesActor2D.h:312
vtkCubeAxesActor2D::SetAxisLabelTextProperty
virtual void SetAxisLabelTextProperty(vtkTextProperty *p)
vtkCubeAxesActor2D::FontFactor
double FontFactor
Definition: vtkCubeAxesActor2D.h:317
vtkCubeAxesActor2D::ZAxis
vtkAxisActor2D * ZAxis
Definition: vtkCubeAxesActor2D.h:299
vtkCubeAxesActor2D::XOrigin
double XOrigin
Definition: vtkCubeAxesActor2D.h:328
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCubeAxesActor2D
create a 2D plot of a bounding box edges - used for navigation
Definition: vtkCubeAxesActor2D.h:69
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:49
vtkCubeAxesActor2D::Scaling
int Scaling
Definition: vtkCubeAxesActor2D.h:295
vtkCubeAxesActor2D::~vtkCubeAxesActor2D
~vtkCubeAxesActor2D()
vtkCubeAxesActor2D::SetFlyModeToNone
void SetFlyModeToNone()
Definition: vtkCubeAxesActor2D.h:162
vtkCubeAxesActor2D::AxisLabelTextProperty
vtkTextProperty * AxisLabelTextProperty
Definition: vtkCubeAxesActor2D.h:302
vtkCubeAxesActor2D::AxisTitleTextProperty
vtkTextProperty * AxisTitleTextProperty
Definition: vtkCubeAxesActor2D.h:301
vtkCubeAxesActor2D::GetInput
virtual vtkDataSet * GetInput()
vtkCubeAxesActor2D::TransformBounds
void TransformBounds(vtkViewport *viewport, double bounds[6], double pts[8][3])
vtkCubeAxesActor2D::SetInputData
virtual void SetInputData(vtkDataSet *)
VTK_FLY_NONE
#define VTK_FLY_NONE
Definition: vtkCubeAxesActor2D.h:59
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkProp::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
vtkgl::zmax
GLclampd zmax
Definition: vtkgl.h:17479
vtkCubeAxesActor2D::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkCubeAxesActor2D.h:83
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkCubeAxesActor2D::LabelFormat
char * LabelFormat
Definition: vtkCubeAxesActor2D.h:316
vtkCubeAxesActor2D::YOrigin
double YOrigin
Definition: vtkCubeAxesActor2D.h:329
VTK_FLY_OUTER_EDGES
#define VTK_FLY_OUTER_EDGES
Definition: vtkCubeAxesActor2D.h:57
vtkCubeAxesActor2D::vtkCubeAxesActor2D
vtkCubeAxesActor2D()
vtkCubeAxesActor2D::BuildTime
vtkTimeStamp BuildTime
Definition: vtkCubeAxesActor2D.h:304
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkCubeAxesActor2D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *)
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkCubeAxesActor2D::RenderSomething
int RenderSomething
Definition: vtkCubeAxesActor2D.h:323
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkCubeAxesActor2D::ShowActualBounds
int ShowActualBounds
Definition: vtkCubeAxesActor2D.h:326
vtkCubeAxesActor2D::ViewProp
vtkProp * ViewProp
Definition: vtkCubeAxesActor2D.h:288
vtkCubeAxesActor2D::GetRanges
double * GetRanges()
vtkCubeAxesActor2D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
vtkCubeAxesActor2D::GetXAxisActor2D
vtkAxisActor2D * GetXAxisActor2D()
Definition: vtkCubeAxesActor2D.h:198
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkActor2D.h
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkSetVector6Macro
#define vtkSetVector6Macro(name, type)
Definition: vtkSetGet.h:360
vtkCubeAxesActor2D::SetAxisTitleTextProperty
virtual void SetAxisTitleTextProperty(vtkTextProperty *p)
vtkCubeAxesActor2D::SetInputConnection
virtual void SetInputConnection(vtkAlgorithmOutput *)
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:74
vtkCubeAxesActor2D::YAxisVisibility
int YAxisVisibility
Definition: vtkCubeAxesActor2D.h:313
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkCubeAxesActor2D::EvaluateBounds
double EvaluateBounds(double planes[24], double bounds[6])
vtkCubeAxesActor2D::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
VTK_FLY_CLOSEST_TRIAD
#define VTK_FLY_CLOSEST_TRIAD
Definition: vtkCubeAxesActor2D.h:58
vtkCubeAxesActor2D::SetFlyModeToOuterEdges
void SetFlyModeToOuterEdges()
Definition: vtkCubeAxesActor2D.h:158
vtkCubeAxesActor2D::ConnectionHolder
vtkCubeAxesActor2DConnection * ConnectionHolder
Definition: vtkCubeAxesActor2D.h:286
vtkCubeAxesActor2D::ZLabel
char * ZLabel
Definition: vtkCubeAxesActor2D.h:309
vtkCubeAxesActor2D::New
static vtkCubeAxesActor2D * New()
vtkCubeAxesActor2D::ZOrigin
double ZOrigin
Definition: vtkCubeAxesActor2D.h:330
vtkCubeAxesActor2D::ClipBounds
int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6])
vtkCubeAxesActor2D::GetZAxisActor2D
vtkAxisActor2D * GetZAxisActor2D()
Definition: vtkCubeAxesActor2D.h:202
vtkCubeAxesActor2D::GetBounds
void GetBounds(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
vtkCubeAxesActor2D::GetBounds
double * GetBounds()
vtkCubeAxesActor2D::NumberOfLabels
int NumberOfLabels
Definition: vtkCubeAxesActor2D.h:306
vtkCubeAxesActor2D::XLabel
char * XLabel
Definition: vtkCubeAxesActor2D.h:307
vtkCubeAxesActor2D::ZAxisVisibility
int ZAxisVisibility
Definition: vtkCubeAxesActor2D.h:314
VTKRENDERINGANNOTATION_EXPORT
#define VTKRENDERINGANNOTATION_EXPORT
Definition: vtkRenderingAnnotationModule.h:15
vtkCubeAxesActor2D::Camera
vtkCamera * Camera
Definition: vtkCubeAxesActor2D.h:293