VTK  9.2.5
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=========================================================================*/
31#ifndef vtkSplineRepresentation_h
32#define vtkSplineRepresentation_h
33
35#include "vtkInteractionWidgetsModule.h" // For export macro
36
38
39class VTKINTERACTIONWIDGETS_EXPORT vtkSplineRepresentation : public vtkAbstractSplineRepresentation
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50 virtual void SetNumberOfHandles(int npts) override;
51
56
63 void InitializeHandles(vtkPoints* points) override;
64
71 void BuildRepresentation() override;
72
73protected:
76
80 int InsertHandleOnLine(double* pos) override;
81
86
91 void AllocateHandles(int npts);
92
96 void CreateDefaultHandles(int npts);
97
104 void ReconfigureHandles(int npts);
105
106 // Specialized methods to access handles
107 vtkActor* GetHandleActor(int index) override;
108 vtkHandleSource* GetHandleSource(int index) override;
109 virtual int GetHandleIndex(vtkProp* prop) override;
110
111private:
113 void operator=(const vtkSplineRepresentation&) = delete;
114
115 void RebuildRepresentation();
116
117 // Glyphs representing hot spots (e.g., handles)
118 std::vector<vtkSmartPointer<vtkPointHandleSource>> PointHandles;
119 std::vector<vtkSmartPointer<vtkActor>> HandleActors;
120};
121
122#endif
abstract representation for a spline.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
interface that can be inherited to define handler sources for any kind of interaction.
a simple class to control print indentation
Definition: vtkIndent.h:40
parametric function for 1D interpolating splines
handle source used to represent points.
represent and manipulate 3D points
Definition: vtkPoints.h:40
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
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.
void SetParametricSpline(vtkParametricSpline *spline) override
Set the parametric spline object.
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.
static vtkSplineRepresentation * New()