VTK  9.0.1
vtkSphereWidget2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSphereWidget2.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
90 #ifndef vtkSphereWidget2_h
91 #define vtkSphereWidget2_h
92 
93 #include "vtkAbstractWidget.h"
94 #include "vtkInteractionWidgetsModule.h" // For export macro
95 
97 class vtkHandleWidget;
98 
99 class VTKINTERACTIONWIDGETS_EXPORT vtkSphereWidget2 : public vtkAbstractWidget
100 {
101 public:
105  static vtkSphereWidget2* New();
106 
108 
112  void PrintSelf(ostream& os, vtkIndent indent) override;
114 
121  {
122  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
123  }
124 
126 
130  vtkSetMacro(TranslationEnabled, vtkTypeBool);
131  vtkGetMacro(TranslationEnabled, vtkTypeBool);
132  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
133  vtkSetMacro(ScalingEnabled, vtkTypeBool);
134  vtkGetMacro(ScalingEnabled, vtkTypeBool);
135  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
137 
142  void CreateDefaultRepresentation() override;
143 
148  void SetEnabled(int enabling) override;
149 
150 protected:
152  ~vtkSphereWidget2() override;
153 
154  // Manage the state of the widget
157  {
158  Start = 0,
159  Active
160  };
161 
162  // These methods handle events
163  static void SelectAction(vtkAbstractWidget*);
164  static void EndSelectAction(vtkAbstractWidget*);
165  static void TranslateAction(vtkAbstractWidget*);
166  static void ScaleAction(vtkAbstractWidget*);
167  static void MoveAction(vtkAbstractWidget*);
168 
169  // Control whether scaling and translation are supported
172 
174  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
175 
176 private:
177  vtkSphereWidget2(const vtkSphereWidget2&) = delete;
178  void operator=(const vtkSphereWidget2&) = delete;
179 };
180 
181 #endif
3D widget for manipulating a point on a sphere
vtkTypeBool TranslationEnabled
abstract base class for most VTK objects
Definition: vtkObject.h:56
vtkCallbackCommand * KeyEventCallbackCommand
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:69
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:33
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