VTK  9.2.6
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 =========================================================================*/
88 #ifndef vtkBorderWidget_h
89 #define vtkBorderWidget_h
90 
91 #include "vtkAbstractWidget.h"
92 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
93 #include "vtkInteractionWidgetsModule.h" // For export macro
94 
96 
97 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
98 {
99 public:
103  static vtkBorderWidget* New();
104 
106 
110  void PrintSelf(ostream& os, vtkIndent indent) override;
112 
114 
120  vtkSetMacro(Selectable, vtkTypeBool);
121  vtkGetMacro(Selectable, vtkTypeBool);
122  vtkBooleanMacro(Selectable, vtkTypeBool);
124 
126 
131  vtkSetMacro(Resizable, vtkTypeBool);
132  vtkGetMacro(Resizable, vtkTypeBool);
133  vtkBooleanMacro(Resizable, vtkTypeBool);
135 
142  {
143  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
144  }
145 
150  {
151  return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
152  }
153 
158 
164 
165 protected:
167  ~vtkBorderWidget() override;
168 
174  virtual void SelectRegion(double eventPos[2]);
175 
176  // enable the selection of the region interior to the widget
179 
180  // processes the registered events
186 
187  // Special internal methods to support subclasses handling events.
188  // If a non-zero value is returned, the subclass is handling the event.
189  virtual int SubclassSelectAction() { return 0; }
190  virtual int SubclassTranslateAction() { return 0; }
191  virtual int SubclassEndSelectAction() { return 0; }
192  virtual int SubclassMoveAction() { return 0; }
193 
194  // helper methods for cursoe management
195  void SetCursor(int State) override;
196 
197  // widget state
200  {
201  Start = 0,
204  Selected
205  };
206 #if !defined(VTK_LEGACY_REMOVE)
207  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
209 #endif
210 
211 private:
212  vtkBorderWidget(const vtkBorderWidget&) = delete;
213  void operator=(const vtkBorderWidget&) = delete;
214 };
215 
216 #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:49
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)