[vtkusers] possible to write actors to file?

N. Yang N.Yang at student.uva.nl
Wed Apr 26 10:09:13 EDT 2006


i am trying to write a particuliar dataset to a file, so that, if
possible, in the: 

// a renderer for the data
vtkRenderer ren1 = new vtkRenderer();
ren1.AddActor(aSphere);
ren1.SetBackground(1,1,1); // background color white

instead of ren1.AddActor(aSphere), i can try ren1.AddActor(*.actor),
which is a dataset representing the aSphere actor. any idea?



> Are you trying to write your whole scene to a file (e.g., an image 
> file like PNG, JPEG, etc.), or are you trying to write a particular 
> dataset to a file?  See the VTK/IO directory to get an idea of the 
> readers and writers VTK supports.
> 
> - Amy
> 
> At 07:21 AM 4/26/2006, N. Yang wrote:
> >Dear all,
> >
> >i am wondering if i can use some writer object to write an actor that
> >has set a certain mapper to a file(binary, ascii)?
> >
> >example:
> >
> >   public static void main (String[] args)
> >   {
> >vtkSphereSource sphere = new vtkSphereSource();
> >sphere.SetRadius(1.0);
> >sphere.SetThetaResolution(18);
> >sphere.SetPhiResolution(18);
> >
> >vtkPolyDataMapper map = new vtkPolyDataMapper();
> >map.SetInput(sphere.GetOutput());
> >
> >// actor coordinates geometry, properties, transformation
> >vtkActor aSphere = new vtkActor();
> >aSphere.SetMapper(map);
> >aSphere.GetProperty().SetColor(0,0,1); // color blue
> >
> >--------some writer object is applicable here?
> >
> >// a renderer for the data
> >vtkRenderer ren1 = new vtkRenderer();
> >ren1.AddActor(aSphere);
> >ren1.SetBackground(1,1,1); // background color white



More information about the vtkusers mailing list