VTK  9.5.2
vtkHandleWidget.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
55#ifndef vtkHandleWidget_h
56#define vtkHandleWidget_h
57
58#include "vtkAbstractWidget.h"
59#include "vtkInteractionWidgetsModule.h" // For export macro
60#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
61
62VTK_ABI_NAMESPACE_BEGIN
64
65class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkHandleWidget : public vtkAbstractWidget
66{
67public:
72
74
78 void PrintSelf(ostream& os, vtkIndent indent) override;
80
87 {
88 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
89 }
90
95 {
96 return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);
97 }
98
104
106
111 vtkSetMacro(EnableAxisConstraint, vtkTypeBool);
112 vtkGetMacro(EnableAxisConstraint, vtkTypeBool);
113 vtkBooleanMacro(EnableAxisConstraint, vtkTypeBool);
115
117
120 vtkSetMacro(EnableTranslation, vtkTypeBool);
121 vtkGetMacro(EnableTranslation, vtkTypeBool);
122 vtkBooleanMacro(EnableTranslation, vtkTypeBool);
124
126
130 vtkSetMacro(AllowHandleResize, vtkTypeBool);
131 vtkGetMacro(AllowHandleResize, vtkTypeBool);
132 vtkBooleanMacro(AllowHandleResize, vtkTypeBool);
134
136
139 vtkGetMacro(WidgetState, int);
141
143
148 vtkSetMacro(ShowInactive, vtkTypeBool);
149 vtkGetMacro(ShowInactive, vtkTypeBool);
150 vtkBooleanMacro(ShowInactive, vtkTypeBool);
152
153 // Manage the state of the widget
155 {
156 Start = 0,
158 Inactive
159 };
160
165 void SetEnabled(int enabling) override;
166
167protected:
170
171 // These are the callbacks for this widget
180 static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
181
182 // helper methods for cursor management
183 void SetCursor(int state) override;
184
188
189 // Allow resizing of handles.
191
192 // Keep representation visible when disabled
194
196
197private:
198 vtkHandleWidget(const vtkHandleWidget&) = delete;
199 void operator=(const vtkHandleWidget&) = delete;
200};
201
202VTK_ABI_NAMESPACE_END
203#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
supports function callbacks
abstract class for representing widget handles
a general widget for moving handles
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK class macros.
static void SelectAction(vtkAbstractWidget *)
static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *)
vtkCallbackCommand * KeyEventCallbackCommand
vtkHandleRepresentation * GetHandleRepresentation()
Return the representation as a vtkHandleRepresentation.
vtkTypeBool ShowInactive
void SetRepresentation(vtkHandleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static vtkHandleWidget * New()
Instantiate this class.
static void GenericAction(vtkHandleWidget *)
static void MoveAction3D(vtkAbstractWidget *)
vtkTypeBool AllowHandleResize
void SetCursor(int state) override
static void MoveAction(vtkAbstractWidget *)
void SetEnabled(int enabling) override
Enable/disable widget.
static void TranslateAction(vtkAbstractWidget *)
static void ScaleAction(vtkAbstractWidget *)
~vtkHandleWidget() override
vtkTypeBool EnableAxisConstraint
static void SelectAction3D(vtkAbstractWidget *)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
static void EndSelectAction(vtkAbstractWidget *)
vtkTypeBool EnableTranslation
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:50
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO