VTK
vtkAngleWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAngleWidget.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 =========================================================================*/
79 #ifndef __vtkAngleWidget_h
80 #define __vtkAngleWidget_h
81 
82 #include "vtkAbstractWidget.h"
83 
85 class vtkHandleWidget;
86 class vtkAngleWidgetCallback;
87 
88 
90 {
91 public:
93  static vtkAngleWidget *New();
94 
96 
98  void PrintSelf(ostream& os, vtkIndent indent);
100 
104  virtual void SetEnabled(int);
105 
107 
111  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
113 
116 
118 
120  {return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);}
122 
125  int IsAngleValid();
126 
129  virtual void SetProcessEvents(int);
130 
132 
136  enum {Start=0,Define,Manipulate};
137  //ETX
139 
141 
149  virtual void SetWidgetStateToStart();
150  virtual void SetWidgetStateToManipulate();
152 
154 
155  virtual int GetWidgetState()
156  {return this->WidgetState;}
158 
159 protected:
160  vtkAngleWidget();
161  ~vtkAngleWidget();
162 
163  // The state of the widget
166 
167  // Callback interface to capture events when
168  // placing the widget.
169  static void AddPointAction(vtkAbstractWidget*);
170  static void MoveAction(vtkAbstractWidget*);
171  static void EndSelectAction(vtkAbstractWidget*);
172 
173  // The positioning handle widgets
177  vtkAngleWidgetCallback *AngleWidgetCallback1;
178  vtkAngleWidgetCallback *AngleWidgetCenterCallback;
179  vtkAngleWidgetCallback *AngleWidgetCallback2;
180 
181  // Methods invoked when the handles at the
182  // end points of the widget are manipulated
183  void StartAngleInteraction(int handleNum);
184  void AngleInteraction(int handleNum);
185  void EndAngleInteraction(int handleNum);
186 
187 //BTX
188  friend class vtkAngleWidgetCallback;
189 //ETX
190 
191 private:
192  vtkAngleWidget(const vtkAngleWidget&); //Not implemented
193  void operator=(const vtkAngleWidget&); //Not implemented
194 };
195 
196 #endif