VTK  9.6.1
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
66
67#ifndef vtkBorderWidget_h
68#define vtkBorderWidget_h
69
70#include "vtkAbstractWidget.h"
71#include "vtkInteractionWidgetsModule.h" // For export macro
72#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
73
74VTK_ABI_NAMESPACE_BEGIN
76
77class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBorderWidget : public vtkAbstractWidget
78{
79public:
84
86
90 void PrintSelf(ostream& os, vtkIndent indent) override;
92
94
100 vtkSetMacro(Selectable, vtkTypeBool);
101 vtkGetMacro(Selectable, vtkTypeBool);
102 vtkBooleanMacro(Selectable, vtkTypeBool);
104
106
111 vtkSetMacro(Resizable, vtkTypeBool);
112 vtkGetMacro(Resizable, vtkTypeBool);
113 vtkBooleanMacro(Resizable, vtkTypeBool);
115
125
130 {
131 return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
132 }
133
138
144
145protected:
148
154 virtual void SelectRegion(double eventPos[2]);
155
156 // enable the selection of the region interior to the widget
159
160 // processes the registered events
166
167 // Special internal methods to support subclasses handling events.
168 // If a non-zero value is returned, the subclass is handling the event.
169 virtual int SubclassSelectAction() { return 0; }
170 virtual int SubclassTranslateAction() { return 0; }
171 virtual int SubclassEndSelectAction() { return 0; }
172 virtual int SubclassMoveAction() { return 0; }
173
174 // helper methods for cursoe management
175 void SetCursor(int State) override;
176
177 // widget state
186
187private:
188 vtkBorderWidget(const vtkBorderWidget&) = delete;
189 void operator=(const vtkBorderWidget&) = delete;
190};
191
192VTK_ABI_NAMESPACE_END
193#endif
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
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_MARSHALAUTO