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 =========================================================================*/
107 #ifndef vtkLineWidget2_h
108 #define vtkLineWidget2_h
109 
110 #include "vtkAbstractWidget.h"
111 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
112 #include "vtkInteractionWidgetsModule.h" // For export macro
113 
115 class vtkHandleWidget;
116 
117 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
118 {
119 public:
123  static vtkLineWidget2* New();
124 
126 
130  void PrintSelf(ostream& os, vtkIndent indent) override;
132 
137  void SetEnabled(int enabling) override;
138 
145  {
146  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
147  }
148 
153  {
154  return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);
155  }
156 
161 
167 
168 protected:
170  ~vtkLineWidget2() override;
171 
172  // Manage the state of the widget
175  {
176  Start = 0,
177  Active
178  };
179 #if !defined(VTK_LEGACY_REMOVE)
180  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
182 #endif
183 
185 
186  // These methods handle events
192 
193  // The positioning handle widgets
194  vtkHandleWidget* Point1Widget; // first end point
195  vtkHandleWidget* Point2Widget; // second end point
196  vtkHandleWidget* LineHandle; // used when selecting the line
197 
199  static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
200 
201 private:
202  vtkLineWidget2(const vtkLineWidget2&) = delete;
203  void operator=(const vtkLineWidget2&) = delete;
204 };
205 
206 #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:119
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:82
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)