[vtkusers] VTK for tree visualization: how to modify the visibility of individual vertex/edge
Jeff Baumes
jeff.baumes at kitware.com
Wed Nov 10 12:31:12 EST 2010
On Wed, Nov 10, 2010 at 11:48 AM, Eric E. Monson <emonson at cs.duke.edu>wrote:
> On Nov 10, 2010, at 10:24 AM, Jeff Baumes wrote:
>
> On Wed, Nov 10, 2010 at 8:56 AM, Xinghua Lou <
> xinghua.lou at iwr.uni-heidelberg.de> wrote:
>
>> Dear all,
>>
>> I am developing some Infovis applications based on VTK by following the
>> TreeLayout.cxx example in VTK/Examples/Infovis. One problem I have now is
>> that I don' know how to modify the visibility of certain vertex or edge. I
>> tried to google this question but can not find a clear answer. Can anyone
>> give me some hints? Any suggestion is highly appreciated. Thank you.
>>
>>
> There is no direct way to do this in VTK at the view level. You may instead
> filter the graph to prune vertices/edges (see vtkExtractSelectedGraph) and
> display the resulting graph in the view.
>
> Jeff
>
>
> If you want certain parts of the graph to not exist any more and have the
> layout adjust accordingly, then follow Jeff's advice.
>
> If you want the layout to stay the same (so all vertices and edges still
> exist) but just have some vertices or edges disappear, you might be able to
> create a view theme to color the elements with a lookup table where some
> attribute value gets mapped to alpha = 0 so they become transparent. Then
> you just need to change the attribute values on the edges and vertices so
> those elements disappear when you want them to.
>
>
To keep the layout the same, you could also do the following pipeline:
graph -> vtkGraphLayout -> vtkExtractSelectedGraph -> vtkGraphLayoutView
Then in the view, set the layout strategy to "pass through". This will keep
the same layout you manually performed with vtkGraphLayout, even when you
change the selection in vtkExtractSelectedGraph.
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101110/5f673fce/attachment.htm>
More information about the vtkusers
mailing list