[vtkusers] Displaying graphs side by side

Bertrand de Boisdeffre bertrand.boisdeffre at gmail.com
Tue Aug 17 13:17:23 EDT 2010


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.
<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 <daviddoria%2Bvtk 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100817/86980336/attachment.htm>


More information about the vtkusers mailing list