[vtkusers] Edit vtkActor points
Jonathan Ruiz Peinado
jonathan.ruiz3 at gmail.com
Wed Jul 18 09:19:17 EDT 2012
Hi I'm trying to edit the points that defines a line that is already
rendered.
So I know how to draw it:
controlPoints.InsertNextPoint(0, 0, 0);
controlPoints.InsertNextPoint(1, 1, 1);
polyLine = new vtkPolyLine();
cellArray = new vtkCellArray();
polyLine.GetPointIds().SetNumberOfIds(
controlPoints.GetNumberOfPoints() );
for ( int i = 0; i < controlPoints.GetNumberOfPoints(); i++ )
{
polyLine.GetPointIds().SetId(i, i);
}
cellArray.InsertNextCell(polyLine);
polyData.SetPoints(controlPoints);
polyData.SetLines(cellArray);
polyData.Update();
length = polyData.GetLength();
polyDataMapper.SetInput(polyData);
actor.SetMapper(polyDataMapper);
....
But I don't know how to get it back from the scene to be able to modify
points coordinates, so far I think that I can get the actor using vtkPicker
and use vtkActor.GetInputDataObject(0,0) do a type casting (vtkPolyData)
to get the points , but not sure, somebody did it before, or got any
advise ?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120718/3e9f3482/attachment.htm>
More information about the vtkusers
mailing list