VTK  9.3.20240424
vtkCameraInterpolator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
59#ifndef vtkCameraInterpolator_h
60#define vtkCameraInterpolator_h
61
62#include "vtkObject.h"
63#include "vtkRenderingCoreModule.h" // For export macro
64
65VTK_ABI_NAMESPACE_BEGIN
66class vtkCamera;
67class vtkCameraList;
69class vtkCameraList;
70
71class VTKRENDERINGCORE_EXPORT vtkCameraInterpolator : public vtkObject
72{
73public:
75 void PrintSelf(ostream& os, vtkIndent indent) override;
76
81
86
88
92 double GetMinimumT();
93 double GetMaximumT();
95
99 void Initialize();
100
107 void AddCamera(double t, vtkCamera* camera);
108
113 void RemoveCamera(double t);
114
120 void InterpolateCamera(double t, vtkCamera* camera);
121
125 enum
126 {
127 INTERPOLATION_TYPE_LINEAR = 0,
129 INTERPOLATION_TYPE_MANUAL
130 };
131
133
143 vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
144 vtkGetMacro(InterpolationType, int);
145 void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
146 void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
147 void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
149
151
158 vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
160
162
169 vtkGetObjectMacro(FocalPointInterpolator, vtkTupleInterpolator);
171
173
180 vtkGetObjectMacro(ViewUpInterpolator, vtkTupleInterpolator);
182
184
191 vtkGetObjectMacro(ViewAngleInterpolator, vtkTupleInterpolator);
193
195
202 vtkGetObjectMacro(ParallelScaleInterpolator, vtkTupleInterpolator);
204
206
213 vtkGetObjectMacro(ClippingRangeInterpolator, vtkTupleInterpolator);
215
221
222protected:
225
226 // Control the interpolation type
228
229 // These perform the interpolation
236
237 // Initialize the interpolating splines
241
242 // Hold the list of cameras. PIMPL'd STL list.
243 vtkCameraList* CameraList;
244
245private:
247 void operator=(const vtkCameraInterpolator&) = delete;
248};
249
250VTK_ABI_NAMESPACE_END
251#endif
interpolate a series of cameras to update a new camera
virtual void SetParallelScaleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the parallel scale portion of the camera.
vtkTupleInterpolator * ClippingRangeInterpolator
vtkTupleInterpolator * ParallelScaleInterpolator
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
void Initialize()
Clear the list of cameras.
virtual void SetClippingRangeInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the clipping range portion of the camera.
virtual void SetPositionInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the position portion of the camera.
virtual void SetFocalPointInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the focal point portion of the camera.
static vtkCameraInterpolator * New()
Instantiate the class.
vtkTupleInterpolator * ViewUpInterpolator
vtkTupleInterpolator * ViewAngleInterpolator
vtkMTimeType GetMTime() override
Override GetMTime() because we depend on the interpolators which may be modified outside of this clas...
int GetNumberOfCameras()
Return the number of cameras in the list of cameras.
vtkTupleInterpolator * FocalPointInterpolator
vtkTupleInterpolator * PositionInterpolator
void RemoveCamera(double t)
Delete the camera at a particular parameter t.
~vtkCameraInterpolator() override
virtual void SetViewUpInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the view up portion of the camera.
void AddCamera(double t, vtkCamera *camera)
Add another camera to the list of cameras defining the camera function.
virtual void SetViewAngleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the view angle portion of the camera.
double GetMinimumT()
Obtain some information about the interpolation range.
void InterpolateCamera(double t, vtkCamera *camera)
Interpolate the list of cameras and determine a new camera (i.e., fill in the camera provided).
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.
double GetMaximumT()
Obtain some information about the interpolation range.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a virtual camera for 3D rendering
Definition vtkCamera.h:151
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
record modification and/or execution time
interpolate a tuple of arbitrary size
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270