VTK
|
position a point in 3D space More...
#include <vtkPointWidget.h>
position a point in 3D space
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.
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.
Definition at line 85 of file vtkPointWidget.h.
Reimplemented from vtk3DWidget.
Definition at line 91 of file vtkPointWidget.h.
enum vtkPointWidget::WidgetState [protected] |
Definition at line 227 of file vtkPointWidget.h.
vtkPointWidget::vtkPointWidget | ( | ) | [protected] |
vtkPointWidget::~vtkPointWidget | ( | ) | [protected] |
static vtkPointWidget* vtkPointWidget::New | ( | ) | [static] |
Instantiate this widget
Reimplemented from vtkObject.
static int vtkPointWidget::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 vtk3DWidget.
virtual int vtkPointWidget::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 vtk3DWidget.
static vtkPointWidget* vtkPointWidget::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtk3DWidget.
virtual vtkObjectBase* vtkPointWidget::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtk3DWidget.
vtkPointWidget* vtkPointWidget::NewInstance | ( | ) | const |
Reimplemented from vtk3DWidget.
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] |
Methods that satisfy the superclass' API.
Reimplemented from vtkInteractorObserver.
virtual void vtkPointWidget::PlaceWidget | ( | double | bounds[6] | ) | [virtual] |
Methods that satisfy the superclass' API.
Implements vtk3DWidget.
void vtkPointWidget::PlaceWidget | ( | ) | [inline, virtual] |
Methods that satisfy the superclass' API.
Reimplemented from vtk3DWidget.
Definition at line 98 of file vtkPointWidget.h.
void vtkPointWidget::PlaceWidget | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
double | zmin, | ||
double | zmax | ||
) | [inline, virtual] |
Methods that satisfy the superclass' API.
Reimplemented from vtk3DWidget.
Definition at line 100 of file vtkPointWidget.h.
void vtkPointWidget::GetPolyData | ( | vtkPolyData * | pd | ) |
Grab the polydata (including points) that defines the point. A single point and a vertex compose the vtkPolyData.
void vtkPointWidget::SetPosition | ( | double | x, |
double | y, | ||
double | 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 113 of file vtkPointWidget.h.
void vtkPointWidget::SetPosition | ( | double | 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 115 of file vtkPointWidget.h.
double* 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 117 of file vtkPointWidget.h.
void vtkPointWidget::GetPosition | ( | double | 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 119 of file vtkPointWidget.h.
void vtkPointWidget::SetOutline | ( | int | o | ) | [inline] |
Turn on/off the wireframe bounding box.
Definition at line 125 of file vtkPointWidget.h.
int vtkPointWidget::GetOutline | ( | ) | [inline] |
Turn on/off the wireframe bounding box.
Definition at line 127 of file vtkPointWidget.h.
void vtkPointWidget::OutlineOn | ( | ) | [inline] |
Turn on/off the wireframe bounding box.
Definition at line 129 of file vtkPointWidget.h.
void vtkPointWidget::OutlineOff | ( | ) | [inline] |
Turn on/off the wireframe bounding box.
Definition at line 131 of file vtkPointWidget.h.
void vtkPointWidget::SetXShadows | ( | int | o | ) | [inline] |
Turn on/off the wireframe x-shadows.
Definition at line 137 of file vtkPointWidget.h.
int vtkPointWidget::GetXShadows | ( | ) | [inline] |
Turn on/off the wireframe x-shadows.
Definition at line 139 of file vtkPointWidget.h.
void vtkPointWidget::XShadowsOn | ( | ) | [inline] |
Turn on/off the wireframe x-shadows.
Definition at line 141 of file vtkPointWidget.h.
void vtkPointWidget::XShadowsOff | ( | ) | [inline] |
Turn on/off the wireframe x-shadows.
Definition at line 143 of file vtkPointWidget.h.
void vtkPointWidget::SetYShadows | ( | int | o | ) | [inline] |
Turn on/off the wireframe y-shadows.
Definition at line 149 of file vtkPointWidget.h.
int vtkPointWidget::GetYShadows | ( | ) | [inline] |
Turn on/off the wireframe y-shadows.
Definition at line 151 of file vtkPointWidget.h.
void vtkPointWidget::YShadowsOn | ( | ) | [inline] |
Turn on/off the wireframe y-shadows.
Definition at line 153 of file vtkPointWidget.h.
void vtkPointWidget::YShadowsOff | ( | ) | [inline] |
Turn on/off the wireframe y-shadows.
Definition at line 155 of file vtkPointWidget.h.
void vtkPointWidget::SetZShadows | ( | int | o | ) | [inline] |
Turn on/off the wireframe z-shadows.
Definition at line 161 of file vtkPointWidget.h.
int vtkPointWidget::GetZShadows | ( | ) | [inline] |
Turn on/off the wireframe z-shadows.
Definition at line 163 of file vtkPointWidget.h.
void vtkPointWidget::ZShadowsOn | ( | ) | [inline] |
Turn on/off the wireframe z-shadows.
Definition at line 165 of file vtkPointWidget.h.
void vtkPointWidget::ZShadowsOff | ( | ) | [inline] |
Turn on/off the wireframe z-shadows.
Definition at line 167 of file vtkPointWidget.h.
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 175 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 177 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 179 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 181 of file vtkPointWidget.h.
void vtkPointWidget::AllOn | ( | ) | [inline] |
Convenience methods to turn outline and shadows on and off.
Definition at line 187 of file vtkPointWidget.h.
void vtkPointWidget::AllOff | ( | ) | [inline] |
Convenience methods to turn outline and shadows on and off.
Definition at line 194 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 | ( | double | ) | [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 double 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.
static 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.
virtual void vtkPointWidget::OnMouseMove | ( | ) | [protected, virtual] |
virtual void vtkPointWidget::OnLeftButtonDown | ( | ) | [protected, virtual] |
virtual void vtkPointWidget::OnLeftButtonUp | ( | ) | [protected, virtual] |
virtual void vtkPointWidget::OnMiddleButtonDown | ( | ) | [protected, virtual] |
virtual void vtkPointWidget::OnMiddleButtonUp | ( | ) | [protected, virtual] |
virtual void vtkPointWidget::OnRightButtonDown | ( | ) | [protected, virtual] |
virtual void vtkPointWidget::OnRightButtonUp | ( | ) | [protected, virtual] |
void vtkPointWidget::Highlight | ( | int | highlight | ) | [protected] |
virtual void vtkPointWidget::RegisterPickers | ( | ) | [protected, virtual] |
Register internal Pickers in the Picking Manager. Must be reimplemented by concrete widgets to register their pickers.
Reimplemented from vtkInteractorObserver.
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] |
friend class vtkLineWidget [friend] |
Definition at line 224 of file vtkPointWidget.h.
int vtkPointWidget::State [protected] |
Definition at line 226 of file vtkPointWidget.h.
vtkActor* vtkPointWidget::Actor [protected] |
Definition at line 253 of file vtkPointWidget.h.
vtkPolyDataMapper* vtkPointWidget::Mapper [protected] |
Definition at line 254 of file vtkPointWidget.h.
vtkCursor3D* vtkPointWidget::Cursor3D [protected] |
Definition at line 255 of file vtkPointWidget.h.
vtkCellPicker* vtkPointWidget::CursorPicker [protected] |
Definition at line 259 of file vtkPointWidget.h.
int vtkPointWidget::ConstraintAxis [protected] |
Definition at line 265 of file vtkPointWidget.h.
int vtkPointWidget::TranslationMode [protected] |
Definition at line 269 of file vtkPointWidget.h.
vtkProperty* vtkPointWidget::Property [protected] |
Definition at line 273 of file vtkPointWidget.h.
vtkProperty* vtkPointWidget::SelectedProperty [protected] |
Definition at line 274 of file vtkPointWidget.h.
double vtkPointWidget::HotSpotSize [protected] |
Definition at line 278 of file vtkPointWidget.h.
int vtkPointWidget::WaitingForMotion [protected] |
Definition at line 280 of file vtkPointWidget.h.
int vtkPointWidget::WaitCount [protected] |
Definition at line 281 of file vtkPointWidget.h.