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 
00122   vtkSeedRepresentation *GetSeedRepresentation()
00123     {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);}
00125 
00127   void CreateDefaultRepresentation();
00128 
00131   virtual void SetProcessEvents(int);
00132 
00140   virtual void CompleteInteraction();
00141 
00144   virtual void RestartInteraction();
00145 
00151   virtual vtkHandleWidget * CreateNewHandle();
00152 
00154   void DeleteSeed(int n);
00155 
00157   vtkHandleWidget * GetSeed( int n );
00158 
00160 
00161   vtkGetMacro( WidgetState, int );
00163 
00164   // The state of the widget
00165   //BTX
00166   enum
00167     {
00168     Start = 1,
00169     PlacingSeeds = 2,
00170     PlacedSeeds = 4,
00171     MovingSeed = 8
00172     };
00173   //ETX
00174 
00175 protected:
00176   vtkSeedWidget();
00177   ~vtkSeedWidget();
00178 
00179 
00180   int WidgetState;
00181 
00182   // Callback interface to capture events when
00183   // placing the widget.
00184   static void AddPointAction( vtkAbstractWidget* );
00185   static void CompletedAction( vtkAbstractWidget* );
00186   static void MoveAction( vtkAbstractWidget* );
00187   static void EndSelectAction( vtkAbstractWidget* );
00188   static void DeleteAction( vtkAbstractWidget* );
00189 
00190   // The positioning handle widgets
00191   vtkSeedList *Seeds;
00192 
00193   // Manipulating or defining ?
00194   int Defining;
00195 
00196 private:
00197   vtkSeedWidget(const vtkSeedWidget&);  //Not implemented
00198   void operator=(const vtkSeedWidget&);  //Not implemented
00199 };
00200 
00201 #endif