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
abstract representation for a spline.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
interface that can be inherited to define handler sources for any kind of interaction.
a simple class to control print indentation
Definition: vtkIndent.h:34
parametric function for 1D interpolating splines
handle source used to represent points.
represent and manipulate 3D points
Definition: vtkPoints.h:34
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
representation for a spline.
void BuildRepresentation() override
Method that satisfy vtkWidgetRepresentation API.
void AllocateHandles(int npts)
Allocate/Reallocate the handles according to npts.
~vtkSplineRepresentation() override
void ClearHandles()
Delete all the handles.
void CreateDefaultHandles(int npts)
Create npts default handles.
int InsertHandleOnLine(double *pos) override
Specialized method to insert a handle on the spline.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkSplineRepresentation * New()
void SetParametricSpline(vtkParametricSpline *spline) override
Set the parametric spline object.
vtkHandleSource * GetHandleSource(int index) override
void ReconfigureHandles(int npts)
Recreate the handles according to a number of points equal to npts.
virtual int GetHandleIndex(vtkProp *prop) override
returns handle index or -1 on fail
void InitializeHandles(vtkPoints *points) override
Convenience method to allocate and set the handles from a vtkPoints instance.
virtual void SetNumberOfHandles(int npts) override
Set the number of handles for this widget, while keeping a similar spline.
vtkActor * GetHandleActor(int index) override
@ points
Definition: vtkX3D.h:452
@ index
Definition: vtkX3D.h:252