VTK  9.7.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 "vtkInteractionWidgetsModule.h" // For export macro
88 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
89 
90 VTK_ABI_NAMESPACE_BEGIN
92 
93 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkTensorWidget : public vtkAbstractWidget
94 {
95 public:
97 
100  static vtkTensorWidget* New();
102  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
111  {
112  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
113  }
114 
116 
124  vtkSetMacro(TranslationEnabled, vtkTypeBool);
125  vtkGetMacro(TranslationEnabled, vtkTypeBool);
126  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
127  vtkSetMacro(ScalingEnabled, vtkTypeBool);
128  vtkGetMacro(ScalingEnabled, vtkTypeBool);
129  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
130  vtkSetMacro(RotationEnabled, vtkTypeBool);
131  vtkGetMacro(RotationEnabled, vtkTypeBool);
132  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
133  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
134  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
135  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
137 
142  void CreateDefaultRepresentation() override;
143 
148  void SetEnabled(int enabling) override;
149 
150 protected:
151  vtkTensorWidget();
152  ~vtkTensorWidget() 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  static void SelectAction3D(vtkAbstractWidget*);
169  static void EndSelectAction3D(vtkAbstractWidget*);
170  static void MoveAction3D(vtkAbstractWidget*);
171  static void StepAction3D(vtkAbstractWidget*);
172 
173  // Control whether scaling, rotation, and translation are supported
178 
180  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
181 
182 private:
183  vtkTensorWidget(const vtkTensorWidget&) = delete;
184  void operator=(const vtkTensorWidget&) = delete;
185 };
186 
187 VTK_ABI_NAMESPACE_END
188 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:52
vtkTypeBool ScalingEnabled
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
#define VTK_MARSHALAUTO
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