VTK  9.0.1
vtkBoxWidget2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBoxWidget2.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 =========================================================================*/
96 #ifndef vtkBoxWidget2_h
97 #define vtkBoxWidget2_h
98 
99 #include "vtkAbstractWidget.h"
100 #include "vtkInteractionWidgetsModule.h" // For export macro
101 
103 class vtkHandleWidget;
104 
105 class VTKINTERACTIONWIDGETS_EXPORT vtkBoxWidget2 : public vtkAbstractWidget
106 {
107 public:
111  static vtkBoxWidget2* New();
112 
114 
118  void PrintSelf(ostream& os, vtkIndent indent) override;
120 
127  {
128  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
129  }
130 
132 
140  vtkSetMacro(TranslationEnabled, vtkTypeBool);
141  vtkGetMacro(TranslationEnabled, vtkTypeBool);
142  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
143  vtkSetMacro(ScalingEnabled, vtkTypeBool);
144  vtkGetMacro(ScalingEnabled, vtkTypeBool);
145  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
146  vtkSetMacro(RotationEnabled, vtkTypeBool);
147  vtkGetMacro(RotationEnabled, vtkTypeBool);
148  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
149  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
150  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
151  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
153 
158  void CreateDefaultRepresentation() override;
159 
164  void SetEnabled(int enabling) override;
165 
166 protected:
167  vtkBoxWidget2();
168  ~vtkBoxWidget2() override;
169 
170  // Manage the state of the widget
173  {
174  Start = 0,
175  Active
176  };
177 
178  // These methods handle events
179  static void SelectAction(vtkAbstractWidget*);
180  static void EndSelectAction(vtkAbstractWidget*);
181  static void TranslateAction(vtkAbstractWidget*);
182  static void ScaleAction(vtkAbstractWidget*);
183  static void MoveAction(vtkAbstractWidget*);
184  static void SelectAction3D(vtkAbstractWidget*);
185  static void EndSelectAction3D(vtkAbstractWidget*);
186  static void MoveAction3D(vtkAbstractWidget*);
187  static void StepAction3D(vtkAbstractWidget*);
188 
189  // Control whether scaling, rotation, and translation are supported
194 
196  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
197 
198 private:
199  vtkBoxWidget2(const vtkBoxWidget2&) = delete;
200  void operator=(const vtkBoxWidget2&) = delete;
201 };
202 
203 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:56
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
vtkCallbackCommand * KeyEventCallbackCommand
vtkTypeBool ScalingEnabled
a class defining the representation for the vtkBoxWidget2
a general widget for moving handles
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
void SetRepresentation(vtkBoxRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
int vtkTypeBool
Definition: vtkABI.h:69
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:33
3D widget for manipulating a box
define the API for widget / widget representation
vtkTypeBool TranslationEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkTypeBool MoveFacesEnabled
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkTypeBool RotationEnabled