VTK  9.0.20201029
vtkTensorWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTensorWidget.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 =========================================================================*/
95 #ifndef vtkTensorWidget_h
96 #define vtkTensorWidget_h
97 
98 #include "vtkAbstractWidget.h"
99 #include "vtkInteractionWidgetsModule.h" // For export macro
100 
102 
103 class VTKINTERACTIONWIDGETS_EXPORT vtkTensorWidget : public vtkAbstractWidget
104 {
105 public:
107 
110  static vtkTensorWidget* New();
112  void PrintSelf(ostream& os, vtkIndent indent) override;
114 
121  {
122  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
123  }
124 
126 
134  vtkSetMacro(TranslationEnabled, vtkTypeBool);
135  vtkGetMacro(TranslationEnabled, vtkTypeBool);
136  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
137  vtkSetMacro(ScalingEnabled, vtkTypeBool);
138  vtkGetMacro(ScalingEnabled, vtkTypeBool);
139  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
140  vtkSetMacro(RotationEnabled, vtkTypeBool);
141  vtkGetMacro(RotationEnabled, vtkTypeBool);
142  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
143  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
144  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
145  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
147 
152  void CreateDefaultRepresentation() override;
153 
158  void SetEnabled(int enabling) override;
159 
160 protected:
161  vtkTensorWidget();
162  ~vtkTensorWidget() override;
163 
164  // Manage the state of the widget
167  {
168  Start = 0,
169  Active
170  };
171 
172  // These methods handle events
173  static void SelectAction(vtkAbstractWidget*);
174  static void EndSelectAction(vtkAbstractWidget*);
175  static void TranslateAction(vtkAbstractWidget*);
176  static void ScaleAction(vtkAbstractWidget*);
177  static void MoveAction(vtkAbstractWidget*);
178  static void SelectAction3D(vtkAbstractWidget*);
179  static void EndSelectAction3D(vtkAbstractWidget*);
180  static void MoveAction3D(vtkAbstractWidget*);
181  static void StepAction3D(vtkAbstractWidget*);
182 
183  // Control whether scaling, rotation, and translation are supported
188 
190  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
191 
192 private:
193  vtkTensorWidget(const vtkTensorWidget&) = delete;
194  void operator=(const vtkTensorWidget&) = delete;
195 };
196 
197 #endif
vtkTensorWidget::SetRepresentation
void SetRepresentation(vtkTensorRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkTensorWidget.h:120
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.
vtkTensorWidget::KeyEventCallbackCommand
vtkCallbackCommand * KeyEventCallbackCommand
Definition: vtkTensorWidget.h:189
vtkTensorWidget::_WidgetState
_WidgetState
Definition: vtkTensorWidget.h:166
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkTensorWidget::WidgetState
int WidgetState
Definition: vtkTensorWidget.h:165
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkTensorWidget::MoveFacesEnabled
vtkTypeBool MoveFacesEnabled
Definition: vtkTensorWidget.h:187
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkTensorWidget::ScalingEnabled
vtkTypeBool ScalingEnabled
Definition: vtkTensorWidget.h:185
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkTensorWidget
3D widget for manipulating a tensor glyph
Definition: vtkTensorWidget.h:103
vtkTensorRepresentation
class defining a representation for the vtkTensorWidget
Definition: vtkTensorRepresentation.h:66
vtkTensorWidget::RotationEnabled
vtkTypeBool RotationEnabled
Definition: vtkTensorWidget.h:186
vtkTensorWidget::TranslationEnabled
vtkTypeBool TranslationEnabled
Definition: vtkTensorWidget.h:184
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69