VTK
vtkBiDimensionalWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBiDimensionalWidget.h,v
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 =========================================================================*/
99 #ifndef vtkBiDimensionalWidget_h
100 #define vtkBiDimensionalWidget_h
101 
102 #include "vtkInteractionWidgetsModule.h" // For export macro
103 #include "vtkAbstractWidget.h"
104 
106 class vtkHandleWidget;
107 class vtkBiDimensionalWidgetCallback;
108 
109 
111 {
112 public:
114  static vtkBiDimensionalWidget *New();
115 
117 
119  void PrintSelf(ostream& os, vtkIndent indent);
121 
125  virtual void SetEnabled(int);
126 
128 
132  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
134 
136 
138  {return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);}
140 
143 
146  int IsMeasureValid();
147 
148  //BTX
150 
151  enum
152  {
153  EndWidgetSelectEvent = 10050
154  };
155  //ETX
157 
160  virtual void SetProcessEvents(int);
161 
163 
167  enum {Start=0,Define,Manipulate};
168  //ETX
170 
172 
180  virtual void SetWidgetStateToStart();
181  virtual void SetWidgetStateToManipulate();
183 
185 
186  virtual int GetWidgetState()
187  {return this->WidgetState;}
189 
190 protected:
193 
194  // The state of the widget
204 
205  // Callback interface to capture events when
206  // placing the widget.
207  static void AddPointAction(vtkAbstractWidget*);
208  static void MoveAction(vtkAbstractWidget*);
209  static void EndSelectAction(vtkAbstractWidget*);
210 
211  // The positioning handle widgets
216  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback1;
217  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback2;
218  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback3;
219  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback4;
220 
221  // Methods invoked when the handles at the
222  // end points of the widget are manipulated
223  void StartBiDimensionalInteraction();
224  virtual void EndBiDimensionalInteraction();
225 
226 //BTX
227  friend class vtkBiDimensionalWidgetCallback;
228 //ETX
229 
230 private:
231  vtkBiDimensionalWidget(const vtkBiDimensionalWidget&); //Not implemented
232  void operator=(const vtkBiDimensionalWidget&); //Not implemented
233 };
234 
235 #endif
measure the bi-dimensional lengths of an object
void PrintSelf(ostream &os, vtkIndent indent)
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
represent the vtkBiDimensionalWidget
virtual void SetProcessEvents(int)
a general widget for moving handles
virtual void CreateDefaultRepresentation()=0
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
vtkWidgetRepresentation * WidgetRep
void SetRepresentation(vtkBiDimensionalRepresentation *r)
#define VTKINTERACTIONWIDGETS_EXPORT
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
a simple class to control print indentation
Definition: vtkIndent.h:38
define the API for widget / widget representation
static vtkObject * New()
virtual void SetEnabled(int)
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()