VTK  9.7.1
vtkCameraPathRepresentation.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
19 #ifndef vtkCameraPathRepresentation_h
20 #define vtkCameraPathRepresentation_h
21 
23 #include "vtkInteractionWidgetsModule.h" // For export macro
24 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25 
26 VTK_ABI_NAMESPACE_BEGIN
28 class vtkCamera;
29 
30 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCameraPathRepresentation
32 {
33 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
42  void SetDirectional(bool val) override;
43 
48  void SetNumberOfHandles(int npts) override;
49 
53  void SetParametricSpline(vtkParametricSpline* spline) override;
54 
62  void InitializeHandles(vtkPoints* points) override;
63 
70  void BuildRepresentation() override;
71 
75  void AddCameraAt(vtkCamera* camera, int index);
76 
80  void DeleteCameraAt(int index);
81 
82 protected:
84  ~vtkCameraPathRepresentation() override = default;
85 
89  void SizeHandles() override;
90 
94  void ClearCameraHandles();
95 
100  void InsertCamera(vtkCamera* camera, int index);
101 
105  void CreateDefaultHandles(int npts);
106 
115  void ReconfigureHandles(int newNPts, int oldNPts);
116 
120  int InsertHandleOnLine(double* pos) override;
121 
125  void EraseHandle(const int&) override;
126 
127  // Specialized methods to access handles
128  vtkActor* GetHandleActor(int index) override;
129  vtkHandleSource* GetHandleSource(int index) override;
130  int GetHandleIndex(vtkProp* prop) override;
131 
132 private:
134  void operator=(const vtkCameraPathRepresentation&) = delete;
135 
136  void RebuildRepresentation();
137 
138  void UpdateConfiguration(int npts);
139 
140  std::vector<vtkSmartPointer<vtkCameraHandleSource>> CameraHandles;
141  std::vector<vtkSmartPointer<vtkActor>> HandleActors;
142 };
143 
144 VTK_ABI_NAMESPACE_END
145 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
virtual void InitializeHandles(vtkPoints *points)=0
Convenience method to allocate and set the handles from a vtkPoints instance.
abstract representation for a spline.
virtual void SetParametricSpline(vtkParametricSpline *spline)
Set the parametric spline object.
virtual void SizeHandles()
interface that can be inherited to define handler sources for any kind of interaction.
virtual int GetHandleIndex(vtkProp *prop)=0
returns handle index or -1 on fail
handle source used to represent one camera.
virtual void SetNumberOfHandles(int npts)=0
Set/Get the number of handles for this widget.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkHandleSource * GetHandleSource(int index)=0
representation for a camera path.
parametric function for 1D interpolating splines
virtual void SetDirectional(bool val)
Set the representation to be directional or not.
a simple class to control print indentation
Definition: vtkIndent.h:28
a virtual camera for 3D rendering
Definition: vtkCamera.h:41
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation API.
virtual void EraseHandle(const int &)
virtual vtkActor * GetHandleActor(int index)=0
virtual int InsertHandleOnLine(double *pos)=0
Returns the position of insertion or -1 on fail.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:30