VTK
vtkCameraInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCameraInterpolator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
52 #ifndef vtkCameraInterpolator_h
53 #define vtkCameraInterpolator_h
54 
55 #include "vtkRenderingCoreModule.h" // For export macro
56 #include "vtkObject.h"
57 
58 class vtkCamera;
59 class vtkCameraList;
61 class vtkCameraList;
62 
63 
64 class VTKRENDERINGCORE_EXPORT vtkCameraInterpolator : public vtkObject
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
73  static vtkCameraInterpolator* New();
74 
78  int GetNumberOfCameras();
79 
81 
85  double GetMinimumT();
86  double GetMaximumT();
88 
92  void Initialize();
93 
100  void AddCamera(double t, vtkCamera *camera);
101 
106  void RemoveCamera(double t);
107 
113  void InterpolateCamera(double t, vtkCamera *camera);
114 
118  enum {INTERPOLATION_TYPE_LINEAR=0,
120  INTERPOLATION_TYPE_MANUAL
121  };
122 
124 
134  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR,
135  INTERPOLATION_TYPE_MANUAL);
136  vtkGetMacro(InterpolationType,int);
138  {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
140  {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
142  {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);}
144 
146 
152  virtual void SetPositionInterpolator(vtkTupleInterpolator*);
153  vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
155 
157 
163  virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
164  vtkGetObjectMacro(FocalPointInterpolator, vtkTupleInterpolator);
166 
168 
174  virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
175  vtkGetObjectMacro(ViewUpInterpolator, vtkTupleInterpolator);
177 
179 
185  virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
186  vtkGetObjectMacro(ViewAngleInterpolator, vtkTupleInterpolator);
188 
190 
196  virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
197  vtkGetObjectMacro(ParallelScaleInterpolator, vtkTupleInterpolator);
199 
201 
207  virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
208  vtkGetObjectMacro(ClippingRangeInterpolator, vtkTupleInterpolator);
210 
215  vtkMTimeType GetMTime() override;
216 
217 protected:
219  ~vtkCameraInterpolator() override;
220 
221  // Control the interpolation type
223 
224  // These perform the interpolation
231 
232  // Initialize the interpolating splines
235  void InitializeInterpolation();
236 
237  // Hold the list of cameras. PIMPL'd STL list.
238  vtkCameraList *CameraList;
239 
240 private:
242  void operator=(const vtkCameraInterpolator&) = delete;
243 };
244 
245 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
interpolate a series of cameras to update a new camera
vtkTupleInterpolator * ViewUpInterpolator
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
interpolate a tuple of arbitrary size
record modification and/or execution time
Definition: vtkTimeStamp.h:35
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
vtkTupleInterpolator * ViewAngleInterpolator
vtkTupleInterpolator * ClippingRangeInterpolator
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
vtkTupleInterpolator * ParallelScaleInterpolator
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkTupleInterpolator * FocalPointInterpolator
vtkTupleInterpolator * PositionInterpolator
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.