Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] how to use write_graphviz_dp with graph bundle properties
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-11-09 14:07:16


On Sat, 9 Nov 2013, Jeremiah Willcock wrote:

> On Sat, 9 Nov 2013, Pablo Madoery wrote:
>
>> Hello. I know how to use write_graphviz_dp with vertices and edges
>> bundle properties but i can't figure out how to print the graph_bundle
>> property of a graph.
>
> (snip)
>
>> void printGraph(Graph graph, string file)
>> {
>>     ofstream ofs(file.c_str());
>>     dynamic_properties dp;
>>     dp.property("node_id", get(vertex_index, graph));
>>     dp.property("label", get(&EdgeInfo::weight, graph));
>>     ///dp.property("label", get(&graph[graph_bundle].duration));   ->error
>>     write_graphviz_dp(ofs, graph, dp);
>> }
>

I have now fixed this problem in the Boost trunk. To write a graph
property, here is the kind of property call you should use:

dp.property("label",
   make_static_property_map<Graph*>(get_property(graph, &GraphInfo::duration)));

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net