VTK
dox/Widgets/vtkHoverWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkHoverWidget.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 =========================================================================*/
00075 #ifndef __vtkHoverWidget_h
00076 #define __vtkHoverWidget_h
00077 
00078 #include "vtkAbstractWidget.h"
00079 
00080 
00081 class VTK_WIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
00082 {
00083 public:
00085   static vtkHoverWidget *New();
00086 
00088 
00089   vtkTypeMacro(vtkHoverWidget,vtkAbstractWidget);
00090   void PrintSelf(ostream& os, vtkIndent indent);
00092 
00094 
00097   vtkSetClampMacro(TimerDuration,int,1,100000);
00098   vtkGetMacro(TimerDuration,int);
00100   
00104   virtual void SetEnabled(int);
00105 
00107 
00110   void CreateDefaultRepresentation()
00111     {this->WidgetRep = NULL;}
00113 
00114 protected:
00115   vtkHoverWidget();
00116   ~vtkHoverWidget();
00117 
00118   // The state of the widget
00119 //BTX
00120   enum {Start=0,Timing,TimedOut};
00121 //ETX
00122   int WidgetState;
00123 
00124   // Callback interface to execute events
00125   static void MoveAction(vtkAbstractWidget*);
00126   static void HoverAction(vtkAbstractWidget*);
00127   static void SelectAction(vtkAbstractWidget*);
00128   
00129   // Subclasses of this class invoke these methods. If a non-zero
00130   // value is returned, a subclass is handling the event.
00131   virtual int SubclassHoverAction() {return 0;}
00132   virtual int SubclassEndHoverAction() {return 0;}
00133   virtual int SubclassSelectAction() {return 0;}
00134   
00136 
00137   int TimerId;
00138   int TimerDuration;
00140   
00141 private:
00142   vtkHoverWidget(const vtkHoverWidget&);  //Not implemented
00143   void operator=(const vtkHoverWidget&);  //Not implemented
00144 };
00145 
00146 #endif