[vtk-developers] GL2PS: a few questions.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sun Jun 15 16:41:10 EDT 2003


Hi,

I just checked in more changes to the vtkGL2PSExporter class.  It now
supports mixed vector/raster output thanks to Goodwin's code.  Goodwin
removed and added actors in his implementation and in the one comitted
I've simply turned on and off visibility instead.  The only major
improvement to be added is handling line width and point sizes.  I
have a few questions:

 1. While adding support for mixed raster/vector output I tried
    creating an array of vtkIntArrays and ran into lots of trouble.  I
    had code that looked like this:

      vtkIntArray **ia;
      ia = new vtkIntArray* [n]
      ia[0] = vtkIntArray::New();

    This was created/initialized inside one function and then the
    array used in another.  The initialization worked fine but I kept
    getting segfaults when I used 'ia' like so:
      ia[0]->GetNumberOfTuples() 
    in another function.  I solved my problem by using a vtkIntArray
    with multiple components but am curious to know whats wrong with
    the above and why I got the behaviour I did.

 2. I plan to add line width and point size support by adding a few
    lines of code each to Rendering/vtkOpenGLPolyDataMapper2D.cxx, and
    vtkOpenGLProperty.cxx in similar fashion to the code in
    vtkOpenGLFreeTypeTextMapper.cxx.  Essentially a couple of lines of
    code with ifdef guards.  The function calls I'll make there will
    return immediately if gl2ps is not initialized and therefore will
    not incur a performance penalty.  I just thought I'd let you folks
    know before I make the change.  Please let me know if you think
    this is not a good idea.


I am not sure about the culling of wireframe actors that Goodwin
mentioned since Goodwin has not clarified this yet.  Goodwin, I sent
you a long email a week back and havent heard from you.  If you did
not receive the mail, please let me know.  I'd appreciate any
clarifications or suggestions you may have.

Thanks!

cheers,
prabhu



More information about the vtk-developers mailing list