VTK  9.2.20230606
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 =========================================================================*/
138 #ifndef vtkBorderWidget_h
139 #define vtkBorderWidget_h
140 
141 #include "vtkAbstractWidget.h"
142 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
143 #include "vtkInteractionWidgetsModule.h" // For export macro
144 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
145 
146 VTK_ABI_NAMESPACE_BEGIN
148 
149 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
150 {
151 public:
155  static vtkBorderWidget* New();
156 
158 
162  void PrintSelf(ostream& os, vtkIndent indent) override;
164 
166 
172  vtkSetMacro(Selectable, vtkTypeBool);
173  vtkGetMacro(Selectable, vtkTypeBool);
174  vtkBooleanMacro(Selectable, vtkTypeBool);
176 
178 
183  vtkSetMacro(Resizable, vtkTypeBool);
184  vtkGetMacro(Resizable, vtkTypeBool);
185  vtkBooleanMacro(Resizable, vtkTypeBool);
187 
194  {
195  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
196  }
197 
202  {
203  return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
204  }
205 
210 
216 
217 protected:
219  ~vtkBorderWidget() override;
220 
226  virtual void SelectRegion(double eventPos[2]);
227 
228  // enable the selection of the region interior to the widget
231 
232  // processes the registered events
238 
239  // Special internal methods to support subclasses handling events.
240  // If a non-zero value is returned, the subclass is handling the event.
241  virtual int SubclassSelectAction() { return 0; }
242  virtual int SubclassTranslateAction() { return 0; }
243  virtual int SubclassEndSelectAction() { return 0; }
244  virtual int SubclassMoveAction() { return 0; }
245 
246  // helper methods for cursoe management
247  void SetCursor(int State) override;
248 
249  // widget state
252  {
253  Start = 0,
256  Selected
257  };
258 #if !defined(VTK_LEGACY_REMOVE)
259  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
261 #endif
262 
263 private:
264  vtkBorderWidget(const vtkBorderWidget&) = delete;
265  void operator=(const vtkBorderWidget&) = delete;
266 };
267 
268 VTK_ABI_NAMESPACE_END
269 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent a vtkBorderWidget
place a border around a 2D rectangular region
vtkTypeBool Resizable
static void SelectAction(vtkAbstractWidget *)
static void TranslateAction(vtkAbstractWidget *)
virtual void SelectRegion(double eventPos[2])
Subclasses generally implement this method.
~vtkBorderWidget() override
static vtkBorderWidget * New()
Method to instantiate class.
void SetCursor(int State) override
vtkTypeBool Selectable
vtkBorderRepresentation * GetBorderRepresentation()
Return the representation as a vtkBorderRepresentation.
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.
static void MoveAction(vtkAbstractWidget *)
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:71
#define VTK_DEPRECATED_IN_9_2_0(reason)