VTK  9.4.20241221
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
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
65VTK_ABI_NAMESPACE_BEGIN
67
68class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkHandleWidget : public vtkAbstractWidget
69{
70public:
75
77
81 void PrintSelf(ostream& os, vtkIndent indent) override;
83
90 {
91 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
92 }
93
98 {
99 return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);
100 }
101
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
158 {
159 Start = 0,
161 Inactive
162 };
163
168 void SetEnabled(int enabling) override;
169
170protected:
173
174 // These are the callbacks for this widget
183 static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
184
185 // helper methods for cursor management
186 void SetCursor(int state) override;
187
191
192 // Allow resizing of handles.
194
195 // Keep representation visible when disabled
197
199
200private:
201 vtkHandleWidget(const vtkHandleWidget&) = delete;
202 void operator=(const vtkHandleWidget&) = delete;
203};
204
205VTK_ABI_NAMESPACE_END
206#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: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