VTK
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 =========================================================================*/
73 #ifndef vtkBorderWidget_h
74 #define vtkBorderWidget_h
75 
76 #include "vtkInteractionWidgetsModule.h" // For export macro
77 #include "vtkAbstractWidget.h"
78 
80 
81 
82 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
83 {
84 public:
88  static vtkBorderWidget *New();
89 
91 
95  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
97 
99 
105  vtkSetMacro(Selectable,int);
106  vtkGetMacro(Selectable,int);
107  vtkBooleanMacro(Selectable,int);
109 
110 
112 
117  vtkSetMacro(Resizable,int);
118  vtkGetMacro(Resizable,int);
119  vtkBooleanMacro(Resizable,int);
121 
122 
129  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
130 
135  {return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);}
136 
140  void CreateDefaultRepresentation() VTK_OVERRIDE;
141 
142 protected:
143  vtkBorderWidget();
144  ~vtkBorderWidget() VTK_OVERRIDE;
145 
151  virtual void SelectRegion(double eventPos[2]);
152 
153  //enable the selection of the region interior to the widget
154  int Selectable;
155  int Resizable;
156 
157  //processes the registered events
158  static void SelectAction(vtkAbstractWidget*);
159  static void TranslateAction(vtkAbstractWidget*);
160  static void EndSelectAction(vtkAbstractWidget*);
161  static void MoveAction(vtkAbstractWidget*);
162 
163  // Special internal methods to support subclasses handling events.
164  // If a non-zero value is returned, the subclass is handling the event.
165  virtual int SubclassSelectAction() {return 0;}
166  virtual int SubclassTranslateAction() {return 0;}
167  virtual int SubclassEndSelectAction() {return 0;}
168  virtual int SubclassMoveAction() {return 0;}
169 
170  // helper methods for cursoe management
171  void SetCursor(int State) VTK_OVERRIDE;
172 
173  //widget state
175  enum _WidgetState{Start=0,Define,Manipulate,Selected};
176 
177 private:
178  vtkBorderWidget(const vtkBorderWidget&) VTK_DELETE_FUNCTION;
179  void operator=(const vtkBorderWidget&) VTK_DELETE_FUNCTION;
180 };
181 
182 #endif
virtual void SetCursor(int vtkNotUsed(state))
place a border around a 2D rectangular region
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
virtual int SubclassTranslateAction()
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
virtual int SubclassMoveAction()
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:33
represent a vtkBorderWidget
virtual int SubclassEndSelectAction()
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
define the API for widget / widget representation
vtkBorderRepresentation * GetBorderRepresentation()
Return the representation as a vtkBorderRepresentation.
void SetRepresentation(vtkBorderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...