VTK
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 =========================================================================*/
71 #ifndef vtkSeedWidget_h
72 #define vtkSeedWidget_h
73 
74 #include "vtkInteractionWidgetsModule.h" // For export macro
75 #include "vtkAbstractWidget.h"
76 
78 class vtkHandleWidget;
79 class vtkSeedList;
81 
82 
83 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
84 {
85 public:
89  static vtkSeedWidget *New();
90 
92 
96  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
98 
104  void SetEnabled(int) VTK_OVERRIDE;
105 
110  void SetCurrentRenderer( vtkRenderer * ) VTK_OVERRIDE;
111 
116  void SetInteractor( vtkRenderWindowInteractor * ) VTK_OVERRIDE;
117 
123  void SetRepresentation( vtkSeedRepresentation *rep )
124  {
125  this->Superclass::SetWidgetRepresentation(
126  reinterpret_cast<vtkWidgetRepresentation*>(rep) );
127  }
128 
133  {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);}
134 
138  void CreateDefaultRepresentation() VTK_OVERRIDE;
139 
144  void SetProcessEvents(int) VTK_OVERRIDE;
145 
155  virtual void CompleteInteraction();
156 
161  virtual void RestartInteraction();
162 
170  virtual vtkHandleWidget * CreateNewHandle();
171 
175  void DeleteSeed(int n);
176 
180  vtkHandleWidget * GetSeed( int n );
181 
183 
186  vtkGetMacro( WidgetState, int );
188 
189  // The state of the widget
190 
191  enum
192  {
193  Start = 1,
194  PlacingSeeds = 2,
195  PlacedSeeds = 4,
196  MovingSeed = 8
197  };
198 
199 protected:
200  vtkSeedWidget();
201  ~vtkSeedWidget() VTK_OVERRIDE;
202 
203 
204  int WidgetState;
205 
206  // Callback interface to capture events when
207  // placing the widget.
208  static void AddPointAction( vtkAbstractWidget* );
209  static void CompletedAction( vtkAbstractWidget* );
210  static void MoveAction( vtkAbstractWidget* );
211  static void EndSelectAction( vtkAbstractWidget* );
212  static void DeleteAction( vtkAbstractWidget* );
213 
214  // The positioning handle widgets
215  vtkSeedList *Seeds;
216 
217  // Manipulating or defining ?
218  int Defining;
219 
220 private:
221  vtkSeedWidget(const vtkSeedWidget&) VTK_DELETE_FUNCTION;
222  void operator=(const vtkSeedWidget&) VTK_DELETE_FUNCTION;
223 };
224 
225 #endif
abstract class for representing widget handles
virtual void SetProcessEvents(int)
Methods to change whether the widget responds to interaction.
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:83
vtkWidgetRepresentation * WidgetRep
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:39
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent the vtkSeedWidget