Skip to content

Commit fa8f9f1

Browse files
author
Arne Böckmann
committed
treeeeeeeeees
1 parent 151bf61 commit fa8f9f1

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

tutorials/tutorial_basic_envire_treeview.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,14 @@ vertex_descriptors can be hashed in constant time (they are just pointers).
1111

1212
## Creating Tree Views
1313
TreeViews can be created by calling ``getTree()`` and providing a root node.
14+
<pre><code data-snippetId="graph_trees_get_1" data-file="https://raw.githubusercontent.com/envire/envire-tutorials/master/src/envire_graph_tutorials/trees.cpp"></code></pre>
1415

15-
```cpp
16-
EnvireGraph g;
17-
const FrameId a = "frame_a";
18-
/* ... */
19-
TreeView view = g.getTree(graph.vertex(a));
20-
```
2116
Note that the view will most likely be copied on return. If the tree is large
2217
you might want to avoid that copy and pass an empty view as out-parameter instead:
18+
<pre><code data-snippetId="graph_trees_get_2" data-file="https://raw.githubusercontent.com/envire/envire-tutorials/master/src/envire_graph_tutorials/trees.cpp"></code></pre>
2319

24-
```cpp
25-
EnvireGraph g;
26-
const FrameId a = "frame_a";
27-
/* ... */
28-
TreeView view;
29-
g.getTree(a, &view);
30-
```
20+
By default, a tree view shows a snapshot of the graph. I.e. if the graph changes,
21+
the changes will not be visible in the view. The view or parts of it might
22+
become invalid when vertices or edges are removed from the graph.
23+
To avoid this, you can request a self-updating tree view:
24+
<pre><code data-snippetId="graph_trees_get_3" data-file="https://raw.githubusercontent.com/envire/envire-tutorials/master/src/envire_graph_tutorials/trees.cpp"></code></pre>

0 commit comments

Comments
 (0)