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

dox/Rendering/vtkCamera.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkCamera.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00034 #ifndef __vtkCamera_h 00035 #define __vtkCamera_h 00036 00037 #include "vtkObject.h" 00038 00039 class vtkMatrix4x4; 00040 class vtkPerspectiveTransform; 00041 class vtkRenderer; 00042 class vtkTransform; 00043 class vtkHomogeneousTransform; 00044 00045 class VTK_RENDERING_EXPORT vtkCamera : public vtkObject 00046 { 00047 public: 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 vtkTypeRevisionMacro(vtkCamera,vtkObject); 00050 00054 static vtkCamera *New(); 00055 00057 00059 void SetPosition(double x, double y, double z); 00060 void SetPosition(const double a[3]) { 00061 this->SetPosition(a[0], a[1], a[2]); }; 00062 vtkGetVector3Macro(Position,double); 00064 00066 00068 void SetFocalPoint(double x, double y, double z); 00069 void SetFocalPoint(const double a[3]) { 00070 this->SetFocalPoint(a[0], a[1], a[2]);}; 00071 vtkGetVector3Macro(FocalPoint,double); 00073 00075 00077 void SetViewUp(double vx, double vy, double vz); 00078 void SetViewUp(const double a[3]) { 00079 this->SetViewUp(a[0], a[1], a[2]); } 00080 vtkGetVector3Macro(ViewUp,double); 00082 00086 void OrthogonalizeViewUp(); 00087 00089 00091 void SetDistance(double); 00092 vtkGetMacro(Distance,double); 00094 00096 00099 vtkGetVector3Macro(DirectionOfProjection,double); 00101 00105 void Dolly(double distance); 00106 00108 00109 void SetRoll(double angle); 00110 double GetRoll(); 00112 00114 void Roll(double angle); 00115 00119 void Azimuth(double angle); 00120 00124 void Yaw(double angle); 00125 00128 void Elevation(double angle); 00129 00132 void Pitch(double angle); 00133 00135 00138 void SetParallelProjection(int flag); 00139 vtkGetMacro(ParallelProjection,int); 00140 vtkBooleanMacro(ParallelProjection,int); 00142 00144 00150 void SetUseHorizontalViewAngle(int flag); 00151 vtkGetMacro(UseHorizontalViewAngle, int); 00152 vtkBooleanMacro(UseHorizontalViewAngle, int); 00154 00156 00163 void SetViewAngle(double angle); 00164 vtkGetMacro(ViewAngle,double); 00166 00168 00173 void SetParallelScale(double scale); 00174 vtkGetMacro(ParallelScale,double); 00176 00181 void Zoom(double factor); 00182 00184 00191 void SetClippingRange(double near, double far); 00192 void SetClippingRange(const double a[2]) { 00193 this->SetClippingRange(a[0], a[1]); }; 00194 vtkGetVector2Macro(ClippingRange,double); 00196 00198 00201 void SetThickness(double); 00202 vtkGetMacro(Thickness,double); 00204 00206 00211 void SetWindowCenter(double x, double y); 00212 vtkGetVector2Macro(WindowCenter,double); 00214 00223 void SetObliqueAngles(double alpha, double beta); 00224 00228 void ApplyTransform(vtkTransform *t); 00229 00231 00234 vtkGetVector3Macro(ViewPlaneNormal,double); 00236 00238 00242 void SetViewShear(double dxdz, double dydz, double center); 00243 void SetViewShear(double d[3]); 00244 vtkGetVector3Macro(ViewShear, double); 00246 00248 00250 vtkSetMacro(EyeAngle,double); 00251 vtkGetMacro(EyeAngle,double); 00253 00255 00259 vtkSetMacro(FocalDisk,double); 00260 vtkGetMacro(FocalDisk,double); 00262 00264 virtual vtkMatrix4x4 *GetViewTransformMatrix(); 00265 00267 00272 virtual vtkMatrix4x4 *GetPerspectiveTransformMatrix(double aspect, 00273 double nearz, 00274 double farz); 00276 00278 00284 virtual vtkMatrix4x4 *GetCompositePerspectiveTransformMatrix(double aspect, 00285 double nearz, 00286 double farz); 00288 00290 00294 void SetUserTransform(vtkHomogeneousTransform *transform); 00295 vtkGetObjectMacro(UserTransform,vtkHomogeneousTransform); 00297 00301 virtual void Render(vtkRenderer *) {}; 00302 00305 unsigned long GetViewingRaysMTime(); 00306 00309 void ViewingRaysModified(); 00310 00316 virtual void GetFrustumPlanes(double aspect, double planes[24]); 00317 00319 00320 double *GetOrientation(); 00321 double *GetOrientationWXYZ(); 00323 00325 00328 void SetViewPlaneNormal(double x, double y, double z); 00329 void SetViewPlaneNormal(const double a[3]) { 00330 this->SetViewPlaneNormal(a[0], a[1], a[2]); }; 00332 00335 void ComputeViewPlaneNormal(); 00336 00340 vtkMatrix4x4 *GetCameraLightTransformMatrix(); 00341 00343 virtual void UpdateViewport(vtkRenderer *vtkNotUsed(ren)) {} 00344 00345 virtual vtkTransform *GetViewTransformObject() {return this->ViewTransform;}; 00346 00347 protected: 00348 vtkCamera(); 00349 ~vtkCamera(); 00350 00352 00353 void ComputeDistance(); 00354 void ComputeViewTransform(); 00355 void ComputePerspectiveTransform(double aspect, double nearz, double farz); 00356 void ComputeCompositePerspectiveTransform(double aspect, 00357 double nearz, double farz); 00358 void ComputeCameraLightTransform(); 00360 00361 double WindowCenter[2]; 00362 double ObliqueAngles[2]; 00363 double FocalPoint[3]; 00364 double Position[3]; 00365 double ViewUp[3]; 00366 double ViewAngle; 00367 double ClippingRange[2]; 00368 double EyeAngle; 00369 int ParallelProjection; 00370 double ParallelScale; 00371 int Stereo; 00372 int LeftEye; 00373 double Thickness; 00374 double Distance; 00375 double DirectionOfProjection[3]; 00376 double ViewPlaneNormal[3]; 00377 double ViewShear[3]; 00378 int UseHorizontalViewAngle; 00379 vtkHomogeneousTransform *UserTransform; 00380 00381 vtkTransform *ViewTransform; 00382 vtkPerspectiveTransform *PerspectiveTransform; 00383 vtkPerspectiveTransform *Transform; 00384 vtkTransform *CameraLightTransform; 00385 00386 double FocalDisk; 00387 00388 // ViewingRaysMtime keeps track of camera modifications which will 00389 // change the calculation of viewing rays for the camera before it is 00390 // transformed to the camera's location and orientation. 00391 vtkTimeStamp ViewingRaysMTime; 00392 private: 00393 vtkCamera(const vtkCamera&); // Not implemented. 00394 void operator=(const vtkCamera&); // Not implemented. 00395 }; 00396 00397 #endif 00398