VTK  9.2.6
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 
38 class vtkCamera;
39 
40 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraPathRepresentation
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52  void SetDirectional(bool val) override;
53 
58  void SetNumberOfHandles(int npts) override;
59 
63  void SetParametricSpline(vtkParametricSpline* spline) override;
64 
72  void InitializeHandles(vtkPoints* points) override;
73 
80  void BuildRepresentation() override;
81 
85  void AddCameraAt(vtkCamera* camera, int index);
86 
90  void DeleteCameraAt(int index);
91 
92 protected:
94  ~vtkCameraPathRepresentation() override = default;
95 
99  void SizeHandles() override;
100 
104  void ClearCameraHandles();
105 
110  void InsertCamera(vtkCamera* camera, int index);
111 
115  void CreateDefaultHandles(int npts);
116 
125  void ReconfigureHandles(int newNPts, int oldNPts);
126 
130  int InsertHandleOnLine(double* pos) override;
131 
135  void EraseHandle(const int&) override;
136 
137  // Specialized methods to access handles
138  vtkActor* GetHandleActor(int index) override;
139  vtkHandleSource* GetHandleSource(int index) override;
140  virtual int GetHandleIndex(vtkProp* prop) override;
141 
142 private:
144  void operator=(const vtkCameraPathRepresentation&) = delete;
145 
146  void RebuildRepresentation();
147 
148  void UpdateConfiguration(int npts);
149 
150  std::vector<vtkSmartPointer<vtkCameraHandleSource>> CameraHandles;
151  std::vector<vtkSmartPointer<vtkActor>> HandleActors;
152 };
153 
154 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
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:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
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.
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:39