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 =========================================================================*/
73 #ifndef __vtkSeedWidget_h
74 #define __vtkSeedWidget_h
75 
76 #include "vtkAbstractWidget.h"
77 
79 class vtkHandleWidget;
80 class vtkSeedList;
82 
83 
85 {
86 public:
88  static vtkSeedWidget *New();
89 
91 
93  void PrintSelf(ostream& os, vtkIndent indent);
95 
99  virtual void SetEnabled(int);
100 
103  virtual void SetCurrentRenderer( vtkRenderer * );
104 
107  virtual void SetInteractor( vtkRenderWindowInteractor * );
108 
110 
113  void SetRepresentation( vtkSeedRepresentation *rep )
114  {
115  this->Superclass::SetWidgetRepresentation(
116  reinterpret_cast<vtkWidgetRepresentation*>(rep) );
117  }
119 
121 
122  vtkSeedRepresentation *GetSeedRepresentation()
123  {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);}
125 
128 
131  virtual void SetProcessEvents(int);
132 
140  virtual void CompleteInteraction();
141 
144  virtual void RestartInteraction();
145 
151  virtual vtkHandleWidget * CreateNewHandle();
152 
154  void DeleteSeed(int n);
155 
157  vtkHandleWidget * GetSeed( int n );
158 
160 
161  vtkGetMacro( WidgetState, int );
163 
164  // The state of the widget
165  //BTX
166  enum
167  {
168  Start = 1,
169  PlacingSeeds = 2,
170  PlacedSeeds = 4,
171  MovingSeed = 8
172  };
173  //ETX
174 
175 protected:
176  vtkSeedWidget();
177  ~vtkSeedWidget();
178 
179 
181 
182  // Callback interface to capture events when
183  // placing the widget.
184  static void AddPointAction( vtkAbstractWidget* );
185  static void CompletedAction( vtkAbstractWidget* );
186  static void MoveAction( vtkAbstractWidget* );
187  static void EndSelectAction( vtkAbstractWidget* );
188  static void DeleteAction( vtkAbstractWidget* );
189 
190  // The positioning handle widgets
191  vtkSeedList *Seeds;
192 
193  // Manipulating or defining ?
194  int Defining;
195 
196 private:
197  vtkSeedWidget(const vtkSeedWidget&); //Not implemented
198  void operator=(const vtkSeedWidget&); //Not implemented
199 };
200 
201 #endif