VTK  9.5.2
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
50
51#ifndef vtkCompassWidget_h
52#define vtkCompassWidget_h
53
54#include "vtkAbstractWidget.h"
55#include "vtkInteractionWidgetsModule.h" // For export macro
56#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
57
58VTK_ABI_NAMESPACE_BEGIN
60
61class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCompassWidget : public vtkAbstractWidget
62{
63public:
68
70
74 void PrintSelf(ostream& os, vtkIndent indent) override;
76
86
91
93
96 double GetHeading();
97 void SetHeading(double v);
98 double GetTilt();
99 void SetTilt(double tilt);
100 double GetDistance();
101 void SetDistance(double distance);
103
105
109 vtkGetMacro(TimerDuration, int);
110 vtkSetMacro(TimerDuration, int);
112
114
118 vtkGetMacro(TiltSpeed, double);
119 vtkSetMacro(TiltSpeed, double);
121
123
127 vtkGetMacro(DistanceSpeed, double);
128 vtkSetMacro(DistanceSpeed, double);
130
131protected:
133 ~vtkCompassWidget() override = default;
134
135 // These are the events that are handled
136 static void SelectAction(vtkAbstractWidget* widget);
137 static void EndSelectAction(vtkAbstractWidget* widget);
138 static void MoveAction(vtkAbstractWidget* widget);
139 static void TimerAction(vtkAbstractWidget* widget);
140
154
155 int TimerId = -1;
157 double StartTime;
158
159 double TiltSpeed = 30.0;
160 double DistanceSpeed = 1.0;
161
162private:
163 vtkCompassWidget(const vtkCompassWidget&) = delete;
164 void operator=(const vtkCompassWidget&) = delete;
165};
166
167VTK_ABI_NAMESPACE_END
168#endif
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
provide a compass and distance, tilt sliders
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_MARSHALAUTO