VTK  9.3.20240329
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
109 
110 VTK_ABI_NAMESPACE_BEGIN
112 class vtkHandleWidget;
113 class vtkSeedList;
115 
116 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSeedWidget : public vtkAbstractWidget
117 {
118 public:
122  static vtkSeedWidget* New();
123 
125 
129  void PrintSelf(ostream& os, vtkIndent indent) override;
131 
137  void SetEnabled(int) override;
138 
144 
150 
157  {
158  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
159  }
160 
165  {
166  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
167  }
168 
173 
179 
189  virtual void CompleteInteraction();
190 
195  virtual void RestartInteraction();
196 
205 
209  void DeleteSeed(int n);
210 
215 
217 
220  vtkGetMacro(WidgetState, int);
222 
223  // The state of the widget
224 
225  enum
226  {
227  Start = 1,
228  PlacingSeeds = 2,
229  PlacedSeeds = 4,
230  MovingSeed = 8
231  };
232 
233 protected:
235  ~vtkSeedWidget() override;
236 
238 
239  // Callback interface to capture events when
240  // placing the widget.
246 
247  // The positioning handle widgets
248  vtkSeedList* Seeds;
249 
250  // Manipulating or defining ?
251  int Defining;
252 
253 private:
254  vtkSeedWidget(const vtkSeedWidget&) = delete;
255  void operator=(const vtkSeedWidget&) = delete;
256 };
257 
258 VTK_ABI_NAMESPACE_END
259 #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:172
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
#define VTK_MARSHALAUTO