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 
114  {
115  this->Superclass::SetWidgetRepresentation(
116  reinterpret_cast<vtkWidgetRepresentation*>(rep) );
117  }
119 
121 
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 
159 protected:
160  vtkSeedWidget();
161  ~vtkSeedWidget();
162 
163  // The state of the widget
164 //BTX
165  enum
166  {
167  Start = 1,
168  PlacingSeeds = 2,
169  PlacedSeeds = 4,
170  MovingSeed = 8
171  };
172 //ETX
174 
175  // Callback interface to capture events when
176  // placing the widget.
177  static void AddPointAction( vtkAbstractWidget* );
178  static void CompletedAction( vtkAbstractWidget* );
179  static void MoveAction( vtkAbstractWidget* );
180  static void EndSelectAction( vtkAbstractWidget* );
181  static void DeleteAction( vtkAbstractWidget* );
182 
183  // The positioning handle widgets
184  vtkSeedList *Seeds;
185 
186  // Manipulating or defining ?
187  int Defining;
188 
189 private:
190  vtkSeedWidget(const vtkSeedWidget&); //Not implemented
191  void operator=(const vtkSeedWidget&); //Not implemented
192 };
193 
194 #endif