[vtkusers] Add two renderers to vtkBorlandRenderWindow

dean.inglis at camris.ca dean.inglis at camris.ca
Fri Aug 29 18:51:34 EDT 2003


Yang,

one thing you should do with vtk/borland gui apps is
in the destructor of the form that contains the
renderwindow component, do something along the
following lines:

void __fastcall TMainForm::FormDestroy(TObject *Sender)
{
  vtkRenderer* ren = m_BorlandRenderWindow->GetRenderer();
  ren->GetProps()->RemoveAllItems();

  vtkRenderWindow* renwin = m_BorlandRenderWindow->GetRenderWindow();
  m_Actor->ReleaseGraphicsResources(renwin);
  
  m_Actor->Delete();
}

I would still say it is necessary to modify or
subclass this component to set/get multiple renderers though...

Dean

> 
> From: Xianjin Yang <Yang at AGIUSA.COM>
> Date: 2003/08/29 Fri AM 10:46:48 GMT-04:00
> To: "'dean.inglis at camris.ca'" <dean.inglis at camris.ca>,  vtkusers at vtk.org
> Subject: RE: [vtkusers] Add two renderers to vtkBorlandRenderWindow
> 
> Hi Dean, 
> 
> Thanks for your advice. In the demo project of vtkBorlandRenderWindow, I found
> that one can do something like this
> 
> BorlandRenderWindow->GetRenderWindow()->AddRenderer(ren1);
> 
> I got what I expected on the screen by doing this. But I got access violation
> errors in several OpenGL-related vtk classes when I exited my program.
> 
> Is it OK to add another renderer this way? Say,
> BorlandRenderWindow->GetRenderWindow()->AddRenderer(ren2);
> 
> When I do this: BorlandRenderWindow->GetRenderer(), I do not know which renderer
> I would end up with.
> 
> Yang
> 
> 
> -----Original Message-----
> From: dean.inglis at camris.ca [mailto:dean.inglis at camris.ca] 
> Sent: Friday, August 29, 2003 9:14 AM
> To: vtkusers at vtk.org
> Subject: Re: [vtkusers] Add two renderers to vtkBorlandRenderWindow
> 
> 
> 
> Hi Yang, 
> 
> Take a look at  /Examples/GUI/Win32/vtkBorland/Package/vtkBorlandRenderWindow.h
> 
> You should note that there is only one render window, and one renderer.  There
> currently is no API for adding renderers, although this could be done by adding
> a vtkRendererCollection member item to this class.  If you are interested in
> doing this you could create your own a modified vtkBorlandRenderWindow, or just
> drop two vtkBorlandRenderWindow on your project's form ...  
> 
> Dean
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 




More information about the vtkusers mailing list