VTK  9.3.0
vtkBorderWidget.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
64#ifndef vtkBorderWidget_h
65#define vtkBorderWidget_h
66
67#include "vtkAbstractWidget.h"
68#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
69#include "vtkInteractionWidgetsModule.h" // For export macro
70#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
71
72VTK_ABI_NAMESPACE_BEGIN
74
75class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
76{
77public:
82
84
88 void PrintSelf(ostream& os, vtkIndent indent) override;
90
92
98 vtkSetMacro(Selectable, vtkTypeBool);
99 vtkGetMacro(Selectable, vtkTypeBool);
100 vtkBooleanMacro(Selectable, vtkTypeBool);
102
104
109 vtkSetMacro(Resizable, vtkTypeBool);
110 vtkGetMacro(Resizable, vtkTypeBool);
111 vtkBooleanMacro(Resizable, vtkTypeBool);
113
120 {
121 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
122 }
123
128 {
129 return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
130 }
131
136
142
143protected:
146
152 virtual void SelectRegion(double eventPos[2]);
153
154 // enable the selection of the region interior to the widget
157
158 // processes the registered events
164
165 // Special internal methods to support subclasses handling events.
166 // If a non-zero value is returned, the subclass is handling the event.
167 virtual int SubclassSelectAction() { return 0; }
168 virtual int SubclassTranslateAction() { return 0; }
169 virtual int SubclassEndSelectAction() { return 0; }
170 virtual int SubclassMoveAction() { return 0; }
171
172 // helper methods for cursoe management
173 void SetCursor(int State) override;
174
175 // widget state
178 {
179 Start = 0,
182 Selected
183 };
184#if !defined(VTK_LEGACY_REMOVE)
185 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
187#endif
188
189private:
190 vtkBorderWidget(const vtkBorderWidget&) = delete;
191 void operator=(const vtkBorderWidget&) = delete;
192};
193
194VTK_ABI_NAMESPACE_END
195#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent a vtkBorderWidget
place a border around a 2D rectangular region
static vtkBorderWidget * New()
Method to instantiate class.
vtkTypeBool Resizable
static void SelectAction(vtkAbstractWidget *)
static void TranslateAction(vtkAbstractWidget *)
virtual void SelectRegion(double eventPos[2])
Subclasses generally implement this method.
~vtkBorderWidget() override
void SetCursor(int State) override
vtkTypeBool Selectable
virtual int SubclassSelectAction()
static void EndSelectAction(vtkAbstractWidget *)
static void HoverLeaveAction(vtkAbstractWidget *)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
virtual int SubclassMoveAction()
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for class.
virtual int SubclassEndSelectAction()
virtual int SubclassTranslateAction()
void SetRepresentation(vtkBorderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkTypeBool GetProcessEvents() override
Reimplement ProcessEvents to disable it when using relative location with windowLocation.
vtkBorderRepresentation * GetBorderRepresentation()
Return the representation as a vtkBorderRepresentation.
static void MoveAction(vtkAbstractWidget *)
a simple class to control print indentation
Definition vtkIndent.h:29
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)