VTK
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 =========================================================================*/
93 #ifndef vtkBoxWidget2_h
94 #define vtkBoxWidget2_h
95 
96 #include "vtkAbstractWidget.h"
97 #include "vtkInteractionWidgetsModule.h" // For export macro
98 
100 class vtkHandleWidget;
101 
102 class VTKINTERACTIONWIDGETS_EXPORT vtkBoxWidget2 : public vtkAbstractWidget
103 {
104 public:
108  static vtkBoxWidget2* New();
109 
111 
115  void PrintSelf(ostream& os, vtkIndent indent) override;
117 
124  {
125  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
126  }
127 
129 
137  vtkSetMacro(TranslationEnabled, vtkTypeBool);
138  vtkGetMacro(TranslationEnabled, vtkTypeBool);
139  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
140  vtkSetMacro(ScalingEnabled, vtkTypeBool);
141  vtkGetMacro(ScalingEnabled, vtkTypeBool);
142  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
143  vtkSetMacro(RotationEnabled, vtkTypeBool);
144  vtkGetMacro(RotationEnabled, vtkTypeBool);
145  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
146  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
147  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
148  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
150 
155  void CreateDefaultRepresentation() override;
156 
161  void SetEnabled(int enabling) override;
162 
163 protected:
164  vtkBoxWidget2();
165  ~vtkBoxWidget2() override;
166 
167  // Manage the state of the widget
170  {
171  Start = 0,
172  Active
173  };
174 
175  // These methods handle events
176  static void SelectAction(vtkAbstractWidget*);
177  static void EndSelectAction(vtkAbstractWidget*);
178  static void TranslateAction(vtkAbstractWidget*);
179  static void ScaleAction(vtkAbstractWidget*);
180  static void MoveAction(vtkAbstractWidget*);
181  static void SelectAction3D(vtkAbstractWidget*);
182  static void EndSelectAction3D(vtkAbstractWidget*);
183  static void MoveAction3D(vtkAbstractWidget*);
184  static void StepAction3D(vtkAbstractWidget*);
185 
186  // Control whether scaling, rotation, and translation are supported
191 
193  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
194 
195 private:
196  vtkBoxWidget2(const vtkBoxWidget2&) = delete;
197  void operator=(const vtkBoxWidget2&) = delete;
198 };
199 
200 #endif
vtkBoxWidget2
3D widget for manipulating a box
Definition: vtkBoxWidget2.h:102
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:72
vtkBoxWidget2::WidgetState
int WidgetState
Definition: vtkBoxWidget2.h:168
vtkBoxRepresentation
a class defining the representation for the vtkBoxWidget2
Definition: vtkBoxRepresentation.h:59
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.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkBoxWidget2::TranslationEnabled
vtkTypeBool TranslationEnabled
Definition: vtkBoxWidget2.h:187
vtkBoxWidget2::ScalingEnabled
vtkTypeBool ScalingEnabled
Definition: vtkBoxWidget2.h:188
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:62
vtkBoxWidget2::KeyEventCallbackCommand
vtkCallbackCommand * KeyEventCallbackCommand
Definition: vtkBoxWidget2.h:192
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkBoxWidget2::SetRepresentation
void SetRepresentation(vtkBoxRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkBoxWidget2.h:123
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkBoxWidget2::MoveFacesEnabled
vtkTypeBool MoveFacesEnabled
Definition: vtkBoxWidget2.h:190
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkBoxWidget2::_WidgetState
_WidgetState
Definition: vtkBoxWidget2.h:169
vtkBoxWidget2::RotationEnabled
vtkTypeBool RotationEnabled
Definition: vtkBoxWidget2.h:189
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69