vtkImplicitPlaneWidget Class Reference
#include <vtkImplicitPlaneWidget.h>
Inheritance diagram for vtkImplicitPlaneWidget:
[legend]Collaboration diagram for vtkImplicitPlaneWidget:
[legend]List of all members.
Detailed Description
3D widget for manipulating an infinite plane
This 3D widget defines an infinite plane that can be interactively placed in a scene. The widget is represented by a plane with a normal vector; the plane is contained by a bounding box, and where the plane intersects the bounding box the edges are shown (possibly tubed). The normal can be selected and moved to rotate the plane; the plane itself can be selected and translated in various directions. As the plane is moved, the implicit plane function and polygon (representing the plane cut against the bounding box) is updated.
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 vtkImplicitPlaneWidget will appear. (See superclass documentation for information about changing this behavior.) If you select the normal vector, the plane can be arbitrarily rotated. The plane can be translated along the normal by selecting the plane and moving it. The plane (the plane origin) can also be arbitrary moved by selecting the plane with the middle mouse button. The right mouse button can be used to uniformly scale the bounding box (moving "up" the box scales larger; moving "down" the box scales 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 vtkImplicitPlaneWidget has several methods that can be used in conjunction with other VTK objects. The GetPolyData() method can be used to get a polygonal representation (the single polygon clipped by the bounding box). 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). (Note: there is also a PlaceWidgetEvent that is invoked when the widget is placed with PlaceWidget().)
Some additional features of this class include the ability to control the properties of the widget. You do this by setting property values on the normal vector (selected and unselected properties); the plane (selected and unselected properties); the outline (selected and unselected properties); and the edges. The edges may also be tubed or not.
- Warning:
- Note that the widget can be picked even when it is "behind" other actors. This is an intended feature and not a bug.
- See also:
- vtk3DWidget vtkBoxWidget vtkPlaneWidget vtkLineWidget vtkPointWidget vtkSphereWidget vtkImagePlaneWidget
- Events:
- vtkCommand::DisableEvent vtkCommand::EndInteractionEvent vtkCommand::InteractionEvent vtkCommand::StartInteractionEvent vtkCommand::EnableEvent
- Created by:
-
- CVS contributions (if > 5%):
- Schroeder, Will (89%)
- Martin, Ken (5%)
- CVS logs (CVSweb):
.h (/Hybrid/vtkImplicitPlaneWidget
.h)
.cxx (/Hybrid/vtkImplicitPlaneWidget
.cxx)
- Examples:
- vtkImplicitPlaneWidget (Examples)
- Tests:
- vtkImplicitPlaneWidget (Tests)
Definition at line 108 of file vtkImplicitPlaneWidget.h.
|
Public Types |
typedef vtkPolyDataSourceWidget | Superclass |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | GetPolyData (vtkPolyData *pd) |
vtkPolyDataSource * | GetPolyDataSource () |
void | GetPlane (vtkPlane *plane) |
void | UpdatePlacement (void) |
|
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 | SetOrigin (double x, double y, double z) |
void | SetOrigin (double x[3]) |
double * | GetOrigin () |
void | GetOrigin (double xyz[3]) |
|
void | SetNormal (double x, double y, double z) |
void | SetNormal (double x[3]) |
double * | GetNormal () |
void | GetNormal (double xyz[3]) |
|
void | SetNormalToXAxis (int) |
virtual int | GetNormalToXAxis () |
virtual void | NormalToXAxisOn () |
virtual void | NormalToXAxisOff () |
void | SetNormalToYAxis (int) |
virtual int | GetNormalToYAxis () |
virtual void | NormalToYAxisOn () |
virtual void | NormalToYAxisOff () |
void | SetNormalToZAxis (int) |
virtual int | GetNormalToZAxis () |
virtual void | NormalToZAxisOn () |
virtual void | NormalToZAxisOff () |
|
virtual void | SetTubing (int) |
virtual int | GetTubing () |
virtual void | TubingOn () |
virtual void | TubingOff () |
|
void | SetDrawPlane (int plane) |
virtual int | GetDrawPlane () |
virtual void | DrawPlaneOn () |
virtual void | DrawPlaneOff () |
|
virtual void | SetOutlineTranslation (int) |
virtual int | GetOutlineTranslation () |
virtual void | OutlineTranslationOn () |
virtual void | OutlineTranslationOff () |
|
virtual vtkProperty * | GetNormalProperty () |
virtual vtkProperty * | GetSelectedNormalProperty () |
|
virtual vtkProperty * | GetPlaneProperty () |
virtual vtkProperty * | GetSelectedPlaneProperty () |
|
virtual vtkProperty * | GetOutlineProperty () |
virtual vtkProperty * | GetSelectedOutlineProperty () |
|
virtual vtkProperty * | GetEdgesProperty () |
Static Public Member Functions |
vtkImplicitPlaneWidget * | New () |
int | IsTypeOf (const char *type) |
vtkImplicitPlaneWidget * | SafeDownCast (vtkObject *o) |
Protected Types |
enum | WidgetState {
Start = 0,
MovingPlane,
MovingOutline,
MovingOrigin,
Scaling,
Pushing,
Rotating,
Outside
} |
Protected Member Functions |
| vtkImplicitPlaneWidget () |
| ~vtkImplicitPlaneWidget () |
void | OnLeftButtonDown () |
void | OnLeftButtonUp () |
void | OnMiddleButtonDown () |
void | OnMiddleButtonUp () |
void | OnRightButtonDown () |
void | OnRightButtonUp () |
void | OnMouseMove () |
void | UpdateRepresentation () |
void | HighlightOutline (int highlight) |
void | HighlightPlane (int highlight) |
void | HighlightNormal (int highlight) |
void | ConstrainOrigin (double x[3]) |
void | Rotate (int X, int Y, double *p1, double *p2, double *vpn) |
void | TranslatePlane (double *p1, double *p2) |
void | TranslateOutline (double *p1, double *p2) |
void | TranslateOrigin (double *p1, double *p2) |
void | Push (double *p1, double *p2) |
void | Scale (double *p1, double *p2, int X, int Y) |
void | CreateDefaultProperties () |
void | GeneratePlane () |
virtual void | SizeHandles () |
Static Protected Member Functions |
void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata) |
Protected Attributes |
int | State |
int | NormalToXAxis |
int | NormalToYAxis |
int | NormalToZAxis |
vtkPlane * | Plane |
vtkImageData * | Box |
vtkOutlineFilter * | Outline |
vtkPolyDataMapper * | OutlineMapper |
vtkActor * | OutlineActor |
int | OutlineTranslation |
vtkCutter * | Cutter |
vtkPolyDataMapper * | CutMapper |
vtkActor * | CutActor |
int | DrawPlane |
vtkFeatureEdges * | Edges |
vtkTubeFilter * | EdgesTuber |
vtkPolyDataMapper * | EdgesMapper |
vtkActor * | EdgesActor |
int | Tubing |
vtkConeSource * | ConeSource |
vtkPolyDataMapper * | ConeMapper |
vtkActor * | ConeActor |
vtkLineSource * | LineSource |
vtkPolyDataMapper * | LineMapper |
vtkActor * | LineActor |
vtkConeSource * | ConeSource2 |
vtkPolyDataMapper * | ConeMapper2 |
vtkActor * | ConeActor2 |
vtkLineSource * | LineSource2 |
vtkPolyDataMapper * | LineMapper2 |
vtkActor * | LineActor2 |
vtkSphereSource * | Sphere |
vtkPolyDataMapper * | SphereMapper |
vtkActor * | SphereActor |
vtkCellPicker * | Picker |
vtkTransform * | Transform |
vtkProperty * | NormalProperty |
vtkProperty * | SelectedNormalProperty |
vtkProperty * | PlaneProperty |
vtkProperty * | SelectedPlaneProperty |
vtkProperty * | OutlineProperty |
vtkProperty * | SelectedOutlineProperty |
vtkProperty * | EdgesProperty |
Member Typedef Documentation
Member Enumeration Documentation
|
- Enumeration values:
-
Start |
|
MovingPlane |
|
MovingOutline |
|
MovingOrigin |
|
Scaling |
|
Pushing |
|
Rotating |
|
Outside |
|
Definition at line 236 of file vtkImplicitPlaneWidget.h. |
Constructor & Destructor Documentation
vtkImplicitPlaneWidget::vtkImplicitPlaneWidget |
( |
|
) |
[protected] |
|
Member Function Documentation
|
Instantiate the object.
Reimplemented from vtkObject. |
virtual const char* vtkImplicitPlaneWidget::GetClassName |
( |
|
) |
[virtual] |
|
int vtkImplicitPlaneWidget::IsTypeOf |
( |
const char * |
type |
) |
[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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkPolyDataSourceWidget. |
virtual int vtkImplicitPlaneWidget::IsA |
( |
const char * |
type |
) |
[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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkPolyDataSourceWidget. |
void vtkImplicitPlaneWidget::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 vtkImplicitPlaneWidget::SetEnabled |
( |
int |
|
) |
[virtual] |
|
virtual void vtkImplicitPlaneWidget::PlaceWidget |
( |
double |
bounds[6] |
) |
[virtual] |
|
void vtkImplicitPlaneWidget::PlaceWidget |
( |
|
) |
[inline, virtual] |
|
void vtkImplicitPlaneWidget::PlaceWidget |
( |
double |
xmin, |
|
|
double |
xmax, |
|
|
double |
ymin, |
|
|
double |
ymax, |
|
|
double |
zmin, |
|
|
double |
zmax |
|
) |
[inline, virtual] |
|
void vtkImplicitPlaneWidget::SetOrigin |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
|
|
|
Get the origin of the plane. |
void vtkImplicitPlaneWidget::SetOrigin |
( |
double |
x[3] |
) |
|
|
|
Get the origin of the plane. |
double* vtkImplicitPlaneWidget::GetOrigin |
( |
|
) |
|
|
|
Get the origin of the plane. |
void vtkImplicitPlaneWidget::GetOrigin |
( |
double |
xyz[3] |
) |
|
|
|
Get the origin of the plane. |
void vtkImplicitPlaneWidget::SetNormal |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
|
|
|
Get the normal to the plane. |
void vtkImplicitPlaneWidget::SetNormal |
( |
double |
x[3] |
) |
|
|
|
Get the normal to the plane. |
double* vtkImplicitPlaneWidget::GetNormal |
( |
|
) |
|
|
|
Get the normal to the plane. |
void vtkImplicitPlaneWidget::GetNormal |
( |
double |
xyz[3] |
) |
|
|
|
Get the normal to the plane. |
void vtkImplicitPlaneWidget::SetNormalToXAxis |
( |
int |
|
) |
|
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual int vtkImplicitPlaneWidget::GetNormalToXAxis |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::NormalToXAxisOn |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::NormalToXAxisOff |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
void vtkImplicitPlaneWidget::SetNormalToYAxis |
( |
int |
|
) |
|
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual int vtkImplicitPlaneWidget::GetNormalToYAxis |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::NormalToYAxisOn |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::NormalToYAxisOff |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
void vtkImplicitPlaneWidget::SetNormalToZAxis |
( |
int |
|
) |
|
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual int vtkImplicitPlaneWidget::GetNormalToZAxis |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::NormalToZAxisOn |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::NormalToZAxisOff |
( |
|
) |
[virtual] |
|
|
Force the plane widget to be aligned with one of the x-y-z axes. If one axis is set on, the other two will be set off. 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. |
virtual void vtkImplicitPlaneWidget::SetTubing |
( |
int |
|
) |
[virtual] |
|
|
Turn on/off tubing of the wire outline of the plane. The tube thickens the line by wrapping with a vtkTubeFilter. |
virtual int vtkImplicitPlaneWidget::GetTubing |
( |
|
) |
[virtual] |
|
|
Turn on/off tubing of the wire outline of the plane. The tube thickens the line by wrapping with a vtkTubeFilter. |
virtual void vtkImplicitPlaneWidget::TubingOn |
( |
|
) |
[virtual] |
|
|
Turn on/off tubing of the wire outline of the plane. The tube thickens the line by wrapping with a vtkTubeFilter. |
virtual void vtkImplicitPlaneWidget::TubingOff |
( |
|
) |
[virtual] |
|
|
Turn on/off tubing of the wire outline of the plane. The tube thickens the line by wrapping with a vtkTubeFilter. |
void vtkImplicitPlaneWidget::SetDrawPlane |
( |
int |
plane |
) |
|
|
|
Enable/disable the drawing of the plane. In some cases the plane interferes with the object that it is operating on (i.e., the plane interferes with the cut surface it produces producing z-buffer artifacts.) |
virtual int vtkImplicitPlaneWidget::GetDrawPlane |
( |
|
) |
[virtual] |
|
|
Enable/disable the drawing of the plane. In some cases the plane interferes with the object that it is operating on (i.e., the plane interferes with the cut surface it produces producing z-buffer artifacts.) |
virtual void vtkImplicitPlaneWidget::DrawPlaneOn |
( |
|
) |
[virtual] |
|
|
Enable/disable the drawing of the plane. In some cases the plane interferes with the object that it is operating on (i.e., the plane interferes with the cut surface it produces producing z-buffer artifacts.) |
virtual void vtkImplicitPlaneWidget::DrawPlaneOff |
( |
|
) |
[virtual] |
|
|
Enable/disable the drawing of the plane. In some cases the plane interferes with the object that it is operating on (i.e., the plane interferes with the cut surface it produces producing z-buffer artifacts.) |
virtual void vtkImplicitPlaneWidget::SetOutlineTranslation |
( |
int |
|
) |
[virtual] |
|
|
Turn on/off the ability to translate the bounding box by grabbing it with the left mouse button. |
virtual int vtkImplicitPlaneWidget::GetOutlineTranslation |
( |
|
) |
[virtual] |
|
|
Turn on/off the ability to translate the bounding box by grabbing it with the left mouse button. |
virtual void vtkImplicitPlaneWidget::OutlineTranslationOn |
( |
|
) |
[virtual] |
|
|
Turn on/off the ability to translate the bounding box by grabbing it with the left mouse button. |
virtual void vtkImplicitPlaneWidget::OutlineTranslationOff |
( |
|
) |
[virtual] |
|
|
Turn on/off the ability to translate the bounding box by grabbing it with the left mouse button. |
void vtkImplicitPlaneWidget::GetPolyData |
( |
vtkPolyData * |
pd |
) |
|
|
|
Grab the polydata that defines the plane. The polydata contains a single polygon that is clipped by the bounding box. |
|
Satisfies superclass API. This returns a pointer to the underlying PolyData (which represents the plane).
Implements vtkPolyDataSourceWidget. |
void vtkImplicitPlaneWidget::GetPlane |
( |
vtkPlane * |
plane |
) |
|
|
|
Get the implicit function for the plane. 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. |
void vtkImplicitPlaneWidget::UpdatePlacement |
( |
void |
|
) |
[virtual] |
|
|
Satisfies the 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* vtkImplicitPlaneWidget::GetNormalProperty |
( |
|
) |
[virtual] |
|
|
Get the properties on the normal (line and cone). |
virtual vtkProperty* vtkImplicitPlaneWidget::GetSelectedNormalProperty |
( |
|
) |
[virtual] |
|
|
Get the properties on the normal (line and cone). |
virtual vtkProperty* vtkImplicitPlaneWidget::GetPlaneProperty |
( |
|
) |
[virtual] |
|
|
Get the plane properties. The properties of the plane when selected and unselected can be manipulated. |
virtual vtkProperty* vtkImplicitPlaneWidget::GetSelectedPlaneProperty |
( |
|
) |
[virtual] |
|
|
Get the plane properties. The properties of the plane when selected and unselected can be manipulated. |
virtual vtkProperty* vtkImplicitPlaneWidget::GetOutlineProperty |
( |
|
) |
[virtual] |
|
|
Get the property of the outline. |
virtual vtkProperty* vtkImplicitPlaneWidget::GetSelectedOutlineProperty |
( |
|
) |
[virtual] |
|
|
Get the property of the outline. |
virtual vtkProperty* vtkImplicitPlaneWidget::GetEdgesProperty |
( |
|
) |
[virtual] |
|
|
Get the property of the intersection edges. (This property also applies to the edges when tubed.) |
void vtkImplicitPlaneWidget::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 vtkImplicitPlaneWidget::OnLeftButtonDown |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::OnLeftButtonUp |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::OnMiddleButtonDown |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::OnMiddleButtonUp |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::OnRightButtonDown |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::OnRightButtonUp |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::OnMouseMove |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::UpdateRepresentation |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::HighlightOutline |
( |
int |
highlight |
) |
[protected] |
|
void vtkImplicitPlaneWidget::HighlightPlane |
( |
int |
highlight |
) |
[protected] |
|
void vtkImplicitPlaneWidget::HighlightNormal |
( |
int |
highlight |
) |
[protected] |
|
void vtkImplicitPlaneWidget::ConstrainOrigin |
( |
double |
x[3] |
) |
[protected] |
|
void vtkImplicitPlaneWidget::Rotate |
( |
int |
X, |
|
|
int |
Y, |
|
|
double * |
p1, |
|
|
double * |
p2, |
|
|
double * |
vpn |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::TranslatePlane |
( |
double * |
p1, |
|
|
double * |
p2 |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::TranslateOutline |
( |
double * |
p1, |
|
|
double * |
p2 |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::TranslateOrigin |
( |
double * |
p1, |
|
|
double * |
p2 |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::Push |
( |
double * |
p1, |
|
|
double * |
p2 |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::Scale |
( |
double * |
p1, |
|
|
double * |
p2, |
|
|
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::CreateDefaultProperties |
( |
|
) |
[protected] |
|
void vtkImplicitPlaneWidget::GeneratePlane |
( |
|
) |
[protected] |
|
virtual void vtkImplicitPlaneWidget::SizeHandles |
( |
|
) |
[protected, virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following file: