[vtkusers] Problem with vtkLegendBoxActor ?

Wilmondes Manzi munniz at yahoo.com
Wed Mar 9 11:47:03 EST 2016


I apologize for bringing this subject up again, but I've been struggling for a while (intermittently) to patch VTK sources by myself with no success.

I have a home-made renderer that inherits from vtkWin32OpenGLRenderWindow and provides methods to draw and handle robotic elements and polygon meshes. Sometimes, such polygons are colored and the final user needs a legend in order to understand what's going on.
The problem I have is that the legend does not show up. Even a copy-paste of your example does not work (as you can see in the file attached to the original message). After much debugging, I found out that the following line of vtkLegendBoxActor::RenderOpaqueGeometry returns [0,0] into tempi array.

this->TextMapper[maxTextMapper]->GetSize(viewport,tempi);  // declaration: int tempi[2]

Even if I simulate valid values in tempi, it does not work : the size of the legend box as well as the positions of the lines of text (variables posX and posY) seem correct but no text is drawn. So, I'm wondering if the problem can come from vtkActor2D when it renders its text at the very end of the same method :
    for (i=0; i<this->NumberOfEntries; i++)
      {      //...
      renderedSomething += this->TextActor[i]->RenderOpaqueGeometry(viewport);  // <= this line
      }
    }

Thank you.
 

    Le Vendredi 22 janvier 2016 15h57, Wilmondes Manzi <munniz at yahoo.com> a écrit :
 

 Hello,

I'm wondering if anyone has experienced any issues with vtkLegendBoxActor ? After upgrading from VTK 5.10 to 6.3 and from 32 to 64 bits (under Win7 SP1 and GCC), the legend does not show up anymore. To test it, I used a simple copy-paste of the following example :
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Legend

The result (the sphere is shown but the legend is empty) is attached to this message. Any clues ?

Thank you.




  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160309/da2745d3/attachment.html>


More information about the vtkusers mailing list