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
69
70#ifndef vtkCompassWidget_h
71#define vtkCompassWidget_h
72
73#include "vtkAbstractWidget.h"
74#include "vtkInteractionWidgetsModule.h" // For export macro
75#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
76
77VTK_ABI_NAMESPACE_BEGIN
79
80class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCompassWidget : public vtkAbstractWidget
81{
82public:
87
89
93 void PrintSelf(ostream& os, vtkIndent indent) override;
95
105
110
112
115 double GetHeading();
116 void SetHeading(double v);
117 double GetTilt();
118 void SetTilt(double tilt);
119 double GetDistance();
120 void SetDistance(double distance);
122
124
128 vtkGetMacro(TimerDuration, int);
129 vtkSetMacro(TimerDuration, int);
131
133
137 vtkGetMacro(TiltSpeed, double);
138 vtkSetMacro(TiltSpeed, double);
140
142
146 vtkGetMacro(DistanceSpeed, double);
147 vtkSetMacro(DistanceSpeed, double);
149
150protected:
152 ~vtkCompassWidget() override = default;
153
154 // These are the events that are handled
155 static void SelectAction(vtkAbstractWidget* widget);
156 static void EndSelectAction(vtkAbstractWidget* widget);
157 static void MoveAction(vtkAbstractWidget* widget);
158 static void TimerAction(vtkAbstractWidget* widget);
159
173
174 int TimerId = -1;
176 double StartTime;
177
178 double TiltSpeed = 30.0;
179 double DistanceSpeed = 1.0;
180
181private:
182 vtkCompassWidget(const vtkCompassWidget&) = delete;
183 void operator=(const vtkCompassWidget&) = delete;
184};
185
186VTK_ABI_NAMESPACE_END
187#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:108
abstract class defines interface between the widget and widget representation classes
#define VTK_MARSHALAUTO