VTK
|
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 "vtkInteractionWidgetsModule.h" // For export macro 00077 #include "vtkAbstractWidget.h" 00078 00079 class vtkHandleRepresentation; 00080 class vtkHandleWidget; 00081 class vtkSeedList; 00082 class vtkSeedRepresentation; 00083 00084 00085 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget 00086 { 00087 public: 00089 static vtkSeedWidget *New(); 00090 00092 00093 vtkTypeMacro(vtkSeedWidget,vtkAbstractWidget); 00094 void PrintSelf(ostream& os, vtkIndent indent); 00096 00100 virtual void SetEnabled(int); 00101 00104 virtual void SetCurrentRenderer( vtkRenderer * ); 00105 00108 virtual void SetInteractor( vtkRenderWindowInteractor * ); 00109 00111 00114 void SetRepresentation( vtkSeedRepresentation *rep ) 00115 { 00116 this->Superclass::SetWidgetRepresentation( 00117 reinterpret_cast<vtkWidgetRepresentation*>(rep) ); 00118 } 00120 00122 00123 vtkSeedRepresentation *GetSeedRepresentation() 00124 {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);} 00126 00128 void CreateDefaultRepresentation(); 00129 00132 virtual void SetProcessEvents(int); 00133 00141 virtual void CompleteInteraction(); 00142 00145 virtual void RestartInteraction(); 00146 00152 virtual vtkHandleWidget * CreateNewHandle(); 00153 00155 void DeleteSeed(int n); 00156 00158 vtkHandleWidget * GetSeed( int n ); 00159 00161 00162 vtkGetMacro( WidgetState, int ); 00164 00165 // The state of the widget 00166 //BTX 00167 enum 00168 { 00169 Start = 1, 00170 PlacingSeeds = 2, 00171 PlacedSeeds = 4, 00172 MovingSeed = 8 00173 }; 00174 //ETX 00175 00176 protected: 00177 vtkSeedWidget(); 00178 ~vtkSeedWidget(); 00179 00180 00181 int WidgetState; 00182 00183 // Callback interface to capture events when 00184 // placing the widget. 00185 static void AddPointAction( vtkAbstractWidget* ); 00186 static void CompletedAction( vtkAbstractWidget* ); 00187 static void MoveAction( vtkAbstractWidget* ); 00188 static void EndSelectAction( vtkAbstractWidget* ); 00189 static void DeleteAction( vtkAbstractWidget* ); 00190 00191 // The positioning handle widgets 00192 vtkSeedList *Seeds; 00193 00194 // Manipulating or defining ? 00195 int Defining; 00196 00197 private: 00198 vtkSeedWidget(const vtkSeedWidget&); //Not implemented 00199 void operator=(const vtkSeedWidget&); //Not implemented 00200 }; 00201 00202 #endif