VTK
9.5.20251125
Interaction
Widgets
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
57
58
#ifndef vtkHandleWidget_h
59
#define vtkHandleWidget_h
60
61
#include "
vtkAbstractWidget.h
"
62
#include "vtkInteractionWidgetsModule.h"
// For export macro
63
#include "
vtkWrappingHints.h
"
// For VTK_MARSHALAUTO
64
65
VTK_ABI_NAMESPACE_BEGIN
66
class
vtkHandleRepresentation
;
67
68
class
VTKINTERACTIONWIDGETS_EXPORT
VTK_MARSHALAUTO
vtkHandleWidget
:
public
vtkAbstractWidget
69
{
70
public
:
74
static
vtkHandleWidget
*
New
();
75
77
80
vtkTypeMacro(
vtkHandleWidget
,
vtkAbstractWidget
);
81
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
83
89
void
SetRepresentation
(
vtkHandleRepresentation
* r)
90
{
91
this->
Superclass::SetWidgetRepresentation
(
reinterpret_cast<
vtkWidgetRepresentation
*
>
(r));
92
}
93
97
vtkHandleRepresentation
*
GetHandleRepresentation
()
98
{
99
return
reinterpret_cast<
vtkHandleRepresentation
*
>
(this->
WidgetRep
);
100
}
101
106
void
CreateDefaultRepresentation
()
override
;
107
109
114
vtkSetMacro(
EnableAxisConstraint
,
vtkTypeBool
);
115
vtkGetMacro(
EnableAxisConstraint
,
vtkTypeBool
);
116
vtkBooleanMacro(
EnableAxisConstraint
,
vtkTypeBool
);
118
120
123
vtkSetMacro(
EnableTranslation
,
vtkTypeBool
);
124
vtkGetMacro(
EnableTranslation
,
vtkTypeBool
);
125
vtkBooleanMacro(
EnableTranslation
,
vtkTypeBool
);
127
129
133
vtkSetMacro(
AllowHandleResize
,
vtkTypeBool
);
134
vtkGetMacro(
AllowHandleResize
,
vtkTypeBool
);
135
vtkBooleanMacro(
AllowHandleResize
,
vtkTypeBool
);
137
139
142
vtkGetMacro(
WidgetState
,
int
);
144
146
151
vtkSetMacro(
ShowInactive
,
vtkTypeBool
);
152
vtkGetMacro(
ShowInactive
,
vtkTypeBool
);
153
vtkBooleanMacro(
ShowInactive
,
vtkTypeBool
);
155
156
// Manage the state of the widget
157
enum
WidgetStateType
158
{
159
Start
= 0,
160
Active
,
161
Inactive
162
};
163
168
void
SetEnabled
(
int
enabling)
override
;
169
170
protected
:
171
vtkHandleWidget
();
172
~vtkHandleWidget
()
override
;
173
174
// These are the callbacks for this widget
175
static
void
GenericAction
(
vtkHandleWidget
*);
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
MoveAction3D
(
vtkAbstractWidget
*);
183
static
void
ProcessKeyEvents
(
vtkObject
*,
unsigned
long
,
void
*,
void
*);
184
185
// helper methods for cursor management
186
void
SetCursor
(
int
state)
override
;
187
188
int
WidgetState
;
189
vtkTypeBool
EnableAxisConstraint
;
190
vtkTypeBool
EnableTranslation
;
191
192
// Allow resizing of handles.
193
vtkTypeBool
AllowHandleResize
;
194
195
// Keep representation visible when disabled
196
vtkTypeBool
ShowInactive
;
197
198
vtkCallbackCommand
*
KeyEventCallbackCommand
;
199
200
private
:
201
vtkHandleWidget
(
const
vtkHandleWidget
&) =
delete
;
202
void
operator=(
const
vtkHandleWidget
&) =
delete
;
203
};
204
205
VTK_ABI_NAMESPACE_END
206
#endif
vtkAbstractWidget::vtkAbstractWidget
vtkAbstractWidget()
vtkAbstractWidget::SetWidgetRepresentation
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition
vtkAbstractWidget.h:200
vtkCallbackCommand
supports function callbacks
Definition
vtkCallbackCommand.h:149
vtkHandleRepresentation
abstract class for representing widget handles
Definition
vtkHandleRepresentation.h:50
vtkHandleWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK class macros.
vtkHandleWidget::vtkHandleWidget
vtkHandleWidget()
vtkHandleWidget::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkHandleWidget::ProcessKeyEvents
static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *)
vtkHandleWidget::KeyEventCallbackCommand
vtkCallbackCommand * KeyEventCallbackCommand
Definition
vtkHandleWidget.h:198
vtkHandleWidget::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation()
Return the representation as a vtkHandleRepresentation.
Definition
vtkHandleWidget.h:97
vtkHandleWidget::ShowInactive
vtkTypeBool ShowInactive
Definition
vtkHandleWidget.h:196
vtkHandleWidget::SetRepresentation
void SetRepresentation(vtkHandleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition
vtkHandleWidget.h:89
vtkHandleWidget::New
static vtkHandleWidget * New()
Instantiate this class.
vtkHandleWidget::GenericAction
static void GenericAction(vtkHandleWidget *)
vtkHandleWidget::MoveAction3D
static void MoveAction3D(vtkAbstractWidget *)
vtkHandleWidget::AllowHandleResize
vtkTypeBool AllowHandleResize
Definition
vtkHandleWidget.h:193
vtkHandleWidget::SetCursor
void SetCursor(int state) override
vtkHandleWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkHandleWidget::SetEnabled
void SetEnabled(int enabling) override
Enable/disable widget.
vtkHandleWidget::TranslateAction
static void TranslateAction(vtkAbstractWidget *)
vtkHandleWidget::WidgetState
int WidgetState
Definition
vtkHandleWidget.h:188
vtkHandleWidget::ScaleAction
static void ScaleAction(vtkAbstractWidget *)
vtkHandleWidget::~vtkHandleWidget
~vtkHandleWidget() override
vtkHandleWidget::EnableAxisConstraint
vtkTypeBool EnableAxisConstraint
Definition
vtkHandleWidget.h:189
vtkHandleWidget::SelectAction3D
static void SelectAction3D(vtkAbstractWidget *)
vtkHandleWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkHandleWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkHandleWidget::WidgetStateType
WidgetStateType
Definition
vtkHandleWidget.h:158
vtkHandleWidget::Start
@ Start
Definition
vtkHandleWidget.h:159
vtkHandleWidget::Active
@ Active
Definition
vtkHandleWidget.h:160
vtkHandleWidget::Inactive
@ Inactive
Definition
vtkHandleWidget.h:161
vtkHandleWidget::EnableTranslation
vtkTypeBool EnableTranslation
Definition
vtkHandleWidget.h:190
vtkIndent
a simple class to control print indentation
Definition
vtkIndent.h:108
vtkObject::vtkObject
vtkObject()
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition
vtkWidgetRepresentation.h:68
vtkTypeBool
int vtkTypeBool
Definition
vtkABI.h:64
vtkAbstractWidget.h
vtkWrappingHints.h
VTK_MARSHALAUTO
#define VTK_MARSHALAUTO
Definition
vtkWrappingHints.h:60
Generated on Tue Nov 25 2025 05:56:46 for VTK by
1.13.2