VTK  9.3.0
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
85 #ifndef vtkLineWidget2_h
86 #define vtkLineWidget2_h
87 
88 #include "vtkAbstractWidget.h"
89 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
90 #include "vtkInteractionWidgetsModule.h" // For export macro
91 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
92 
93 VTK_ABI_NAMESPACE_BEGIN
95 class vtkHandleWidget;
96 
97 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
98 {
99 public:
103  static vtkLineWidget2* New();
104 
106 
110  void PrintSelf(ostream& os, vtkIndent indent) override;
112 
117  void SetEnabled(int enabling) override;
118 
125  {
126  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
127  }
128 
133  {
134  return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);
135  }
136 
141 
147 
148 protected:
150  ~vtkLineWidget2() override;
151 
152  // Manage the state of the widget
155  {
156  Start = 0,
157  Active
158  };
159 #if !defined(VTK_LEGACY_REMOVE)
160  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
162 #endif
163 
165 
166  // These methods handle events
172 
173  // The positioning handle widgets
174  vtkHandleWidget* Point1Widget; // first end point
175  vtkHandleWidget* Point2Widget; // second end point
176  vtkHandleWidget* LineHandle; // used when selecting the line
177 
179  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
180 
181 private:
182  vtkLineWidget2(const vtkLineWidget2&) = delete;
183  void operator=(const vtkLineWidget2&) = delete;
184 };
185 
186 VTK_ABI_NAMESPACE_END
187 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
supports function callbacks
a general widget for moving handles
a simple class to control print indentation
Definition: vtkIndent.h:38
a class defining the representation for a vtkLineWidget2
3D widget for manipulating a finite, straight line
~vtkLineWidget2() override
vtkHandleWidget * Point1Widget
static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *)
vtkHandleWidget * Point2Widget
void SetRepresentation(vtkLineRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkCallbackCommand * KeyEventCallbackCommand
static void EndSelectAction(vtkAbstractWidget *)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
static vtkLineWidget2 * New()
Instantiate the object.
static void MoveAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard vtkObject methods.
static void ScaleAction(vtkAbstractWidget *)
void SetEnabled(int enabling) override
Override superclasses' SetEnabled() method because the line widget must enable its internal handle wi...
static void TranslateAction(vtkAbstractWidget *)
vtkLineRepresentation * GetLineRepresentation()
Return the representation as a vtkLineRepresentation.
vtkHandleWidget * LineHandle
static void SelectAction(vtkAbstractWidget *)
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
abstract base class for most VTK objects
Definition: vtkObject.h:61
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DEPRECATED_IN_9_2_0(reason)