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 =========================================================================*/
68 #ifndef vtkSeedWidget_h
69 #define vtkSeedWidget_h
70 
71 #include "vtkInteractionWidgetsModule.h" // For export macro
72 #include "vtkAbstractWidget.h"
73 
75 class vtkHandleWidget;
76 class vtkSeedList;
78 
79 
80 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
81 {
82 public:
86  static vtkSeedWidget *New();
87 
89 
93  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
95 
101  void SetEnabled(int) VTK_OVERRIDE;
102 
107  void SetCurrentRenderer( vtkRenderer * ) VTK_OVERRIDE;
108 
113  void SetInteractor( vtkRenderWindowInteractor * ) VTK_OVERRIDE;
114 
120  void SetRepresentation( vtkSeedRepresentation *rep )
121  {
122  this->Superclass::SetWidgetRepresentation(
123  reinterpret_cast<vtkWidgetRepresentation*>(rep) );
124  }
125 
130  {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);}
131 
135  void CreateDefaultRepresentation() VTK_OVERRIDE;
136 
141  void SetProcessEvents(int) VTK_OVERRIDE;
142 
152  virtual void CompleteInteraction();
153 
158  virtual void RestartInteraction();
159 
167  virtual vtkHandleWidget * CreateNewHandle();
168 
172  void DeleteSeed(int n);
173 
177  vtkHandleWidget * GetSeed( int n );
178 
180 
183  vtkGetMacro( WidgetState, int );
185 
186  // The state of the widget
187 
188  enum
189  {
190  Start = 1,
191  PlacingSeeds = 2,
192  PlacedSeeds = 4,
193  MovingSeed = 8
194  };
195 
196 protected:
197  vtkSeedWidget();
198  ~vtkSeedWidget() VTK_OVERRIDE;
199 
200 
201  int WidgetState;
202 
203  // Callback interface to capture events when
204  // placing the widget.
205  static void AddPointAction( vtkAbstractWidget* );
206  static void CompletedAction( vtkAbstractWidget* );
207  static void MoveAction( vtkAbstractWidget* );
208  static void EndSelectAction( vtkAbstractWidget* );
209  static void DeleteAction( vtkAbstractWidget* );
210 
211  // The positioning handle widgets
212  vtkSeedList *Seeds;
213 
214  // Manipulating or defining ?
215  int Defining;
216 
217 private:
218  vtkSeedWidget(const vtkSeedWidget&) VTK_DELETE_FUNCTION;
219  void operator=(const vtkSeedWidget&) VTK_DELETE_FUNCTION;
220 };
221 
222 #endif
abstract class for representing widget handles
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:57
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:80
vtkWidgetRepresentation * WidgetRep
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:33
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