VTK  9.2.6
vtkLineWidget2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLineWidget2.h
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 =========================================================================*/
88 #ifndef vtkLineWidget2_h
89 #define vtkLineWidget2_h
90 
91 #include "vtkAbstractWidget.h"
92 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
93 #include "vtkInteractionWidgetsModule.h" // For export macro
94 
96 class vtkHandleWidget;
97 
98 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
99 {
100 public:
104  static vtkLineWidget2* New();
105 
107 
111  void PrintSelf(ostream& os, vtkIndent indent) override;
113 
118  void SetEnabled(int enabling) override;
119 
126  {
127  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
128  }
129 
134  {
135  return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);
136  }
137 
141  void CreateDefaultRepresentation() override;
142 
147  void SetProcessEvents(vtkTypeBool) override;
148 
149 protected:
150  vtkLineWidget2();
151  ~vtkLineWidget2() override;
152 
153  // Manage the state of the widget
156  {
157  Start = 0,
158  Active
159  };
160 #if !defined(VTK_LEGACY_REMOVE)
161  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
163 #endif
164 
166 
167  // These methods handle events
168  static void SelectAction(vtkAbstractWidget*);
169  static void TranslateAction(vtkAbstractWidget*);
170  static void ScaleAction(vtkAbstractWidget*);
171  static void EndSelectAction(vtkAbstractWidget*);
172  static void MoveAction(vtkAbstractWidget*);
173 
174  // The positioning handle widgets
175  vtkHandleWidget* Point1Widget; // first end point
176  vtkHandleWidget* Point2Widget; // second end point
177  vtkHandleWidget* LineHandle; // used when selecting the line
178 
180  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
181 
182 private:
183  vtkLineWidget2(const vtkLineWidget2&) = delete;
184  void operator=(const vtkLineWidget2&) = delete;
185 };
186 
187 #endif
vtkHandleWidget * LineHandle
vtkCallbackCommand * KeyEventCallbackCommand
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:69
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
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