Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
vtkPointWidget Class Reference
#include <vtkPointWidget.h>
Inheritance diagram for vtkPointWidget:
[legend]Collaboration diagram for vtkPointWidget:
[legend]List of all members.
Detailed Description
position a point in 3D space
- Date:
-
2002/09/05 11:53:07
- Revision:
-
1.14
This 3D widget allows the user to position a point in 3D space using a 3D cursor. The cursor has an outline bounding box, axes-aligned cross-hairs, and axes shadows. (The outline and shadows can be turned off.) Any of these can be turned off. A nice feature of the object is that the vtkPointWidget, like any 3D widget, will work with the current interactor style. That is, if vtkPointWidget does not handle an event, then all other registered observers (including the interactor style) have an opportunity to process the event. Otherwise, the vtkPointWidget 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 vtkPointWidget will appear. (See superclass documentation for information about changing this behavior.) To move the point, the user can grab (left mouse) on any widget line and "slide" the point into position. Scaling is achieved by using the right mouse button "up" the render window (makes the widget bigger) or "down" the render window (makes the widget smaller). To translate the widget use the middle mouse button. (Note: all of the translation interactions can be constrained to one of the x-y-z axes by using the "shift" key.) The vtkPointWidget produces as output a polydata with a single point and a vertex cell.
Some additional features of this class include the ability to control the rendered properties of the widget. You can set the properties of the selected and unselected representations of the parts of the widget. For example, you can set the property of the 3D cursor in its normal and selected states.
- Warning:
-
Note that widget can be picked even when it is "behind" other actors. This is an intended feature and not a bug.
- Warning:
-
The constrained translation/sliding action (i.e., when the "shift" key is depressed) along the axes is based on a combination of a "hot" spot around the cursor focus plus the initial mouse motion after selection. That is, if the user selects an axis outside of the hot spot, then the motion is constrained along that axis. If the user selects the point widget near the focus (within the hot spot), the initial motion defines a vector which is compared to the x-y-z axes. The motion is constrained to the axis that is most parallel to the initial motion vector.
- See also:
-
vtk3DWidget vtkLineWidget vtkBoxWidget vtkPlaneWidget
- Events:
-
vtkCommand::EnableEvent vtkCommand::InteractionEvent vtkCommand::EndInteractionEvent vtkCommand::DisableEvent vtkCommand::StartInteractionEvent
- Created by:
-
- CVS contributions (if > 5%):
-
- CVS logs (CVSweb):
-
- .
cxx
(/Hybrid/vtkPointWidget.cxx)
- .
h
(/Hybrid/vtkPointWidget.h)
- Examples:
-
vtkPointWidget (Examples)
- Tests:
-
vtkPointWidget (Tests)
Definition at line 102 of file vtkPointWidget.h.
|
Public Types |
typedef vtk3DWidget | Superclass |
Public Methods |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | GetPolyData (vtkPolyData *pd) |
|
virtual void | SetEnabled (int) |
virtual void | PlaceWidget (float bounds[6]) |
void | PlaceWidget () |
void | PlaceWidget (float xmin, float xmax, float ymin, float ymax, float zmin, float zmax) |
|
void | SetPosition (float x, float y, float z) |
void | SetPosition (float x[3]) |
float * | GetPosition () |
void | GetPosition (float xyz[3]) |
|
void | SetOutline (int o) |
int | GetOutline () |
void | OutlineOn () |
void | OutlineOff () |
|
void | SetXShadows (int o) |
int | GetXShadows () |
void | XShadowsOn () |
void | XShadowsOff () |
|
void | SetYShadows (int o) |
int | GetYShadows () |
void | YShadowsOn () |
void | YShadowsOff () |
|
void | SetZShadows (int o) |
int | GetZShadows () |
void | ZShadowsOn () |
void | ZShadowsOff () |
|
void | SetTranslationMode (int mode) |
int | GetTranslationMode () |
void | TranslationModeOn () |
void | TranslationModeOff () |
|
void | AllOn () |
void | AllOff () |
|
virtual vtkProperty * | GetProperty () |
virtual vtkProperty * | GetSelectedProperty () |
|
virtual void | SetHotSpotSize (float) |
virtual float | GetHotSpotSize () |
Static Public Methods |
vtkPointWidget * | New () |
int | IsTypeOf (const char *type) |
vtkPointWidget * | SafeDownCast (vtkObject *o) |
Protected Types |
enum | WidgetState {
Start = 0,
Moving,
Scaling,
Translating,
Outside
} |
Protected Methods |
| vtkPointWidget () |
| ~vtkPointWidget () |
void | OnMouseMove () |
void | OnLeftButtonDown () |
void | OnLeftButtonUp () |
void | OnMiddleButtonDown () |
void | OnMiddleButtonUp () |
void | OnRightButtonDown () |
void | OnRightButtonUp () |
void | Highlight (int highlight) |
void | Translate (double *p1, double *p2) |
void | Scale (double *p1, double *p2, int X, int Y) |
void | MoveFocus (double *p1, double *p2) |
void | CreateDefaultProperties () |
int | DetermineConstraintAxis (int constraint, double *x) |
Static Protected Methods |
void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata) |
Protected Attributes |
int | State |
vtkActor * | Actor |
vtkPolyDataMapper * | Mapper |
vtkCursor3D * | Cursor3D |
vtkCellPicker * | CursorPicker |
int | ConstraintAxis |
int | TranslationMode |
vtkProperty * | Property |
vtkProperty * | SelectedProperty |
float | HotSpotSize |
int | WaitingForMotion |
int | WaitCount |
Friends |
class | vtkLineWidget |
Member Typedef Documentation
Member Enumeration Documentation
enum vtkPointWidget::WidgetState [protected]
|
|
|
- Enumeration values:
-
Start |
|
Moving |
|
Scaling |
|
Translating |
|
Outside |
|
Definition at line 244 of file vtkPointWidget.h. |
Constructor & Destructor Documentation
vtkPointWidget::vtkPointWidget |
( |
|
) |
[protected] |
|
vtkPointWidget::~vtkPointWidget |
( |
|
) |
[protected] |
|
Member Function Documentation
vtkPointWidget* vtkPointWidget::New |
( |
|
) |
[static] |
|
|
Instantiate this widget
Reimplemented from vtkObject. |
virtual const char* vtkPointWidget::GetClassName |
( |
|
) |
[virtual] |
|
int vtkPointWidget::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 vtk3DWidget. |
virtual int vtkPointWidget::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 vtk3DWidget. |
vtkPointWidget* vtkPointWidget::SafeDownCast |
( |
vtkObject * |
o |
) |
[static] |
|
void vtkPointWidget::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 vtk3DWidget. |
virtual void vtkPointWidget::SetEnabled |
( |
int |
|
) |
[virtual] |
|
virtual void vtkPointWidget::PlaceWidget |
( |
float |
bounds[6] |
) |
[virtual] |
|
|
Methods that satisfy the superclass' API.
Implements vtk3DWidget. |
void vtkPointWidget::PlaceWidget |
( |
|
) |
[inline] |
|
void vtkPointWidget::PlaceWidget |
( |
float |
xmin, |
|
|
float |
xmax, |
|
|
float |
ymin, |
|
|
float |
ymax, |
|
|
float |
zmin, |
|
|
float |
zmax |
|
) |
[inline] |
|
|
Grab the polydata (including points) that defines the point. A single point and a vertex compose the vtkPolyData. |
void vtkPointWidget::SetPosition |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
[inline] |
|
|
Set/Get the position of the point. Note that if the position is set outside of the bounding box, it will be clamped to the boundary of the bounding box.
Definition at line 130 of file vtkPointWidget.h. |
void vtkPointWidget::SetPosition |
( |
float |
x[3] |
) |
[inline] |
|
|
Set/Get the position of the point. Note that if the position is set outside of the bounding box, it will be clamped to the boundary of the bounding box.
Definition at line 132 of file vtkPointWidget.h. |
float* vtkPointWidget::GetPosition |
( |
|
) |
[inline] |
|
|
Set/Get the position of the point. Note that if the position is set outside of the bounding box, it will be clamped to the boundary of the bounding box.
Definition at line 134 of file vtkPointWidget.h. |
void vtkPointWidget::GetPosition |
( |
float |
xyz[3] |
) |
[inline] |
|
|
Set/Get the position of the point. Note that if the position is set outside of the bounding box, it will be clamped to the boundary of the bounding box.
Definition at line 136 of file vtkPointWidget.h. |
void vtkPointWidget::SetOutline |
( |
int |
o |
) |
[inline] |
|
int vtkPointWidget::GetOutline |
( |
|
) |
[inline] |
|
void vtkPointWidget::OutlineOn |
( |
|
) |
[inline] |
|
void vtkPointWidget::OutlineOff |
( |
|
) |
[inline] |
|
void vtkPointWidget::SetXShadows |
( |
int |
o |
) |
[inline] |
|
int vtkPointWidget::GetXShadows |
( |
|
) |
[inline] |
|
void vtkPointWidget::XShadowsOn |
( |
|
) |
[inline] |
|
void vtkPointWidget::XShadowsOff |
( |
|
) |
[inline] |
|
void vtkPointWidget::SetYShadows |
( |
int |
o |
) |
[inline] |
|
int vtkPointWidget::GetYShadows |
( |
|
) |
[inline] |
|
void vtkPointWidget::YShadowsOn |
( |
|
) |
[inline] |
|
void vtkPointWidget::YShadowsOff |
( |
|
) |
[inline] |
|
void vtkPointWidget::SetZShadows |
( |
int |
o |
) |
[inline] |
|
int vtkPointWidget::GetZShadows |
( |
|
) |
[inline] |
|
void vtkPointWidget::ZShadowsOn |
( |
|
) |
[inline] |
|
void vtkPointWidget::ZShadowsOff |
( |
|
) |
[inline] |
|
void vtkPointWidget::SetTranslationMode |
( |
int |
mode |
) |
[inline] |
|
|
If translation mode is on, as the widget is moved the bounding box, shadows, and cursor are all translated simultaneously as the point moves.
Definition at line 192 of file vtkPointWidget.h. |
int vtkPointWidget::GetTranslationMode |
( |
|
) |
[inline] |
|
|
If translation mode is on, as the widget is moved the bounding box, shadows, and cursor are all translated simultaneously as the point moves.
Definition at line 194 of file vtkPointWidget.h. |
void vtkPointWidget::TranslationModeOn |
( |
|
) |
[inline] |
|
|
If translation mode is on, as the widget is moved the bounding box, shadows, and cursor are all translated simultaneously as the point moves.
Definition at line 196 of file vtkPointWidget.h. |
void vtkPointWidget::TranslationModeOff |
( |
|
) |
[inline] |
|
|
If translation mode is on, as the widget is moved the bounding box, shadows, and cursor are all translated simultaneously as the point moves.
Definition at line 198 of file vtkPointWidget.h. |
void vtkPointWidget::AllOn |
( |
|
) |
[inline] |
|
|
Convenience methods to turn outline and shadows on and off.
Definition at line 204 of file vtkPointWidget.h. |
void vtkPointWidget::AllOff |
( |
|
) |
[inline] |
|
|
Convenience methods to turn outline and shadows on and off.
Definition at line 211 of file vtkPointWidget.h. |
virtual vtkProperty* vtkPointWidget::GetProperty |
( |
|
) |
[virtual] |
|
|
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be set. |
virtual vtkProperty* vtkPointWidget::GetSelectedProperty |
( |
|
) |
[virtual] |
|
|
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be set. |
virtual void vtkPointWidget::SetHotSpotSize |
( |
float |
|
) |
[virtual] |
|
|
Set the "hot spot" size; i.e., the region around the focus, in which the motion vector is used to control the constrained sliding action. Note the size is specified as a fraction of the length of the diagonal of the point widget's bounding box. |
virtual float vtkPointWidget::GetHotSpotSize |
( |
|
) |
[virtual] |
|
|
Set the "hot spot" size; i.e., the region around the focus, in which the motion vector is used to control the constrained sliding action. Note the size is specified as a fraction of the length of the diagonal of the point widget's bounding box. |
void vtkPointWidget::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 vtkPointWidget::OnMouseMove |
( |
|
) |
[protected] |
|
void vtkPointWidget::OnLeftButtonDown |
( |
|
) |
[protected] |
|
void vtkPointWidget::OnLeftButtonUp |
( |
|
) |
[protected] |
|
void vtkPointWidget::OnMiddleButtonDown |
( |
|
) |
[protected] |
|
void vtkPointWidget::OnMiddleButtonUp |
( |
|
) |
[protected] |
|
void vtkPointWidget::OnRightButtonDown |
( |
|
) |
[protected] |
|
void vtkPointWidget::OnRightButtonUp |
( |
|
) |
[protected] |
|
void vtkPointWidget::Highlight |
( |
int |
highlight |
) |
[protected] |
|
void vtkPointWidget::Translate |
( |
double * |
p1, |
|
|
double * |
p2 |
|
) |
[protected] |
|
void vtkPointWidget::Scale |
( |
double * |
p1, |
|
|
double * |
p2, |
|
|
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkPointWidget::MoveFocus |
( |
double * |
p1, |
|
|
double * |
p2 |
|
) |
[protected] |
|
void vtkPointWidget::CreateDefaultProperties |
( |
|
) |
[protected] |
|
int vtkPointWidget::DetermineConstraintAxis |
( |
int |
constraint, |
|
|
double * |
x |
|
) |
[protected] |
|
Friends And Related Function Documentation
friend class vtkLineWidget [friend]
|
|
Member Data Documentation
int vtkPointWidget::State [protected]
|
|
vtkActor* vtkPointWidget::Actor [protected]
|
|
int vtkPointWidget::ConstraintAxis [protected]
|
|
int vtkPointWidget::TranslationMode [protected]
|
|
vtkProperty* vtkPointWidget::SelectedProperty [protected]
|
|
float vtkPointWidget::HotSpotSize [protected]
|
|
int vtkPointWidget::WaitingForMotion [protected]
|
|
int vtkPointWidget::WaitCount [protected]
|
|
The documentation for this class was generated from the following file: