VTK  9.3.0
vtkCompassWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4
60#ifndef vtkCompassWidget_h
61#define vtkCompassWidget_h
62
63#include "vtkAbstractWidget.h"
64#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
65#include "vtkInteractionWidgetsModule.h" // For export macro
66#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
67
68VTK_ABI_NAMESPACE_BEGIN
70
71class VTKINTERACTIONWIDGETS_EXPORT vtkCompassWidget : public vtkAbstractWidget
72{
73public:
78
80
84 void PrintSelf(ostream& os, vtkIndent indent) override;
86
93 {
94 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
95 }
96
101
103
106 double GetHeading();
107 void SetHeading(double v);
108 double GetTilt();
109 void SetTilt(double tilt);
110 double GetDistance();
111 void SetDistance(double distance);
113
115
119 vtkGetMacro(TimerDuration, int);
120 vtkSetMacro(TimerDuration, int);
122
124
128 vtkGetMacro(TiltSpeed, double);
129 vtkSetMacro(TiltSpeed, double);
131
133
137 vtkGetMacro(DistanceSpeed, double);
138 vtkSetMacro(DistanceSpeed, double);
140
141protected:
143 ~vtkCompassWidget() override = default;
144
145 // These are the events that are handled
146 static void SelectAction(vtkAbstractWidget* widget);
147 static void EndSelectAction(vtkAbstractWidget* widget);
148 static void MoveAction(vtkAbstractWidget* widget);
149 static void TimerAction(vtkAbstractWidget* widget);
150
153 {
154 Start = 0,
162 DistanceTimerAdjustingOut
163 };
164#if !defined(VTK_LEGACY_REMOVE)
165 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
167#endif
168
169 int TimerId = -1;
170 int TimerDuration = 50;
171 double StartTime;
172
173 double TiltSpeed = 30.0;
174 double DistanceSpeed = 1.0;
175
176private:
177 vtkCompassWidget(const vtkCompassWidget&) = delete;
178 void operator=(const vtkCompassWidget&) = delete;
179};
180
181VTK_ABI_NAMESPACE_END
182#endif
define the API for widget / widget representation
provide a compass and distance, tilt sliders
widget to set distance, tilt and heading
static void SelectAction(vtkAbstractWidget *widget)
~vtkCompassWidget() override=default
void SetRepresentation(vtkCompassRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void SetHeading(double v)
Get/set the value for this widget.
double GetHeading()
Get/set the value for this widget.
static vtkCompassWidget * New()
Instantiate the class.
static void MoveAction(vtkAbstractWidget *widget)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static void TimerAction(vtkAbstractWidget *widget)
static void EndSelectAction(vtkAbstractWidget *widget)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
double GetDistance()
Get/set the value for this widget.
double GetTilt()
Get/set the value for this widget.
void SetTilt(double tilt)
Get/set the value for this widget.
void SetDistance(double distance)
Get/set the value for this widget.
a simple class to control print indentation
Definition vtkIndent.h:38
abstract class defines interface between the widget and widget representation classes
#define VTK_DEPRECATED_IN_9_2_0(reason)