VTK  9.3.20240417
vtkBoxWidget2.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
106 #ifndef vtkBoxWidget2_h
107 #define vtkBoxWidget2_h
108 
109 #include "vtkAbstractWidget.h"
110 #include "vtkInteractionWidgetsModule.h" // For export macro
111 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
112 
113 VTK_ABI_NAMESPACE_BEGIN
115 class vtkHandleWidget;
116 
117 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBoxWidget2 : public vtkAbstractWidget
118 {
119 public:
123  static vtkBoxWidget2* New();
124 
126 
130  void PrintSelf(ostream& os, vtkIndent indent) override;
132 
139  {
140  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
141  }
142 
144 
152  vtkSetMacro(TranslationEnabled, vtkTypeBool);
153  vtkGetMacro(TranslationEnabled, vtkTypeBool);
154  vtkBooleanMacro(TranslationEnabled, vtkTypeBool);
155  vtkSetMacro(ScalingEnabled, vtkTypeBool);
156  vtkGetMacro(ScalingEnabled, vtkTypeBool);
157  vtkBooleanMacro(ScalingEnabled, vtkTypeBool);
158  vtkSetMacro(RotationEnabled, vtkTypeBool);
159  vtkGetMacro(RotationEnabled, vtkTypeBool);
160  vtkBooleanMacro(RotationEnabled, vtkTypeBool);
161  vtkSetMacro(MoveFacesEnabled, vtkTypeBool);
162  vtkGetMacro(MoveFacesEnabled, vtkTypeBool);
163  vtkBooleanMacro(MoveFacesEnabled, vtkTypeBool);
165 
171 
176  void SetEnabled(int enabling) override;
177 
178 protected:
180  ~vtkBoxWidget2() override;
181 
182  // Manage the state of the widget
185  {
186  Start = 0,
187  Active
188  };
189 
190  // These methods handle events
200 
201  // Control whether scaling, rotation, and translation are supported
206 
208  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
209 
210 private:
211  vtkBoxWidget2(const vtkBoxWidget2&) = delete;
212  void operator=(const vtkBoxWidget2&) = delete;
213 };
214 
215 VTK_ABI_NAMESPACE_END
216 #endif
define the API for widget / widget representation
a class defining the representation for the vtkBoxWidget2
3D widget for manipulating a box
static vtkBoxWidget2 * New()
Instantiate the object.
vtkTypeBool MoveFacesEnabled
void CreateDefaultRepresentation() override
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.
static void SelectAction3D(vtkAbstractWidget *)
void SetEnabled(int enabling) override
Override superclasses' SetEnabled() method because the line widget must enable its internal handle wi...
static void ScaleAction(vtkAbstractWidget *)
static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *)
~vtkBoxWidget2() override
static void SelectAction(vtkAbstractWidget *)
static void EndSelectAction(vtkAbstractWidget *)
static void EndSelectAction3D(vtkAbstractWidget *)
static void TranslateAction(vtkAbstractWidget *)
vtkTypeBool TranslationEnabled
vtkTypeBool RotationEnabled
static void MoveAction3D(vtkAbstractWidget *)
static void MoveAction(vtkAbstractWidget *)
vtkTypeBool ScalingEnabled
void PrintSelf(ostream &os, vtkIndent indent) override
Standard class methods for type information and printing.
vtkCallbackCommand * KeyEventCallbackCommand
static void StepAction3D(vtkAbstractWidget *)
supports function callbacks
a general widget for moving handles
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_MARSHALAUTO