VTK  9.3.0
vtkAngleWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
62#ifndef vtkAngleWidget_h
63#define vtkAngleWidget_h
64
65#include "vtkAbstractWidget.h"
66#include "vtkInteractionWidgetsModule.h" // For export macro
67
68VTK_ABI_NAMESPACE_BEGIN
70class vtkHandleWidget;
71class vtkAngleWidgetCallback;
72
73class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
74{
75public:
80
82
86 void PrintSelf(ostream& os, vtkIndent indent) override;
88
94 void SetEnabled(int) override;
95
102 {
103 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
104 }
105
110
115 {
116 return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);
117 }
118
124
130
137 enum
138 {
139 Start = 0,
141 Manipulate
142 };
143
145
155 virtual void SetWidgetStateToStart();
158
162 virtual int GetWidgetState() { return this->WidgetState; }
163
164protected:
166 ~vtkAngleWidget() override;
167
168 // The state of the widget
171
172 // Callback interface to capture events when
173 // placing the widget.
177
178 // The positioning handle widgets
182 vtkAngleWidgetCallback* AngleWidgetCallback1;
183 vtkAngleWidgetCallback* AngleWidgetCenterCallback;
184 vtkAngleWidgetCallback* AngleWidgetCallback2;
185
186 // Methods invoked when the handles at the
187 // end points of the widget are manipulated
188 void StartAngleInteraction(int handleNum);
189 void AngleInteraction(int handleNum);
190 void EndAngleInteraction(int handleNum);
191
192 friend class vtkAngleWidgetCallback;
193
194private:
195 vtkAngleWidget(const vtkAngleWidget&) = delete;
196 void operator=(const vtkAngleWidget&) = delete;
197};
198
199VTK_ABI_NAMESPACE_END
200#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkAngleWidget
measure the angle between two rays (defined by three points)
~vtkAngleWidget() override
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.
vtkAngleRepresentation * GetAngleRepresentation()
Return the representation as a vtkAngleRepresentation.
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 *)
static vtkAngleWidget * New()
Instantiate this class.
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:29
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64