VTK  9.4.20241221
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
83#ifndef vtkHoverWidget_h
84#define vtkHoverWidget_h
85
86#include "vtkAbstractWidget.h"
87#include "vtkInteractionWidgetsModule.h" // For export macro
88#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
89
90VTK_ABI_NAMESPACE_BEGIN
91class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkHoverWidget : public vtkAbstractWidget
92{
93public:
98
100
104 void PrintSelf(ostream& os, vtkIndent indent) override;
106
108
113 vtkSetClampMacro(TimerDuration, int, 1, 100000);
114 vtkGetMacro(TimerDuration, int);
116
121 void SetEnabled(int) override;
122
128 void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
129
130protected:
132 ~vtkHoverWidget() override;
133
134 // The state of the widget
135
136 enum
137 {
138 Start = 0,
140 TimedOut
141 };
142
144
145 // Callback interface to execute events
149
150 // Subclasses of this class invoke these methods. If a non-zero
151 // value is returned, a subclass is handling the event.
152 virtual int SubclassHoverAction() { return 0; }
153 virtual int SubclassEndHoverAction() { return 0; }
154 virtual int SubclassSelectAction() { return 0; }
155
157
163
164private:
165 vtkHoverWidget(const vtkHoverWidget&) = delete;
166 void operator=(const vtkHoverWidget&) = delete;
167};
168
169VTK_ABI_NAMESPACE_END
170#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:108
#define VTK_MARSHALAUTO