VTK  9.1.0
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 =========================================================================*/
68 #ifndef vtkCameraInterpolator_h
69 #define vtkCameraInterpolator_h
70 
71 #include "vtkObject.h"
72 #include "vtkRenderingCoreModule.h" // For export macro
73 
74 class vtkCamera;
75 class vtkCameraList;
77 class vtkCameraList;
78 
79 class VTKRENDERINGCORE_EXPORT vtkCameraInterpolator : public vtkObject
80 {
81 public:
83  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
89 
94 
96 
100  double GetMinimumT();
101  double GetMaximumT();
103 
107  void Initialize();
108 
115  void AddCamera(double t, vtkCamera* camera);
116 
121  void RemoveCamera(double t);
122 
128  void InterpolateCamera(double t, vtkCamera* camera);
129 
133  enum
134  {
135  INTERPOLATION_TYPE_LINEAR = 0,
137  INTERPOLATION_TYPE_MANUAL
138  };
139 
141 
151  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
152  vtkGetMacro(InterpolationType, int);
153  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
154  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
155  void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
157 
159 
168 
170 
177  vtkGetObjectMacro(FocalPointInterpolator, vtkTupleInterpolator);
179 
181 
188  vtkGetObjectMacro(ViewUpInterpolator, vtkTupleInterpolator);
190 
192 
199  vtkGetObjectMacro(ViewAngleInterpolator, vtkTupleInterpolator);
201 
203 
210  vtkGetObjectMacro(ParallelScaleInterpolator, vtkTupleInterpolator);
212 
214 
221  vtkGetObjectMacro(ClippingRangeInterpolator, vtkTupleInterpolator);
223 
228  vtkMTimeType GetMTime() override;
229 
230 protected:
233 
234  // Control the interpolation type
236 
237  // These perform the interpolation
244 
245  // Initialize the interpolating splines
249 
250  // Hold the list of cameras. PIMPL'd STL list.
251  vtkCameraList* CameraList;
252 
253 private:
255  void operator=(const vtkCameraInterpolator&) = delete;
256 };
257 
258 #endif
vtkCameraInterpolator::New
static vtkCameraInterpolator * New()
Instantiate the class.
vtkCameraInterpolator::RemoveCamera
void RemoveCamera(double t)
Delete the camera at a particular parameter t.
vtkCameraInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCameraInterpolator::SetViewUpInterpolator
virtual void SetViewUpInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the view up portion of the camera.
vtkCameraInterpolator::FocalPointInterpolator
vtkTupleInterpolator * FocalPointInterpolator
Definition: vtkCameraInterpolator.h:239
vtkCameraInterpolator::SetInterpolationTypeToLinear
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkCameraInterpolator.h:153
vtkCameraInterpolator::GetMaximumT
double GetMaximumT()
Obtain some information about the interpolation range.
vtkCameraInterpolator::SetInterpolationTypeToSpline
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkCameraInterpolator.h:154
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkCameraInterpolator::vtkCameraInterpolator
vtkCameraInterpolator()
vtkCameraInterpolator::ParallelScaleInterpolator
vtkTupleInterpolator * ParallelScaleInterpolator
Definition: vtkCameraInterpolator.h:242
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkCameraInterpolator
interpolate a series of cameras to update a new camera
Definition: vtkCameraInterpolator.h:80
vtkCameraInterpolator::InitializeInterpolation
void InitializeInterpolation()
vtkCameraInterpolator::GetNumberOfCameras
int GetNumberOfCameras()
Return the number of cameras in the list of cameras.
vtkCameraInterpolator::SetPositionInterpolator
virtual void SetPositionInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the position portion of the camera.
vtkCameraInterpolator::ViewUpInterpolator
vtkTupleInterpolator * ViewUpInterpolator
Definition: vtkCameraInterpolator.h:240
vtkCameraInterpolator::ViewAngleInterpolator
vtkTupleInterpolator * ViewAngleInterpolator
Definition: vtkCameraInterpolator.h:241
vtkCameraInterpolator::SetClippingRangeInterpolator
virtual void SetClippingRangeInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the clipping range portion of the camera.
vtkCameraInterpolator::InterpolationType
int InterpolationType
Definition: vtkCameraInterpolator.h:235
vtkCameraInterpolator::SetInterpolationTypeToManual
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkCameraInterpolator.h:155
vtkCameraInterpolator::GetMTime
vtkMTimeType GetMTime() override
Override GetMTime() because we depend on the interpolators which may be modified outside of this clas...
vtkCameraInterpolator::AddCamera
void AddCamera(double t, vtkCamera *camera)
Add another camera to the list of cameras defining the camera function.
vtkCameraInterpolator::SetFocalPointInterpolator
virtual void SetFocalPointInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the focal point portion of the camera.
vtkCameraInterpolator::PositionInterpolator
vtkTupleInterpolator * PositionInterpolator
Definition: vtkCameraInterpolator.h:238
vtkCameraInterpolator::SetParallelScaleInterpolator
virtual void SetParallelScaleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the parallel scale portion of the camera.
vtkCameraInterpolator::~vtkCameraInterpolator
~vtkCameraInterpolator() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
vtkObject.h
vtkCameraInterpolator::InitializeTime
vtkTimeStamp InitializeTime
Definition: vtkCameraInterpolator.h:247
vtkTupleInterpolator
interpolate a tuple of arbitrary size
Definition: vtkTupleInterpolator.h:83
vtkCameraInterpolator::CameraList
vtkCameraList * CameraList
Definition: vtkCameraInterpolator.h:251
vtkCameraInterpolator::INTERPOLATION_TYPE_SPLINE
@ INTERPOLATION_TYPE_SPLINE
Definition: vtkCameraInterpolator.h:136
vtkCameraInterpolator::InterpolateCamera
void InterpolateCamera(double t, vtkCamera *camera)
Interpolate the list of cameras and determine a new camera (i.e., fill in the camera provided).
vtkCameraInterpolator::ClippingRangeInterpolator
vtkTupleInterpolator * ClippingRangeInterpolator
Definition: vtkCameraInterpolator.h:243
vtkCameraInterpolator::Initialized
int Initialized
Definition: vtkCameraInterpolator.h:246
vtkCameraInterpolator::GetMinimumT
double GetMinimumT()
Obtain some information about the interpolation range.
vtkX3D::PositionInterpolator
@ PositionInterpolator
Definition: vtkX3D.h:151
vtkCameraInterpolator::Initialize
void Initialize()
Clear the list of cameras.
vtkCameraInterpolator::SetViewAngleInterpolator
virtual void SetViewAngleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the view angle portion of the camera.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287