VTK  9.3.20231207
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
103 #ifndef vtkSeedWidget_h
104 #define vtkSeedWidget_h
105 
106 #include "vtkAbstractWidget.h"
107 #include "vtkInteractionWidgetsModule.h" // For export macro
108 
109 VTK_ABI_NAMESPACE_BEGIN
111 class vtkHandleWidget;
112 class vtkSeedList;
114 
115 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
116 {
117 public:
121  static vtkSeedWidget* New();
122 
124 
128  void PrintSelf(ostream& os, vtkIndent indent) override;
130 
136  void SetEnabled(int) override;
137 
143 
149 
156  {
157  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
158  }
159 
164  {
165  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
166  }
167 
172 
178 
188  virtual void CompleteInteraction();
189 
194  virtual void RestartInteraction();
195 
204 
208  void DeleteSeed(int n);
209 
214 
216 
219  vtkGetMacro(WidgetState, int);
221 
222  // The state of the widget
223 
224  enum
225  {
226  Start = 1,
227  PlacingSeeds = 2,
228  PlacedSeeds = 4,
229  MovingSeed = 8
230  };
231 
232 protected:
234  ~vtkSeedWidget() override;
235 
237 
238  // Callback interface to capture events when
239  // placing the widget.
245 
246  // The positioning handle widgets
247  vtkSeedList* Seeds;
248 
249  // Manipulating or defining ?
250  int Defining;
251 
252 private:
253  vtkSeedWidget(const vtkSeedWidget&) = delete;
254  void operator=(const vtkSeedWidget&) = delete;
255 };
256 
257 VTK_ABI_NAMESPACE_END
258 #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:108
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition: vtkRenderer.h:171
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:64