Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

common/vtkPerspectiveTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPerspectiveTransform.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00040 
00074 #ifndef __vtkPerspectiveTransform_h
00075 #define __vtkPerspectiveTransform_h
00076 
00077 #include "vtkHomogeneousTransform.h"
00078 
00079 class VTK_EXPORT vtkPerspectiveTransform : public vtkHomogeneousTransform
00080 {
00081  public:
00082   static vtkPerspectiveTransform *New();
00083   vtkTypeMacro(vtkPerspectiveTransform,vtkHomogeneousTransform);
00084   void PrintSelf(ostream& os, vtkIndent indent);
00085 
00089   void Identity() { this->Concatenation->Identity(); this->Modified(); };
00090 
00094   void Inverse() { this->Concatenation->Inverse(); this->Modified(); };
00095 
00102   void AdjustViewport(double oldXMin, double oldXMax, 
00103             double oldYMin, double oldYMax,
00104             double newXMin, double newXMax, 
00105             double newYMin, double newYMax);
00106 
00112   void AdjustZBuffer(double oldNearZ, double oldFarZ,
00113            double newNearZ, double newFarZ);
00114 
00118   void Ortho(double xmin, double xmax, double ymin, double ymax, 
00119         double znear, double zfar);
00120 
00125   void Frustum(double xmin, double xmax, double ymin, double ymax, 
00126           double znear, double zfar);
00127 
00132   void Perspective(double angle, double aspect, double znear, double zfar);
00133 
00144   void Shear(double dxdz, double dydz, double zplane);
00145 
00153   void Stereo(double angle, double focaldistance);
00154 
00158   void SetupCamera(const double position[3], const double focalpoint[3],
00159          const double viewup[3]);
00160 
00163   void Translate(double x, double y, double z) {
00164     this->Concatenation->Translate(x,y,z); };
00165   void Translate(const double x[3]) { this->Translate(x[0], x[1], x[2]); };
00166   void Translate(const float x[3]) { this->Translate(x[0], x[1], x[2]); };
00167 
00172   void RotateWXYZ(double angle, double x, double y, double z) {
00173     this->Concatenation->Rotate(angle,x,y,z); };
00174   void RotateWXYZ(double angle, const double axis[3]) {
00175     this->RotateWXYZ(angle, axis[0], axis[1], axis[2]); };
00176   void RotateWXYZ(double angle, const float axis[3]) {
00177     this->RotateWXYZ(angle, axis[0], axis[1], axis[2]); };
00178 
00182   void RotateX(double angle) { this->RotateWXYZ(angle, 1, 0, 0); };
00183   void RotateY(double angle) { this->RotateWXYZ(angle, 0, 1, 0); };
00184   void RotateZ(double angle) { this->RotateWXYZ(angle, 0, 0, 1); };
00185 
00189   void Scale(double x, double y, double z) {
00190     this->Concatenation->Scale(x,y,z); };
00191   void Scale(const double s[3]) { this->Scale(s[0], s[1], s[2]); };
00192   void Scale(const float s[3]) { this->Scale(s[0], s[1], s[2]); };
00193 
00196   void SetMatrix(vtkMatrix4x4 *matrix) { 
00197     this->SetMatrix(*matrix->Element); };
00198   void SetMatrix(const double elements[16]) { 
00199     this->Identity(); this->Concatenate(elements); };
00200 
00203   void Concatenate(vtkMatrix4x4 *matrix) { 
00204     this->Concatenate(*matrix->Element); };
00205   void Concatenate(const double elements[16]) {
00206     this->Concatenation->Concatenate(elements); };
00207 
00213   void Concatenate(vtkHomogeneousTransform *transform);
00214 
00220   void PreMultiply() { 
00221     if (this->Concatenation->GetPreMultiplyFlag()) { return; }
00222     this->Concatenation->SetPreMultiplyFlag(1); this->Modified(); };
00223 
00229   void PostMultiply()  { 
00230     if (!this->Concatenation->GetPreMultiplyFlag()) { return; }
00231     this->Concatenation->SetPreMultiplyFlag(0); this->Modified(); };
00232 
00234   void Push() { if (this->Stack == NULL) { 
00235                     this->Stack = vtkTransformConcatenationStack::New(); }
00236                 this->Stack->Push(&this->Concatenation); 
00237                 this->Modified(); };
00238 
00241   void Pop() { if (this->Stack == NULL) { return; }
00242                this->Stack->Pop(&this->Concatenation);
00243                this->Modified(); };
00244 
00249   void SetInput(vtkHomogeneousTransform *input);
00250   vtkHomogeneousTransform *GetInput() { return this->Input; };
00251 
00252 
00255   vtkAbstractTransform *MakeTransform();
00256 
00263   int CircuitCheck(vtkAbstractTransform *transform);
00264 
00266   unsigned long GetMTime();
00267 
00268 protected:
00269   vtkPerspectiveTransform();
00270   ~vtkPerspectiveTransform();
00271   vtkPerspectiveTransform(const vtkPerspectiveTransform& t);
00272   void operator=(const vtkPerspectiveTransform&) {};
00273 
00274   void InternalDeepCopy(vtkAbstractTransform *t);
00275   void InternalUpdate();
00276 
00277   vtkHomogeneousTransform *Input;
00278   vtkTransformConcatenation *Concatenation;
00279   vtkTransformConcatenationStack *Stack;
00280 };
00281 
00282 
00283 #endif

Generated on Wed Nov 21 12:26:53 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001