[vtkusers] Displaying graphs side by side

Eric E. Monson emonson at cs.duke.edu
Tue Aug 17 13:25:47 EDT 2010


Hey David,

I think Bertrand is right -- because vtkGraphLayoutView creates its own vtkRenderWindow, you're not going to be able to use it for your side-by-side layout, and it's not _too_ hard to set up the graph layout and rendering as polydata yourself. 

The problem is that if you need not just the rendering of the graph, but all of the nice selection and coloring and labeling, etc, that the graph layout view hooks up automatically for you, you might need to basically reproduce the internals of the vtkGraphLayoutView class without the render window.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Aug 17, 2010, at 1:17 PM, Bertrand de Boisdeffre wrote:

> Hi,
> 
> The answer is here :  http://comments.gmane.org/gmane.comp.lib.vtk.user/30503.
> 
> In your case, I think the second method described in the link is the best. So the main steps are the following:
> 
> For each graph :
> - Built your  "vtkGraphLayout" (not "vtkGraphLayoutViewer" !!)
> - Convert "vtkGraphLayout" into a "vtkPolyData" with "vtkGraphPolyData"
> - Map your PolyData with "vtkPolyDataMapper"
> - Create your Actor with "vtkActor"
> 
> 
> (In Fact, VtkGraphLayoutViewer does all these steps => it is faster, easier,... but not necessary better than your own "work".
> Maybe it is possible to  display two graphs side by side with a "vtkGraphLayoutView", but i have not the answer.)
> 
> After, it's simple. You create 2 renders as in this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/SideBySideViewports. Then, you just add one graph per render. To Finish make a renderWindow, (and a renderWindowInteractor to interact with the scene if you want).
> 
> I didn't try myself, but i think it  works.
> 
> Best Regards,
> 
> 2010/8/17 David Doria <daviddoria+vtk at gmail.com>
> Is it possible to display two graphs side by side with a
> vtkGraphLayoutView? Exactly like this:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/SideBySideViewports
> 
> but with graphs.
> 
> I have created two graphs here:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Graphs/SideBySideGraphs . If
> anyone could demonstrate how to display them side by side that would
> be great!
> 
> Thanks,
> 
> David
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 
> 
> -- 
> Bertrand de Boisdeffre
> Etudiant 2A  SICOM Phelma Grenoble-INP
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100817/4b55c486/attachment.htm>


More information about the vtkusers mailing list