|
Boost Users : |
Subject: [Boost-users] [graph] GraphML property problem.
From: Raindog (raindog_at_[hidden])
Date: 2008-09-28 05:15:20
Hi,
I am wondering how I can assign a Vector3 (eg. float val[3] or float
x,y,z) to a property in a graph that is read in from a graphml xml file.
I can easily set 3 properties, x,y,z but then I have to create a graph
that is read like this:
typedef property<vertex_x_t, float> x_coord_t;
typedef property<vertex_y_t, float, x_coord_t> y_coord_t;
typedef property<vertex_z_t, float, y_coord_t> coord_t;
typedef adjacency_list<vecS,vecS,directedS,
coord_t,
property<edge_weight_t,float> > graph_t;
graph_t g;
dynamic_properties dp;
dp.property("x",get(vertex_x_t(),g));
dp.property("y",get(vertex_y_t(),g));
dp.property("z",get(vertex_z_t(),g));
dp.property("weight",get(edge_weight_t(),g));
std::ifstream ifile(path.string().c_str());
read_graphml(ifile, g, dp);
I would much rather be able to set a property of type Vector3 and not
have to convert from the above code to a new graph whose vertices have
Vector3 properties attached.
thanks.
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