VTK  9.0.1
vtkSeedWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSeedWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
70 #ifndef vtkSeedWidget_h
71 #define vtkSeedWidget_h
72 
73 #include "vtkAbstractWidget.h"
74 #include "vtkInteractionWidgetsModule.h" // For export macro
75 
77 class vtkHandleWidget;
78 class vtkSeedList;
80 
81 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
82 {
83 public:
87  static vtkSeedWidget* New();
88 
90 
94  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
102  void SetEnabled(int) override;
103 
108  void SetCurrentRenderer(vtkRenderer*) override;
109 
115 
122  {
123  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
124  }
125 
130  {
131  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
132  }
133 
137  void CreateDefaultRepresentation() override;
138 
143  void SetProcessEvents(vtkTypeBool) override;
144 
154  virtual void CompleteInteraction();
155 
160  virtual void RestartInteraction();
161 
169  virtual vtkHandleWidget* CreateNewHandle();
170 
174  void DeleteSeed(int n);
175 
179  vtkHandleWidget* GetSeed(int n);
180 
182 
185  vtkGetMacro(WidgetState, int);
187 
188  // The state of the widget
189 
190  enum
191  {
192  Start = 1,
193  PlacingSeeds = 2,
194  PlacedSeeds = 4,
195  MovingSeed = 8
196  };
197 
198 protected:
199  vtkSeedWidget();
200  ~vtkSeedWidget() override;
201 
203 
204  // Callback interface to capture events when
205  // placing the widget.
206  static void AddPointAction(vtkAbstractWidget*);
207  static void CompletedAction(vtkAbstractWidget*);
208  static void MoveAction(vtkAbstractWidget*);
209  static void EndSelectAction(vtkAbstractWidget*);
210  static void DeleteAction(vtkAbstractWidget*);
211 
212  // The positioning handle widgets
213  vtkSeedList* Seeds;
214 
215  // Manipulating or defining ?
216  int Defining;
217 
218 private:
219  vtkSeedWidget(const vtkSeedWidget&) = delete;
220  void operator=(const vtkSeedWidget&) = delete;
221 };
222 
223 #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:58
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:81
vtkWidgetRepresentation * WidgetRep
int vtkTypeBool
Definition: vtkABI.h:69
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:33
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