VTK  9.3.0
vtkSeedWidget.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
64#ifndef vtkSeedWidget_h
65#define vtkSeedWidget_h
66
67#include "vtkAbstractWidget.h"
68#include "vtkInteractionWidgetsModule.h" // For export macro
69
70VTK_ABI_NAMESPACE_BEGIN
72class vtkHandleWidget;
73class vtkSeedList;
75
76class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
77{
78public:
82 static vtkSeedWidget* New();
83
85
89 void PrintSelf(ostream& os, vtkIndent indent) override;
91
97 void SetEnabled(int) override;
98
104
110
117 {
118 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
119 }
120
125 {
126 return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
127 }
128
133
139
149 virtual void CompleteInteraction();
150
155 virtual void RestartInteraction();
156
165
169 void DeleteSeed(int n);
170
175
177
180 vtkGetMacro(WidgetState, int);
182
183 // The state of the widget
184
185 enum
186 {
187 Start = 1,
188 PlacingSeeds = 2,
189 PlacedSeeds = 4,
190 MovingSeed = 8
191 };
192
193protected:
195 ~vtkSeedWidget() override;
196
198
199 // Callback interface to capture events when
200 // placing the widget.
206
207 // The positioning handle widgets
208 vtkSeedList* Seeds;
209
210 // Manipulating or defining ?
212
213private:
214 vtkSeedWidget(const vtkSeedWidget&) = delete;
215 void operator=(const vtkSeedWidget&) = delete;
216};
217
218VTK_ABI_NAMESPACE_END
219#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
abstract class for representing widget handles
a general widget for moving handles
a simple class to control print indentation
Definition vtkIndent.h:29
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition vtkRenderer.h:62
represent the vtkSeedWidget
place multiple seed points
virtual void CompleteInteraction()
Method to be called when the seed widget should stop responding to the place point interaction.
void DeleteSeed(int n)
Delete the nth seed.
static void EndSelectAction(vtkAbstractWidget *)
~vtkSeedWidget() override
vtkHandleWidget * GetSeed(int n)
Get the nth seed.
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkSeedList * Seeds
static void CompletedAction(vtkAbstractWidget *)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
void SetEnabled(int) override
The method for activating and deactivating this widget.
virtual void RestartInteraction()
Method to be called when the seed widget should start responding to the interaction.
static void MoveAction(vtkAbstractWidget *)
void SetInteractor(vtkRenderWindowInteractor *) override
Set the interactor.
static void AddPointAction(vtkAbstractWidget *)
static vtkSeedWidget * New()
Instantiate this class.
void SetCurrentRenderer(vtkRenderer *) override
Set the current renderer.
static void DeleteAction(vtkAbstractWidget *)
vtkSeedRepresentation * GetSeedRepresentation()
Return the representation as a vtkSeedRepresentation.
virtual vtkHandleWidget * CreateNewHandle()
Use this method to programmatically create a new handle.
void SetRepresentation(vtkSeedRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64