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 =========================================================================*/
85 #ifndef vtkLineWidget2_h
86 #define vtkLineWidget2_h
87 
88 #include "vtkInteractionWidgetsModule.h" // For export macro
89 #include "vtkAbstractWidget.h"
90 
92 class vtkHandleWidget;
93 
94 
95 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
96 {
97 public:
101  static vtkLineWidget2 *New();
102 
104 
108  void PrintSelf(ostream& os, vtkIndent indent);
110 
115  virtual void SetEnabled(int enabling);
116 
123  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
124 
129  {return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);}
130 
135 
140  virtual void SetProcessEvents(int);
141 
142 protected:
143  vtkLineWidget2();
144  ~vtkLineWidget2();
145 
146  // Manage the state of the widget
148  enum _WidgetState {Start=0,Active};
150 
151  // These methods handle events
152  static void SelectAction(vtkAbstractWidget*);
153  static void TranslateAction(vtkAbstractWidget*);
154  static void ScaleAction(vtkAbstractWidget*);
155  static void EndSelectAction(vtkAbstractWidget*);
156  static void MoveAction(vtkAbstractWidget*);
157 
158  // The positioning handle widgets
159  vtkHandleWidget *Point1Widget; //first end point
160  vtkHandleWidget *Point2Widget; //second end point
161  vtkHandleWidget *LineHandle; //used when selecting the line
162 
165  static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *);
166 
167 private:
168  vtkLineWidget2(const vtkLineWidget2&) VTK_DELETE_FUNCTION;
169  void operator=(const vtkLineWidget2&) VTK_DELETE_FUNCTION;
170 };
171 
172 #endif
vtkHandleWidget * LineHandle
void PrintSelf(ostream &os, vtkIndent indent)
Standard macros implementing standard VTK methods.
vtkCallbackCommand * KeyEventCallbackCommand
abstract base class for most VTK objects
Definition: vtkObject.h:59
virtual void SetProcessEvents(int)
Methods to change whether the widget responds to interaction.
vtkLineRepresentation * GetLineRepresentation()
Return the representation as a vtkLineRepresentation.
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
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
define the API for widget / widget representation
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
virtual void SetEnabled(int)
Methods for activating this widget.
void SetRepresentation(vtkLineRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
vtkHandleWidget * Point1Widget