VTK
vtkHoverWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHoverWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
70 #ifndef vtkHoverWidget_h
71 #define vtkHoverWidget_h
72 
73 #include "vtkInteractionWidgetsModule.h" // For export macro
74 #include "vtkAbstractWidget.h"
75 
76 
77 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
78 {
79 public:
83  static vtkHoverWidget *New();
84 
86 
90  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
92 
94 
99  vtkSetClampMacro(TimerDuration,int,1,100000);
100  vtkGetMacro(TimerDuration,int);
102 
107  void SetEnabled(int) VTK_OVERRIDE;
108 
114  void CreateDefaultRepresentation() VTK_OVERRIDE
115  {this->WidgetRep = NULL;}
116 
117 protected:
118  vtkHoverWidget();
119  ~vtkHoverWidget() VTK_OVERRIDE;
120 
121  // The state of the widget
122 
123  enum {Start=0,Timing,TimedOut};
124 
126 
127  // Callback interface to execute events
128  static void MoveAction(vtkAbstractWidget*);
129  static void HoverAction(vtkAbstractWidget*);
130  static void SelectAction(vtkAbstractWidget*);
131 
132  // Subclasses of this class invoke these methods. If a non-zero
133  // value is returned, a subclass is handling the event.
134  virtual int SubclassHoverAction() {return 0;}
135  virtual int SubclassEndHoverAction() {return 0;}
136  virtual int SubclassSelectAction() {return 0;}
137 
139 
142  int TimerId;
145 
146 private:
147  vtkHoverWidget(const vtkHoverWidget&) VTK_DELETE_FUNCTION;
148  void operator=(const vtkHoverWidget&) VTK_DELETE_FUNCTION;
149 };
150 
151 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:33
int TimerDuration
Helper methods for creating and destroying timers.
void CreateDefaultRepresentation() override
A default representation, of which there is none, is created.
virtual int SubclassHoverAction()
virtual int SubclassSelectAction()
virtual int SubclassEndHoverAction()
define the API for widget / widget representation
int TimerId
Helper methods for creating and destroying timers.
void SetEnabled(int) override
Methods for activating this widget.
invoke a vtkTimerEvent when hovering
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...