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 00159 protected: 00160 vtkSeedWidget(); 00161 ~vtkSeedWidget(); 00162 00163 // The state of the widget 00164 //BTX 00165 enum 00166 { 00167 Start = 1, 00168 PlacingSeeds = 2, 00169 PlacedSeeds = 4, 00170 MovingSeed = 8 00171 }; 00172 //ETX 00173 int WidgetState; 00174 00175 // Callback interface to capture events when 00176 // placing the widget. 00177 static void AddPointAction( vtkAbstractWidget* ); 00178 static void CompletedAction( vtkAbstractWidget* ); 00179 static void MoveAction( vtkAbstractWidget* ); 00180 static void EndSelectAction( vtkAbstractWidget* ); 00181 static void DeleteAction( vtkAbstractWidget* ); 00182 00183 // The positioning handle widgets 00184 vtkSeedList *Seeds; 00185 00186 // Manipulating or defining ? 00187 int Defining; 00188 00189 private: 00190 vtkSeedWidget(const vtkSeedWidget&); //Not implemented 00191 void operator=(const vtkSeedWidget&); //Not implemented 00192 }; 00193 00194 #endif