<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Hi, I'm 
relatively new to vtk and I have been having this problem with it. What we are 
doing is running a simulation of cell growth in a chemical field and I have been 
asked to come up with a function that will capture the screen for later 
reference. They were previously doing it using the jpegs to do it but the 
problem with that was that they weren't able to run it in the background then. 
So I suggested using VRML, and they said that was ok.<BR><BR>Now I'm having a 
problem getting this Exporter to work correctly. Here is what my code looks 
like:<BR><BR>void<BR><BR>SciViz::init_screen_capture()<BR><BR>{<BR><BR>renSrc = 
vtkRendererSource::New();<BR>renSrc-&gt;WholeWindowOn();<BR>renSrc-&gt;SetInput(renderer);<BR>//imgWriter 
= vtkJPEGWriter::New();<BR>imgWriter = vtkVRMLExporter::New();<BR><BR>// Set 
graphics outfile name;<BR>outfile = "output";<BR>outfiletag = 
".wrl";<BR><BR>}<BR><BR><BR>SciViz::capture_screen()<BR><BR>{<BR><BR>// Compute 
image filename<BR>char imNum[16];<BR><BR>// Get step number<BR>int 
step_num;<BR>if(fromFile)<BR>step_num = step;<BR>else<BR>step_num = 
simulator.simulationData-&gt;evolution;<BR><BR>// Generate file name based on: 
outfile, step number, and outfiletag<BR>sprintf(imNum,"%d",step_num);<BR>string 
fname = outfile;<BR>if(step_num &lt;10) {<BR>fname += "000";<BR>}<BR>else 
if(step_num &lt;100){<BR>fname += "00";<BR>}<BR>else if(step_num 
&lt;1000){<BR>fname += "0";<BR>}<BR>fname += string(imNum) + 
outfiletag;<BR><BR>// Only capture once every ten steps.<BR>// Note: the 
filename generation should be inside this 
condition.<BR>if(step_num%10==1)<BR>{<BR>// Store screen to 
image<BR><BR>renSrc-&gt;Modified();<BR><BR>// required to capture updated 
screen<BR>//imgWriter-&gt;SetInput(renSrc-&gt;GetOutput());<BR>//imgWriter-&gt;SetFileName(fname.c_str());<BR>//imgWriter-&gt;Write();<BR><BR><BR>imgWriter-&gt;SetInput(renWin);<BR>imgWriter-&gt;SetFileName(fname.c_str());<BR>imgWriter-&gt;Write();<BR>}<BR><BR>}<BR><BR><BR>Where 
renWin is of type RenderWindow *. The commented out stuff is the old code. Also 
I am Deleting the imgWriter in another cleanup function we have.<BR><BR>and so 
anytime I try to run this. I always get the following error at runtime: ERROR: 
In /afs/nd.edu/user28/izaguirr/Research/vtk/VTK/Rendering/vtkVRMLExporter.cxx, 
line 108<BR>vtkVRMLExporter (0x1ca3c0): VRML files only support one renderer per 
window.<BR><BR>I've looked online for what this error means but haven't been 
able to find anything for a few days. One of the things I don't understand is 
why I'm only getting this error at runtime.<BR><BR>Anyways, I would appreciate 
any help.<BR><BR>Will Ryan<BR>University of Notre 
Dame</FONT><BR></FONT></DIV></BODY></HTML>