VTK  9.1.0
vtkSplineRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSplineRepresentation.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 vtkSplineRepresentation_h
29 #define vtkSplineRepresentation_h
30 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
33 
35 
36 class VTKINTERACTIONWIDGETS_EXPORT vtkSplineRepresentation : public vtkAbstractSplineRepresentation
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
47  virtual void SetNumberOfHandles(int npts) override;
48 
52  void SetParametricSpline(vtkParametricSpline* spline) override;
53 
61 
68  void BuildRepresentation() override;
69 
70 protected:
73 
77  int InsertHandleOnLine(double* pos) override;
78 
82  void ClearHandles();
83 
88  void AllocateHandles(int npts);
89 
93  void CreateDefaultHandles(int npts);
94 
101  void ReconfigureHandles(int npts);
102 
103  // Specialized methods to access handles
104  vtkActor* GetHandleActor(int index) override;
106  virtual int GetHandleIndex(vtkProp* prop) override;
107 
108 private:
110  void operator=(const vtkSplineRepresentation&) = delete;
111 
112  void RebuildRepresentation();
113 
114  // Glyphs representing hot spots (e.g., handles)
115  std::vector<vtkSmartPointer<vtkPointHandleSource>> PointHandles;
116  std::vector<vtkSmartPointer<vtkActor>> HandleActors;
117 };
118 
119 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkSplineRepresentation::~vtkSplineRepresentation
~vtkSplineRepresentation() override
vtkPointHandleSource
handle source used to represent points.
Definition: vtkPointHandleSource.h:36
vtkSplineRepresentation::InsertHandleOnLine
int InsertHandleOnLine(double *pos) override
Specialized method to insert a handle on the spline.
vtkSplineRepresentation::AllocateHandles
void AllocateHandles(int npts)
Allocate/Reallocate the handles according to npts.
vtkParametricSpline
parametric function for 1D interpolating splines
Definition: vtkParametricSpline.h:137
vtkHandleSource
interface that can be inherited to define handler sources for any kind of interaction.
Definition: vtkHandleSource.h:34
vtkSplineRepresentation::InitializeHandles
void InitializeHandles(vtkPoints *points) override
Convenience method to allocate and set the handles from a vtkPoints instance.
vtkX3D::points
@ points
Definition: vtkX3D.h:452
vtkSplineRepresentation::CreateDefaultHandles
void CreateDefaultHandles(int npts)
Create npts default handles.
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkSplineRepresentation::ClearHandles
void ClearHandles()
Delete all the handles.
vtkAbstractSplineRepresentation.h
vtkSplineRepresentation::GetHandleIndex
virtual int GetHandleIndex(vtkProp *prop) override
returns handle index or -1 on fail
vtkSplineRepresentation::BuildRepresentation
void BuildRepresentation() override
Method that satisfy vtkWidgetRepresentation API.
vtkSplineRepresentation::New
static vtkSplineRepresentation * New()
vtkSplineRepresentation::SetParametricSpline
void SetParametricSpline(vtkParametricSpline *spline) override
Set the parametric spline object.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
vtkSplineRepresentation::vtkSplineRepresentation
vtkSplineRepresentation()
vtkSplineRepresentation::GetHandleActor
vtkActor * GetHandleActor(int index) override
vtkSplineRepresentation::ReconfigureHandles
void ReconfigureHandles(int npts)
Recreate the handles according to a number of points equal to npts.
vtkAbstractSplineRepresentation
abstract representation for a spline.
Definition: vtkAbstractSplineRepresentation.h:35
vtkSplineRepresentation::SetNumberOfHandles
virtual void SetNumberOfHandles(int npts) override
Set the number of handles for this widget, while keeping a similar spline.
vtkSplineRepresentation
representation for a spline.
Definition: vtkSplineRepresentation.h:37
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkSplineRepresentation::GetHandleSource
vtkHandleSource * GetHandleSource(int index) override
vtkSplineRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.