TreeViews
provide a tree view of the graph structure. I.e. when viewed
through a TreeView
the graph turns into a tree with a specific root node.
TreeViews use vertex_descriptors instead of FrameIds to reference frames because vertex_descriptors can be hashed in constant time (they are just pointers).
TreeViews can be created by calling getTree()
and providing a root node.
Note that the view will most likely be copied on return. If the tree is large you might want to avoid that copy and pass an empty view as out-parameter instead:
By default, a tree view shows a snapshot of the graph. I.e. if the graph changes, the changes will not be visible in the view. The view or parts of it might become invalid when vertices or edges are removed from the graph. To avoid this, you can request a self-updating tree view:
The view has three signals crossEdgeAdded
, edgeAdded
and edgeRemoved
that will be emitted whenever the tree view changes.