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 
63 #ifndef vtkCompassWidget_h
64 #define vtkCompassWidget_h
65 
66 #include "vtkAbstractWidget.h"
67 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
68 #include "vtkInteractionWidgetsModule.h" // For export macro
69 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
70 
71 VTK_ABI_NAMESPACE_BEGIN
73 
74 class VTKINTERACTIONWIDGETS_EXPORT vtkCompassWidget : public vtkAbstractWidget
75 {
76 public:
80  static vtkCompassWidget* New();
81 
83 
87  void PrintSelf(ostream& os, vtkIndent indent) override;
89 
96  {
97  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
98  }
99 
104 
106 
109  double GetHeading();
110  void SetHeading(double v);
111  double GetTilt();
112  void SetTilt(double tilt);
113  double GetDistance();
114  void SetDistance(double distance);
116 
118 
122  vtkGetMacro(TimerDuration, int);
123  vtkSetMacro(TimerDuration, int);
125 
127 
131  vtkGetMacro(TiltSpeed, double);
132  vtkSetMacro(TiltSpeed, double);
134 
136 
140  vtkGetMacro(DistanceSpeed, double);
141  vtkSetMacro(DistanceSpeed, double);
143 
144 protected:
146  ~vtkCompassWidget() override = default;
147 
148  // These are the events that are handled
149  static void SelectAction(vtkAbstractWidget* widget);
150  static void EndSelectAction(vtkAbstractWidget* widget);
151  static void MoveAction(vtkAbstractWidget* widget);
152  static void TimerAction(vtkAbstractWidget* widget);
153 
156  {
157  Start = 0,
165  DistanceTimerAdjustingOut
166  };
167 #if !defined(VTK_LEGACY_REMOVE)
168  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
170 #endif
171 
172  int TimerId = -1;
173  int TimerDuration = 50;
174  double StartTime;
175 
176  double TiltSpeed = 30.0;
177  double DistanceSpeed = 1.0;
178 
179 private:
180  vtkCompassWidget(const vtkCompassWidget&) = delete;
181  void operator=(const vtkCompassWidget&) = delete;
182 };
183 
184 VTK_ABI_NAMESPACE_END
185 #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:38
abstract class defines interface between the widget and widget representation classes
#define VTK_DEPRECATED_IN_9_2_0(reason)