VTK  9.0.1
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 "vtkAbstractWidget.h"
74 #include "vtkInteractionWidgetsModule.h" // For export macro
75 
76 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
77 {
78 public:
82  static vtkHoverWidget* New();
83 
85 
89  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
93 
98  vtkSetClampMacro(TimerDuration, int, 1, 100000);
99  vtkGetMacro(TimerDuration, int);
101 
106  void SetEnabled(int) override;
107 
113  void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
114 
115 protected:
117  ~vtkHoverWidget() override;
118 
119  // The state of the widget
120 
121  enum
122  {
123  Start = 0,
125  TimedOut
126  };
127 
129 
130  // Callback interface to execute events
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
define the API for widget / widget representation
invoke a vtkTimerEvent when hovering
virtual int SubclassSelectAction()
int TimerId
Helper methods for creating and destroying timers.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateDefaultRepresentation() override
A default representation, of which there is none, is created.
static void HoverAction(vtkAbstractWidget *)
~vtkHoverWidget() override
static void MoveAction(vtkAbstractWidget *)
static void SelectAction(vtkAbstractWidget *)
void SetEnabled(int) override
The method for activating and deactivating this widget.
virtual int SubclassEndHoverAction()
virtual int SubclassHoverAction()
static vtkHoverWidget * New()
Instantiate this class.
a simple class to control print indentation
Definition: vtkIndent.h:34