VTK  9.1.0
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=========================================================================*/
28#ifndef vtkCameraPathRepresentation_h
29#define vtkCameraPathRepresentation_h
30
32#include "vtkInteractionWidgetsModule.h" // For export macro
33
35class vtkCamera;
36
37class VTKINTERACTIONWIDGETS_EXPORT vtkCameraPathRepresentation
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
49 void SetDirectional(bool val) override;
50
55 void SetNumberOfHandles(int npts) override;
56
61
70
77 void BuildRepresentation() override;
78
82 void AddCameraAt(vtkCamera* camera, int index);
83
88
89protected:
91 ~vtkCameraPathRepresentation() override = default;
92
96 void SizeHandles() override;
97
102
107 void InsertCamera(vtkCamera* camera, int index);
108
112 void CreateDefaultHandles(int npts);
113
122 void ReconfigureHandles(int newNPts, int oldNPts);
123
127 int InsertHandleOnLine(double* pos) override;
128
132 void EraseHandle(const int&) override;
133
134 // Specialized methods to access handles
137 virtual int GetHandleIndex(vtkProp* prop) override;
138
139private:
141 void operator=(const vtkCameraPathRepresentation&) = delete;
142
143 void RebuildRepresentation();
144
145 void UpdateConfiguration(int npts);
146
147 std::vector<vtkSmartPointer<vtkCameraHandleSource>> CameraHandles;
148 std::vector<vtkSmartPointer<vtkActor>> HandleActors;
149};
150
151#endif
abstract representation for a spline.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
handle source used to represent one camera.
representation for a camera path.
void SetNumberOfHandles(int npts) override
Adjust the number of camera handles while keeping the same path.
vtkHandleSource * GetHandleSource(int index) override
void CreateDefaultHandles(int npts)
Create/Recreate npts default camera handles.
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.
vtkActor * GetHandleActor(int index) override
void SetDirectional(bool val) override
Sets the representation to be a curve interpolating multiple cameras pointing to their focal point.
static vtkCameraPathRepresentation * New()
void SizeHandles() override
Resize the camera handles on demand.
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
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.
virtual int GetHandleIndex(vtkProp *prop) override
returns handle index or -1 on fail
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:155
interface that can be inherited to define handler sources for any kind of interaction.
a simple class to control print indentation
Definition: vtkIndent.h:113
parametric function for 1D interpolating splines
represent and manipulate 3D points
Definition: vtkPoints.h:143
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:67
@ points
Definition: vtkX3D.h:452
@ index
Definition: vtkX3D.h:252