VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
70 
71 VTK_ABI_NAMESPACE_BEGIN
73 class vtkHandleWidget;
74 class vtkSeedList;
76 
77 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSeedWidget : public vtkAbstractWidget
78 {
79 public:
83  static vtkSeedWidget* New();
84 
86 
90  void PrintSelf(ostream& os, vtkIndent indent) override;
92 
98  void SetEnabled(int) override;
99 
104  void SetCurrentRenderer(vtkRenderer*) override;
105 
111 
118  {
119  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
120  }
121 
126  {
127  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
128  }
129 
133  void CreateDefaultRepresentation() override;
134 
139  void SetProcessEvents(vtkTypeBool) override;
140 
150  virtual void CompleteInteraction();
151 
156  virtual void RestartInteraction();
157 
165  virtual vtkHandleWidget* CreateNewHandle();
166 
170  void DeleteSeed(int n);
171 
175  vtkHandleWidget* GetSeed(int n);
176 
178 
181  vtkGetMacro(WidgetState, int);
183 
184  // The state of the widget
185 
186  enum
187  {
188  Start = 1,
189  PlacingSeeds = 2,
190  PlacedSeeds = 4,
191  MovingSeed = 8
192  };
193 
194 protected:
195  vtkSeedWidget();
196  ~vtkSeedWidget() override;
197 
199 
200  // Callback interface to capture events when
201  // placing the widget.
202  static void AddPointAction(vtkAbstractWidget*);
203  static void CompletedAction(vtkAbstractWidget*);
204  static void MoveAction(vtkAbstractWidget*);
205  static void EndSelectAction(vtkAbstractWidget*);
206  static void DeleteAction(vtkAbstractWidget*);
207 
208  // The positioning handle widgets
209  vtkSeedList* Seeds;
210 
211  // Manipulating or defining ?
212  int Defining;
213 
214 private:
215  vtkSeedWidget(const vtkSeedWidget&) = delete;
216  void operator=(const vtkSeedWidget&) = delete;
217 };
218 
219 VTK_ABI_NAMESPACE_END
220 #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:63
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:77
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...
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent the vtkSeedWidget