VTK  9.0.3
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 "vtkAbstractWidget.h"
75 #include "vtkInteractionWidgetsModule.h" // For export macro
76 
78 class vtkHandleWidget;
79 class vtkAngleWidgetCallback;
80 
81 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
82 {
83 public:
87  static vtkAngleWidget* New();
88 
90 
94  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
102  void SetEnabled(int) override;
103 
110  {
111  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
112  }
113 
118 
123  {
124  return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);
125  }
126 
132 
138 
145  enum
146  {
147  Start = 0,
149  Manipulate
150  };
151 
153 
163  virtual void SetWidgetStateToStart();
166 
170  virtual int GetWidgetState() { return this->WidgetState; }
171 
172 protected:
174  ~vtkAngleWidget() override;
175 
176  // The state of the widget
179 
180  // Callback interface to capture events when
181  // placing the widget.
185 
186  // The positioning handle widgets
190  vtkAngleWidgetCallback* AngleWidgetCallback1;
191  vtkAngleWidgetCallback* AngleWidgetCenterCallback;
192  vtkAngleWidgetCallback* AngleWidgetCallback2;
193 
194  // Methods invoked when the handles at the
195  // end points of the widget are manipulated
196  void StartAngleInteraction(int handleNum);
197  void AngleInteraction(int handleNum);
198  void EndAngleInteraction(int handleNum);
199 
200  friend class vtkAngleWidgetCallback;
201 
202 private:
203  vtkAngleWidget(const vtkAngleWidget&) = delete;
204  void operator=(const vtkAngleWidget&) = delete;
205 };
206 
207 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkAngleWidget
measure the angle between two rays (defined by three points)
vtkAngleRepresentation * GetAngleRepresentation()
Return the representation as a vtkAngleRepresentation.
~vtkAngleWidget() override
static vtkAngleWidget * New()
Instantiate this class.
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkAngleWidgetCallback * AngleWidgetCallback2
vtkAngleWidgetCallback * AngleWidgetCallback1
vtkHandleWidget * Point2Widget
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool IsAngleValid()
A flag indicates whether the angle is valid.
vtkAngleWidgetCallback * AngleWidgetCenterCallback
virtual void SetWidgetStateToStart()
Set the state of the widget.
virtual int GetWidgetState()
Return the current widget state.
vtkHandleWidget * CenterWidget
static void EndSelectAction(vtkAbstractWidget *)
static void AddPointAction(vtkAbstractWidget *)
void AngleInteraction(int handleNum)
void SetRepresentation(vtkAngleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static void MoveAction(vtkAbstractWidget *)
void StartAngleInteraction(int handleNum)
virtual void SetWidgetStateToManipulate()
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkHandleWidget * Point1Widget
void SetEnabled(int) override
The method for activating and deactivating this widget.
void EndAngleInteraction(int handleNum)
a general widget for moving handles
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69