VTK  9.0.1
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 =========================================================================*/
85 #ifndef vtkLineWidget2_h
86 #define vtkLineWidget2_h
87 
88 #include "vtkAbstractWidget.h"
89 #include "vtkInteractionWidgetsModule.h" // For export macro
90 
92 class vtkHandleWidget;
93 
94 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
95 {
96 public:
100  static vtkLineWidget2* New();
101 
103 
107  void PrintSelf(ostream& os, vtkIndent indent) override;
109 
114  void SetEnabled(int enabling) override;
115 
122  {
123  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
124  }
125 
130  {
131  return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);
132  }
133 
137  void CreateDefaultRepresentation() override;
138 
143  void SetProcessEvents(vtkTypeBool) override;
144 
145 protected:
146  vtkLineWidget2();
147  ~vtkLineWidget2() override;
148 
149  // Manage the state of the widget
152  {
153  Start = 0,
154  Active
155  };
157 
158  // These methods handle events
159  static void SelectAction(vtkAbstractWidget*);
160  static void TranslateAction(vtkAbstractWidget*);
161  static void ScaleAction(vtkAbstractWidget*);
162  static void EndSelectAction(vtkAbstractWidget*);
163  static void MoveAction(vtkAbstractWidget*);
164 
165  // The positioning handle widgets
166  vtkHandleWidget* Point1Widget; // first end point
167  vtkHandleWidget* Point2Widget; // second end point
168  vtkHandleWidget* LineHandle; // used when selecting the line
169 
171  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
172 
173 private:
174  vtkLineWidget2(const vtkLineWidget2&) = delete;
175  void operator=(const vtkLineWidget2&) = delete;
176 };
177 
178 #endif
vtkHandleWidget * LineHandle
vtkCallbackCommand * KeyEventCallbackCommand
abstract base class for most VTK objects
Definition: vtkObject.h:56
vtkLineRepresentation * GetLineRepresentation()
Return the representation as a vtkLineRepresentation.
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:33
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