VTK
|
3D widget for manipulating a finite plane More...
#include <vtkPlaneWidget.h>
3D widget for manipulating a finite plane
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 108 of file vtkPlaneWidget.h.
Reimplemented from vtkPolyDataSourceWidget.
Definition at line 114 of file vtkPlaneWidget.h.
enum vtkPlaneWidget::WidgetState [protected] |
Definition at line 259 of file vtkPlaneWidget.h.
vtkPlaneWidget::vtkPlaneWidget | ( | ) | [protected] |
vtkPlaneWidget::~vtkPlaneWidget | ( | ) | [protected] |
static vtkPlaneWidget* vtkPlaneWidget::New | ( | ) | [static] |
Instantiate the object.
Reimplemented from vtkObject.
static int vtkPlaneWidget::IsTypeOf | ( | const char * | name | ) | [static] |
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 vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkPolyDataSourceWidget.
virtual int vtkPlaneWidget::IsA | ( | const char * | name | ) | [virtual] |
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 vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkPolyDataSourceWidget.
static vtkPlaneWidget* vtkPlaneWidget::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkPolyDataSourceWidget.
virtual vtkObjectBase* vtkPlaneWidget::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkPolyDataSourceWidget.
vtkPlaneWidget* vtkPlaneWidget::NewInstance | ( | ) | const |
Reimplemented from vtkPolyDataSourceWidget.
void vtkPlaneWidget::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
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.
virtual void vtkPlaneWidget::SetEnabled | ( | int | ) | [virtual] |
Methods that satisfy the superclass' API.
Reimplemented from vtkInteractorObserver.
virtual void vtkPlaneWidget::PlaceWidget | ( | double | bounds[6] | ) | [virtual] |
Methods that satisfy the superclass' API.
Implements vtkPolyDataSourceWidget.
void vtkPlaneWidget::PlaceWidget | ( | ) | [inline, virtual] |
Methods that satisfy the superclass' API.
Reimplemented from vtkPolyDataSourceWidget.
Definition at line 121 of file vtkPlaneWidget.h.
void vtkPlaneWidget::PlaceWidget | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
double | zmin, | ||
double | zmax | ||
) | [inline, virtual] |
Methods that satisfy the superclass' API.
Reimplemented from vtkPolyDataSourceWidget.
Definition at line 123 of file vtkPlaneWidget.h.
void vtkPlaneWidget::SetResolution | ( | int | r | ) |
Set/Get the resolution (number of subdivisions) of the plane.
Set/Get the resolution (number of subdivisions) of the plane.
void vtkPlaneWidget::SetOrigin | ( | double | x, |
double | y, | ||
double | z | ||
) |
Set/Get the origin of the plane.
void vtkPlaneWidget::SetOrigin | ( | double | x[3] | ) |
Set/Get the origin of the plane.
Set/Get the origin of the plane.
void vtkPlaneWidget::GetOrigin | ( | double | xyz[3] | ) |
Set/Get the origin of the plane.
void vtkPlaneWidget::SetPoint1 | ( | double | x, |
double | y, | ||
double | z | ||
) |
Set/Get the position of the point defining the first axis of the plane.
void vtkPlaneWidget::SetPoint1 | ( | double | x[3] | ) |
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.
void vtkPlaneWidget::GetPoint1 | ( | double | xyz[3] | ) |
Set/Get the position of the point defining the first axis of the plane.
void vtkPlaneWidget::SetPoint2 | ( | double | x, |
double | y, | ||
double | z | ||
) |
Set/Get the position of the point defining the second axis of the plane.
void vtkPlaneWidget::SetPoint2 | ( | double | x[3] | ) |
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.
void vtkPlaneWidget::GetPoint2 | ( | double | xyz[3] | ) |
Set/Get the position of the point defining the second axis of the plane.
void vtkPlaneWidget::SetCenter | ( | double | x, |
double | y, | ||
double | z | ||
) |
Get the center of the plane.
void vtkPlaneWidget::SetCenter | ( | double | x[3] | ) |
Get the center of the plane.
Get the center of the plane.
void vtkPlaneWidget::GetCenter | ( | double | xyz[3] | ) |
Get the center of the plane.
void vtkPlaneWidget::SetNormal | ( | double | x, |
double | y, | ||
double | z | ||
) |
Get the normal to the plane.
void vtkPlaneWidget::SetNormal | ( | double | x[3] | ) |
Get the normal to the plane.
Get the normal to the plane.
void vtkPlaneWidget::GetNormal | ( | double | xyz[3] | ) |
Get the normal to the plane.
virtual void vtkPlaneWidget::SetRepresentation | ( | int | ) | [virtual] |
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.
virtual int vtkPlaneWidget::GetRepresentation | ( | ) | [virtual] |
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.
void vtkPlaneWidget::SetRepresentationToOff | ( | ) | [inline] |
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 184 of file vtkPlaneWidget.h.
void vtkPlaneWidget::SetRepresentationToOutline | ( | ) | [inline] |
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 186 of file vtkPlaneWidget.h.
void vtkPlaneWidget::SetRepresentationToWireframe | ( | ) | [inline] |
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 188 of file vtkPlaneWidget.h.
void vtkPlaneWidget::SetRepresentationToSurface | ( | ) | [inline] |
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 190 of file vtkPlaneWidget.h.
virtual void vtkPlaneWidget::SetNormalToXAxis | ( | int | ) | [virtual] |
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 originally not aligned.
virtual int vtkPlaneWidget::GetNormalToXAxis | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::NormalToXAxisOn | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::NormalToXAxisOff | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::SetNormalToYAxis | ( | int | ) | [virtual] |
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 originally not aligned.
virtual int vtkPlaneWidget::GetNormalToYAxis | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::NormalToYAxisOn | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::NormalToYAxisOff | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::SetNormalToZAxis | ( | int | ) | [virtual] |
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 originally not aligned.
virtual int vtkPlaneWidget::GetNormalToZAxis | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::NormalToZAxisOn | ( | ) | [virtual] |
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 originally not aligned.
virtual void vtkPlaneWidget::NormalToZAxisOff | ( | ) | [virtual] |
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 originally not aligned.
void vtkPlaneWidget::GetPolyData | ( | vtkPolyData * | pd | ) |
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.
void vtkPlaneWidget::GetPlane | ( | vtkPlane * | plane | ) |
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.
vtkPolyDataAlgorithm* vtkPlaneWidget::GetPolyDataAlgorithm | ( | ) | [virtual] |
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.
void vtkPlaneWidget::UpdatePlacement | ( | void | ) | [virtual] |
Satisfies superclass API. This will change the state of the widget to match changes that have been made to the underlying PolyDataSource
Implements vtkPolyDataSourceWidget.
virtual vtkProperty* vtkPlaneWidget::GetHandleProperty | ( | ) | [virtual] |
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated.
virtual vtkProperty* vtkPlaneWidget::GetSelectedHandleProperty | ( | ) | [virtual] |
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated.
virtual void vtkPlaneWidget::SetPlaneProperty | ( | vtkProperty * | ) | [virtual] |
Get the plane properties. The properties of the plane when selected and unselected can be manipulated.
virtual vtkProperty* vtkPlaneWidget::GetPlaneProperty | ( | ) | [virtual] |
Get the plane properties. The properties of the plane when selected and unselected can be manipulated.
virtual vtkProperty* vtkPlaneWidget::GetSelectedPlaneProperty | ( | ) | [virtual] |
Get the plane properties. The properties of the plane when selected and unselected can be manipulated.
static void vtkPlaneWidget::ProcessEvents | ( | vtkObject * | object, |
unsigned long | event, | ||
void * | clientdata, | ||
void * | calldata | ||
) | [static, protected] |
Handles the char widget activation event. Also handles the delete event.
Reimplemented from vtkInteractorObserver.
void vtkPlaneWidget::OnLeftButtonDown | ( | ) | [protected] |
void vtkPlaneWidget::OnLeftButtonUp | ( | ) | [protected] |
void vtkPlaneWidget::OnMiddleButtonDown | ( | ) | [protected] |
void vtkPlaneWidget::OnMiddleButtonUp | ( | ) | [protected] |
void vtkPlaneWidget::OnRightButtonDown | ( | ) | [protected] |
void vtkPlaneWidget::OnRightButtonUp | ( | ) | [protected] |
void vtkPlaneWidget::OnMouseMove | ( | ) | [protected] |
void vtkPlaneWidget::SelectRepresentation | ( | ) | [protected] |
void vtkPlaneWidget::HighlightPlane | ( | int | highlight | ) | [protected] |
void vtkPlaneWidget::PositionHandles | ( | ) | [protected] |
void vtkPlaneWidget::HandlesOn | ( | double | length | ) | [protected] |
void vtkPlaneWidget::HandlesOff | ( | ) | [protected] |
int vtkPlaneWidget::HighlightHandle | ( | vtkProp * | prop | ) | [protected] |
virtual void vtkPlaneWidget::SizeHandles | ( | ) | [protected, virtual] |
Reimplemented from vtk3DWidget.
void vtkPlaneWidget::HighlightNormal | ( | int | highlight | ) | [protected] |
virtual void vtkPlaneWidget::RegisterPickers | ( | ) | [protected, virtual] |
Register internal Pickers in the Picking Manager. Must be reimplemented by concrete widgets to register their pickers.
Reimplemented from vtkInteractorObserver.
void vtkPlaneWidget::MoveOrigin | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::MovePoint1 | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::MovePoint2 | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::MovePoint3 | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::Spin | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::Scale | ( | double * | p1, |
double * | p2, | ||
int | X, | ||
int | Y | ||
) | [protected] |
void vtkPlaneWidget::Translate | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::Push | ( | double * | p1, |
double * | p2 | ||
) | [protected] |
void vtkPlaneWidget::CreateDefaultProperties | ( | ) | [protected] |
void vtkPlaneWidget::GeneratePlane | ( | ) | [protected] |
int vtkPlaneWidget::State [protected] |
Definition at line 258 of file vtkPlaneWidget.h.
int vtkPlaneWidget::NormalToXAxis [protected] |
Definition at line 287 of file vtkPlaneWidget.h.
int vtkPlaneWidget::NormalToYAxis [protected] |
Definition at line 288 of file vtkPlaneWidget.h.
int vtkPlaneWidget::NormalToZAxis [protected] |
Definition at line 289 of file vtkPlaneWidget.h.
int vtkPlaneWidget::Representation [protected] |
Definition at line 290 of file vtkPlaneWidget.h.
vtkActor* vtkPlaneWidget::PlaneActor [protected] |
Definition at line 294 of file vtkPlaneWidget.h.
vtkPolyDataMapper* vtkPlaneWidget::PlaneMapper [protected] |
Definition at line 295 of file vtkPlaneWidget.h.
vtkPlaneSource* vtkPlaneWidget::PlaneSource [protected] |
Definition at line 296 of file vtkPlaneWidget.h.
vtkPolyData* vtkPlaneWidget::PlaneOutline [protected] |
Definition at line 297 of file vtkPlaneWidget.h.
vtkActor** vtkPlaneWidget::Handle [protected] |
Definition at line 301 of file vtkPlaneWidget.h.
vtkPolyDataMapper** vtkPlaneWidget::HandleMapper [protected] |
Definition at line 302 of file vtkPlaneWidget.h.
vtkSphereSource** vtkPlaneWidget::HandleGeometry [protected] |
Definition at line 303 of file vtkPlaneWidget.h.
vtkActor* vtkPlaneWidget::ConeActor [protected] |
Definition at line 311 of file vtkPlaneWidget.h.
vtkPolyDataMapper* vtkPlaneWidget::ConeMapper [protected] |
Definition at line 312 of file vtkPlaneWidget.h.
vtkConeSource* vtkPlaneWidget::ConeSource [protected] |
Definition at line 313 of file vtkPlaneWidget.h.
vtkActor* vtkPlaneWidget::LineActor [protected] |
Definition at line 317 of file vtkPlaneWidget.h.
vtkPolyDataMapper* vtkPlaneWidget::LineMapper [protected] |
Definition at line 318 of file vtkPlaneWidget.h.
vtkLineSource* vtkPlaneWidget::LineSource [protected] |
Definition at line 319 of file vtkPlaneWidget.h.
vtkActor* vtkPlaneWidget::ConeActor2 [protected] |
Definition at line 322 of file vtkPlaneWidget.h.
vtkPolyDataMapper* vtkPlaneWidget::ConeMapper2 [protected] |
Definition at line 323 of file vtkPlaneWidget.h.
vtkConeSource* vtkPlaneWidget::ConeSource2 [protected] |
Definition at line 324 of file vtkPlaneWidget.h.
vtkActor* vtkPlaneWidget::LineActor2 [protected] |
Definition at line 327 of file vtkPlaneWidget.h.
vtkPolyDataMapper* vtkPlaneWidget::LineMapper2 [protected] |
Definition at line 328 of file vtkPlaneWidget.h.
vtkLineSource* vtkPlaneWidget::LineSource2 [protected] |
Definition at line 329 of file vtkPlaneWidget.h.
vtkCellPicker* vtkPlaneWidget::HandlePicker [protected] |
Definition at line 332 of file vtkPlaneWidget.h.
vtkCellPicker* vtkPlaneWidget::PlanePicker [protected] |
Definition at line 333 of file vtkPlaneWidget.h.
vtkActor* vtkPlaneWidget::CurrentHandle [protected] |
Definition at line 334 of file vtkPlaneWidget.h.
double vtkPlaneWidget::Normal[3] [protected] |
Definition at line 351 of file vtkPlaneWidget.h.
vtkTransform* vtkPlaneWidget::Transform [protected] |
Definition at line 354 of file vtkPlaneWidget.h.
vtkProperty* vtkPlaneWidget::HandleProperty [protected] |
Definition at line 358 of file vtkPlaneWidget.h.
vtkProperty* vtkPlaneWidget::SelectedHandleProperty [protected] |
Definition at line 359 of file vtkPlaneWidget.h.
vtkProperty* vtkPlaneWidget::PlaneProperty [protected] |
Definition at line 360 of file vtkPlaneWidget.h.
vtkProperty* vtkPlaneWidget::SelectedPlaneProperty [protected] |
Definition at line 361 of file vtkPlaneWidget.h.
int vtkPlaneWidget::LastPickValid [protected] |
Definition at line 366 of file vtkPlaneWidget.h.
double vtkPlaneWidget::HandleSizeFactor [protected] |
Definition at line 367 of file vtkPlaneWidget.h.