[vtkusers] Visualizing a vtkGraph

David Doria daviddoria+vtk at gmail.com
Fri Nov 6 09:55:32 EST 2009


>
>
> Why not just visualize the graph in VTK? This is the visualization toolkit
> after all ...
>
> vtkGraphLayoutView* view = vtkGraphLayoutView::New();
> view->AddRepresentationFromInput(G);
>
> view->ResetCamera();
> view->Render();
> view->GetInteractor()->Start();
>
> The view has a vtkGraphLayout filter inside, and allows you to change the
> layout strategy (which defaults to a force-directed strategy).
>
> You can also use vtkBoostConnectedComponents to see if your graph is indeed
> connected. Just get the output of the filter, extract the vertex array named
> "component", and see if the max value is indeed 0.
>
> Jeff
>
>
Jeff,

Very cool! This visualization is fantastic! I made a demo of it here:
http://www.vtk.org/Wiki/Visualize_a_graph

The connected component filter is exactly what I wrote yesterday, dang...
haha I guess we'll call that one a good exercise for me.

I also made an example of this:
http://www.vtk.org/Wiki/Find_Connected_Components

Now that I have some nice tools I'll go check out my real problem...

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091106/d124fc82/attachment.htm>


More information about the vtkusers mailing list