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 00102 00105 void SetRepresentation( vtkSeedRepresentation *rep ) 00106 { 00107 this->Superclass::SetWidgetRepresentation( 00108 reinterpret_cast<vtkWidgetRepresentation*>(rep) ); 00109 } 00111 00113 void CreateDefaultRepresentation(); 00114 00117 virtual void SetProcessEvents(int); 00118 00121 virtual void CompleteInteraction(); 00122 00125 virtual void RestartInteraction(); 00126 00127 00128 protected: 00129 vtkSeedWidget(); 00130 ~vtkSeedWidget(); 00131 00132 // The state of the widget 00133 //BTX 00134 enum 00135 { 00136 Start = 0, 00137 PlacingSeeds, 00138 PlacedSeeds, 00139 MovingSeed 00140 }; 00141 //ETX 00142 int WidgetState; 00143 00144 // Callback interface to capture events when 00145 // placing the widget. 00146 static void AddPointAction( vtkAbstractWidget* ); 00147 static void CompletedAction( vtkAbstractWidget* ); 00148 static void MoveAction( vtkAbstractWidget* ); 00149 static void EndSelectAction( vtkAbstractWidget* ); 00150 static void DeleteAction( vtkAbstractWidget* ); 00151 00152 // The positioning handle widgets 00153 vtkSeedList *Seeds; 00154 void DeleteSeed(int); 00155 00156 // Helper method for creating widgets 00157 static vtkHandleWidget *CreateHandleWidget( vtkSeedWidget *self, 00158 vtkSeedRepresentation *rep ); 00159 00160 private: 00161 vtkSeedWidget(const vtkSeedWidget&); //Not implemented 00162 void operator=(const vtkSeedWidget&); //Not implemented 00163 }; 00164 00165 #endif