00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkSeedWidget.h,v $ 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 vtkTypeRevisionMacro(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 00131 virtual void CompleteInteraction(); 00132 00135 virtual void RestartInteraction(); 00136 00142 virtual vtkHandleWidget * CreateNewHandle(); 00143 00145 void DeleteSeed(int n); 00146 00148 vtkHandleWidget * GetSeed( int n ); 00149 00150 protected: 00151 vtkSeedWidget(); 00152 ~vtkSeedWidget(); 00153 00154 // The state of the widget 00155 //BTX 00156 enum 00157 { 00158 Start = 0, 00159 PlacingSeeds, 00160 PlacedSeeds, 00161 MovingSeed 00162 }; 00163 //ETX 00164 int WidgetState; 00165 00166 // Callback interface to capture events when 00167 // placing the widget. 00168 static void AddPointAction( vtkAbstractWidget* ); 00169 static void CompletedAction( vtkAbstractWidget* ); 00170 static void MoveAction( vtkAbstractWidget* ); 00171 static void EndSelectAction( vtkAbstractWidget* ); 00172 static void DeleteAction( vtkAbstractWidget* ); 00173 00174 // The positioning handle widgets 00175 vtkSeedList *Seeds; 00176 00177 private: 00178 vtkSeedWidget(const vtkSeedWidget&); //Not implemented 00179 void operator=(const vtkSeedWidget&); //Not implemented 00180 }; 00181 00182 #endif