#include <vtkPlaneWidget.h>
Inheritance diagram for vtkPlaneWidget:
This 3D widget defines a finite (bounded) plane that can be interactively placed in a scene. The plane has four handles (at its corner vertices), a normal vector, and the plane itself. The handles are used to resize the plane; the normal vector to rotate it, and the plane can be picked and translated. Selecting the plane while pressing CTRL makes it spin around the normal. A nice feature of the object is that the vtkPlaneWidget, like any 3D widget, will work with the current interactor style. That is, if vtkPlaneWidget does not handle an event, then all other registered observers (including the interactor style) have an opportunity to process the event. Otherwise, the vtkPlaneWidget 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. If the "i" key (for "interactor") is pressed, the vtkPlaneWidget will appear. (See superclass documentation for information about changing this behavior.) By grabbing the one of the four handles (use the left mouse button), the plane can be resized. By grabbing the plane itself, the entire plane can be arbitrarily translated. Pressing CTRL while grabbing the plane will spin the plane around the normal. If you select the normal vector, the plane can be arbitrarily rotated. Selecting any part of the widget with the middle mouse button enables translation of the plane along its normal. (Once selected using middle mouse, moving the mouse in the direction of the normal translates the plane in the direction of the normal; moving in the direction opposite the normal translates the plane in the direction opposite the normal.) Scaling (about the center of the plane) is achieved by using the right mouse button. By moving the mouse "up" the render window the plane will be made bigger; by moving "down" the render window the widget will be made smaller. Events that occur outside of the widget (i.e., no part of the widget is picked) are propagated to any other registered obsevers (such as the interaction style). Turn off the widget by pressing the "i" key again (or invoke the Off() method).
The vtkPlaneWidget has several methods that can be used in conjunction with other VTK objects. The Set/GetResolution() methods control the number of subdivisions of the plane; the GetPolyData() method can be used to get the polygonal representation and can be used for things like seeding stream lines. GetPlane() can be used to update a vtkPlane implicit function. 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 plane. For example, you can set the property for the handles and plane. In addition there are methods to constrain the plane so that it is perpendicular to the x-y-z axes.
Definition at line 111 of file vtkPlaneWidget.h.
Public Types | |
typedef vtkPolyDataSourceWidget | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | GetPolyData (vtkPolyData *pd) |
void | GetPlane (vtkPlane *plane) |
vtkPolyDataAlgorithm * | GetPolyDataAlgorithm () |
void | PrintSelf (ostream &os, vtkIndent indent) |
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 | SetOrigin (double x, double y, double z) |
void | SetOrigin (double x[3]) |
double * | GetOrigin () |
void | GetOrigin (double xyz[3]) |
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]) |
void | SetCenter (double x, double y, double z) |
void | SetCenter (double x[3]) |
double * | GetCenter () |
void | GetCenter (double xyz[3]) |
void | SetNormal (double x, double y, double z) |
void | SetNormal (double x[3]) |
double * | GetNormal () |
void | GetNormal (double xyz[3]) |
virtual void | SetRepresentation (int) |
virtual int | GetRepresentation () |
void | SetRepresentationToOff () |
void | SetRepresentationToOutline () |
void | SetRepresentationToWireframe () |
void | SetRepresentationToSurface () |
virtual void | SetNormalToXAxis (int) |
virtual int | GetNormalToXAxis () |
virtual void | NormalToXAxisOn () |
virtual void | NormalToXAxisOff () |
virtual void | SetNormalToYAxis (int) |
virtual int | GetNormalToYAxis () |
virtual void | NormalToYAxisOn () |
virtual void | NormalToYAxisOff () |
virtual void | SetNormalToZAxis (int) |
virtual int | GetNormalToZAxis () |
virtual void | NormalToZAxisOn () |
virtual void | NormalToZAxisOff () |
void | UpdatePlacement (void) |
virtual vtkProperty * | GetHandleProperty () |
virtual vtkProperty * | GetSelectedHandleProperty () |
virtual void | SetPlaneProperty (vtkProperty *) |
virtual vtkProperty * | GetPlaneProperty () |
virtual vtkProperty * | GetSelectedPlaneProperty () |
Static Public Member Functions | |
static vtkPlaneWidget * | New () |
static int | IsTypeOf (const char *type) |
static vtkPlaneWidget * | SafeDownCast (vtkObject *o) |
Protected Types | |
enum | WidgetState { Start = 0, Moving, Scaling, Pushing, Rotating, Spinning, Outside } |
Protected Member Functions | |
vtkPlaneWidget () | |
~vtkPlaneWidget () | |
void | OnLeftButtonDown () |
void | OnLeftButtonUp () |
void | OnMiddleButtonDown () |
void | OnMiddleButtonUp () |
void | OnRightButtonDown () |
void | OnRightButtonUp () |
void | OnMouseMove () |
void | SelectRepresentation () |
void | HighlightPlane (int highlight) |
void | PositionHandles () |
void | HandlesOn (double length) |
void | HandlesOff () |
int | HighlightHandle (vtkProp *prop) |
virtual void | SizeHandles () |
void | HighlightNormal (int highlight) |
void | MoveOrigin (double *p1, double *p2) |
void | MovePoint1 (double *p1, double *p2) |
void | MovePoint2 (double *p1, double *p2) |
void | MovePoint3 (double *p1, double *p2) |
void | Rotate (int X, int Y, double *p1, double *p2, double *vpn) |
void | Spin (double *p1, double *p2) |
void | Scale (double *p1, double *p2, int X, int Y) |
void | Translate (double *p1, double *p2) |
void | Push (double *p1, double *p2) |
void | CreateDefaultProperties () |
void | GeneratePlane () |
Static Protected Member Functions | |
static void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata) |
Protected Attributes | |
int | State |
int | NormalToXAxis |
int | NormalToYAxis |
int | NormalToZAxis |
int | Representation |
vtkActor * | PlaneActor |
vtkPolyDataMapper * | PlaneMapper |
vtkPlaneSource * | PlaneSource |
vtkPolyData * | PlaneOutline |
vtkActor ** | Handle |
vtkPolyDataMapper ** | HandleMapper |
vtkSphereSource ** | HandleGeometry |
vtkActor * | ConeActor |
vtkPolyDataMapper * | ConeMapper |
vtkConeSource * | ConeSource |
vtkActor * | LineActor |
vtkPolyDataMapper * | LineMapper |
vtkLineSource * | LineSource |
vtkActor * | ConeActor2 |
vtkPolyDataMapper * | ConeMapper2 |
vtkConeSource * | ConeSource2 |
vtkActor * | LineActor2 |
vtkPolyDataMapper * | LineMapper2 |
vtkLineSource * | LineSource2 |
vtkCellPicker * | HandlePicker |
vtkCellPicker * | PlanePicker |
vtkActor * | CurrentHandle |
double | Normal [3] |
vtkTransform * | Transform |
vtkProperty * | HandleProperty |
vtkProperty * | SelectedHandleProperty |
vtkProperty * | PlaneProperty |
vtkProperty * | SelectedPlaneProperty |
|
Reimplemented from vtkPolyDataSourceWidget. Definition at line 117 of file vtkPlaneWidget.h. |
|
Definition at line 262 of file vtkPlaneWidget.h. |
|
|
|
|
|
Instantiate the object. Reimplemented from vtkObject. |
|
Reimplemented from vtkPolyDataSourceWidget. |
|
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkPolyDataSourceWidget. |
|
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkPolyDataSourceWidget. |
|
Reimplemented from vtkPolyDataSourceWidget. |
|
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes. Reimplemented from vtkPolyDataSourceWidget. |
|
Methods that satisfy the superclass' API. Reimplemented from vtkInteractorObserver. |
|
We have to redeclare this abstract, PlaceWidget() requires it. You HAVE to override this in your concrete child classes. If there's no Prop3D and no Input, your PlaceWidget must make use of the underlying PolyDataSource to do its work. Implements vtkPolyDataSourceWidget. |
|
Overrides vtk3DWidget PlaceWidget() so that it doesn't complain if there's no Input and no Prop3D. Reimplemented from vtkPolyDataSourceWidget. Definition at line 124 of file vtkPlaneWidget.h. |
|
Convenience method brought over from vtkPlaneWidget. Reimplemented from vtkPolyDataSourceWidget. Definition at line 126 of file vtkPlaneWidget.h. |
|
Set/Get the resolution (number of subdivisions) of the plane. |
|
Set/Get the resolution (number of subdivisions) of the plane. |
|
Set/Get the origin of the plane. |
|
Set/Get the origin of the plane. |
|
Set/Get the origin of the plane. |
|
Set/Get the origin of the plane. |
|
Set/Get the position of the point defining the first axis of the plane. |
|
Set/Get the position of the point defining the first axis of the plane. |
|
Set/Get the position of the point defining the first axis of the plane. |
|
Set/Get the position of the point defining the first axis of the plane. |
|
Set/Get the position of the point defining the second axis of the plane. |
|
Set/Get the position of the point defining the second axis of the plane. |
|
Set/Get the position of the point defining the second axis of the plane. |
|
Set/Get the position of the point defining the second axis of the plane. |
|
Get the center of the plane. |
|
Get the center of the plane. |
|
Get the center of the plane. |
|
Get the center of the plane. |
|
Get the normal to the plane. |
|
Get the normal to the plane. |
|
Get the normal to the plane. |
|
Get the normal to the plane. |
|
Control how the plane appears when GetPolyData() is invoked. If the mode is "outline", then just the outline of the plane is shown. If the mode is "wireframe" then the plane is drawn with the outline plus the interior mesh (corresponding to the resolution specified). If the mode is "surface" then the plane is drawn as a surface. |
|
Control how the plane appears when GetPolyData() is invoked. If the mode is "outline", then just the outline of the plane is shown. If the mode is "wireframe" then the plane is drawn with the outline plus the interior mesh (corresponding to the resolution specified). If the mode is "surface" then the plane is drawn as a surface. |
|
Control how the plane appears when GetPolyData() is invoked. If the mode is "outline", then just the outline of the plane is shown. If the mode is "wireframe" then the plane is drawn with the outline plus the interior mesh (corresponding to the resolution specified). If the mode is "surface" then the plane is drawn as a surface. Definition at line 187 of file vtkPlaneWidget.h. References VTK_PLANE_OFF. |
|
Control how the plane appears when GetPolyData() is invoked. If the mode is "outline", then just the outline of the plane is shown. If the mode is "wireframe" then the plane is drawn with the outline plus the interior mesh (corresponding to the resolution specified). If the mode is "surface" then the plane is drawn as a surface. Definition at line 189 of file vtkPlaneWidget.h. References VTK_PLANE_OUTLINE. |
|
Control how the plane appears when GetPolyData() is invoked. If the mode is "outline", then just the outline of the plane is shown. If the mode is "wireframe" then the plane is drawn with the outline plus the interior mesh (corresponding to the resolution specified). If the mode is "surface" then the plane is drawn as a surface. Definition at line 191 of file vtkPlaneWidget.h. References VTK_PLANE_WIREFRAME. |
|
Control how the plane appears when GetPolyData() is invoked. If the mode is "outline", then just the outline of the plane is shown. If the mode is "wireframe" then the plane is drawn with the outline plus the interior mesh (corresponding to the resolution specified). If the mode is "surface" then the plane is drawn as a surface. Definition at line 193 of file vtkPlaneWidget.h. References VTK_PLANE_SURFACE. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Force the plane 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 plane to the axes if it is orginally not aligned. |
|
Grab the polydata (including points) that defines the plane. The polydata consists of (res+1)*(res+1) points, and res*res quadrilateral polygons, where res is the resolution of the plane. 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 polyplane are added to it. |
|
Get the planes describing the implicit function defined by the plane widget. The user must provide the instance of the class vtkPlane. Note that vtkPlane is a subclass of vtkImplicitFunction, meaning that it can be used by a variety of filters to perform clipping, cutting, and selection of data. |
|
Satisfies superclass API. This returns a pointer to the underlying PolyData. Make changes to this before calling the initial PlaceWidget() to have the initial placement follow suit. Or, make changes after the widget has been initialised and call UpdatePlacement() to realise. Implements vtkPolyDataSourceWidget. |
|
Satisfies superclass API. This will change the state of the widget to match changes that have been made to the underlying PolyDataSource Implements vtkPolyDataSourceWidget. |
|
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated. |
|
Satisfies superclass API. This will change the state of the widget to match changes that have been made to the underlying PolyDataSource |
|
Get the plane properties. The properties of the plane when selected and unselected can be manipulated. |
|
Get the plane properties. The properties of the plane when selected and unselected can be manipulated. |
|
Get the plane properties. The properties of the plane when selected and unselected can be manipulated. |
|
Handles the char widget activation event. Also handles the delete event. Reimplemented from vtkInteractorObserver. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from vtk3DWidget. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 261 of file vtkPlaneWidget.h. |
|
Definition at line 290 of file vtkPlaneWidget.h. |
|
Definition at line 291 of file vtkPlaneWidget.h. |
|
Definition at line 292 of file vtkPlaneWidget.h. |
|
Definition at line 293 of file vtkPlaneWidget.h. |
|
Definition at line 297 of file vtkPlaneWidget.h. |
|
Definition at line 298 of file vtkPlaneWidget.h. |
|
Definition at line 299 of file vtkPlaneWidget.h. |
|
Definition at line 300 of file vtkPlaneWidget.h. |
|
Definition at line 304 of file vtkPlaneWidget.h. |
|
Definition at line 305 of file vtkPlaneWidget.h. |
|
Definition at line 306 of file vtkPlaneWidget.h. |
|
Definition at line 314 of file vtkPlaneWidget.h. |
|
Definition at line 315 of file vtkPlaneWidget.h. |
|
Definition at line 316 of file vtkPlaneWidget.h. |
|
Definition at line 320 of file vtkPlaneWidget.h. |
|
Definition at line 321 of file vtkPlaneWidget.h. |
|
Definition at line 322 of file vtkPlaneWidget.h. |
|
Definition at line 325 of file vtkPlaneWidget.h. |
|
Definition at line 326 of file vtkPlaneWidget.h. |
|
Definition at line 327 of file vtkPlaneWidget.h. |
|
Definition at line 330 of file vtkPlaneWidget.h. |
|
Definition at line 331 of file vtkPlaneWidget.h. |
|
Definition at line 332 of file vtkPlaneWidget.h. |
|
Definition at line 335 of file vtkPlaneWidget.h. |
|
Definition at line 336 of file vtkPlaneWidget.h. |
|
Definition at line 337 of file vtkPlaneWidget.h. |
|
Definition at line 351 of file vtkPlaneWidget.h. |
|
Definition at line 354 of file vtkPlaneWidget.h. |
|
Definition at line 358 of file vtkPlaneWidget.h. |
|
Definition at line 359 of file vtkPlaneWidget.h. |
|
Definition at line 360 of file vtkPlaneWidget.h. |
|
Definition at line 361 of file vtkPlaneWidget.h. |