I am having troubles figuring out how to use write_graphml from the
documentation. My problem is in creating the dynamic_property.
To access my vertex properties i use this:
VERTEXPROPERTIES& properties(const Vertex& v)
{
typename property_map
On Fri, 23 Apr 2010, Theodore McCormack wrote:
I am having troubles figuring out how to use write_graphml from the documentation. My problem is in creating the dynamic_property. To access my vertex properties i use this:
VERTEXPROPERTIES& properties(const Vertex& v) { typename property_map
::type param = get(vertex_properties, graph); return param[v]; } where VERTEXPROPERTIES is a type of a structure that i use for vertex properties. how would i go about creating a dynamic_property from that property map?
dynamic_properties dp; dp.property("properties", param); A more complete example is at URL:http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/write_graphml.html. Note that if you would like separate names for the different properties you will need to define separate property names and add an entry to dp for each; property maps can be created using a function call on an existing property map, though, so you would not need to rearrange your graph data structures. Are you using bundled properties by any chance? Or do you really have a single struct that has all of your properties but is not used as a bundle? -- Jeremiah Willcock
participants (2)
-
Jeremiah Willcock
-
Theodore McCormack