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 =========================================================================*/
78 #ifndef vtkBorderWidget_h
79 #define vtkBorderWidget_h
80 
81 #include "vtkInteractionWidgetsModule.h" // For export macro
82 #include "vtkAbstractWidget.h"
83 
85 
86 
88 {
89 public:
91  static vtkBorderWidget *New();
92 
94 
96  void PrintSelf(ostream& os, vtkIndent indent);
98 
100 
104  vtkSetMacro(Selectable,int);
105  vtkGetMacro(Selectable,int);
106  vtkBooleanMacro(Selectable,int);
108 
109 
111 
114  vtkSetMacro(Resizable,int);
115  vtkGetMacro(Resizable,int);
116  vtkBooleanMacro(Resizable,int);
118 
119 
121 
125  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
127 
129 
131  {return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);}
133 
135  virtual void CreateDefaultRepresentation();
136 
137 protected:
138  vtkBorderWidget();
139  ~vtkBorderWidget();
140 
144  virtual void SelectRegion(double eventPos[2]);
145 
146  //enable the selection of the region interior to the widget
149 
150  //processes the registered events
151  static void SelectAction(vtkAbstractWidget*);
152  static void TranslateAction(vtkAbstractWidget*);
153  static void EndSelectAction(vtkAbstractWidget*);
154  static void MoveAction(vtkAbstractWidget*);
155 
156  // Special internal methods to support subclasses handling events.
157  // If a non-zero value is returned, the subclass is handling the event.
158  virtual int SubclassSelectAction() {return 0;}
159  virtual int SubclassTranslateAction() {return 0;}
160  virtual int SubclassEndSelectAction() {return 0;}
161  virtual int SubclassMoveAction() {return 0;}
162 
163  // helper methods for cursoe management
164  virtual void SetCursor(int State);
165 
166 //BTX
167  //widget state
169  enum _WidgetState{Start=0,Define,Manipulate,Selected};
170 //ETX
171 
172 private:
173  vtkBorderWidget(const vtkBorderWidget&); //Not implemented
174  void operator=(const vtkBorderWidget&); //Not implemented
175 };
176 
177 #endif
void PrintSelf(ostream &os, vtkIndent indent)
virtual void SetCursor(int vtkNotUsed(state))
place a border around a 2D rectangular region
virtual int SubclassTranslateAction()
virtual void CreateDefaultRepresentation()=0
virtual int SubclassMoveAction()
vtkWidgetRepresentation * WidgetRep
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
represent a vtkBorderWidget
virtual int SubclassEndSelectAction()
define the API for widget / widget representation
vtkBorderRepresentation * GetBorderRepresentation()
virtual int SubclassSelectAction()
void SetRepresentation(vtkBorderRepresentation *r)
static vtkObject * New()