VTK: Interaction/Widgets/vtkHoverWidget.h Source File

| 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
73 #ifndef vtkHoverWidget_h
74 #define vtkHoverWidget_h
75
76 #include "vtkAbstractWidget.h"
77 #include "vtkInteractionWidgetsModule.h" // For export macro
78
79 VTK_ABI_NAMESPACE_BEGIN
80 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
81 {
82 public:
86 static vtkHoverWidget* New();
87
89
92 vtkTypeMacro(vtkHoverWidget, vtkAbstractWidget);
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
117 void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
118
119 protected:
120 vtkHoverWidget();
121 ~vtkHoverWidget() override;
122
123 // The state of the widget
124
125 enum
126 {
127 Start = 0,
128 Timing,
129 TimedOut
130 };
131
132 int WidgetState;
133
134 // Callback interface to execute events
135 static void MoveAction(vtkAbstractWidget*);
136 static void HoverAction(vtkAbstractWidget*);
137 static void SelectAction(vtkAbstractWidget*);
138
139 // Subclasses of this class invoke these methods. If a non-zero
140 // value is returned, a subclass is handling the event.
141 virtual int SubclassHoverAction() { return 0; }
142 virtual int SubclassEndHoverAction() { return 0; }
143 virtual int SubclassSelectAction() { return 0; }
144
146
149 int TimerId;
150 int TimerDuration;
152
153 private:
154 vtkHoverWidget(const vtkHoverWidget&) = delete;
155 void operator=(const vtkHoverWidget&) = delete;
156 };
157
158 VTK_ABI_NAMESPACE_END
159 #endif
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkHoverWidget
invoke a vtkTimerEvent when hovering
Definition: vtkHoverWidget.h:81
vtkHoverWidget::SubclassSelectAction
virtual int SubclassSelectAction()
Definition: vtkHoverWidget.h:143
vtkHoverWidget::vtkHoverWidget
vtkHoverWidget()
vtkHoverWidget::TimerId
int TimerId
Helper methods for creating and destroying timers.
Definition: vtkHoverWidget.h:149
vtkHoverWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
vtkHoverWidget::Timing
@ Timing
Definition: vtkHoverWidget.h:128
vtkHoverWidget::WidgetState
int WidgetState
Definition: vtkHoverWidget.h:132
vtkHoverWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
A default representation, of which there is none, is created.
Definition: vtkHoverWidget.h:117
vtkHoverWidget::HoverAction
static void HoverAction(vtkAbstractWidget *)
vtkHoverWidget::TimerDuration
int TimerDuration
Helper methods for creating and destroying timers.
Definition: vtkHoverWidget.h:150
vtkHoverWidget::~vtkHoverWidget
~vtkHoverWidget() override
vtkHoverWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkHoverWidget::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkHoverWidget::SetEnabled
void SetEnabled(int) override
The method for activating and deactivating this widget.
vtkHoverWidget::SubclassEndHoverAction
virtual int SubclassEndHoverAction()
Definition: vtkHoverWidget.h:142
vtkHoverWidget::SubclassHoverAction
virtual int SubclassHoverAction()
Definition: vtkHoverWidget.h:141
vtkHoverWidget::New
static vtkHoverWidget * New()
Instantiate this class.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkAbstractWidget.h