VTK
|
3D widget for manipulating a line More...
#include <vtkLineWidget.h>
Public Types | |
typedef vtk3DWidget | Superclass |
![]() | |
typedef vtkInteractorObserver | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkLineWidget * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | GetPolyData (vtkPolyData *pd) |
virtual void | SetEnabled (int) |
virtual void | PlaceWidget (double bounds[6]) |
void | PlaceWidget () |
void | PlaceWidget (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) |
void | SetResolution (int r) |
int | GetResolution () |
void | SetPoint1 (double x, double y, double z) |
void | SetPoint1 (double x[3]) |
double * | GetPoint1 () |
void | GetPoint1 (double xyz[3]) |
void | SetPoint2 (double x, double y, double z) |
void | SetPoint2 (double x[3]) |
double * | GetPoint2 () |
void | GetPoint2 (double xyz[3]) |
virtual void | SetAlign (int) |
virtual int | GetAlign () |
void | SetAlignToXAxis () |
void | SetAlignToYAxis () |
void | SetAlignToZAxis () |
void | SetAlignToNone () |
virtual void | SetClampToBounds (int) |
virtual int | GetClampToBounds () |
virtual void | ClampToBoundsOn () |
virtual void | ClampToBoundsOff () |
virtual vtkProperty * | GetHandleProperty () |
virtual vtkProperty * | GetSelectedHandleProperty () |
virtual vtkProperty * | GetLineProperty () |
virtual vtkProperty * | GetSelectedLineProperty () |
![]() | |
vtk3DWidget * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetProp3D (vtkProp3D *) |
virtual vtkProp3D * | GetProp3D () |
virtual void | SetInputData (vtkDataSet *) |
virtual void | SetInputConnection (vtkAlgorithmOutput *) |
virtual vtkDataSet * | GetInput () |
virtual void | SetPlaceFactor (double) |
virtual double | GetPlaceFactor () |
virtual void | SetHandleSize (double) |
virtual double | GetHandleSize () |
Static Public Member Functions | |
static vtkLineWidget * | New () |
static int | IsTypeOf (const char *type) |
static vtkLineWidget * | SafeDownCast (vtkObjectBase *o) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtk3DWidget * | SafeDownCast (vtkObjectBase *o) |
Protected Types | |
enum | WidgetState { Start =0, MovingHandle, MovingLine, Scaling, Outside } |
enum | AlignmentState { XAxis, YAxis, ZAxis, None } |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkLineWidget () | |
~vtkLineWidget () | |
void | OnLeftButtonDown () |
void | OnLeftButtonUp () |
void | OnMiddleButtonDown () |
void | OnMiddleButtonUp () |
void | OnRightButtonDown () |
void | OnRightButtonUp () |
virtual void | OnMouseMove () |
void | HighlightLine (int highlight) |
void | BuildRepresentation () |
virtual void | SizeHandles () |
void | HandlesOn (double length) |
void | HandlesOff () |
int | HighlightHandle (vtkProp *prop) |
void | HighlightHandles (int highlight) |
void | SetLinePosition (double x[3]) |
virtual void | RegisterPickers () |
void | Scale (double *p1, double *p2, int X, int Y) |
void | ClampPosition (double x[3]) |
int | InBounds (double x[3]) |
void | CreateDefaultProperties () |
void | GenerateLine () |
void | EnablePointWidget () |
void | DisablePointWidget () |
int | ForwardEvent (unsigned long event) |
![]() | |
vtk3DWidget () | |
~vtk3DWidget () | |
void | AdjustBounds (double bounds[6], double newBounds[6], double center[3]) |
double | SizeHandles (double factor) |
void | UpdateInput () |
Static Protected Member Functions | |
static void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata) |
Protected Attributes | |
int | State |
int | Align |
vtkActor * | LineActor |
vtkPolyDataMapper * | LineMapper |
vtkLineSource * | LineSource |
vtkActor ** | Handle |
vtkPolyDataMapper ** | HandleMapper |
vtkSphereSource ** | HandleGeometry |
vtkCellPicker * | HandlePicker |
vtkCellPicker * | LinePicker |
vtkActor * | CurrentHandle |
double | LastPosition [3] |
int | ClampToBounds |
vtkProperty * | HandleProperty |
vtkProperty * | SelectedHandleProperty |
vtkProperty * | LineProperty |
vtkProperty * | SelectedLineProperty |
vtkPointWidget * | PointWidget |
vtkPointWidget * | PointWidget1 |
vtkPointWidget * | PointWidget2 |
vtkPWCallback * | PWCallback |
vtkPW1Callback * | PW1Callback |
vtkPW2Callback * | PW2Callback |
vtkPointWidget * | CurrentPointWidget |
![]() | |
vtkProp3D * | Prop3D |
vtk3DWidgetConnection * | ConnectionHolder |
double | PlaceFactor |
int | Placed |
double | InitialBounds [6] |
double | InitialLength |
double | HandleSize |
int | ValidPick |
double | LastPickPosition [3] |
Friends | |
class | vtkPWCallback |
3D widget for manipulating a line
This 3D widget defines a line that can be interactively placed in a scene. The line has two handles (at its endpoints), plus the line can be picked to translate it in the scene. A nice feature of the object is that the vtkLineWidget, like any 3D widget, will work with the current interactor style and any other widgets present in the scene. That is, if vtkLineWidget does not handle an event, then all other registered observers (including the interactor style) have an opportunity to process the event. Otherwise, the vtkLineWidget will terminate the processing of the event that it handles.
To use this object, just invoke SetInteractor() with the argument of the method a vtkRenderWindowInteractor. You may also wish to invoke "PlaceWidget()" to initially position the widget. The interactor will act normally until the "i" key (for "interactor") is pressed, at which point the vtkLineWidget will appear. (See superclass documentation for information about changing this behavior.) By grabbing one of the two end point handles (use the left mouse button), the line can be oriented and stretched (the other end point remains fixed). By grabbing the line itself, or using the middle mouse button, the entire line can be translated. Scaling (about the center of the line) is achieved by using the right mouse button. By moving the mouse "up" the render window the line will be made bigger; by moving "down" the render window the widget will be made smaller. Turn off the widget by pressing the "i" key again (or invoke the Off() method). (Note: picking the line or either one of the two end point handles causes a vtkPointWidget to appear. This widget has the ability to constrain motion to an axis by pressing the "shift" key while moving the mouse.)
The vtkLineWidget has several methods that can be used in conjunction with other VTK objects. The Set/GetResolution() methods control the number of subdivisions of the line; the GetPolyData() method can be used to get the polygonal representation and can be used for things like seeding streamlines. Typical usage of the widget is to make use of the StartInteractionEvent, InteractionEvent, and EndInteractionEvent events. The InteractionEvent is called on mouse motion; the other two events are called on button down and button up (either left or right button).
Some additional features of this class include the ability to control the properties of the widget. You can set the properties of the selected and unselected representations of the line. For example, you can set the property for the handles and line. In addition there are methods to constrain the line so that it is aligned along the x-y-z axes.
Definition at line 95 of file vtkLineWidget.h.
typedef vtk3DWidget vtkLineWidget::Superclass |
Definition at line 101 of file vtkLineWidget.h.
|
protected |
Enumerator | |
---|---|
Start | |
MovingHandle | |
MovingLine | |
Scaling | |
Outside |
Definition at line 198 of file vtkLineWidget.h.
|
protected |
Enumerator | |
---|---|
XAxis | |
YAxis | |
ZAxis | |
None |
Definition at line 227 of file vtkLineWidget.h.
|
protected |
|
protected |
|
static |
Instantiate the object.
|
static |
|
virtual |
Reimplemented from vtk3DWidget.
|
static |
|
protectedvirtual |
Reimplemented from vtk3DWidget.
vtkLineWidget* vtkLineWidget::NewInstance | ( | ) | const |
void vtkLineWidget::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
|
virtual |
Methods that satisfy the superclass' API.
|
virtual |
Methods that satisfy the superclass' API.
Implements vtk3DWidget.
|
inlinevirtual |
Methods that satisfy the superclass' API.
Reimplemented from vtk3DWidget.
Definition at line 108 of file vtkLineWidget.h.
|
inlinevirtual |
Methods that satisfy the superclass' API.
Reimplemented from vtk3DWidget.
Definition at line 110 of file vtkLineWidget.h.
|
inline |
Set/Get the resolution (number of subdivisions) of the line.
Definition at line 117 of file vtkLineWidget.h.
|
inline |
Set/Get the resolution (number of subdivisions) of the line.
Definition at line 119 of file vtkLineWidget.h.
void vtkLineWidget::SetPoint1 | ( | double | x, |
double | y, | ||
double | z | ||
) |
Set/Get the position of first end point.
|
inline |
Set/Get the position of first end point.
Definition at line 126 of file vtkLineWidget.h.
|
inline |
Set/Get the position of first end point.
Definition at line 128 of file vtkLineWidget.h.
|
inline |
Set/Get the position of first end point.
Definition at line 130 of file vtkLineWidget.h.
void vtkLineWidget::SetPoint2 | ( | double | x, |
double | y, | ||
double | z | ||
) |
Set position of other end point.
|
inline |
Set position of other end point.
Definition at line 137 of file vtkLineWidget.h.
|
inline |
Set position of other end point.
Definition at line 139 of file vtkLineWidget.h.
|
inline |
Set position of other end point.
Definition at line 141 of file vtkLineWidget.h.
|
virtual |
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is originally not aligned.
|
virtual |
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is originally not aligned.
|
inline |
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is originally not aligned.
Definition at line 152 of file vtkLineWidget.h.
|
inline |
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is originally not aligned.
Definition at line 153 of file vtkLineWidget.h.
|
inline |
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is originally not aligned.
Definition at line 154 of file vtkLineWidget.h.
|
inline |
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is originally not aligned.
Definition at line 155 of file vtkLineWidget.h.
|
virtual |
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.
|
virtual |
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.
|
virtual |
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.
|
virtual |
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.
void vtkLineWidget::GetPolyData | ( | vtkPolyData * | pd | ) |
Grab the polydata (including points) that defines the line. The polydata consists of n+1 points, where n is the resolution of the line. These point values are guaranteed to be up-to-date when either the InteractionEvent or EndInteraction events are invoked. The user provides the vtkPolyData and the points and polyline are added to it.
|
virtual |
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated.
|
virtual |
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated.
|
virtual |
Get the line properties. The properties of the line when selected and unselected can be manipulated.
|
virtual |
Get the line properties. The properties of the line when selected and unselected can be manipulated.
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
|
protected |
|
protected |
|
protectedvirtual |
Reimplemented from vtk3DWidget.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
friend |
Definition at line 195 of file vtkLineWidget.h.
|
protected |
Definition at line 197 of file vtkLineWidget.h.
|
protected |
Definition at line 224 of file vtkLineWidget.h.
|
protected |
Definition at line 236 of file vtkLineWidget.h.
|
protected |
Definition at line 237 of file vtkLineWidget.h.
|
protected |
Definition at line 238 of file vtkLineWidget.h.
|
protected |
Definition at line 242 of file vtkLineWidget.h.
|
protected |
Definition at line 243 of file vtkLineWidget.h.
|
protected |
Definition at line 244 of file vtkLineWidget.h.
|
protected |
Definition at line 254 of file vtkLineWidget.h.
|
protected |
Definition at line 255 of file vtkLineWidget.h.
|
protected |
Definition at line 256 of file vtkLineWidget.h.
|
protected |
Definition at line 257 of file vtkLineWidget.h.
|
protected |
Definition at line 267 of file vtkLineWidget.h.
|
protected |
Definition at line 273 of file vtkLineWidget.h.
|
protected |
Definition at line 274 of file vtkLineWidget.h.
|
protected |
Definition at line 275 of file vtkLineWidget.h.
|
protected |
Definition at line 276 of file vtkLineWidget.h.
|
protected |
Definition at line 282 of file vtkLineWidget.h.
|
protected |
Definition at line 283 of file vtkLineWidget.h.
|
protected |
Definition at line 284 of file vtkLineWidget.h.
|
protected |
Definition at line 285 of file vtkLineWidget.h.
|
protected |
Definition at line 286 of file vtkLineWidget.h.
|
protected |
Definition at line 287 of file vtkLineWidget.h.
|
protected |
Definition at line 288 of file vtkLineWidget.h.