VTK  9.1.0
vtkSeedWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSeedWidget.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=========================================================================*/
79#ifndef vtkSeedWidget_h
80#define vtkSeedWidget_h
81
82#include "vtkAbstractWidget.h"
83#include "vtkInteractionWidgetsModule.h" // For export macro
84
86class vtkHandleWidget;
87class vtkSeedList;
89
90class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
91{
92public:
96 static vtkSeedWidget* New();
97
99
103 void PrintSelf(ostream& os, vtkIndent indent) override;
105
111 void SetEnabled(int) override;
112
118
124
131 {
132 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
133 }
134
139 {
140 return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
141 }
142
147
153
163 virtual void CompleteInteraction();
164
169 virtual void RestartInteraction();
170
179
183 void DeleteSeed(int n);
184
189
191
194 vtkGetMacro(WidgetState, int);
196
197 // The state of the widget
198
199 enum
200 {
201 Start = 1,
202 PlacingSeeds = 2,
203 PlacedSeeds = 4,
204 MovingSeed = 8
205 };
206
207protected:
209 ~vtkSeedWidget() override;
210
212
213 // Callback interface to capture events when
214 // placing the widget.
220
221 // The positioning handle widgets
222 vtkSeedList* Seeds;
223
224 // Manipulating or defining ?
226
227private:
228 vtkSeedWidget(const vtkSeedWidget&) = delete;
229 void operator=(const vtkSeedWidget&) = delete;
230};
231
232#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:43
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition: vtkRenderer.h:73
represent the vtkSeedWidget
place multiple seed points
Definition: vtkSeedWidget.h:91
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:69