VTK  9.0.20201029
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 =========================================================================*/
93 #ifndef vtkSphereWidget2_h
94 #define vtkSphereWidget2_h
95 
96 #include "vtkAbstractWidget.h"
97 #include "vtkInteractionWidgetsModule.h" // For export macro
98 
100 class vtkHandleWidget;
101 
102 class VTKINTERACTIONWIDGETS_EXPORT vtkSphereWidget2 : public vtkAbstractWidget
103 {
104 public:
108  static vtkSphereWidget2* New();
109 
111 
115  void PrintSelf(ostream& os, vtkIndent indent) override;
117 
124  {
125  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
126  }
127 
129 
133  vtkSetMacro(TranslationEnabled, vtkTypeBool);
134  vtkGetMacro(TranslationEnabled, vtkTypeBool);
135  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
136  vtkSetMacro(ScalingEnabled, vtkTypeBool);
137  vtkGetMacro(ScalingEnabled, vtkTypeBool);
138  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
140 
145  void CreateDefaultRepresentation() override;
146 
151  void SetEnabled(int enabling) override;
152 
153 protected:
155  ~vtkSphereWidget2() override;
156 
157  // Manage the state of the widget
160  {
161  Start = 0,
162  Active
163  };
164 
165  // These methods handle events
166  static void SelectAction(vtkAbstractWidget*);
167  static void EndSelectAction(vtkAbstractWidget*);
168  static void TranslateAction(vtkAbstractWidget*);
169  static void ScaleAction(vtkAbstractWidget*);
170  static void MoveAction(vtkAbstractWidget*);
171 
172  // Control whether scaling and translation are supported
175 
177  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
178 
179 private:
180  vtkSphereWidget2(const vtkSphereWidget2&) = delete;
181  void operator=(const vtkSphereWidget2&) = delete;
182 };
183 
184 #endif
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:78
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkSphereRepresentation
a class defining the representation for the vtkSphereWidget2
Definition: vtkSphereRepresentation.h:75
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkSphereWidget2::ScalingEnabled
vtkTypeBool ScalingEnabled
Definition: vtkSphereWidget2.h:174
vtkSphereWidget2::KeyEventCallbackCommand
vtkCallbackCommand * KeyEventCallbackCommand
Definition: vtkSphereWidget2.h:176
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkSphereWidget2::TranslationEnabled
vtkTypeBool TranslationEnabled
Definition: vtkSphereWidget2.h:173
vtkSphereWidget2
3D widget for manipulating a point on a sphere
Definition: vtkSphereWidget2.h:102
vtkSphereWidget2::WidgetState
int WidgetState
Definition: vtkSphereWidget2.h:158
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkSphereWidget2::SetRepresentation
void SetRepresentation(vtkSphereRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkSphereWidget2.h:123
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkSphereWidget2::_WidgetState
_WidgetState
Definition: vtkSphereWidget2.h:159