[vtkusers] how to prevent the point using vtkHandleWidget being moved out of a 3D model?

Liu_tj tjlp at netease.com
Tue Oct 25 12:17:41 EDT 2016


Hi,

I want to draw a point on a 3D model generated from DICOM files. I use vtkHandleWidget and add PointPlacer.

vtkHandleWidget handleWidget = vtkHandleWidget.New();
handleWidget.SetInteractor(m_renderWin.GetInteractor());

vtkSphereHandleRepresentation vtkHandleRepr = vtkSphereHandleRepresentation.New();
vtkHandleRepr.SetHandleSize(5.0);
vtkHandleRepr.GetProperty().SetColor(1.0, 0.0, 0.0);
vtkHandleRepr.SetSphereRadius(5);
vtkHandleRepr.SetRenderer(m_renderer);
vtkCellCentersPointPlacer pointPlacer = vtkCellCentersPointPlacer.New();
pointPlacer.AddProp(m_actor);
vtkHandleRepr.SetPointPlacer(pointPlacer);
vtkHandleRepr.SetWorldPosition(pointer);
handleWidget.SetRepresentation(vtkHandleRepr);
handleWidget.On();
m_renderWin.Render();

When I firstly select a posistion for this point, I can only select the position on the 3D model. After the point is drawed, when I try to move it, it can be moved out of the 3D model. It seems that the pointplacer does not work. How to solve it?

Thanks
Liu Peng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161026/2086d4c5/attachment.html>


More information about the vtkusers mailing list