VTK  9.3.1
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 
62 VTK_ABI_NAMESPACE_BEGIN
64 
65 class VTKINTERACTIONWIDGETS_EXPORT vtkCompassWidget : public vtkAbstractWidget
66 {
67 public:
71  static vtkCompassWidget* New();
72 
74 
78  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
87  {
88  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
89  }
90 
94  void CreateDefaultRepresentation() override;
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 
135 protected:
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 
147  {
148  Start = 0,
156  DistanceTimerAdjustingOut
157  };
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 
170 private:
171  vtkCompassWidget(const vtkCompassWidget&) = delete;
172  void operator=(const vtkCompassWidget&) = delete;
173 };
174 
175 VTK_ABI_NAMESPACE_END
176 #endif
void SetRepresentation(vtkCompassRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
a simple class to control print indentation
Definition: vtkIndent.h:28
define the API for widget / widget representation
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
widget to set distance, tilt and heading
provide a compass and distance, tilt sliders