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 =========================================================================*/
73 #ifndef vtkHoverWidget_h
74 #define vtkHoverWidget_h
75 
76 #include "vtkInteractionWidgetsModule.h" // For export macro
77 #include "vtkAbstractWidget.h"
78 
79 
80 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
81 {
82 public:
86  static vtkHoverWidget *New();
87 
89 
93  void PrintSelf(ostream& os, vtkIndent indent) override;
95 
97 
102  vtkSetClampMacro(TimerDuration,int,1,100000);
103  vtkGetMacro(TimerDuration,int);
105 
110  void SetEnabled(int) override;
111 
118  {this->WidgetRep = nullptr;}
119 
120 protected:
121  vtkHoverWidget();
122  ~vtkHoverWidget() override;
123 
124  // The state of the widget
125 
126  enum {Start=0,Timing,TimedOut};
127 
129 
130  // Callback interface to execute events
131  static void MoveAction(vtkAbstractWidget*);
132  static void HoverAction(vtkAbstractWidget*);
133  static void SelectAction(vtkAbstractWidget*);
134 
135  // Subclasses of this class invoke these methods. If a non-zero
136  // value is returned, a subclass is handling the event.
137  virtual int SubclassHoverAction() {return 0;}
138  virtual int SubclassEndHoverAction() {return 0;}
139  virtual int SubclassSelectAction() {return 0;}
140 
142 
145  int TimerId;
148 
149 private:
150  vtkHoverWidget(const vtkHoverWidget&) = delete;
151  void operator=(const vtkHoverWidget&) = delete;
152 };
153 
154 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:39
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...