VTK  9.0.1
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 =========================================================================*/
49 #ifndef vtkCameraInterpolator_h
50 #define vtkCameraInterpolator_h
51 
52 #include "vtkObject.h"
53 #include "vtkRenderingCoreModule.h" // For export macro
54 
55 class vtkCamera;
56 class vtkCameraList;
58 class vtkCameraList;
59 
60 class VTKRENDERINGCORE_EXPORT vtkCameraInterpolator : public vtkObject
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
69  static vtkCameraInterpolator* New();
70 
74  int GetNumberOfCameras();
75 
77 
81  double GetMinimumT();
82  double GetMaximumT();
84 
88  void Initialize();
89 
96  void AddCamera(double t, vtkCamera* camera);
97 
102  void RemoveCamera(double t);
103 
109  void InterpolateCamera(double t, vtkCamera* camera);
110 
114  enum
115  {
116  INTERPOLATION_TYPE_LINEAR = 0,
118  INTERPOLATION_TYPE_MANUAL
119  };
120 
122 
132  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
133  vtkGetMacro(InterpolationType, int);
134  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
135  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
136  void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
138 
140 
146  virtual void SetPositionInterpolator(vtkTupleInterpolator*);
147  vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
149 
151 
157  virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
158  vtkGetObjectMacro(FocalPointInterpolator, vtkTupleInterpolator);
160 
162 
168  virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
169  vtkGetObjectMacro(ViewUpInterpolator, vtkTupleInterpolator);
171 
173 
179  virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
180  vtkGetObjectMacro(ViewAngleInterpolator, vtkTupleInterpolator);
182 
184 
190  virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
191  vtkGetObjectMacro(ParallelScaleInterpolator, vtkTupleInterpolator);
193 
195 
201  virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
202  vtkGetObjectMacro(ClippingRangeInterpolator, vtkTupleInterpolator);
204 
209  vtkMTimeType GetMTime() override;
210 
211 protected:
213  ~vtkCameraInterpolator() override;
214 
215  // Control the interpolation type
217 
218  // These perform the interpolation
225 
226  // Initialize the interpolating splines
229  void InitializeInterpolation();
230 
231  // Hold the list of cameras. PIMPL'd STL list.
232  vtkCameraList* CameraList;
233 
234 private:
236  void operator=(const vtkCameraInterpolator&) = delete;
237 };
238 
239 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:293
interpolate a tuple of arbitrary size
record modification and/or execution time
Definition: vtkTimeStamp.h:32
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:33
a virtual camera for 3D rendering
Definition: vtkCamera.h:45
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.