[vtkusers] Displaying graphs side by side
Xiaofeng Z
xf10036 at hotmail.com
Tue Aug 17 14:00:11 EDT 2010
SetRenderWindow() is a method of a base class vtkRenderView from which vtkGraphLayoutView is derived from.
Xiaofeng Zhao
Subject: Re: [vtkusers] Displaying graphs side by side
From: emonson at cs.duke.edu
Date: Tue, 17 Aug 2010 13:38:37 -0400
CC: daviddoria+vtk at gmail.com; vtkusers at vtk.org
To: xf10036 at hotmail.com
Hmmm. Maybe you're right -- I hadn't seen that. Then maybe you can use the GetRenderer() method and set the viewport...
I don't have time to try it right now, but maybe Xiaofeng is on to something.
-Eric
On Aug 17, 2010, at 1:35 PM, Xiaofeng Z wrote:
What about SetRenderWindow() method? Does that allow vtkGraphLayoutView to use a user defined render window?
Xiaofeng Zhao
From: emonson at cs.duke.edu
Date: Tue, 17 Aug 2010 13:25:47 -0400
To: daviddoria+vtk at gmail.com
CC: vtkusers at vtk.org
Subject: Re: [vtkusers] Displaying graphs side by side
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 athttp://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 athttp://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
_______________________________________________ Powered bywww.kitware.com Visit other Kitware open-source projects athttp://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/4e61e34f/attachment.htm>
More information about the vtkusers
mailing list