VTK: Rendering/Core/vtkCameraInterpolator.h Source File

| VTK 9.3.1

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
49 #ifndef vtkCameraInterpolator_h
50 #define vtkCameraInterpolator_h
51
52 #include "vtkObject.h"
53 #include "vtkRenderingCoreModule.h" // For export macro
54
55 VTK_ABI_NAMESPACE_BEGIN
56 class vtkCamera;
57 class vtkCameraList;
58 class vtkTupleInterpolator;
59 class vtkCameraList;
60
61 class VTKRENDERINGCORE_EXPORT vtkCameraInterpolator : public vtkObject
62 {
63 public:
64 vtkTypeMacro(vtkCameraInterpolator, vtkObject);
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
70 static vtkCameraInterpolator* New();
71
75 int GetNumberOfCameras();
76
78
82 double GetMinimumT();
83 double GetMaximumT();
85
89 void Initialize();
90
97 void AddCamera(double t, vtkCamera* camera);
98
103 void RemoveCamera(double t);
104
110 void InterpolateCamera(double t, vtkCamera* camera);
111
115 enum
116 {
117 INTERPOLATION_TYPE_LINEAR = 0,
118 INTERPOLATION_TYPE_SPLINE,
119 INTERPOLATION_TYPE_MANUAL
120 };
121
123
133 vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
134 vtkGetMacro(InterpolationType, int);
135 void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
136 void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
137 void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
139
141
147 virtual void SetPositionInterpolator(vtkTupleInterpolator*);
148 vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
150
152
158 virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
159 vtkGetObjectMacro(FocalPointInterpolator, vtkTupleInterpolator);
161
163
169 virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
170 vtkGetObjectMacro(ViewUpInterpolator, vtkTupleInterpolator);
172
174
180 virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
181 vtkGetObjectMacro(ViewAngleInterpolator, vtkTupleInterpolator);
183
185
191 virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
192 vtkGetObjectMacro(ParallelScaleInterpolator, vtkTupleInterpolator);
194
196
202 virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
203 vtkGetObjectMacro(ClippingRangeInterpolator, vtkTupleInterpolator);
205
210 vtkMTimeType GetMTime() override;
211
212 protected:
213 vtkCameraInterpolator();
214 ~vtkCameraInterpolator() override;
215
216 // Control the interpolation type
217 int InterpolationType;
218
219 // These perform the interpolation
220 vtkTupleInterpolator* PositionInterpolator;
221 vtkTupleInterpolator* FocalPointInterpolator;
222 vtkTupleInterpolator* ViewUpInterpolator;
223 vtkTupleInterpolator* ViewAngleInterpolator;
224 vtkTupleInterpolator* ParallelScaleInterpolator;
225 vtkTupleInterpolator* ClippingRangeInterpolator;
226
227 // Initialize the interpolating splines
228 int Initialized;
229 vtkTimeStamp InitializeTime;
230 void InitializeInterpolation();
231
232 // Hold the list of cameras. PIMPL'd STL list.
233 vtkCameraList* CameraList;
234
235 private:
236 vtkCameraInterpolator(const vtkCameraInterpolator&) = delete;
237 void operator=(const vtkCameraInterpolator&) = delete;
238 };
239
240 VTK_ABI_NAMESPACE_END
241 #endif
vtkCameraInterpolator
interpolate a series of cameras to update a new camera
Definition: vtkCameraInterpolator.h:62
vtkCameraInterpolator::InitializeTime
vtkTimeStamp InitializeTime
Definition: vtkCameraInterpolator.h:229
vtkCameraInterpolator::SetParallelScaleInterpolator
virtual void SetParallelScaleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the parallel scale portion of the camera.
vtkCameraInterpolator::ClippingRangeInterpolator
vtkTupleInterpolator * ClippingRangeInterpolator
Definition: vtkCameraInterpolator.h:225
vtkCameraInterpolator::ParallelScaleInterpolator
vtkTupleInterpolator * ParallelScaleInterpolator
Definition: vtkCameraInterpolator.h:224
vtkCameraInterpolator::SetInterpolationTypeToLinear
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkCameraInterpolator.h:135
vtkCameraInterpolator::SetInterpolationTypeToSpline
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkCameraInterpolator.h:136
vtkCameraInterpolator::Initialize
void Initialize()
Clear the list of cameras.
vtkCameraInterpolator::SetClippingRangeInterpolator
virtual void SetClippingRangeInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the clipping range portion of the camera.
vtkCameraInterpolator::SetPositionInterpolator
virtual void SetPositionInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the position portion of the camera.
vtkCameraInterpolator::Initialized
int Initialized
Definition: vtkCameraInterpolator.h:228
vtkCameraInterpolator::SetFocalPointInterpolator
virtual void SetFocalPointInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the focal point portion of the camera.
vtkCameraInterpolator::vtkCameraInterpolator
vtkCameraInterpolator()
vtkCameraInterpolator::InitializeInterpolation
void InitializeInterpolation()
vtkCameraInterpolator::ViewUpInterpolator
vtkTupleInterpolator * ViewUpInterpolator
Definition: vtkCameraInterpolator.h:222
vtkCameraInterpolator::ViewAngleInterpolator
vtkTupleInterpolator * ViewAngleInterpolator
Definition: vtkCameraInterpolator.h:223
vtkCameraInterpolator::GetMTime
vtkMTimeType GetMTime() override
Override GetMTime() because we depend on the interpolators which may be modified outside of this clas...
vtkCameraInterpolator::GetNumberOfCameras
int GetNumberOfCameras()
Return the number of cameras in the list of cameras.
vtkCameraInterpolator::FocalPointInterpolator
vtkTupleInterpolator * FocalPointInterpolator
Definition: vtkCameraInterpolator.h:221
vtkCameraInterpolator::PositionInterpolator
vtkTupleInterpolator * PositionInterpolator
Definition: vtkCameraInterpolator.h:220
vtkCameraInterpolator::INTERPOLATION_TYPE_SPLINE
@ INTERPOLATION_TYPE_SPLINE
Definition: vtkCameraInterpolator.h:118
vtkCameraInterpolator::RemoveCamera
void RemoveCamera(double t)
Delete the camera at a particular parameter t.
vtkCameraInterpolator::~vtkCameraInterpolator
~vtkCameraInterpolator() override
vtkCameraInterpolator::InterpolationType
int InterpolationType
Definition: vtkCameraInterpolator.h:217
vtkCameraInterpolator::SetViewUpInterpolator
virtual void SetViewUpInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the view up portion of the camera.
vtkCameraInterpolator::AddCamera
void AddCamera(double t, vtkCamera *camera)
Add another camera to the list of cameras defining the camera function.
vtkCameraInterpolator::CameraList
vtkCameraList * CameraList
Definition: vtkCameraInterpolator.h:233
vtkCameraInterpolator::SetViewAngleInterpolator
virtual void SetViewAngleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the view angle portion of the camera.
vtkCameraInterpolator::GetMinimumT
double GetMinimumT()
Obtain some information about the interpolation range.
vtkCameraInterpolator::New
static vtkCameraInterpolator * New()
Instantiate the class.
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::SetInterpolationTypeToManual
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkCameraInterpolator.h:137
vtkCameraInterpolator::GetMaximumT
double GetMaximumT()
Obtain some information about the interpolation range.
vtkCameraInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkTupleInterpolator
interpolate a tuple of arbitrary size
Definition: vtkTupleInterpolator.h:55
vtkX3D::PositionInterpolator
@ PositionInterpolator
Definition: vtkX3D.h:145
vtkObject.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270