VTK  9.3.0
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
60#include "vtkInteractionWidgetsModule.h" // For export macro
61#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
62
63VTK_ABI_NAMESPACE_BEGIN
65
66class VTKINTERACTIONWIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget
67{
68public:
73
75
79 void PrintSelf(ostream& os, vtkIndent indent) override;
81
88 {
89 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
90 }
91
96 {
97 return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);
98 }
99
105
107
112 vtkSetMacro(EnableAxisConstraint, vtkTypeBool);
113 vtkGetMacro(EnableAxisConstraint, vtkTypeBool);
114 vtkBooleanMacro(EnableAxisConstraint, vtkTypeBool);
116
118
121 vtkSetMacro(EnableTranslation, vtkTypeBool);
122 vtkGetMacro(EnableTranslation, vtkTypeBool);
123 vtkBooleanMacro(EnableTranslation, vtkTypeBool);
125
127
131 vtkSetMacro(AllowHandleResize, vtkTypeBool);
132 vtkGetMacro(AllowHandleResize, vtkTypeBool);
133 vtkBooleanMacro(AllowHandleResize, vtkTypeBool);
135
137
140 vtkGetMacro(WidgetState, int);
142
144
149 vtkSetMacro(ShowInactive, vtkTypeBool);
150 vtkGetMacro(ShowInactive, vtkTypeBool);
151 vtkBooleanMacro(ShowInactive, vtkTypeBool);
153
154 // Manage the state of the widget
156 {
157 Start = 0,
159 Inactive
160 };
161#if !defined(VTK_LEGACY_REMOVE)
162 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
164#endif
165
170 void SetEnabled(int enabling) override;
171
172protected:
175
176 // These are the callbacks for this widget
185 static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
186
187 // helper methods for cursor management
188 void SetCursor(int state) override;
189
193
194 // Allow resizing of handles.
196
197 // Keep representation visible when disabled
199
201
202private:
203 vtkHandleWidget(const vtkHandleWidget&) = delete;
204 void operator=(const vtkHandleWidget&) = delete;
205};
206
207VTK_ABI_NAMESPACE_END
208#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:49
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_2_0(reason)