VTK  9.2.20230603
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 =========================================================================*/
115 #ifndef vtkSeedWidget_h
116 #define vtkSeedWidget_h
117 
118 #include "vtkAbstractWidget.h"
119 #include "vtkInteractionWidgetsModule.h" // For export macro
120 
121 VTK_ABI_NAMESPACE_BEGIN
123 class vtkHandleWidget;
124 class vtkSeedList;
126 
127 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
128 {
129 public:
133  static vtkSeedWidget* New();
134 
136 
140  void PrintSelf(ostream& os, vtkIndent indent) override;
142 
148  void SetEnabled(int) override;
149 
155 
161 
168  {
169  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
170  }
171 
176  {
177  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
178  }
179 
184 
190 
200  virtual void CompleteInteraction();
201 
206  virtual void RestartInteraction();
207 
216 
220  void DeleteSeed(int n);
221 
226 
228 
231  vtkGetMacro(WidgetState, int);
233 
234  // The state of the widget
235 
236  enum
237  {
238  Start = 1,
239  PlacingSeeds = 2,
240  PlacedSeeds = 4,
241  MovingSeed = 8
242  };
243 
244 protected:
246  ~vtkSeedWidget() override;
247 
249 
250  // Callback interface to capture events when
251  // placing the widget.
257 
258  // The positioning handle widgets
259  vtkSeedList* Seeds;
260 
261  // Manipulating or defining ?
262  int Defining;
263 
264 private:
265  vtkSeedWidget(const vtkSeedWidget&) = delete;
266  void operator=(const vtkSeedWidget&) = delete;
267 };
268 
269 VTK_ABI_NAMESPACE_END
270 #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:120
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition: vtkRenderer.h:183
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.
vtkSeedRepresentation * GetSeedRepresentation()
Return the representation as a vtkSeedRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
~vtkSeedWidget() override
static vtkSeedWidget * New()
Instantiate this class.
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 *)
void SetCurrentRenderer(vtkRenderer *) override
Set the current renderer.
static void DeleteAction(vtkAbstractWidget *)
vtkHandleWidget * GetSeed(int n)
Get the nth seed.
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:71