[vtkusers] Hide root vertex and first edges in a directed graph

Jeff Baumes jeff.baumes at kitware.com
Thu Jan 26 16:14:36 EST 2012


Nicolas,

There is no straightforward way to accomplish this in vtkGraphLayoutView.
What you could possibly do is create a color lookup tables for the vertices
and edges that is transparent at 0 and the normal color at 1, set those on
a vtkViewTheme, and apply that theme to the graph. Then you'd need to add a
0/1 array to the vertices and edges where the root vertex/edges are 0 and
everything else is 1, and color by this array. Pretty hackish, but would
probably work.

Jeff

On Thu, Jan 19, 2012 at 12:22 PM, Nicolas Rannou <nicolas.lists at gmail.com>wrote:

> Hi all,
>
> I have a vtkMutableDirectedGraph and I would like to hide the root vertex
> and the first edges, while visualizing it through a vtkGraphLayoutView.
>              ______
>         root         |
>        /   |   \  __ |  HIDE
>     d1  d2  d3
>  ....    ....   ...
>
> It is possible to do so in the vtkQtTreeView (SetShowRootNode(false)) and
> I was wondering if such a feature was available?
> Which would be the best practice to achieve this goal?
>
> Thanks,
> Nicolas
>
> _______________________________________________
> 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/20120126/cb0a1249/attachment.htm>


More information about the vtkusers mailing list