VTK  9.5.2
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
63
64#ifndef vtkBorderWidget_h
65#define vtkBorderWidget_h
66
67#include "vtkAbstractWidget.h"
68#include "vtkInteractionWidgetsModule.h" // For export macro
69#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
70
71VTK_ABI_NAMESPACE_BEGIN
73
74class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBorderWidget : public vtkAbstractWidget
75{
76public:
81
83
87 void PrintSelf(ostream& os, vtkIndent indent) override;
89
91
97 vtkSetMacro(Selectable, vtkTypeBool);
98 vtkGetMacro(Selectable, vtkTypeBool);
99 vtkBooleanMacro(Selectable, vtkTypeBool);
101
103
108 vtkSetMacro(Resizable, vtkTypeBool);
109 vtkGetMacro(Resizable, vtkTypeBool);
110 vtkBooleanMacro(Resizable, vtkTypeBool);
112
122
127 {
128 return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
129 }
130
135
141
142protected:
145
151 virtual void SelectRegion(double eventPos[2]);
152
153 // enable the selection of the region interior to the widget
156
157 // processes the registered events
163
164 // Special internal methods to support subclasses handling events.
165 // If a non-zero value is returned, the subclass is handling the event.
166 virtual int SubclassSelectAction() { return 0; }
167 virtual int SubclassTranslateAction() { return 0; }
168 virtual int SubclassEndSelectAction() { return 0; }
169 virtual int SubclassMoveAction() { return 0; }
170
171 // helper methods for cursoe management
172 void SetCursor(int State) override;
173
174 // widget state
183
184private:
185 vtkBorderWidget(const vtkBorderWidget&) = delete;
186 void operator=(const vtkBorderWidget&) = delete;
187};
188
189VTK_ABI_NAMESPACE_END
190#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