VTK  9.3.20240420
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26VTK_ABI_NAMESPACE_BEGIN
28
29class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSplineRepresentation
31{
32public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
41 void SetNumberOfHandles(int npts) override;
42
47
54 void InitializeHandles(vtkPoints* points) override;
55
62 void BuildRepresentation() override;
63
64protected:
67
71 int InsertHandleOnLine(double* pos) override;
72
77
82 void AllocateHandles(int npts);
83
87 void CreateDefaultHandles(int npts);
88
95 void ReconfigureHandles(int npts);
96
97 // Specialized methods to access handles
98 vtkActor* GetHandleActor(int index) override;
99 vtkHandleSource* GetHandleSource(int index) override;
100 int GetHandleIndex(vtkProp* prop) override;
101
102private:
104 void operator=(const vtkSplineRepresentation&) = delete;
105
106 void RebuildRepresentation();
107
108 // Glyphs representing hot spots (e.g., handles)
109 std::vector<vtkSmartPointer<vtkPointHandleSource>> PointHandles;
110 std::vector<vtkSmartPointer<vtkActor>> HandleActors;
111};
112
113VTK_ABI_NAMESPACE_END
114#endif
abstract representation for a spline.
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
interface that can be inherited to define handler sources for any kind of interaction.
a simple class to control print indentation
Definition vtkIndent.h:108
parametric function for 1D interpolating splines
handle source used to represent points.
represent and manipulate 3D points
Definition vtkPoints.h:139
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
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()
#define VTK_MARSHALAUTO