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
92class vtkHandleWidget;
93
94
95class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
96{
97public:
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
142protected:
145
146 // Manage the state of the widget
148 enum _WidgetState {Start=0,Active};
150
151 // These methods handle events
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
167private:
168 vtkLineWidget2(const vtkLineWidget2&) VTK_DELETE_FUNCTION;
169 void operator=(const vtkLineWidget2&) VTK_DELETE_FUNCTION;
170};
171
172#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:40
a class defining the representation for a vtkLineWidget2
3D widget for manipulating a finite, straight line
void CreateDefaultRepresentation()
Create the default widget representation if one is not set.
vtkHandleWidget * Point1Widget
static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *)
virtual void SetProcessEvents(int)
Methods to change the whether the widget responds to interaction.
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 *)
vtkLineRepresentation * GetLineRepresentation()
Return the representation as a vtkLineRepresentation.
static void MoveAction(vtkAbstractWidget *)
static void ScaleAction(vtkAbstractWidget *)
static void TranslateAction(vtkAbstractWidget *)
virtual void SetEnabled(int enabling)
Override superclasses' SetEnabled() method because the line widget must enable its internal handle wi...
static vtkLineWidget2 * New()
Instantiate the object.
vtkHandleWidget * LineHandle
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static void SelectAction(vtkAbstractWidget *)
abstract base class for most VTK objects
Definition: vtkObject.h:60
abstract class defines interface between the widget and widget representation classes