VTK
dox/Widgets/vtkSeedWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSeedWidget.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00073 #ifndef __vtkSeedWidget_h
00074 #define __vtkSeedWidget_h
00075 
00076 #include "vtkAbstractWidget.h"
00077 
00078 class vtkHandleRepresentation;
00079 class vtkHandleWidget;
00080 class vtkSeedList;
00081 class vtkSeedRepresentation;
00082 
00083 
00084 class VTK_WIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
00085 {
00086 public:
00088   static vtkSeedWidget *New();
00089 
00091 
00092   vtkTypeMacro(vtkSeedWidget,vtkAbstractWidget);
00093   void PrintSelf(ostream& os, vtkIndent indent);
00095 
00099   virtual void SetEnabled(int);
00100 
00103   virtual void SetCurrentRenderer( vtkRenderer * );
00104 
00107   virtual void SetInteractor( vtkRenderWindowInteractor * );
00108 
00110 
00113   void SetRepresentation( vtkSeedRepresentation *rep )
00114     {
00115     this->Superclass::SetWidgetRepresentation(
00116       reinterpret_cast<vtkWidgetRepresentation*>(rep) );
00117     }
00119 
00121   void CreateDefaultRepresentation();
00122 
00125   virtual void SetProcessEvents(int);
00126 
00134   virtual void CompleteInteraction();
00135 
00138   virtual void RestartInteraction();
00139 
00145   virtual vtkHandleWidget * CreateNewHandle();
00146 
00148   void DeleteSeed(int n);
00149 
00151   vtkHandleWidget * GetSeed( int n );
00152 
00153 protected:
00154   vtkSeedWidget();
00155   ~vtkSeedWidget();
00156 
00157   // The state of the widget
00158 //BTX
00159   enum
00160     {
00161     Start = 1,
00162     PlacingSeeds = 2,
00163     PlacedSeeds = 4,
00164     MovingSeed = 8 
00165     };
00166 //ETX
00167   int WidgetState;
00168 
00169   // Callback interface to capture events when
00170   // placing the widget.
00171   static void AddPointAction( vtkAbstractWidget* );
00172   static void CompletedAction( vtkAbstractWidget* );
00173   static void MoveAction( vtkAbstractWidget* );
00174   static void EndSelectAction( vtkAbstractWidget* );
00175   static void DeleteAction( vtkAbstractWidget* );
00176   
00177   // The positioning handle widgets
00178   vtkSeedList *Seeds; 
00179   
00180   // Manipulating or defining ? 
00181   int Defining;
00182 
00183 private:
00184   vtkSeedWidget(const vtkSeedWidget&);  //Not implemented
00185   void operator=(const vtkSeedWidget&);  //Not implemented
00186 };
00187 
00188 #endif