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 =========================================================================*/
71 #ifndef vtkAngleWidget_h
72 #define vtkAngleWidget_h
73 
74 #include "vtkInteractionWidgetsModule.h" // For export macro
75 #include "vtkAbstractWidget.h"
76 
78 class vtkHandleWidget;
79 class vtkAngleWidgetCallback;
80 
81 
82 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
83 {
84 public:
88  static vtkAngleWidget *New();
89 
91 
95  void PrintSelf(ostream& os, vtkIndent indent) override;
97 
103  void SetEnabled(int) override;
104 
111  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
112 
116  void CreateDefaultRepresentation() override;
117 
122  {return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);}
123 
128  int IsAngleValid();
129 
134  void SetProcessEvents(vtkTypeBool) override;
135 
142  enum {Start=0,Define,Manipulate};
143 
145 
155  virtual void SetWidgetStateToStart();
156  virtual void SetWidgetStateToManipulate();
158 
162  virtual int GetWidgetState()
163  {return this->WidgetState;}
164 
165 protected:
166  vtkAngleWidget();
167  ~vtkAngleWidget() override;
168 
169  // The state of the widget
172 
173  // Callback interface to capture events when
174  // placing the widget.
175  static void AddPointAction(vtkAbstractWidget*);
176  static void MoveAction(vtkAbstractWidget*);
177  static void EndSelectAction(vtkAbstractWidget*);
178 
179  // The positioning handle widgets
183  vtkAngleWidgetCallback *AngleWidgetCallback1;
184  vtkAngleWidgetCallback *AngleWidgetCenterCallback;
185  vtkAngleWidgetCallback *AngleWidgetCallback2;
186 
187  // Methods invoked when the handles at the
188  // end points of the widget are manipulated
189  void StartAngleInteraction(int handleNum);
190  void AngleInteraction(int handleNum);
191  void EndAngleInteraction(int handleNum);
192 
193  friend class vtkAngleWidgetCallback;
194 
195 private:
196  vtkAngleWidget(const vtkAngleWidget&) = delete;
197  void operator=(const vtkAngleWidget&) = delete;
198 };
199 
200 #endif
vtkAngleWidgetCallback * AngleWidgetCenterCallback
void SetRepresentation(vtkAngleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
vtkAngleRepresentation * GetAngleRepresentation()
Return the representation as a vtkAngleRepresentation.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
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
int vtkTypeBool
Definition: vtkABI.h:69
vtkHandleWidget * CenterWidget
a simple class to control print indentation
Definition: vtkIndent.h:33
represent the vtkAngleWidget
measure the angle between two rays (defined by three points)
vtkAngleWidgetCallback * AngleWidgetCallback1
define the API for widget / widget representation
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
vtkHandleWidget * Point2Widget
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual int GetWidgetState()
Return the current widget state.