VTK: Interaction/Widgets/vtkAngleWidget.h Source File

| VTK 9.3.1

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
74 #ifndef vtkAngleWidget_h
75 #define vtkAngleWidget_h
76
77 #include "vtkAbstractWidget.h"
78 #include "vtkInteractionWidgetsModule.h" // For export macro
79
80 VTK_ABI_NAMESPACE_BEGIN
81 class vtkAngleRepresentation;
82 class vtkHandleWidget;
83 class vtkAngleWidgetCallback;
84
85 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
86 {
87 public:
91 static vtkAngleWidget* New();
92
94
97 vtkTypeMacro(vtkAngleWidget, vtkAbstractWidget);
98 void PrintSelf(ostream& os, vtkIndent indent) override;
100
106 void SetEnabled(int) override;
107
113 void SetRepresentation(vtkAngleRepresentation* r)
114 {
115 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
116 }
117
121 void CreateDefaultRepresentation() override;
122
126 vtkAngleRepresentation* GetAngleRepresentation()
127 {
128 return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);
129 }
130
135 vtkTypeBool IsAngleValid();
136
141 void SetProcessEvents(vtkTypeBool) override;
142
149 enum
150 {
151 Start = 0,
152 Define,
153 Manipulate
154 };
155
157
167 virtual void SetWidgetStateToStart();
168 virtual void SetWidgetStateToManipulate();
170
174 virtual int GetWidgetState() { return this->WidgetState; }
175
176 protected:
177 vtkAngleWidget();
178 ~vtkAngleWidget() override;
179
180 // The state of the widget
181 int WidgetState;
182 int CurrentHandle;
183
184 // Callback interface to capture events when
185 // placing the widget.
186 static void AddPointAction(vtkAbstractWidget*);
187 static void MoveAction(vtkAbstractWidget*);
188 static void EndSelectAction(vtkAbstractWidget*);
189
190 // The positioning handle widgets
191 vtkHandleWidget* Point1Widget;
192 vtkHandleWidget* CenterWidget;
193 vtkHandleWidget* Point2Widget;
194 vtkAngleWidgetCallback* AngleWidgetCallback1;
195 vtkAngleWidgetCallback* AngleWidgetCenterCallback;
196 vtkAngleWidgetCallback* AngleWidgetCallback2;
197
198 // Methods invoked when the handles at the
199 // end points of the widget are manipulated
200 void StartAngleInteraction(int handleNum);
201 void AngleInteraction(int handleNum);
202 void EndAngleInteraction(int handleNum);
203
204 friend class vtkAngleWidgetCallback;
205
206 private:
207 vtkAngleWidget(const vtkAngleWidget&) = delete;
208 void operator=(const vtkAngleWidget&) = delete;
209 };
210
211 VTK_ABI_NAMESPACE_END
212 #endif
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:178
vtkAngleRepresentation
represent the vtkAngleWidget
Definition: vtkAngleRepresentation.h:28
vtkAngleWidget
measure the angle between two rays (defined by three points)
Definition: vtkAngleWidget.h:86
vtkAngleWidget::GetAngleRepresentation
vtkAngleRepresentation * GetAngleRepresentation()
Return the representation as a vtkAngleRepresentation.
Definition: vtkAngleWidget.h:126
vtkAngleWidget::~vtkAngleWidget
~vtkAngleWidget() override
vtkAngleWidget::New
static vtkAngleWidget * New()
Instantiate this class.
vtkAngleWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkAngleWidget::AngleWidgetCallback2
vtkAngleWidgetCallback * AngleWidgetCallback2
Definition: vtkAngleWidget.h:196
vtkAngleWidget::AngleWidgetCallback1
vtkAngleWidgetCallback * AngleWidgetCallback1
Definition: vtkAngleWidget.h:194
vtkAngleWidget::Point2Widget
vtkHandleWidget * Point2Widget
Definition: vtkAngleWidget.h:193
vtkAngleWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
vtkAngleWidget::IsAngleValid
vtkTypeBool IsAngleValid()
A flag indicates whether the angle is valid.
vtkAngleWidget::vtkAngleWidget
vtkAngleWidget()
vtkAngleWidget::WidgetState
int WidgetState
Definition: vtkAngleWidget.h:181
vtkAngleWidget::AngleWidgetCenterCallback
vtkAngleWidgetCallback * AngleWidgetCenterCallback
Definition: vtkAngleWidget.h:195
vtkAngleWidget::SetWidgetStateToStart
virtual void SetWidgetStateToStart()
Set the state of the widget.
vtkAngleWidget::GetWidgetState
virtual int GetWidgetState()
Return the current widget state.
Definition: vtkAngleWidget.h:174
vtkAngleWidget::CenterWidget
vtkHandleWidget * CenterWidget
Definition: vtkAngleWidget.h:192
vtkAngleWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkAngleWidget::AddPointAction
static void AddPointAction(vtkAbstractWidget *)
vtkAngleWidget::AngleInteraction
void AngleInteraction(int handleNum)
vtkAngleWidget::SetRepresentation
void SetRepresentation(vtkAngleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkAngleWidget.h:113
vtkAngleWidget::CurrentHandle
int CurrentHandle
Definition: vtkAngleWidget.h:182
vtkAngleWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkAngleWidget::StartAngleInteraction
void StartAngleInteraction(int handleNum)
vtkAngleWidget::SetWidgetStateToManipulate
virtual void SetWidgetStateToManipulate()
Set the state of the widget.
vtkAngleWidget::SetProcessEvents
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkAngleWidget::Define
@ Define
Definition: vtkAngleWidget.h:152
vtkAngleWidget::Point1Widget
vtkHandleWidget * Point1Widget
Definition: vtkAngleWidget.h:191
vtkAngleWidget::SetEnabled
void SetEnabled(int) override
The method for activating and deactivating this widget.
vtkAngleWidget::EndAngleInteraction
void EndAngleInteraction(int handleNum)
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:70
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:65
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkAbstractWidget.h