VTK  9.3.1
vtkHoverWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
64 #ifndef vtkHoverWidget_h
65 #define vtkHoverWidget_h
66 
67 #include "vtkAbstractWidget.h"
68 #include "vtkInteractionWidgetsModule.h" // For export macro
69 
70 VTK_ABI_NAMESPACE_BEGIN
71 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
72 {
73 public:
77  static vtkHoverWidget* New();
78 
80 
84  void PrintSelf(ostream& os, vtkIndent indent) override;
86 
88 
93  vtkSetClampMacro(TimerDuration, int, 1, 100000);
94  vtkGetMacro(TimerDuration, int);
96 
101  void SetEnabled(int) override;
102 
108  void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
109 
110 protected:
111  vtkHoverWidget();
112  ~vtkHoverWidget() override;
113 
114  // The state of the widget
115 
116  enum
117  {
118  Start = 0,
120  TimedOut
121  };
122 
124 
125  // Callback interface to execute events
126  static void MoveAction(vtkAbstractWidget*);
127  static void HoverAction(vtkAbstractWidget*);
128  static void SelectAction(vtkAbstractWidget*);
129 
130  // Subclasses of this class invoke these methods. If a non-zero
131  // value is returned, a subclass is handling the event.
132  virtual int SubclassHoverAction() { return 0; }
133  virtual int SubclassEndHoverAction() { return 0; }
134  virtual int SubclassSelectAction() { return 0; }
135 
137 
140  int TimerId;
143 
144 private:
145  vtkHoverWidget(const vtkHoverWidget&) = delete;
146  void operator=(const vtkHoverWidget&) = delete;
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:28
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...