VTK  9.3.1
vtkTensorWidget.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
83 #ifndef vtkTensorWidget_h
84 #define vtkTensorWidget_h
85 
86 #include "vtkAbstractWidget.h"
87 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
88 #include "vtkInteractionWidgetsModule.h" // For export macro
89 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
90 
91 VTK_ABI_NAMESPACE_BEGIN
93 
94 class VTKINTERACTIONWIDGETS_EXPORT vtkTensorWidget : public vtkAbstractWidget
95 {
96 public:
98 
101  static vtkTensorWidget* New();
103  void PrintSelf(ostream& os, vtkIndent indent) override;
105 
112  {
113  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
114  }
115 
117 
125  vtkSetMacro(TranslationEnabled, vtkTypeBool);
126  vtkGetMacro(TranslationEnabled, vtkTypeBool);
127  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
128  vtkSetMacro(ScalingEnabled, vtkTypeBool);
129  vtkGetMacro(ScalingEnabled, vtkTypeBool);
130  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
131  vtkSetMacro(RotationEnabled, vtkTypeBool);
132  vtkGetMacro(RotationEnabled, vtkTypeBool);
133  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
134  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
135  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
136  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
138 
143  void CreateDefaultRepresentation() override;
144 
149  void SetEnabled(int enabling) override;
150 
151 protected:
152  vtkTensorWidget();
153  ~vtkTensorWidget() override;
154 
155  // Manage the state of the widget
158  {
159  Start = 0,
160  Active
161  };
162 #if !defined(VTK_LEGACY_REMOVE)
163  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
165 #endif
166 
167  // These methods handle events
168  static void SelectAction(vtkAbstractWidget*);
169  static void EndSelectAction(vtkAbstractWidget*);
170  static void TranslateAction(vtkAbstractWidget*);
171  static void ScaleAction(vtkAbstractWidget*);
172  static void MoveAction(vtkAbstractWidget*);
173  static void SelectAction3D(vtkAbstractWidget*);
174  static void EndSelectAction3D(vtkAbstractWidget*);
175  static void MoveAction3D(vtkAbstractWidget*);
176  static void StepAction3D(vtkAbstractWidget*);
177 
178  // Control whether scaling, rotation, and translation are supported
183 
185  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
186 
187 private:
188  vtkTensorWidget(const vtkTensorWidget&) = delete;
189  void operator=(const vtkTensorWidget&) = delete;
190 };
191 
192 VTK_ABI_NAMESPACE_END
193 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkTypeBool ScalingEnabled
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
vtkTypeBool RotationEnabled
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
class defining a representation for the vtkTensorWidget
vtkCallbackCommand * KeyEventCallbackCommand
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
vtkTypeBool TranslationEnabled
void SetRepresentation(vtkTensorRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkTypeBool MoveFacesEnabled
3D widget for manipulating a tensor glyph