[vtkusers] Saving actors and their current transformations (camera angle and orientation)

Taro Trabish tarotrabish at hotmail.com
Mon Oct 23 03:32:03 EDT 2006


 
Hi All,
I've looked about the forum but I couldnt find anything that would allow me to save the the actors after being manipulated with the interactor (rotated or moved around) such that when they are loaded up, they appear just as they were on the screen before the save operation.
 
I tried to use the vtkXMLPolyDataWriter/Reader but I was only able to save one actor.
 
Here is the code I used to save actors.  My renderer has many actors and I want to save them all.  This only saves one actor for some reason.
 
vtkXMLPolyDataWriter output = new vtkXMLPolyDataWriter();
output.SetFileName(filename);
vtkActorCollection actors = renderer.GetActors();
output.SetNumberOfPieces(actors.GetNumberOfItems());

actors.InitTraversal();
for (int a = 0; a < actors.GetNumberOfItems(); a++)
{
   vtk.vtkActor actor = actors.GetNextActor();
   output.AddInputConnection(a, actor.GetMapper().GetInputConnection(0,0));
}
output.Write();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061023/11012a79/attachment.htm>


More information about the vtkusers mailing list