VTK  9.3.1
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 
70 VTK_ABI_NAMESPACE_BEGIN
72 class vtkHandleWidget;
73 class vtkSeedList;
75 
76 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
77 {
78 public:
82  static vtkSeedWidget* New();
83 
85 
89  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
97  void SetEnabled(int) override;
98 
103  void SetCurrentRenderer(vtkRenderer*) override;
104 
110 
117  {
118  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
119  }
120 
125  {
126  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
127  }
128 
132  void CreateDefaultRepresentation() override;
133 
138  void SetProcessEvents(vtkTypeBool) override;
139 
149  virtual void CompleteInteraction();
150 
155  virtual void RestartInteraction();
156 
164  virtual vtkHandleWidget* CreateNewHandle();
165 
169  void DeleteSeed(int n);
170 
174  vtkHandleWidget* GetSeed(int n);
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 
193 protected:
194  vtkSeedWidget();
195  ~vtkSeedWidget() override;
196 
198 
199  // Callback interface to capture events when
200  // placing the widget.
201  static void AddPointAction(vtkAbstractWidget*);
202  static void CompletedAction(vtkAbstractWidget*);
203  static void MoveAction(vtkAbstractWidget*);
204  static void EndSelectAction(vtkAbstractWidget*);
205  static void DeleteAction(vtkAbstractWidget*);
206 
207  // The positioning handle widgets
208  vtkSeedList* Seeds;
209 
210  // Manipulating or defining ?
211  int Defining;
212 
213 private:
214  vtkSeedWidget(const vtkSeedWidget&) = delete;
215  void operator=(const vtkSeedWidget&) = delete;
216 };
217 
218 VTK_ABI_NAMESPACE_END
219 #endif
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
This method is used to associate the widget with the render window interactor.
abstract class for representing widget handles
vtkSeedList * Seeds
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
abstract specification for renderers
Definition: vtkRenderer.h:61
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkSeedRepresentation * GetSeedRepresentation()
Return the representation as a vtkSeedRepresentation.
place multiple seed points
Definition: vtkSeedWidget.h:76
vtkWidgetRepresentation * WidgetRep
int vtkTypeBool
Definition: vtkABI.h:64
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void SetCurrentRenderer(vtkRenderer *)
Set/Get the current renderer.
define the API for widget / widget representation
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
void SetEnabled(int) override
Methods for activating this widget.
void SetRepresentation(vtkSeedRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent the vtkSeedWidget