VTK  9.5.2
vtkSeedRepresentation.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
18
19#ifndef vtkSeedRepresentation_h
20#define vtkSeedRepresentation_h
21
22#include "vtkInteractionWidgetsModule.h" // For export macro
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkHandleList;
29
30class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSeedRepresentation
32{
33public:
38
40
44 void PrintSelf(ostream& os, vtkIndent indent) override;
46
48
54 virtual void GetSeedWorldPosition(unsigned int seedNum, double pos[3]);
55 virtual void SetSeedWorldPosition(unsigned int seedNum, double pos[3]);
56 virtual void SetSeedDisplayPosition(unsigned int seedNum, double pos[3]);
57 virtual void GetSeedDisplayPosition(unsigned int seedNum, double pos[3]);
59
64
74
81
83
88
90
95 vtkSetClampMacro(Tolerance, int, 1, 100);
96 vtkGetMacro(Tolerance, int);
98
99 // Used to communicate about the state of the representation
100 enum
101 {
104 };
105
107
111 virtual int GetActiveHandle();
112 virtual void SetActiveHandle(int handleId);
113 // Returns the id of the seed created, -1 on failure. e is the display position.
114 virtual int CreateHandle(double e[2]);
115 // Delete last handle created
116 virtual void RemoveLastHandle();
117 // Delete the currently active handle
118 virtual void RemoveActiveHandle();
120
124 virtual void RemoveHandle(int n);
125
127
130 void BuildRepresentation() override;
131 int ComputeInteractionState(int X, int Y, int modify = 0) override;
134
135protected:
138
139 // The handle and the rep used to close the handles
141 vtkHandleList* Handles;
142
143 // Selection tolerance for the handles
145
146 // The active seed (handle) based on the last ComputeInteractionState()
148
149private:
151 void operator=(const vtkSeedRepresentation&) = delete;
152};
153
154VTK_ABI_NAMESPACE_END
155#endif
abstract class for representing widget handles
a simple class to control print indentation
Definition vtkIndent.h:29
an ordered list of Props
virtual int CreateHandle(double e[2])
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
int GetNumberOfSeeds()
Return the number of seeds (or handles) that have been created.
~vtkSeedRepresentation() override
virtual void SetActiveHandle(int handleId)
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
virtual void GetSeedWorldPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
virtual int GetActiveHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkHandleRepresentation * HandleRepresentation
virtual void SetSeedWorldPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void RemoveLastHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
virtual void RemoveHandle(int n)
Remove the nth handle.
vtkHandleRepresentation * GetHandleRepresentation()
Returns the model HandleRepresentation.
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the internal vtkHandleWid...
vtkHandleRepresentation * GetHandleRepresentation(unsigned int num)
Get the handle representations used for a particular seed.
void GetActors(vtkPropCollection *) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void RemoveActiveHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
int ComputeInteractionState(int X, int Y, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual void SetSeedDisplayPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
virtual void GetSeedDisplayPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
static vtkSeedRepresentation * New()
Instantiate class.
#define VTK_MARSHALAUTO