VTK  9.4.20251007
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
53
54#ifndef vtkCompassWidget_h
55#define vtkCompassWidget_h
56
57#include "vtkAbstractWidget.h"
58#include "vtkInteractionWidgetsModule.h" // For export macro
59#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
60
61VTK_ABI_NAMESPACE_BEGIN
63
64class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCompassWidget : public vtkAbstractWidget
65{
66public:
71
73
77 void PrintSelf(ostream& os, vtkIndent indent) override;
79
89
94
96
99 double GetHeading();
100 void SetHeading(double v);
101 double GetTilt();
102 void SetTilt(double tilt);
103 double GetDistance();
104 void SetDistance(double distance);
106
108
112 vtkGetMacro(TimerDuration, int);
113 vtkSetMacro(TimerDuration, int);
115
117
121 vtkGetMacro(TiltSpeed, double);
122 vtkSetMacro(TiltSpeed, double);
124
126
130 vtkGetMacro(DistanceSpeed, double);
131 vtkSetMacro(DistanceSpeed, double);
133
134protected:
136 ~vtkCompassWidget() override = default;
137
138 // These are the events that are handled
139 static void SelectAction(vtkAbstractWidget* widget);
140 static void EndSelectAction(vtkAbstractWidget* widget);
141 static void MoveAction(vtkAbstractWidget* widget);
142 static void TimerAction(vtkAbstractWidget* widget);
143
157
158 int TimerId = -1;
160 double StartTime;
161
162 double TiltSpeed = 30.0;
163 double DistanceSpeed = 1.0;
164
165private:
166 vtkCompassWidget(const vtkCompassWidget&) = delete;
167 void operator=(const vtkCompassWidget&) = delete;
168};
169
170VTK_ABI_NAMESPACE_END
171#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