VTK  9.0.1
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 =========================================================================*/
76 #ifndef vtkHoverWidget_h
77 #define vtkHoverWidget_h
78 
79 #include "vtkAbstractWidget.h"
80 #include "vtkInteractionWidgetsModule.h" // For export macro
81 
82 class VTKINTERACTIONWIDGETS_EXPORT vtkHoverWidget : public vtkAbstractWidget
83 {
84 public:
88  static vtkHoverWidget* New();
89 
91 
95  void PrintSelf(ostream& os, vtkIndent indent) override;
97 
99 
104  vtkSetClampMacro(TimerDuration, int, 1, 100000);
105  vtkGetMacro(TimerDuration, int);
107 
112  void SetEnabled(int) override;
113 
119  void CreateDefaultRepresentation() override { this->WidgetRep = nullptr; }
120 
121 protected:
122  vtkHoverWidget();
123  ~vtkHoverWidget() override;
124 
125  // The state of the widget
126 
127  enum
128  {
129  Start = 0,
131  TimedOut
132  };
133 
135 
136  // Callback interface to execute events
137  static void MoveAction(vtkAbstractWidget*);
138  static void HoverAction(vtkAbstractWidget*);
139  static void SelectAction(vtkAbstractWidget*);
140 
141  // Subclasses of this class invoke these methods. If a non-zero
142  // value is returned, a subclass is handling the event.
143  virtual int SubclassHoverAction() { return 0; }
144  virtual int SubclassEndHoverAction() { return 0; }
145  virtual int SubclassSelectAction() { return 0; }
146 
148 
151  int TimerId;
154 
155 private:
156  vtkHoverWidget(const vtkHoverWidget&) = delete;
157  void operator=(const vtkHoverWidget&) = delete;
158 };
159 
160 #endif
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkHoverWidget
invoke a vtkTimerEvent when hovering
Definition: vtkHoverWidget.h:82
vtkHoverWidget::WidgetState
int WidgetState
Definition: vtkHoverWidget.h:134
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkHoverWidget::SubclassSelectAction
virtual int SubclassSelectAction()
Definition: vtkHoverWidget.h:145
vtkHoverWidget::Timing
@ Timing
Definition: vtkHoverWidget.h:130
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkHoverWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
A default representation, of which there is none, is created.
Definition: vtkHoverWidget.h:119
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkHoverWidget::SubclassHoverAction
virtual int SubclassHoverAction()
Definition: vtkHoverWidget.h:143
vtkHoverWidget::TimerDuration
int TimerDuration
Definition: vtkHoverWidget.h:152
vtkHoverWidget::SubclassEndHoverAction
virtual int SubclassEndHoverAction()
Definition: vtkHoverWidget.h:144
vtkHoverWidget::TimerId
int TimerId
Helper methods for creating and destroying timers.
Definition: vtkHoverWidget.h:151