VTK  9.0.1
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 =========================================================================*/
74 #ifndef vtkAngleWidget_h
75 #define vtkAngleWidget_h
76 
77 #include "vtkAbstractWidget.h"
78 #include "vtkInteractionWidgetsModule.h" // For export macro
79 
81 class vtkHandleWidget;
82 class vtkAngleWidgetCallback;
83 
84 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
85 {
86 public:
90  static vtkAngleWidget* New();
91 
93 
97  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
105  void SetEnabled(int) override;
106 
113  {
114  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
115  }
116 
120  void CreateDefaultRepresentation() override;
121 
126  {
127  return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);
128  }
129 
134  vtkTypeBool IsAngleValid();
135 
140  void SetProcessEvents(vtkTypeBool) override;
141 
148  enum
149  {
150  Start = 0,
152  Manipulate
153  };
154 
156 
166  virtual void SetWidgetStateToStart();
167  virtual void SetWidgetStateToManipulate();
169 
173  virtual int GetWidgetState() { return this->WidgetState; }
174 
175 protected:
176  vtkAngleWidget();
177  ~vtkAngleWidget() override;
178 
179  // The state of the widget
182 
183  // Callback interface to capture events when
184  // placing the widget.
185  static void AddPointAction(vtkAbstractWidget*);
186  static void MoveAction(vtkAbstractWidget*);
187  static void EndSelectAction(vtkAbstractWidget*);
188 
189  // The positioning handle widgets
193  vtkAngleWidgetCallback* AngleWidgetCallback1;
194  vtkAngleWidgetCallback* AngleWidgetCenterCallback;
195  vtkAngleWidgetCallback* AngleWidgetCallback2;
196 
197  // Methods invoked when the handles at the
198  // end points of the widget are manipulated
199  void StartAngleInteraction(int handleNum);
200  void AngleInteraction(int handleNum);
201  void EndAngleInteraction(int handleNum);
202 
203  friend class vtkAngleWidgetCallback;
204 
205 private:
206  vtkAngleWidget(const vtkAngleWidget&) = delete;
207  void operator=(const vtkAngleWidget&) = delete;
208 };
209 
210 #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.