VTK
dox/Rendering/vtkCameraInterpolator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCameraInterpolator.h
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 =========================================================================*/
00054 #ifndef __vtkCameraInterpolator_h
00055 #define __vtkCameraInterpolator_h
00056 
00057 #include "vtkObject.h"
00058 
00059 class vtkCamera;
00060 class vtkCameraList;
00061 class vtkTupleInterpolator;
00062 class vtkCameraList;
00063 
00064 
00065 class VTK_RENDERING_EXPORT vtkCameraInterpolator : public vtkObject
00066 {
00067 public:
00068   vtkTypeMacro(vtkCameraInterpolator, vtkObject);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072   static vtkCameraInterpolator* New();
00073 
00075   int GetNumberOfCameras();
00076 
00078 
00080   double GetMinimumT();
00081   double GetMaximumT();
00083 
00085   void Initialize();
00086   
00091   void AddCamera(double t, vtkCamera *camera);
00092 
00095   void RemoveCamera(double t);
00096 
00100   void InterpolateCamera(double t, vtkCamera *camera);
00101 
00102 //BTX
00104 
00105   enum {INTERPOLATION_TYPE_LINEAR=0,
00106         INTERPOLATION_TYPE_SPLINE,
00107         INTERPOLATION_TYPE_MANUAL
00108   };
00109 //ETX
00111 
00113 
00121   vtkSetClampMacro(InterpolationType,int, INTERPOLATION_TYPE_LINEAR,
00122                    INTERPOLATION_TYPE_MANUAL);
00123   vtkGetMacro(InterpolationType,int);
00124   void SetInterpolationTypeToLinear()
00125     {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
00126   void SetInterpolationTypeToSpline()
00127     {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
00128   void SetInterpolationTypeToManual()
00129     {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);}
00131 
00133 
00137   virtual void SetPositionInterpolator(vtkTupleInterpolator*);
00138   vtkGetObjectMacro(PositionInterpolator,vtkTupleInterpolator);
00140 
00142 
00146   virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
00147   vtkGetObjectMacro(FocalPointInterpolator,vtkTupleInterpolator);
00149 
00151 
00155   virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
00156   vtkGetObjectMacro(ViewUpInterpolator,vtkTupleInterpolator);
00158 
00160 
00164   virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
00165   vtkGetObjectMacro(ViewAngleInterpolator,vtkTupleInterpolator);
00167 
00169 
00173   virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
00174   vtkGetObjectMacro(ParallelScaleInterpolator,vtkTupleInterpolator);
00176 
00178 
00182   virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
00183   vtkGetObjectMacro(ClippingRangeInterpolator,vtkTupleInterpolator);
00185 
00188   unsigned long GetMTime();
00189 
00190 protected:
00191   vtkCameraInterpolator();
00192   virtual ~vtkCameraInterpolator();
00193 
00194   // Control the interpolation type
00195   int InterpolationType;
00196 
00197   // These perform the interpolation
00198   vtkTupleInterpolator *PositionInterpolator;
00199   vtkTupleInterpolator *FocalPointInterpolator;
00200   vtkTupleInterpolator *ViewUpInterpolator;
00201   vtkTupleInterpolator *ViewAngleInterpolator;
00202   vtkTupleInterpolator *ParallelScaleInterpolator;
00203   vtkTupleInterpolator *ClippingRangeInterpolator;
00204 
00205   // Initialize the interpolating splines
00206   int Initialized;
00207   vtkTimeStamp InitializeTime;
00208   void InitializeInterpolation();
00209 
00210   // Hold the list of cameras. PIMPL'd STL list.
00211   vtkCameraList *CameraList;
00212 
00213 private:
00214   vtkCameraInterpolator(const vtkCameraInterpolator&);  // Not implemented.
00215   void operator=(const vtkCameraInterpolator&);  // Not implemented.
00216 
00217 };
00218 
00219 #endif