45 #ifndef vtkPerspectiveTransform_h 46 #define vtkPerspectiveTransform_h 48 #include "vtkCommonTransformsModule.h" 73 { this->Concatenation->Inverse(); this->
Modified(); };
83 void AdjustViewport(
double oldXMin,
double oldXMax,
84 double oldYMin,
double oldYMax,
85 double newXMin,
double newXMax,
86 double newYMin,
double newYMax);
95 void AdjustZBuffer(
double oldNearZ,
double oldFarZ,
96 double newNearZ,
double newFarZ);
103 void Ortho(
double xmin,
double xmax,
double ymin,
double ymax,
104 double znear,
double zfar);
112 void Frustum(
double xmin,
double xmax,
double ymin,
double ymax,
113 double znear,
double zfar);
121 void Perspective(
double angle,
double aspect,
double znear,
double zfar);
136 void Shear(
double dxdz,
double dydz,
double zplane);
148 void Stereo(
double angle,
double focaldistance);
155 void SetupCamera(
const double position[3],
const double focalpoint[3],
156 const double viewup[3]);
158 void SetupCamera(
double p0,
double p1,
double p2,
159 double fp0,
double fp1,
double fp2,
160 double vup0,
double vup1,
double vup2);
168 this->Concatenation->Translate(x,y,z); };
180 void RotateWXYZ(
double angle,
double x,
double y,
double z) {
181 this->Concatenation->Rotate(angle,x,y,z); };
183 this->RotateWXYZ(angle, axis[0], axis[1], axis[2]); };
185 this->RotateWXYZ(angle, axis[0], axis[1], axis[2]); };
194 void RotateX(
double angle) { this->RotateWXYZ(angle, 1, 0, 0); };
195 void RotateY(
double angle) { this->RotateWXYZ(angle, 0, 1, 0); };
196 void RotateZ(
double angle) { this->RotateWXYZ(angle, 0, 0, 1); };
205 void Scale(
double x,
double y,
double z) {
206 this->Concatenation->Scale(x,y,z); };
207 void Scale(
const double s[3]) { this->
Scale(s[0], s[1], s[2]); };
208 void Scale(
const float s[3]) { this->
Scale(s[0], s[1], s[2]); };
217 this->SetMatrix(*matrix->
Element); };
219 this->Identity(); this->Concatenate(elements); };
228 this->Concatenate(*matrix->
Element); };
230 this->Concatenation->Concatenate(elements); };
250 if (this->Concatenation->GetPreMultiplyFlag()) {
return; }
251 this->Concatenation->SetPreMultiplyFlag(1); this->
Modified(); };
261 if (!this->Concatenation->GetPreMultiplyFlag()) {
return; }
262 this->Concatenation->SetPreMultiplyFlag(0); this->
Modified(); };
269 return this->Concatenation->GetNumberOfTransforms() +
270 (this->Input ==
nullptr ? 0 : 1); };
283 if (this->Input ==
nullptr)
285 t=this->Concatenation->GetTransform(i);
287 else if (i < this->Concatenation->GetNumberOfPreTransforms())
289 t=this->Concatenation->GetTransform(i);
291 else if (i > this->Concatenation->GetNumberOfPreTransforms())
293 t=this->Concatenation->GetTransform(i-1);
295 else if (this->GetInverseFlag())
303 return static_cast<vtkHomogeneousTransform *>(t);
328 return this->Concatenation->GetInverseFlag(); };
334 void Push() {
if (this->Stack ==
nullptr) {
336 this->Stack->Push(&this->Concatenation);
345 void Pop() {
if (this->Stack ==
nullptr) {
return; }
346 this->Stack->Pop(&this->Concatenation);
represent and manipulate 4x4 transformation matrices
vtkTypeUInt32 vtkMTimeType
a simple class to control print indentation
virtual void Modified()
Update the modification time for this object.
double Element[4][4]
The internal data is public for historical reasons. Do not use!
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.