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
73 #ifndef vtkSeedWidget_h
74 #define vtkSeedWidget_h
75 
76 #include "vtkAbstractWidget.h"
77 #include "vtkInteractionWidgetsModule.h" // For export macro
78 
79 VTK_ABI_NAMESPACE_BEGIN
81 class vtkHandleWidget;
82 class vtkSeedList;
84 
85 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
86 {
87 public:
91  static vtkSeedWidget* New();
92 
94 
98  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
106  void SetEnabled(int) override;
107 
113 
119 
126  {
127  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
128  }
129 
134  {
135  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
136  }
137 
142 
148 
158  virtual void CompleteInteraction();
159 
164  virtual void RestartInteraction();
165 
174 
178  void DeleteSeed(int n);
179 
184 
186 
189  vtkGetMacro(WidgetState, int);
191 
192  // The state of the widget
193 
194  enum
195  {
196  Start = 1,
197  PlacingSeeds = 2,
198  PlacedSeeds = 4,
199  MovingSeed = 8
200  };
201 
202 protected:
204  ~vtkSeedWidget() override;
205 
207 
208  // Callback interface to capture events when
209  // placing the widget.
215 
216  // The positioning handle widgets
217  vtkSeedList* Seeds;
218 
219  // Manipulating or defining ?
220  int Defining;
221 
222 private:
223  vtkSeedWidget(const vtkSeedWidget&) = delete;
224  void operator=(const vtkSeedWidget&) = delete;
225 };
226 
227 VTK_ABI_NAMESPACE_END
228 #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:38
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition: vtkRenderer.h:71
represent the vtkSeedWidget
place multiple seed points
Definition: vtkSeedWidget.h:86
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:64