VTK  9.0.20201029
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 =========================================================================*/
76 #ifndef vtkSeedWidget_h
77 #define vtkSeedWidget_h
78 
79 #include "vtkAbstractWidget.h"
80 #include "vtkInteractionWidgetsModule.h" // For export macro
81 
83 class vtkHandleWidget;
84 class vtkSeedList;
86 
87 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
88 {
89 public:
93  static vtkSeedWidget* New();
94 
96 
100  void PrintSelf(ostream& os, vtkIndent indent) override;
102 
108  void SetEnabled(int) override;
109 
114  void SetCurrentRenderer(vtkRenderer*) override;
115 
121 
128  {
129  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(rep));
130  }
131 
136  {
137  return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);
138  }
139 
143  void CreateDefaultRepresentation() override;
144 
149  void SetProcessEvents(vtkTypeBool) override;
150 
160  virtual void CompleteInteraction();
161 
166  virtual void RestartInteraction();
167 
175  virtual vtkHandleWidget* CreateNewHandle();
176 
180  void DeleteSeed(int n);
181 
185  vtkHandleWidget* GetSeed(int n);
186 
188 
191  vtkGetMacro(WidgetState, int);
193 
194  // The state of the widget
195 
196  enum
197  {
198  Start = 1,
199  PlacingSeeds = 2,
200  PlacedSeeds = 4,
201  MovingSeed = 8
202  };
203 
204 protected:
205  vtkSeedWidget();
206  ~vtkSeedWidget() override;
207 
209 
210  // Callback interface to capture events when
211  // placing the widget.
212  static void AddPointAction(vtkAbstractWidget*);
213  static void CompletedAction(vtkAbstractWidget*);
214  static void MoveAction(vtkAbstractWidget*);
215  static void EndSelectAction(vtkAbstractWidget*);
216  static void DeleteAction(vtkAbstractWidget*);
217 
218  // The positioning handle widgets
219  vtkSeedList* Seeds;
220 
221  // Manipulating or defining ?
222  int Defining;
223 
224 private:
225  vtkSeedWidget(const vtkSeedWidget&) = delete;
226  void operator=(const vtkSeedWidget&) = delete;
227 };
228 
229 #endif
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:78
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:55
vtkSeedWidget::Defining
int Defining
Definition: vtkSeedWidget.h:222
vtkSeedWidget::Seeds
vtkSeedList * Seeds
Definition: vtkSeedWidget.h:219
vtkSeedWidget::WidgetState
int WidgetState
Definition: vtkSeedWidget.h:208
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkSeedWidget
place multiple seed points
Definition: vtkSeedWidget.h:87
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkSeedWidget::SetRepresentation
void SetRepresentation(vtkSeedRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkSeedWidget.h:127
vtkInteractorObserver::SetInteractor
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
This method is used to associate the widget with the render window interactor.
vtkAbstractWidget::SetProcessEvents
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
vtkSeedWidget::GetSeedRepresentation
vtkSeedRepresentation * GetSeedRepresentation()
Return the representation as a vtkSeedRepresentation.
Definition: vtkSeedWidget.h:135
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkSeedRepresentation
represent the vtkSeedWidget
Definition: vtkSeedRepresentation.h:37
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkInteractorObserver::SetCurrentRenderer
virtual void SetCurrentRenderer(vtkRenderer *)