[vtk-developers] adding vtkActor to multiple vtkRenderers (opengl) possible fix

Charl P. Botha c.p.botha at its.tudelft.nl
Thu Jul 18 08:48:54 EDT 2002


Dear developers,

A colleague ran into the "adding an actor to multiple renderers" issue again
today.  For those of you who don't know, this does not work for OpenGL as
the mapper doesn't realise that its display list is invalid when being
Render()ed from a different Renderer and this we don't see the actor at all.

I would like to fix this by adding a vtkOpenGLRenderer* instance variable to
vtkOpenGLPolyDataMapper and checking whether this has changed at round about
line 219.  Current code is as follows:

  // if something has changed regenerate colors and display lists
  // if required
  //
  int noAbort=1;
  if ( this->GetMTime() > this->BuildTime ||
       input->GetMTime() > this->BuildTime ||
       act->GetProperty()->GetMTime() > this->BuildTime ||
       ren->GetRenderWindow() != this->LastWindow)
    {
    // sets this->Colors as side effect
    this->MapScalars(act->GetProperty()->GetOpacity());
      
    if (!this->ImmediateModeRendering &&
        !this->GetGlobalImmediateModeRendering())
      {
      vtkTimerLog::MarkStartEvent("Building display list");

My check for the vtkOpenGLRender instance variable will result in the
display list being rebuilt if the Renderer has changed and
ImmediateModeRendering is NOT active.

Are there any fundamental problems with this?

Best regards,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtk-developers mailing list