VTK  9.1.0
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 =========================================================================*/
100 #ifndef vtkAngleWidget_h
101 #define vtkAngleWidget_h
102 
103 #include "vtkAbstractWidget.h"
104 #include "vtkInteractionWidgetsModule.h" // For export macro
105 
107 class vtkHandleWidget;
108 class vtkAngleWidgetCallback;
109 
110 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
111 {
112 public:
116  static vtkAngleWidget* New();
117 
119 
123  void PrintSelf(ostream& os, vtkIndent indent) override;
125 
131  void SetEnabled(int) override;
132 
139  {
140  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
141  }
142 
147 
152  {
153  return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);
154  }
155 
161 
167 
174  enum
175  {
176  Start = 0,
178  Manipulate
179  };
180 
182 
192  virtual void SetWidgetStateToStart();
195 
199  virtual int GetWidgetState() { return this->WidgetState; }
200 
201 protected:
203  ~vtkAngleWidget() override;
204 
205  // The state of the widget
208 
209  // Callback interface to capture events when
210  // placing the widget.
214 
215  // The positioning handle widgets
219  vtkAngleWidgetCallback* AngleWidgetCallback1;
220  vtkAngleWidgetCallback* AngleWidgetCenterCallback;
221  vtkAngleWidgetCallback* AngleWidgetCallback2;
222 
223  // Methods invoked when the handles at the
224  // end points of the widget are manipulated
225  void StartAngleInteraction(int handleNum);
226  void AngleInteraction(int handleNum);
227  void EndAngleInteraction(int handleNum);
228 
229  friend class vtkAngleWidgetCallback;
230 
231 private:
232  vtkAngleWidget(const vtkAngleWidget&) = delete;
233  void operator=(const vtkAngleWidget&) = delete;
234 };
235 
236 #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
Standard methods for a VTK class.
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()
Set the state of the widget.
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:113
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69