VTK  9.0.20201019
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 =========================================================================*/
77 #ifndef vtkAngleWidget_h
78 #define vtkAngleWidget_h
79 
80 #include "vtkAbstractWidget.h"
81 #include "vtkInteractionWidgetsModule.h" // For export macro
82 
84 class vtkHandleWidget;
85 class vtkAngleWidgetCallback;
86 
87 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget
88 {
89 public:
93  static vtkAngleWidget* New();
94 
96 
100  void PrintSelf(ostream& os, vtkIndent indent) override;
102 
108  void SetEnabled(int) override;
109 
116  {
117  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
118  }
119 
123  void CreateDefaultRepresentation() override;
124 
129  {
130  return reinterpret_cast<vtkAngleRepresentation*>(this->WidgetRep);
131  }
132 
137  vtkTypeBool IsAngleValid();
138 
143  void SetProcessEvents(vtkTypeBool) override;
144 
151  enum
152  {
153  Start = 0,
155  Manipulate
156  };
157 
159 
169  virtual void SetWidgetStateToStart();
170  virtual void SetWidgetStateToManipulate();
172 
176  virtual int GetWidgetState() { return this->WidgetState; }
177 
178 protected:
179  vtkAngleWidget();
180  ~vtkAngleWidget() override;
181 
182  // The state of the widget
185 
186  // Callback interface to capture events when
187  // placing the widget.
188  static void AddPointAction(vtkAbstractWidget*);
189  static void MoveAction(vtkAbstractWidget*);
190  static void EndSelectAction(vtkAbstractWidget*);
191 
192  // The positioning handle widgets
196  vtkAngleWidgetCallback* AngleWidgetCallback1;
197  vtkAngleWidgetCallback* AngleWidgetCenterCallback;
198  vtkAngleWidgetCallback* AngleWidgetCallback2;
199 
200  // Methods invoked when the handles at the
201  // end points of the widget are manipulated
202  void StartAngleInteraction(int handleNum);
203  void AngleInteraction(int handleNum);
204  void EndAngleInteraction(int handleNum);
205 
206  friend class vtkAngleWidgetCallback;
207 
208 private:
209  vtkAngleWidget(const vtkAngleWidget&) = delete;
210  void operator=(const vtkAngleWidget&) = delete;
211 };
212 
213 #endif
vtkAngleWidget
measure the angle between two rays (defined by three points)
Definition: vtkAngleWidget.h:87
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:78
vtkAngleWidget::Point1Widget
vtkHandleWidget * Point1Widget
Definition: vtkAngleWidget.h:193
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkAngleWidget::GetAngleRepresentation
vtkAngleRepresentation * GetAngleRepresentation()
Return the representation as a vtkAngleRepresentation.
Definition: vtkAngleWidget.h:128
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkAngleWidget::AngleWidgetCallback1
vtkAngleWidgetCallback * AngleWidgetCallback1
Definition: vtkAngleWidget.h:196
vtkAngleWidget::CurrentHandle
int CurrentHandle
Definition: vtkAngleWidget.h:184
vtkAngleWidget::Point2Widget
vtkHandleWidget * Point2Widget
Definition: vtkAngleWidget.h:195
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkAngleWidget::GetWidgetState
virtual int GetWidgetState()
Return the current widget state.
Definition: vtkAngleWidget.h:176
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAngleWidget::AngleWidgetCenterCallback
vtkAngleWidgetCallback * AngleWidgetCenterCallback
Definition: vtkAngleWidget.h:197
vtkAngleWidget::AngleWidgetCallback2
vtkAngleWidgetCallback * AngleWidgetCallback2
Definition: vtkAngleWidget.h:198
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkAngleWidget::Define
Definition: vtkAngleWidget.h:154
vtkAngleWidget::CenterWidget
vtkHandleWidget * CenterWidget
Definition: vtkAngleWidget.h:194
vtkAbstractWidget::SetProcessEvents
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
vtkAngleWidget::WidgetState
int WidgetState
Definition: vtkAngleWidget.h:183
vtkAngleWidget::SetRepresentation
void SetRepresentation(vtkAngleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkAngleWidget.h:115
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkAngleRepresentation
represent the vtkAngleWidget
Definition: vtkAngleRepresentation.h:38