VTK  9.2.6
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 =========================================================================*/
99 #ifndef vtkBoxWidget2_h
100 #define vtkBoxWidget2_h
101 
102 #include "vtkAbstractWidget.h"
103 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
104 #include "vtkInteractionWidgetsModule.h" // For export macro
105 
107 class vtkHandleWidget;
108 
109 class VTKINTERACTIONWIDGETS_EXPORT vtkBoxWidget2 : public vtkAbstractWidget
110 {
111 public:
115  static vtkBoxWidget2* New();
116 
118 
122  void PrintSelf(ostream& os, vtkIndent indent) override;
124 
131  {
132  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
133  }
134 
136 
144  vtkSetMacro(TranslationEnabled, vtkTypeBool);
145  vtkGetMacro(TranslationEnabled, vtkTypeBool);
146  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
147  vtkSetMacro(ScalingEnabled, vtkTypeBool);
148  vtkGetMacro(ScalingEnabled, vtkTypeBool);
149  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
150  vtkSetMacro(RotationEnabled, vtkTypeBool);
151  vtkGetMacro(RotationEnabled, vtkTypeBool);
152  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
153  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
154  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
155  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
157 
162  void CreateDefaultRepresentation() override;
163 
168  void SetEnabled(int enabling) override;
169 
170 protected:
171  vtkBoxWidget2();
172  ~vtkBoxWidget2() override;
173 
174  // Manage the state of the widget
177  {
178  Start = 0,
179  Active
180  };
181 #if !defined(VTK_LEGACY_REMOVE)
182  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
184 #endif
185 
186  // These methods handle events
187  static void SelectAction(vtkAbstractWidget*);
188  static void EndSelectAction(vtkAbstractWidget*);
189  static void TranslateAction(vtkAbstractWidget*);
190  static void ScaleAction(vtkAbstractWidget*);
191  static void MoveAction(vtkAbstractWidget*);
192  static void SelectAction3D(vtkAbstractWidget*);
193  static void EndSelectAction3D(vtkAbstractWidget*);
194  static void MoveAction3D(vtkAbstractWidget*);
195  static void StepAction3D(vtkAbstractWidget*);
196 
197  // Control whether scaling, rotation, and translation are supported
202 
204  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
205 
206 private:
207  vtkBoxWidget2(const vtkBoxWidget2&) = delete;
208  void operator=(const vtkBoxWidget2&) = delete;
209 };
210 
211 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
#define VTK_DEPRECATED_IN_9_2_0(reason)
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:39
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