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=========================================================================*/
36#ifndef vtkProp3D_h
37#define vtkProp3D_h
38
39#include "vtkRenderingCoreModule.h" // For export macro
40#include "vtkProp.h"
41
42class vtkRenderer;
43class vtkTransform;
45
46class VTKRENDERINGCORE_EXPORT vtkProp3D : public vtkProp
47{
48public:
49 vtkTypeMacro(vtkProp3D,vtkProp);
50 void PrintSelf(ostream& os, vtkIndent indent);
51
55 void ShallowCopy(vtkProp *prop);
56
58
61 virtual void SetPosition(double x, double y, double z)
62 {
63 vtkDebugMacro(<< this->GetClassName() << " (" << this <<
64 "): setting Position to (" << x << "," << y << "," <<
65 z << ")");
66 if ((this->Position[0] != x)||
67 (this->Position[1] != y)||
68 (this->Position[2] != z))
69 {
70 this->Position[0] = x;
71 this->Position[1] = y;
72 this->Position[2] = z;
73 this->Modified();
74 this->IsIdentity = 0;
75 }
76 };
78
79 virtual void SetPosition(double pos[3])
80 { this->SetPosition(pos[0], pos[1], pos[2]); }
81 vtkGetVectorMacro(Position, double, 3);
82 void AddPosition(double deltaPosition[3]);
83 void AddPosition(double deltaX, double deltaY, double deltaZ);
84
86
90 virtual void SetOrigin(double x, double y, double z)
91 {
92 vtkDebugMacro(<< this->GetClassName() << " (" << this <<
93 "): setting Origin to (" << x << "," << y << "," <<
94 z << ")");
95 if ((this->Origin[0] != x)||
96 (this->Origin[1] != y)||
97 (this->Origin[2] != z))
98 {
99 this->Origin[0] = x;
100 this->Origin[1] = y;
101 this->Origin[2] = z;
102 this->Modified();
103 this->IsIdentity = 0;
104 }
105 };
106 virtual void SetOrigin(const double pos[3])
107 { this->SetOrigin(pos[0], pos[1], pos[2]); }
108 vtkGetVectorMacro(Origin, double, 3);
110
112
116 virtual void SetScale(double x, double y, double z)
117 {
118 vtkDebugMacro(<< this->GetClassName() << " (" << this <<
119 "): setting Scale to (" << x << "," << y << "," <<
120 z << ")");
121 if (this->Scale[0] != x ||
122 this->Scale[1] != y ||
123 this->Scale[2] != z )
124 {
125 this->Scale[0] = x;
126 this->Scale[1] = y;
127 this->Scale[2] = z;
128 this->Modified();
129 this->IsIdentity = 0;
130 }
131 };
132 virtual void SetScale(double scale[3])
133 { this->SetScale(scale[0], scale[1], scale[2]); }
134 vtkGetVectorMacro(Scale, double, 3);
136
140 void SetScale(double s)
141 { this->SetScale(s, s, s); }
142
144
157 vtkGetObjectMacro(UserTransform, vtkLinearTransform);
159
161
167
169
174 virtual void GetMatrix(vtkMatrix4x4 *m);
175 virtual void GetMatrix(double m[16]);
177
186 void GetBounds(double bounds[6]);
187 virtual double *GetBounds() = 0;
189
193 double *GetCenter();
194
198 double *GetXRange();
199
203 double *GetYRange();
204
208 double *GetZRange();
209
213 double GetLength();
214
222 void RotateX(double);
223
231 void RotateY(double);
232
240 void RotateZ(double);
241
248 void RotateWXYZ(double w, double x, double y, double z);
249
255 void SetOrientation(double x, double y, double z);
256
263
265
271 double *GetOrientation();
272 void GetOrientation(double orentation[3]);
274
279
286 void AddOrientation(double x, double y, double z);
287
294 void AddOrientation(double orentation[3]);
295
307
313
318
323
327 virtual void ComputeMatrix();
328
330
334 {
335 this->ComputeMatrix();
336 return this->Matrix;
337 }
339
341
344 vtkGetMacro(IsIdentity, int);
346
347protected:
350
355 double Origin[3];
356 double Position[3];
357 double Orientation[3];
358 double Scale[3];
359 double Center[3];
361 double Bounds[6];
362 vtkProp3D *CachedProp3D; //support the PokeMatrix() method
364private:
365 vtkProp3D(const vtkProp3D&) VTK_DELETE_FUNCTION;
366 void operator=(const vtkProp3D&) VTK_DELETE_FUNCTION;
367};
368
369#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract superclass for linear transformations
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
const char * GetClassName() const
Return the class name as a string.
virtual void Modified()
Update the modification time for this object.
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
virtual void SetPosition(double x, double y, double z)
Set/Get/Add the position of the Prop3D in world coordinates.
Definition: vtkProp3D.h:61
double * GetOrientation()
Returns the orientation of the Prop3D as s vector of X,Y and Z rotation.
double * GetZRange()
Get the Prop3D's z range in world coordinates.
vtkTimeStamp MatrixMTime
Definition: vtkProp3D.h:354
void SetOrientation(double x, double y, double z)
Sets the orientation of the Prop3D.
void SetScale(double s)
Method to set the scale isotropically.
Definition: vtkProp3D.h:140
virtual void SetScale(double scale[3])
Definition: vtkProp3D.h:132
void RotateX(double)
Rotate the Prop3D in degrees about the X axis using the right hand rule.
double GetLength()
Get the length of the diagonal of the bounding box.
virtual double * GetBounds()=0
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void AddPosition(double deltaX, double deltaY, double deltaZ)
double * GetCenter()
Get the center of the bounding box in world coordinates.
void AddPosition(double deltaPosition[3])
void RotateWXYZ(double w, double x, double y, double z)
Rotate the Prop3D in degrees about an arbitrary axis specified by the last three arguments.
vtkMatrix4x4 * UserMatrix
Definition: vtkProp3D.h:352
vtkMTimeType GetMTime()
Get the vtkProp3D's mtime.
vtkMatrix4x4 * GetUserMatrix()
virtual void SetPosition(double pos[3])
Definition: vtkProp3D.h:79
double * GetXRange()
Get the Prop3D's x range in world coordinates.
virtual void SetOrigin(double x, double y, double z)
Set/Get the origin of the Prop3D.
Definition: vtkProp3D.h:90
virtual void SetScale(double x, double y, double z)
Set/Get the scale of the actor.
Definition: vtkProp3D.h:116
void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp3D.
void PokeMatrix(vtkMatrix4x4 *matrix)
This method modifies the vtkProp3D so that its transformation state is set to the matrix specified.
vtkTransform * Transform
Definition: vtkProp3D.h:360
void RotateY(double)
Rotate the Prop3D in degrees about the Y axis using the right hand rule.
double * GetOrientationWXYZ()
Returns the WXYZ orientation of the Prop3D.
double * GetYRange()
Get the Prop3D's y range in world coordinates.
void SetUserMatrix(vtkMatrix4x4 *matrix)
The UserMatrix can be used in place of UserTransform.
int IsIdentity
Definition: vtkProp3D.h:363
void AddOrientation(double orentation[3])
Add to the current orientation.
vtkMatrix4x4 * Matrix
Definition: vtkProp3D.h:353
void InitPathTraversal()
Overload vtkProp's method for setting up assembly paths.
void SetUserTransform(vtkLinearTransform *transform)
In addition to the instance variables such as position and orientation, you can add an additional tra...
virtual void GetMatrix(double m[16])
vtkProp3D * CachedProp3D
Definition: vtkProp3D.h:362
void GetBounds(double bounds[6])
Return a reference to the Prop3D's composite transform.
void AddOrientation(double x, double y, double z)
Add to the current orientation.
virtual void GetMatrix(vtkMatrix4x4 *m)
Return a reference to the Prop3D's 4x4 composite matrix.
void SetOrientation(double orientation[3])
Sets the orientation of the Prop3D.
vtkLinearTransform * UserTransform
Definition: vtkProp3D.h:351
virtual void ComputeMatrix()
Generate the matrix based on ivars.
void GetOrientation(double orentation[3])
vtkMTimeType GetUserTransformMatrixMTime()
Get the modified time of the user matrix or user transform.
virtual void SetOrigin(const double pos[3])
Definition: vtkProp3D.h:106
vtkMatrix4x4 * GetMatrix()
Get a pointer to an internal vtkMatrix4x4.
Definition: vtkProp3D.h:333
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void RotateZ(double)
Rotate the Prop3D in degrees about the Z axis using the right hand rule.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
abstract specification for renderers
Definition: vtkRenderer.h:64
record modification and/or execution time
Definition: vtkTimeStamp.h:36
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
@ orientation
Definition: vtkX3D.h:262
@ scale
Definition: vtkX3D.h:229
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248