VTK
|
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 "vtkInteractionWidgetsModule.h" // For export macro 00079 #include "vtkAbstractWidget.h" 00080 00081 00082 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget 00083 { 00084 public: 00086 static vtkHoverWidget *New(); 00087 00089 00090 vtkTypeMacro(vtkHoverWidget,vtkAbstractWidget); 00091 void PrintSelf(ostream& os, vtkIndent indent); 00093 00095 00098 vtkSetClampMacro(TimerDuration,int,1,100000); 00099 vtkGetMacro(TimerDuration,int); 00101 00105 virtual void SetEnabled(int); 00106 00108 00111 void CreateDefaultRepresentation() 00112 {this->WidgetRep = NULL;} 00114 00115 protected: 00116 vtkHoverWidget(); 00117 ~vtkHoverWidget(); 00118 00119 // The state of the widget 00120 //BTX 00121 enum {Start=0,Timing,TimedOut}; 00122 //ETX 00123 int WidgetState; 00124 00125 // Callback interface to execute events 00126 static void MoveAction(vtkAbstractWidget*); 00127 static void HoverAction(vtkAbstractWidget*); 00128 static void SelectAction(vtkAbstractWidget*); 00129 00130 // Subclasses of this class invoke these methods. If a non-zero 00131 // value is returned, a subclass is handling the event. 00132 virtual int SubclassHoverAction() {return 0;} 00133 virtual int SubclassEndHoverAction() {return 0;} 00134 virtual int SubclassSelectAction() {return 0;} 00135 00137 00138 int TimerId; 00139 int TimerDuration; 00141 00142 private: 00143 vtkHoverWidget(const vtkHoverWidget&); //Not implemented 00144 void operator=(const vtkHoverWidget&); //Not implemented 00145 }; 00146 00147 #endif