VTK: Interaction/Widgets/vtkSeedRepresentation.h Source File

| VTK 9.3.1

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
28 #ifndef vtkSeedRepresentation_h
29 #define vtkSeedRepresentation_h
30
31 #include "vtkInteractionWidgetsModule.h" // For export macro
32 #include "vtkWidgetRepresentation.h"
33
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkHandleList;
36 class vtkHandleRepresentation;
37
38 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedRepresentation : public vtkWidgetRepresentation
39 {
40 public:
44 static vtkSeedRepresentation* New();
45
47
50 vtkTypeMacro(vtkSeedRepresentation, vtkWidgetRepresentation);
51 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
61 virtual void GetSeedWorldPosition(unsigned int seedNum, double pos[3]);
62 virtual void SetSeedWorldPosition(unsigned int seedNum, double pos[3]);
63 virtual void SetSeedDisplayPosition(unsigned int seedNum, double pos[3]);
64 virtual void GetSeedDisplayPosition(unsigned int seedNum, double pos[3]);
66
70 int GetNumberOfSeeds();
71
80 void SetHandleRepresentation(vtkHandleRepresentation* handle);
81
87 vtkHandleRepresentation* GetHandleRepresentation(unsigned int num);
88
90
93 vtkHandleRepresentation* GetHandleRepresentation() { return this->HandleRepresentation; };
95
97
102 vtkSetClampMacro(Tolerance, int, 1, 100);
103 vtkGetMacro(Tolerance, int);
105
106 // Used to communicate about the state of the representation
107 enum
108 {
109 Outside = 0,
110 NearSeed
111 };
112
114
118 virtual int GetActiveHandle();
119 virtual void SetActiveHandle(int handleId);
120 // Returns the id of the seed created, -1 on failure. e is the display position.
121 virtual int CreateHandle(double e[2]);
122 // Delete last handle created
123 virtual void RemoveLastHandle();
124 // Delete the currently active handle
125 virtual void RemoveActiveHandle();
127
131 virtual void RemoveHandle(int n);
132
134
137 void BuildRepresentation() override;
138 int ComputeInteractionState(int X, int Y, int modify = 0) override;
139 void GetActors(vtkPropCollection*) override;
141
142 protected:
143 vtkSeedRepresentation();
144 ~vtkSeedRepresentation() override;
145
146 // The handle and the rep used to close the handles
147 vtkHandleRepresentation* HandleRepresentation;
148 vtkHandleList* Handles;
149
150 // Selection tolerance for the handles
151 int Tolerance;
152
153 // The active seed (handle) based on the last ComputeInteractionState()
154 int ActiveHandle;
155
156 private:
157 vtkSeedRepresentation(const vtkSeedRepresentation&) = delete;
158 void operator=(const vtkSeedRepresentation&) = delete;
159 };
160
161 VTK_ABI_NAMESPACE_END
162 #endif
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:37
vtkSeedRepresentation
represent the vtkSeedWidget
Definition: vtkSeedRepresentation.h:39
vtkSeedRepresentation::CreateHandle
virtual int CreateHandle(double e[2])
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkSeedRepresentation::GetNumberOfSeeds
int GetNumberOfSeeds()
Return the number of seeds (or handles) that have been created.
vtkSeedRepresentation::vtkSeedRepresentation
vtkSeedRepresentation()
vtkSeedRepresentation::~vtkSeedRepresentation
~vtkSeedRepresentation() override
vtkSeedRepresentation::SetActiveHandle
virtual void SetActiveHandle(int handleId)
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkSeedRepresentation::GetSeedWorldPosition
virtual void GetSeedWorldPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
vtkSeedRepresentation::Handles
vtkHandleList * Handles
Definition: vtkSeedRepresentation.h:148
vtkSeedRepresentation::GetActiveHandle
virtual int GetActiveHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkSeedRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkSeedRepresentation.h:147
vtkSeedRepresentation::SetSeedWorldPosition
virtual void SetSeedWorldPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
vtkSeedRepresentation::BuildRepresentation
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
vtkSeedRepresentation::New
static vtkSeedRepresentation * New()
Instantiate class.
vtkSeedRepresentation::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation(unsigned int num)
Get the handle representations used for a particular seed.
vtkSeedRepresentation::ActiveHandle
int ActiveHandle
Definition: vtkSeedRepresentation.h:154
vtkSeedRepresentation::Tolerance
int Tolerance
Definition: vtkSeedRepresentation.h:151
vtkSeedRepresentation::RemoveLastHandle
virtual void RemoveLastHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkSeedRepresentation::RemoveHandle
virtual void RemoveHandle(int n)
Remove the nth handle.
vtkSeedRepresentation::SetHandleRepresentation
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the internal vtkHandleWid...
vtkSeedRepresentation::GetActors
void GetActors(vtkPropCollection *) override
These are methods that satisfy vtkWidgetRepresentation's API.
vtkSeedRepresentation::RemoveActiveHandle
virtual void RemoveActiveHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkSeedRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
vtkSeedRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
vtkSeedRepresentation::SetSeedDisplayPosition
virtual void SetSeedDisplayPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
vtkSeedRepresentation::GetSeedDisplayPosition
virtual void GetSeedDisplayPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
vtkSeedRepresentation::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation()
Returns the model HandleRepresentation.
Definition: vtkSeedRepresentation.h:93
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:65
vtkWidgetRepresentation.h