[vtkusers] problem rendering

Lucas Lorenzo lucas at cvrti.utah.edu
Fri Aug 20 13:26:03 EDT 2004


Hi all,

I'm trying to run this simple code (I'm pasting only the important 
parts):


				.
				.
				.

  // Create the RenderWindow, Renderer and both Actors
   vtkRenderer *ren1 = vtkRenderer::New();
   vtkRenderWindow *renWin = vtkRenderWindow::New();
   renWin->AddRenderer(ren1);

   // Add the actors to the renderer, set the background and size
   ren1->AddActor(imActor);
   renWin->SetSize(640,640);

   // render the image
   vtkCamera *cam1 = ren1->GetActiveCamera();
   cam1->Zoom(2.5);
   renWin->Render();

   // deallocate memory:
   image_reader->Delete();
   lut->Delete();
   get_slice->Delete();
   im_mapper->Delete();
   imActor->Delete();
   ren1->Delete();
   renWin->Delete();

   return 0;
}

The problem I have is that the window pops up, shows the image I want 
to render but then immediately it closes.
What am I missing so that the renderer window doesn't close ?
Thanks,

Lucas


Lucas Lorenzo

University of Utah
Nora Eccles Harrison CardioVascular Research and Training Institute
Fellows Room
95 South 2000 East
Salt Lake City, UT 84112-5000

e-mail:  lucas at cvrti.utah.edu
telephone: 801-587-9536
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1235 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040820/3e044d7f/attachment.bin>


More information about the vtkusers mailing list