[vtkusers] Mouse drag

elena ovreiu elena.ovreiu at gmail.com
Thu Feb 17 13:23:41 EST 2011


Hi vtk users,

I'm trying to move a vertex of a mesh by mouse interaction.
In order to do that, I pick a point on my mesh using vtkPropPicker class.
This position is set as start position in the  vtkPointWidget class..

My code for widget is:

vtkPointWidget *pointWidget = vtkPointWidget::New();
 pointWidget->SetInteractor(this->GetInteractor());
 pointWidget->PlaceWidget(polydata->GetBounds());
 pointWidget->SetPosition(pos[0],pos[1],pos[2]); //position selected by
mouse (using vtkPropPicker class)
 pointWidget->EnabledOn();
 pointWidget->TranslationModeOff();
 pointWidget->AllOff();
pointWidget->OutlineOff();
pointWidget->GetDefaultRenderer();

After this code I move the widget by mouse, but a new position is not
returned.

pointWidget->GetPosition() returns me pos[0],pos[1],pos[2].(the initial
position) and this position is returned straightforward and not after I drag
the point by mouse.

Thank you for your help.
Elena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110217/bd9227b2/attachment.htm>


More information about the vtkusers mailing list