VTK  9.3.1
vtkLineWidget2.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
76 #ifndef vtkLineWidget2_h
77 #define vtkLineWidget2_h
78 
79 #include "vtkAbstractWidget.h"
80 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
81 #include "vtkInteractionWidgetsModule.h" // For export macro
82 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
83 
84 VTK_ABI_NAMESPACE_BEGIN
86 class vtkHandleWidget;
87 
88 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
89 {
90 public:
94  static vtkLineWidget2* New();
95 
97 
101  void PrintSelf(ostream& os, vtkIndent indent) override;
103 
108  void SetEnabled(int enabling) override;
109 
116  {
117  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
118  }
119 
124  {
125  return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);
126  }
127 
131  void CreateDefaultRepresentation() override;
132 
137  void SetProcessEvents(vtkTypeBool) override;
138 
139 protected:
140  vtkLineWidget2();
141  ~vtkLineWidget2() override;
142 
143  // Manage the state of the widget
146  {
147  Start = 0,
148  Active
149  };
150 #if !defined(VTK_LEGACY_REMOVE)
151  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
153 #endif
154 
156 
157  // These methods handle events
158  static void SelectAction(vtkAbstractWidget*);
159  static void TranslateAction(vtkAbstractWidget*);
160  static void ScaleAction(vtkAbstractWidget*);
161  static void EndSelectAction(vtkAbstractWidget*);
162  static void MoveAction(vtkAbstractWidget*);
163 
164  // The positioning handle widgets
165  vtkHandleWidget* Point1Widget; // first end point
166  vtkHandleWidget* Point2Widget; // second end point
167  vtkHandleWidget* LineHandle; // used when selecting the line
168 
170  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
171 
172 private:
173  vtkLineWidget2(const vtkLineWidget2&) = delete;
174  void operator=(const vtkLineWidget2&) = delete;
175 };
176 
177 VTK_ABI_NAMESPACE_END
178 #endif
vtkHandleWidget * LineHandle
vtkCallbackCommand * KeyEventCallbackCommand
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkLineRepresentation * GetLineRepresentation()
Return the representation as a vtkLineRepresentation.
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
3D widget for manipulating a finite, straight line
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkHandleWidget * Point2Widget
vtkWidgetRepresentation * WidgetRep
int vtkTypeBool
Definition: vtkABI.h:64
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:28
define the API for widget / widget representation
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
a class defining the representation for a vtkLineWidget2
void SetRepresentation(vtkLineRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
vtkHandleWidget * Point1Widget