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 "vtkInteractionWidgetsModule.h" // For export macro
77 #include "vtkAbstractWidget.h"
78 
80 class vtkHandleWidget;
81 class vtkSeedList;
83 
84 
86 {
87 public:
89  static vtkSeedWidget *New();
90 
92 
94  void PrintSelf(ostream& os, vtkIndent indent);
96 
100  virtual void SetEnabled(int);
101 
104  virtual void SetCurrentRenderer( vtkRenderer * );
105 
108  virtual void SetInteractor( vtkRenderWindowInteractor * );
109 
111 
115  {
116  this->Superclass::SetWidgetRepresentation(
117  reinterpret_cast<vtkWidgetRepresentation*>(rep) );
118  }
120 
122 
124  {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);}
126 
129 
132  virtual void SetProcessEvents(int);
133 
141  virtual void CompleteInteraction();
142 
145  virtual void RestartInteraction();
146 
152  virtual vtkHandleWidget * CreateNewHandle();
153 
155  void DeleteSeed(int n);
156 
158  vtkHandleWidget * GetSeed( int n );
159 
161 
162  vtkGetMacro( WidgetState, int );
164 
165  // The state of the widget
166  //BTX
167  enum
168  {
169  Start = 1,
170  PlacingSeeds = 2,
171  PlacedSeeds = 4,
172  MovingSeed = 8
173  };
174  //ETX
175 
176 protected:
177  vtkSeedWidget();
178  ~vtkSeedWidget();
179 
180 
182 
183  // Callback interface to capture events when
184  // placing the widget.
185  static void AddPointAction( vtkAbstractWidget* );
186  static void CompletedAction( vtkAbstractWidget* );
187  static void MoveAction( vtkAbstractWidget* );
188  static void EndSelectAction( vtkAbstractWidget* );
189  static void DeleteAction( vtkAbstractWidget* );
190 
191  // The positioning handle widgets
192  vtkSeedList *Seeds;
193 
194  // Manipulating or defining ?
195  int Defining;
196 
197 private:
198  vtkSeedWidget(const vtkSeedWidget&); //Not implemented
199  void operator=(const vtkSeedWidget&); //Not implemented
200 };
201 
202 #endif
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
void PrintSelf(ostream &os, vtkIndent indent)
abstract class for representing widget handles
vtkSeedList * Seeds
virtual void SetProcessEvents(int)
a general widget for moving handles
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void CreateDefaultRepresentation()=0
vtkSeedRepresentation * GetSeedRepresentation()
place multiple seed points
Definition: vtkSeedWidget.h:85
vtkWidgetRepresentation * WidgetRep
platform-independent render window interaction including picking and frame rate control.
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void SetCurrentRenderer(vtkRenderer *)
define the API for widget / widget representation
void SetRepresentation(vtkSeedRepresentation *rep)
static vtkObject * New()
virtual void SetEnabled(int)
represent the vtkSeedWidget