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
51#ifndef vtkCompassWidget_h
52#define vtkCompassWidget_h
53
54#include "vtkAbstractWidget.h"
55#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
56#include "vtkInteractionWidgetsModule.h" // For export macro
57#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
58
59VTK_ABI_NAMESPACE_BEGIN
61
62class VTKINTERACTIONWIDGETS_EXPORT vtkCompassWidget : public vtkAbstractWidget
63{
64public:
69
71
75 void PrintSelf(ostream& os, vtkIndent indent) override;
77
84 {
85 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
86 }
87
92
94
97 double GetHeading();
98 void SetHeading(double v);
99 double GetTilt();
100 void SetTilt(double tilt);
101 double GetDistance();
102 void SetDistance(double distance);
104
106
110 vtkGetMacro(TimerDuration, int);
111 vtkSetMacro(TimerDuration, int);
113
115
119 vtkGetMacro(TiltSpeed, double);
120 vtkSetMacro(TiltSpeed, double);
122
124
128 vtkGetMacro(DistanceSpeed, double);
129 vtkSetMacro(DistanceSpeed, double);
131
132protected:
134 ~vtkCompassWidget() override = default;
135
136 // These are the events that are handled
137 static void SelectAction(vtkAbstractWidget* widget);
138 static void EndSelectAction(vtkAbstractWidget* widget);
139 static void MoveAction(vtkAbstractWidget* widget);
140 static void TimerAction(vtkAbstractWidget* widget);
141
144 {
145 Start = 0,
153 DistanceTimerAdjustingOut
154 };
155#if !defined(VTK_LEGACY_REMOVE)
156 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
158#endif
159
160 int TimerId = -1;
161 int TimerDuration = 50;
162 double StartTime;
163
164 double TiltSpeed = 30.0;
165 double DistanceSpeed = 1.0;
166
167private:
168 vtkCompassWidget(const vtkCompassWidget&) = delete;
169 void operator=(const vtkCompassWidget&) = delete;
170};
171
172VTK_ABI_NAMESPACE_END
173#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:29
abstract class defines interface between the widget and widget representation classes
#define VTK_DEPRECATED_IN_9_2_0(reason)