VTK  9.1.0
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=========================================================================*/
79#ifndef vtkHoverWidget_h
80#define vtkHoverWidget_h
81
82#include "vtkAbstractWidget.h"
83#include "vtkInteractionWidgetsModule.h" // For export macro
84
85class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
86{
87public:
92
94
98 void PrintSelf(ostream& os, vtkIndent indent) override;
100
102
107 vtkSetClampMacro(TimerDuration, int, 1, 100000);
108 vtkGetMacro(TimerDuration, int);
110
115 void SetEnabled(int) override;
116
122 void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
123
124protected:
126 ~vtkHoverWidget() override;
127
128 // The state of the widget
129
130 enum
131 {
132 Start = 0,
134 TimedOut
135 };
136
138
139 // Callback interface to execute events
143
144 // Subclasses of this class invoke these methods. If a non-zero
145 // value is returned, a subclass is handling the event.
146 virtual int SubclassHoverAction() { return 0; }
147 virtual int SubclassEndHoverAction() { return 0; }
148 virtual int SubclassSelectAction() { return 0; }
149
151
157
158private:
159 vtkHoverWidget(const vtkHoverWidget&) = delete;
160 void operator=(const vtkHoverWidget&) = delete;
161};
162
163#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:43