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 "vtkAbstractWidget.h"
82 
84 
85 
87 {
88 public:
90  static vtkBorderWidget *New();
91 
93 
95  void PrintSelf(ostream& os, vtkIndent indent);
97 
99 
103  vtkSetMacro(Selectable,int);
104  vtkGetMacro(Selectable,int);
105  vtkBooleanMacro(Selectable,int);
107 
108 
110 
113  vtkSetMacro(Resizable,int);
114  vtkGetMacro(Resizable,int);
115  vtkBooleanMacro(Resizable,int);
117 
118 
120 
124  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
126 
128 
130  {return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);}
132 
134  virtual void CreateDefaultRepresentation();
135 
136 protected:
137  vtkBorderWidget();
138  ~vtkBorderWidget();
139 
143  virtual void SelectRegion(double eventPos[2]);
144 
145  //enable the selection of the region interior to the widget
148 
149  //processes the registered events
150  static void SelectAction(vtkAbstractWidget*);
151  static void TranslateAction(vtkAbstractWidget*);
152  static void EndSelectAction(vtkAbstractWidget*);
153  static void MoveAction(vtkAbstractWidget*);
154 
155  // Special internal methods to support subclasses handling events.
156  // If a non-zero value is returned, the subclass is handling the event.
157  virtual int SubclassSelectAction() {return 0;}
158  virtual int SubclassTranslateAction() {return 0;}
159  virtual int SubclassEndSelectAction() {return 0;}
160  virtual int SubclassMoveAction() {return 0;}
161 
162  // helper methods for cursoe management
163  virtual void SetCursor(int State);
164 
165 //BTX
166  //widget state
168  enum _WidgetState{Start=0,Define,Manipulate,Selected};
169 //ETX
170 
171 private:
172  vtkBorderWidget(const vtkBorderWidget&); //Not implemented
173  void operator=(const vtkBorderWidget&); //Not implemented
174 };
175 
176 #endif