00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00030 #ifndef __vtkSeedRepresentation_h
00031 #define __vtkSeedRepresentation_h
00032 
00033 #include "vtkWidgetRepresentation.h"
00034 
00035 class vtkHandleList;
00036 class vtkHandleRepresentation;
00037 
00038 
00039 class VTK_WIDGETS_EXPORT vtkSeedRepresentation : public vtkWidgetRepresentation
00040 {
00041 public:
00043   static vtkSeedRepresentation *New();
00044 
00046 
00047   vtkTypeMacro(vtkSeedRepresentation,vtkWidgetRepresentation);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00055   virtual void GetSeedWorldPosition( unsigned int seedNum, double pos[3] );
00056   virtual void SetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
00057   virtual void GetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
00059 
00061   int GetNumberOfSeeds();
00062 
00069   void SetHandleRepresentation( vtkHandleRepresentation *handle );
00070 
00074   vtkHandleRepresentation *GetHandleRepresentation( unsigned int num );
00075 
00077 
00078   vtkHandleRepresentation *GetHandleRepresentation()
00079     {
00080     return this->HandleRepresentation;
00081     };
00083 
00085 
00088   vtkSetClampMacro( Tolerance, int, 1, 100 );
00089   vtkGetMacro( Tolerance, int );
00091 
00092 
00093   enum
00094     {
00095     Outside = 0,
00096     NearSeed
00097     };
00098 
00099 
00101 
00103   virtual int GetActiveHandle();
00104   virtual int CreateHandle( double e[2] ); 
00105   virtual void RemoveLastHandle(); 
00106   virtual void RemoveActiveHandle();
00108 
00110   virtual void RemoveHandle( int n );
00111 
00113 
00114   virtual void BuildRepresentation();
00115   virtual int ComputeInteractionState( int X, int Y, int modify = 0 );
00117   
00118 protected:
00119   vtkSeedRepresentation();
00120   ~vtkSeedRepresentation();
00121 
00122   
00123   vtkHandleRepresentation  *HandleRepresentation;
00124   vtkHandleList            *Handles;
00125 
00126   
00127   int Tolerance;
00128   
00129   
00130   int ActiveHandle;
00131 
00132 private:
00133   vtkSeedRepresentation(const vtkSeedRepresentation&);  
00134   void operator=(const vtkSeedRepresentation&);  
00135 };
00136 
00137 #endif