VTK  9.3.1
vtkSphereWidget2.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
81 #ifndef vtkSphereWidget2_h
82 #define vtkSphereWidget2_h
83 
84 #include "vtkAbstractWidget.h"
85 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
86 #include "vtkInteractionWidgetsModule.h" // For export macro
87 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
88 
89 VTK_ABI_NAMESPACE_BEGIN
91 class vtkHandleWidget;
92 
93 class VTKINTERACTIONWIDGETS_EXPORT vtkSphereWidget2 : public vtkAbstractWidget
94 {
95 public:
99  static vtkSphereWidget2* New();
100 
102 
106  void PrintSelf(ostream& os, vtkIndent indent) override;
108 
115  {
116  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
117  }
118 
120 
124  vtkSetMacro(TranslationEnabled, vtkTypeBool);
125  vtkGetMacro(TranslationEnabled, vtkTypeBool);
126  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
127  vtkSetMacro(ScalingEnabled, vtkTypeBool);
128  vtkGetMacro(ScalingEnabled, vtkTypeBool);
129  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
131 
136  void CreateDefaultRepresentation() override;
137 
142  void SetEnabled(int enabling) override;
143 
144 protected:
146  ~vtkSphereWidget2() override;
147 
148  // Manage the state of the widget
151  {
152  Start = 0,
153  Active
154  };
155 #if !defined(VTK_LEGACY_REMOVE)
156  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
158 #endif
159 
160  // These methods handle events
161  static void SelectAction(vtkAbstractWidget*);
162  static void EndSelectAction(vtkAbstractWidget*);
163  static void TranslateAction(vtkAbstractWidget*);
164  static void ScaleAction(vtkAbstractWidget*);
165  static void MoveAction(vtkAbstractWidget*);
166 
167  // Control whether scaling and translation are supported
170 
172  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
173 
174 private:
175  vtkSphereWidget2(const vtkSphereWidget2&) = delete;
176  void operator=(const vtkSphereWidget2&) = delete;
177 };
178 
179 VTK_ABI_NAMESPACE_END
180 #endif
3D widget for manipulating a point on a sphere
vtkTypeBool TranslationEnabled
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkCallbackCommand * KeyEventCallbackCommand
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
void SetRepresentation(vtkSphereRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
int vtkTypeBool
Definition: vtkABI.h:64
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:28
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
a class defining the representation for the vtkSphereWidget2
vtkTypeBool ScalingEnabled