VTK  9.3.0
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
70#ifndef vtkHoverWidget_h
71#define vtkHoverWidget_h
72
73#include "vtkAbstractWidget.h"
74#include "vtkInteractionWidgetsModule.h" // For export macro
75
76VTK_ABI_NAMESPACE_BEGIN
77class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
78{
79public:
84
86
90 void PrintSelf(ostream& os, vtkIndent indent) override;
92
94
99 vtkSetClampMacro(TimerDuration, int, 1, 100000);
100 vtkGetMacro(TimerDuration, int);
102
107 void SetEnabled(int) override;
108
114 void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
115
116protected:
118 ~vtkHoverWidget() override;
119
120 // The state of the widget
121
122 enum
123 {
124 Start = 0,
126 TimedOut
127 };
128
130
131 // Callback interface to execute events
135
136 // Subclasses of this class invoke these methods. If a non-zero
137 // value is returned, a subclass is handling the event.
138 virtual int SubclassHoverAction() { return 0; }
139 virtual int SubclassEndHoverAction() { return 0; }
140 virtual int SubclassSelectAction() { return 0; }
141
143
149
150private:
151 vtkHoverWidget(const vtkHoverWidget&) = delete;
152 void operator=(const vtkHoverWidget&) = delete;
153};
154
155VTK_ABI_NAMESPACE_END
156#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
Standard methods for a VTK class.
static vtkHoverWidget * New()
Instantiate this class.
void CreateDefaultRepresentation() override
A default representation, of which there is none, is created.
static void HoverAction(vtkAbstractWidget *)
int TimerDuration
Helper methods for creating and destroying timers.
~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()
a simple class to control print indentation
Definition vtkIndent.h:38