VTK
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 =========================================================================*/
82 #ifndef vtkLineWidget2_h
83 #define vtkLineWidget2_h
84 
85 #include "vtkInteractionWidgetsModule.h" // For export macro
86 #include "vtkAbstractWidget.h"
87 
89 class vtkHandleWidget;
90 
91 
92 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
93 {
94 public:
98  static vtkLineWidget2 *New();
99 
101 
105  void PrintSelf(ostream& os, vtkIndent indent) override;
107 
112  void SetEnabled(int enabling) override;
113 
120  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
121 
126  {return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);}
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
145  enum _WidgetState {Start=0,Active};
147 
148  // These methods handle events
149  static void SelectAction(vtkAbstractWidget*);
150  static void TranslateAction(vtkAbstractWidget*);
151  static void ScaleAction(vtkAbstractWidget*);
152  static void EndSelectAction(vtkAbstractWidget*);
153  static void MoveAction(vtkAbstractWidget*);
154 
155  // The positioning handle widgets
156  vtkHandleWidget *Point1Widget; //first end point
157  vtkHandleWidget *Point2Widget; //second end point
158  vtkHandleWidget *LineHandle; //used when selecting the line
159 
162  static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *);
163 
164 private:
165  vtkLineWidget2(const vtkLineWidget2&) = delete;
166  void operator=(const vtkLineWidget2&) = delete;
167 };
168 
169 #endif
vtkHandleWidget * LineHandle
vtkCallbackCommand * KeyEventCallbackCommand
abstract base class for most VTK objects
Definition: vtkObject.h:53
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
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