VTK
|
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 "vtkRenderingCoreModule.h" // For export macro 00058 #include "vtkObject.h" 00059 00060 class vtkCamera; 00061 class vtkCameraList; 00062 class vtkTupleInterpolator; 00063 class vtkCameraList; 00064 00065 00066 class VTKRENDERINGCORE_EXPORT vtkCameraInterpolator : public vtkObject 00067 { 00068 public: 00069 vtkTypeMacro(vtkCameraInterpolator, vtkObject); 00070 void PrintSelf(ostream& os, vtkIndent indent); 00071 00073 static vtkCameraInterpolator* New(); 00074 00076 int GetNumberOfCameras(); 00077 00079 00081 double GetMinimumT(); 00082 double GetMaximumT(); 00084 00086 void Initialize(); 00087 00092 void AddCamera(double t, vtkCamera *camera); 00093 00096 void RemoveCamera(double t); 00097 00101 void InterpolateCamera(double t, vtkCamera *camera); 00102 00103 //BTX 00105 00106 enum {INTERPOLATION_TYPE_LINEAR=0, 00107 INTERPOLATION_TYPE_SPLINE, 00108 INTERPOLATION_TYPE_MANUAL 00109 }; 00110 //ETX 00112 00114 00122 vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, 00123 INTERPOLATION_TYPE_MANUAL); 00124 vtkGetMacro(InterpolationType,int); 00125 void SetInterpolationTypeToLinear() 00126 {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);} 00127 void SetInterpolationTypeToSpline() 00128 {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);} 00129 void SetInterpolationTypeToManual() 00130 {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);} 00132 00134 00138 virtual void SetPositionInterpolator(vtkTupleInterpolator*); 00139 vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator); 00141 00143 00147 virtual void SetFocalPointInterpolator(vtkTupleInterpolator*); 00148 vtkGetObjectMacro(FocalPointInterpolator, vtkTupleInterpolator); 00150 00152 00156 virtual void SetViewUpInterpolator(vtkTupleInterpolator*); 00157 vtkGetObjectMacro(ViewUpInterpolator, vtkTupleInterpolator); 00159 00161 00165 virtual void SetViewAngleInterpolator(vtkTupleInterpolator*); 00166 vtkGetObjectMacro(ViewAngleInterpolator, vtkTupleInterpolator); 00168 00170 00174 virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*); 00175 vtkGetObjectMacro(ParallelScaleInterpolator, vtkTupleInterpolator); 00177 00179 00183 virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*); 00184 vtkGetObjectMacro(ClippingRangeInterpolator, vtkTupleInterpolator); 00186 00189 unsigned long GetMTime(); 00190 00191 protected: 00192 vtkCameraInterpolator(); 00193 virtual ~vtkCameraInterpolator(); 00194 00195 // Control the interpolation type 00196 int InterpolationType; 00197 00198 // These perform the interpolation 00199 vtkTupleInterpolator *PositionInterpolator; 00200 vtkTupleInterpolator *FocalPointInterpolator; 00201 vtkTupleInterpolator *ViewUpInterpolator; 00202 vtkTupleInterpolator *ViewAngleInterpolator; 00203 vtkTupleInterpolator *ParallelScaleInterpolator; 00204 vtkTupleInterpolator *ClippingRangeInterpolator; 00205 00206 // Initialize the interpolating splines 00207 int Initialized; 00208 vtkTimeStamp InitializeTime; 00209 void InitializeInterpolation(); 00210 00211 // Hold the list of cameras. PIMPL'd STL list. 00212 vtkCameraList *CameraList; 00213 00214 private: 00215 vtkCameraInterpolator(const vtkCameraInterpolator&); // Not implemented. 00216 void operator=(const vtkCameraInterpolator&); // Not implemented. 00217 }; 00218 00219 #endif