VTK  9.3.0
vtkSplineRepresentation.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 vtkSplineRepresentation_h
20#define vtkSplineRepresentation_h
21
23#include "vtkInteractionWidgetsModule.h" // For export macro
24
25VTK_ABI_NAMESPACE_BEGIN
27
28class VTKINTERACTIONWIDGETS_EXPORT vtkSplineRepresentation : public vtkAbstractSplineRepresentation
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
39 void SetNumberOfHandles(int npts) override;
40
45
52 void InitializeHandles(vtkPoints* points) override;
53
60 void BuildRepresentation() override;
61
62protected:
65
69 int InsertHandleOnLine(double* pos) override;
70
75
80 void AllocateHandles(int npts);
81
85 void CreateDefaultHandles(int npts);
86
93 void ReconfigureHandles(int npts);
94
95 // Specialized methods to access handles
96 vtkActor* GetHandleActor(int index) override;
97 vtkHandleSource* GetHandleSource(int index) override;
98 int GetHandleIndex(vtkProp* prop) override;
99
100private:
102 void operator=(const vtkSplineRepresentation&) = delete;
103
104 void RebuildRepresentation();
105
106 // Glyphs representing hot spots (e.g., handles)
107 std::vector<vtkSmartPointer<vtkPointHandleSource>> PointHandles;
108 std::vector<vtkSmartPointer<vtkActor>> HandleActors;
109};
110
111VTK_ABI_NAMESPACE_END
112#endif
abstract representation for a spline.
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
interface that can be inherited to define handler sources for any kind of interaction.
a simple class to control print indentation
Definition vtkIndent.h:29
parametric function for 1D interpolating splines
handle source used to represent points.
represent and manipulate 3D points
Definition vtkPoints.h:29
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:43
representation for a spline.
vtkHandleSource * GetHandleSource(int index) override
void BuildRepresentation() override
Method that satisfy vtkWidgetRepresentation API.
void AllocateHandles(int npts)
Allocate/Reallocate the handles according to npts.
~vtkSplineRepresentation() override
vtkActor * GetHandleActor(int index) 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.
int GetHandleIndex(vtkProp *prop) override
returns handle index or -1 on fail
void SetParametricSpline(vtkParametricSpline *spline) override
Set the parametric spline object.
void SetNumberOfHandles(int npts) override
Set the number of handles for this widget, while keeping a similar spline.
void ReconfigureHandles(int npts)
Recreate the handles according to a number of points equal to npts.
void InitializeHandles(vtkPoints *points) override
Convenience method to allocate and set the handles from a vtkPoints instance.
static vtkSplineRepresentation * New()