VTK  9.2.20230606
vtkCameraPathRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCameraPathRepresentation.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 =========================================================================*/
31 #ifndef vtkCameraPathRepresentation_h
32 #define vtkCameraPathRepresentation_h
33 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
36 
37 VTK_ABI_NAMESPACE_BEGIN
39 class vtkCamera;
40 
41 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraPathRepresentation
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  void SetDirectional(bool val) override;
54 
59  void SetNumberOfHandles(int npts) override;
60 
64  void SetParametricSpline(vtkParametricSpline* spline) override;
65 
74 
81  void BuildRepresentation() override;
82 
86  void AddCameraAt(vtkCamera* camera, int index);
87 
91  void DeleteCameraAt(int index);
92 
93 protected:
95  ~vtkCameraPathRepresentation() override = default;
96 
100  void SizeHandles() override;
101 
106 
111  void InsertCamera(vtkCamera* camera, int index);
112 
116  void CreateDefaultHandles(int npts);
117 
126  void ReconfigureHandles(int newNPts, int oldNPts);
127 
131  int InsertHandleOnLine(double* pos) override;
132 
136  void EraseHandle(const int&) override;
137 
138  // Specialized methods to access handles
139  vtkActor* GetHandleActor(int index) override;
141  int GetHandleIndex(vtkProp* prop) override;
142 
143 private:
145  void operator=(const vtkCameraPathRepresentation&) = delete;
146 
147  void RebuildRepresentation();
148 
149  void UpdateConfiguration(int npts);
150 
151  std::vector<vtkSmartPointer<vtkCameraHandleSource>> CameraHandles;
152  std::vector<vtkSmartPointer<vtkActor>> HandleActors;
153 };
154 
155 VTK_ABI_NAMESPACE_END
156 #endif
abstract representation for a spline.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
handle source used to represent one camera.
representation for a camera path.
vtkActor * GetHandleActor(int index) override
void SetNumberOfHandles(int npts) override
Adjust the number of camera handles while keeping the same path.
void CreateDefaultHandles(int npts)
Create/Recreate npts default camera handles.
static vtkCameraPathRepresentation * New()
void BuildRepresentation() override
Method that satisfy vtkWidgetRepresentation API.
int InsertHandleOnLine(double *pos) override
Specialized method to insert a camera handle on the camera path.
void SetParametricSpline(vtkParametricSpline *spline) override
Set the parametric spline object.
void SetDirectional(bool val) override
Sets the representation to be a curve interpolating multiple cameras pointing to their focal point.
void SizeHandles() override
Resize the camera handles on demand.
int GetHandleIndex(vtkProp *prop) override
returns handle index or -1 on fail
void ClearCameraHandles()
Delete all camera handles.
void EraseHandle(const int &) override
Specialized method to erase a camera handle from the camera path.
void AddCameraAt(vtkCamera *camera, int index)
Add a camera to the path.
~vtkCameraPathRepresentation() override=default
vtkHandleSource * GetHandleSource(int index) override
void InsertCamera(vtkCamera *camera, int index)
Creates a new handle from a vtkcamera and insert it in the handles collection.
void InitializeHandles(vtkPoints *points) override
Convenience method to allocate and set the Camera handles from a vtkPoints instance (corresponding to...
void DeleteCameraAt(int index)
Remove a camera from the path.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ReconfigureHandles(int newNPts, int oldNPts)
Recreate the handles according to a number of points equal to newNPts.
a virtual camera for 3D rendering
Definition: vtkCamera.h:162
interface that can be inherited to define handler sources for any kind of interaction.
a simple class to control print indentation
Definition: vtkIndent.h:120
parametric function for 1D interpolating splines
represent and manipulate 3D points
Definition: vtkPoints.h:150
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:77
@ points
Definition: vtkX3D.h:458
@ index
Definition: vtkX3D.h:258