VTK  9.0.20201030
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 =========================================================================*/
79 #ifndef vtkBorderWidget_h
80 #define vtkBorderWidget_h
81 
82 #include "vtkAbstractWidget.h"
83 #include "vtkInteractionWidgetsModule.h" // For export macro
84 
86 
87 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
88 {
89 public:
93  static vtkBorderWidget* New();
94 
96 
100  void PrintSelf(ostream& os, vtkIndent indent) override;
102 
104 
110  vtkSetMacro(Selectable, vtkTypeBool);
111  vtkGetMacro(Selectable, vtkTypeBool);
112  vtkBooleanMacro(Selectable, vtkTypeBool);
114 
116 
121  vtkSetMacro(Resizable, vtkTypeBool);
122  vtkGetMacro(Resizable, vtkTypeBool);
123  vtkBooleanMacro(Resizable, vtkTypeBool);
125 
132  {
133  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
134  }
135 
140  {
141  return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);
142  }
143 
147  void CreateDefaultRepresentation() override;
148 
149 protected:
150  vtkBorderWidget();
151  ~vtkBorderWidget() override;
152 
158  virtual void SelectRegion(double eventPos[2]);
159 
160  // enable the selection of the region interior to the widget
163 
164  // processes the registered events
165  static void SelectAction(vtkAbstractWidget*);
166  static void TranslateAction(vtkAbstractWidget*);
167  static void EndSelectAction(vtkAbstractWidget*);
168  static void MoveAction(vtkAbstractWidget*);
169 
170  // Special internal methods to support subclasses handling events.
171  // If a non-zero value is returned, the subclass is handling the event.
172  virtual int SubclassSelectAction() { return 0; }
173  virtual int SubclassTranslateAction() { return 0; }
174  virtual int SubclassEndSelectAction() { return 0; }
175  virtual int SubclassMoveAction() { return 0; }
176 
177  // helper methods for cursoe management
178  void SetCursor(int State) override;
179 
180  // widget state
183  {
184  Start = 0,
187  Selected
188  };
189 
190 private:
191  vtkBorderWidget(const vtkBorderWidget&) = delete;
192  void operator=(const vtkBorderWidget&) = delete;
193 };
194 
195 #endif
vtkAbstractWidget::SetCursor
virtual void SetCursor(int vtkNotUsed(state))
Definition: vtkAbstractWidget.h:179
vtkBorderWidget::Define
Definition: vtkBorderWidget.h:185
vtkBorderWidget::SubclassEndSelectAction
virtual int SubclassEndSelectAction()
Definition: vtkBorderWidget.h:174
vtkBorderWidget::Manipulate
Definition: vtkBorderWidget.h:186
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:54
vtkBorderWidget
place a border around a 2D rectangular region
Definition: vtkBorderWidget.h:87
vtkBorderWidget::GetBorderRepresentation
vtkBorderRepresentation * GetBorderRepresentation()
Return the representation as a vtkBorderRepresentation.
Definition: vtkBorderWidget.h:139
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkBorderWidget::Selectable
vtkTypeBool Selectable
Definition: vtkBorderWidget.h:161
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkBorderWidget::SubclassMoveAction
virtual int SubclassMoveAction()
Definition: vtkBorderWidget.h:175
vtkBorderWidget::Resizable
vtkTypeBool Resizable
Definition: vtkBorderWidget.h:162
vtkBorderWidget::WidgetState
int WidgetState
Definition: vtkBorderWidget.h:181
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkBorderWidget::SubclassSelectAction
virtual int SubclassSelectAction()
Definition: vtkBorderWidget.h:172
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkBorderWidget::_WidgetState
_WidgetState
Definition: vtkBorderWidget.h:182
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkBorderWidget::SubclassTranslateAction
virtual int SubclassTranslateAction()
Definition: vtkBorderWidget.h:173
vtkBorderWidget::SetRepresentation
void SetRepresentation(vtkBorderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkBorderWidget.h:131
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69