VTK  9.2.6
vtkHandleWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkHandleWidget.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
67#ifndef vtkHandleWidget_h
68#define vtkHandleWidget_h
69
70#include "vtkAbstractWidget.h"
71#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
72#include "vtkInteractionWidgetsModule.h" // For export macro
73
75
76class VTKINTERACTIONWIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget
77{
78public:
83
85
89 void PrintSelf(ostream& os, vtkIndent indent) override;
91
98 {
99 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
100 }
101
106 {
107 return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);
108 }
109
115
117
122 vtkSetMacro(EnableAxisConstraint, vtkTypeBool);
123 vtkGetMacro(EnableAxisConstraint, vtkTypeBool);
124 vtkBooleanMacro(EnableAxisConstraint, vtkTypeBool);
126
128
131 vtkSetMacro(EnableTranslation, vtkTypeBool);
132 vtkGetMacro(EnableTranslation, vtkTypeBool);
133 vtkBooleanMacro(EnableTranslation, vtkTypeBool);
135
137
141 vtkSetMacro(AllowHandleResize, vtkTypeBool);
142 vtkGetMacro(AllowHandleResize, vtkTypeBool);
143 vtkBooleanMacro(AllowHandleResize, vtkTypeBool);
145
147
150 vtkGetMacro(WidgetState, int);
152
154
159 vtkSetMacro(ShowInactive, vtkTypeBool);
160 vtkGetMacro(ShowInactive, vtkTypeBool);
161 vtkBooleanMacro(ShowInactive, vtkTypeBool);
163
164 // Manage the state of the widget
166 {
167 Start = 0,
169 Inactive
170 };
171#if !defined(VTK_LEGACY_REMOVE)
172 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
174#endif
175
180 void SetEnabled(int enabling) override;
181
182protected:
185
186 // These are the callbacks for this widget
195 static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
196
197 // helper methods for cursor management
198 void SetCursor(int state) override;
199
203
204 // Allow resizing of handles.
206
207 // Keep representation visible when disabled
209
211
212private:
213 vtkHandleWidget(const vtkHandleWidget&) = delete;
214 void operator=(const vtkHandleWidget&) = delete;
215};
216
217#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:34
abstract base class for most VTK objects
Definition vtkObject.h:57
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)