VTK  9.1.0
vtkBorderWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkBorderWidget.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=========================================================================*/
82#ifndef vtkBorderWidget_h
83#define vtkBorderWidget_h
84
85#include "vtkAbstractWidget.h"
86#include "vtkInteractionWidgetsModule.h" // For export macro
87
89
90class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
91{
92public:
97
99
103 void PrintSelf(ostream& os, vtkIndent indent) override;
105
107
113 vtkSetMacro(Selectable, vtkTypeBool);
114 vtkGetMacro(Selectable, vtkTypeBool);
115 vtkBooleanMacro(Selectable, vtkTypeBool);
117
119
124 vtkSetMacro(Resizable, vtkTypeBool);
125 vtkGetMacro(Resizable, vtkTypeBool);
126 vtkBooleanMacro(Resizable, vtkTypeBool);
128
135 {
136 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
137 }
138
143 {
144 return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
145 }
146
151
152protected:
155
161 virtual void SelectRegion(double eventPos[2]);
162
163 // enable the selection of the region interior to the widget
166
167 // processes the registered events
173
174 // Special internal methods to support subclasses handling events.
175 // If a non-zero value is returned, the subclass is handling the event.
176 virtual int SubclassSelectAction() { return 0; }
177 virtual int SubclassTranslateAction() { return 0; }
178 virtual int SubclassEndSelectAction() { return 0; }
179 virtual int SubclassMoveAction() { return 0; }
180
181 // helper methods for cursoe management
182 void SetCursor(int State) override;
183
184 // widget state
187 {
188 Start = 0,
191 Selected
192 };
193
194private:
195 vtkBorderWidget(const vtkBorderWidget&) = delete;
196 void operator=(const vtkBorderWidget&) = delete;
197};
198
199#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.
vtkBorderRepresentation * GetBorderRepresentation()
Return the representation as a vtkBorderRepresentation.
static void MoveAction(vtkAbstractWidget *)
a simple class to control print indentation
Definition: vtkIndent.h:43
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69