VTK
vtkProp3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProp3D.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 =========================================================================*/
32 #ifndef __vtkProp3D_h
33 #define __vtkProp3D_h
34 
35 #include "vtkProp.h"
36 
37 class vtkRenderer;
38 class vtkTransform;
39 class vtkLinearTransform;
40 
42 {
43 public:
44  vtkTypeMacro(vtkProp3D,vtkProp);
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48  void ShallowCopy(vtkProp *prop);
49 
51 
52  virtual void SetPosition(double _arg1, double _arg2, double _arg3)
53  {
54  vtkDebugMacro(<< this->GetClassName() << " (" << this <<
55  "): setting Position to (" << _arg1 << "," << _arg2 << "," <<
56  _arg3 << ")");
57  if ((this->Position[0] != _arg1)||
58  (this->Position[1] != _arg2)||
59  (this->Position[2] != _arg3))
60  {
61  this->Position[0] = _arg1;
62  this->Position[1] = _arg2;
63  this->Position[2] = _arg3;
64  this->Modified();
65  this->IsIdentity = 0;
66  }
67  };
68  virtual void SetPosition (double _arg[3])
69  {
70  this->SetPosition (_arg[0], _arg[1], _arg[2]);
71  }
72  vtkGetVectorMacro(Position,double,3);
73  void AddPosition(double deltaPosition[3]);
74  void AddPosition(double deltaX,double deltaY,double deltaZ);
76 
78 
80  virtual void SetOrigin(double _arg1, double _arg2, double _arg3)
81  {
82  vtkDebugMacro(<< this->GetClassName() << " (" << this <<
83  "): setting Origin to (" << _arg1 << "," << _arg2 << "," <<
84  _arg3 << ")");
85  if ((this->Origin[0] != _arg1)||
86  (this->Origin[1] != _arg2)||
87  (this->Origin[2] != _arg3))
88  {
89  this->Origin[0] = _arg1;
90  this->Origin[1] = _arg2;
91  this->Origin[2] = _arg3;
92  this->Modified();
93  this->IsIdentity = 0;
94  }
95  };
96  virtual void SetOrigin(double _arg[3])
97  {
98  this->SetOrigin (_arg[0], _arg[1], _arg[2]);
99  }
100  vtkGetVectorMacro(Origin,double,3);
102 
104 
107  virtual void SetScale(double _arg1, double _arg2, double _arg3)
108  {
109  vtkDebugMacro(<< this->GetClassName() << " (" << this <<
110  "): setting Scale to (" << _arg1 << "," << _arg2 << "," <<
111  _arg3 << ")");
112  if (this->Scale[0] != _arg1 ||
113  this->Scale[1] != _arg2 ||
114  this->Scale[2] != _arg3 )
115  {
116  this->Scale[0] = _arg1;
117  this->Scale[1] = _arg2;
118  this->Scale[2] = _arg3;
119  this->Modified();
120  this->IsIdentity = 0;
121  }
122  };
123  virtual void SetScale (double _arg[3])
124  {
125  this->SetScale (_arg[0], _arg[1], _arg[2]);
126  }
127  vtkGetVectorMacro(Scale,double,3);
129 
131  void SetScale(double s) {this->SetScale(s,s,s);};
132 
134 
143  void SetUserTransform(vtkLinearTransform *transform);
144  vtkGetObjectMacro(UserTransform,vtkLinearTransform);
146 
148 
149  void SetUserMatrix(vtkMatrix4x4 *matrix);
150  vtkMatrix4x4 *GetUserMatrix();
152 
154 
157  virtual void GetMatrix(vtkMatrix4x4 *m);
158  virtual void GetMatrix(double m[16]);
160 
165  void GetBounds(double bounds[6]);
166  virtual double *GetBounds() = 0;
168 
170  double *GetCenter();
171 
173  double *GetXRange();
174 
176  double *GetYRange();
177 
179  double *GetZRange();
180 
182  double GetLength();
183 
189  void RotateX(double);
190 
196  void RotateY(double);
197 
203  void RotateZ(double);
204 
208  void RotateWXYZ(double,double,double,double);
209 
213  void SetOrientation(double,double,double);
214 
218  void SetOrientation(double a[3]);
219 
221 
225  double *GetOrientation();
226  void GetOrientation(double o[3]);
228 
230  double *GetOrientationWXYZ();
231 
235  void AddOrientation(double,double,double);
236 
240  void AddOrientation(double a[3]);
241 
250  void PokeMatrix(vtkMatrix4x4 *matrix);
251 
254  void InitPathTraversal();
255 
257  unsigned long int GetMTime();
258 
260  unsigned long int GetUserTransformMatrixMTime();
261 
263  virtual void ComputeMatrix();
264 
266 
268  {
269  this->ComputeMatrix();
270  return this->Matrix;
271  }
273 
275 
276  vtkGetMacro(IsIdentity,int);
278 
279 protected:
280  vtkProp3D();
281  ~vtkProp3D();
282 
287  double Origin[3];
288  double Position[3];
289  double Orientation[3];
290  double Scale[3];
291  double Center[3];
293  double Bounds[6];
294  vtkProp3D *CachedProp3D; //support the PokeMatrix() method
296 private:
297  vtkProp3D(const vtkProp3D&); // Not implemented.
298  void operator=(const vtkProp3D&); // Not implemented.
299 };
300 
301 #endif
302