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 =========================================================================*/
77 #ifndef vtkAngleWidget_h
78 #define vtkAngleWidget_h
79 
80 #include "vtkInteractionWidgetsModule.h" // For export macro
81 #include "vtkAbstractWidget.h"
82 
84 class vtkHandleWidget;
85 class vtkAngleWidgetCallback;
86 
87 
88 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
89 {
90 public:
94  static vtkAngleWidget *New();
95 
97 
101  void PrintSelf(ostream& os, vtkIndent indent);
103 
109  virtual void SetEnabled(int);
110 
117  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
118 
123 
128  {return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);}
129 
134  int IsAngleValid();
135 
140  virtual void SetProcessEvents(int);
141 
148  enum {Start=0,Define,Manipulate};
149 
151 
161  virtual void SetWidgetStateToStart();
162  virtual void SetWidgetStateToManipulate();
164 
168  virtual int GetWidgetState()
169  {return this->WidgetState;}
170 
171 protected:
172  vtkAngleWidget();
173  ~vtkAngleWidget();
174 
175  // The state of the widget
178 
179  // Callback interface to capture events when
180  // placing the widget.
181  static void AddPointAction(vtkAbstractWidget*);
182  static void MoveAction(vtkAbstractWidget*);
183  static void EndSelectAction(vtkAbstractWidget*);
184 
185  // The positioning handle widgets
189  vtkAngleWidgetCallback *AngleWidgetCallback1;
190  vtkAngleWidgetCallback *AngleWidgetCenterCallback;
191  vtkAngleWidgetCallback *AngleWidgetCallback2;
192 
193  // Methods invoked when the handles at the
194  // end points of the widget are manipulated
195  void StartAngleInteraction(int handleNum);
196  void AngleInteraction(int handleNum);
197  void EndAngleInteraction(int handleNum);
198 
199  friend class vtkAngleWidgetCallback;
200 
201 private:
202  vtkAngleWidget(const vtkAngleWidget&) VTK_DELETE_FUNCTION;
203  void operator=(const vtkAngleWidget&) VTK_DELETE_FUNCTION;
204 };
205 
206 #endif
vtkAngleWidgetCallback * AngleWidgetCenterCallback
void PrintSelf(ostream &os, vtkIndent indent)
Standard macros implementing standard VTK methods.
void SetRepresentation(vtkAngleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
virtual void SetProcessEvents(int)
Methods to change whether the widget responds to interaction.
vtkAngleRepresentation * GetAngleRepresentation()
Return the representation as a vtkAngleRepresentation.
a general widget for moving handles
vtkAngleWidgetCallback * AngleWidgetCallback2
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkWidgetRepresentation * WidgetRep
vtkHandleWidget * Point1Widget
vtkHandleWidget * CenterWidget
a simple class to control print indentation
Definition: vtkIndent.h:39
represent the vtkAngleWidget
measure the angle between two rays (defined by three points)
vtkAngleWidgetCallback * AngleWidgetCallback1
define the API for widget / widget representation
vtkHandleWidget * Point2Widget
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void SetEnabled(int)
Methods for activating this widget.
virtual int GetWidgetState()
Return the current widget state.