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
54#ifndef vtkCompassWidget_h
55#define vtkCompassWidget_h
56
57#include "vtkAbstractWidget.h"
58#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
59#include "vtkInteractionWidgetsModule.h" // For export macro
60#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
61
62VTK_ABI_NAMESPACE_BEGIN
64
65class VTKINTERACTIONWIDGETS_EXPORT vtkCompassWidget : public vtkAbstractWidget
66{
67public:
72
74
78 void PrintSelf(ostream& os, vtkIndent indent) override;
80
87 {
88 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
89 }
90
95
97
100 double GetHeading();
101 void SetHeading(double v);
102 double GetTilt();
103 void SetTilt(double tilt);
104 double GetDistance();
105 void SetDistance(double distance);
107
109
113 vtkGetMacro(TimerDuration, int);
114 vtkSetMacro(TimerDuration, int);
116
118
122 vtkGetMacro(TiltSpeed, double);
123 vtkSetMacro(TiltSpeed, double);
125
127
131 vtkGetMacro(DistanceSpeed, double);
132 vtkSetMacro(DistanceSpeed, double);
134
135protected:
137 ~vtkCompassWidget() override = default;
138
139 // These are the events that are handled
140 static void SelectAction(vtkAbstractWidget* widget);
141 static void EndSelectAction(vtkAbstractWidget* widget);
142 static void MoveAction(vtkAbstractWidget* widget);
143 static void TimerAction(vtkAbstractWidget* widget);
144
158#if !defined(VTK_LEGACY_REMOVE)
159 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
161#endif
162
163 int TimerId = -1;
164 int TimerDuration = 50;
165 double StartTime;
166
167 double TiltSpeed = 30.0;
168 double DistanceSpeed = 1.0;
169
170private:
171 vtkCompassWidget(const vtkCompassWidget&) = delete;
172 void operator=(const vtkCompassWidget&) = delete;
173};
174
175VTK_ABI_NAMESPACE_END
176#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)