c++ - 使用 read_graphviz() 读取节点的默认属性
问题描述
我被 BGL 卡住了,试图读取节点的默认属性。我设法读取节点、边甚至图形属性。但不是下图中的默认属性(color、fontname、shape):
digraph G {
node [color = black, fontname = courier, shape = plaintext];
0[id=0, label=start];
1[id=1, label="0x00007ff7ca001358"];
2[id=2, label="0x00007ff7ca001969"];
0->1;
1->2;
}
这是我的代码,首先是:
class Node {
public:
std::string label, id;
};
class Branch {
public:
bool path;
};
typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS,Node,Branch> DAG;
std::istream & operator>>(std::istream & i, DAG & g)
{
boost::dynamic_properties dp;
dp.property("id",get(&Node::id,g));
dp.property("label",get(&Node::label,g));
dp.property("path", get(&Branch::path, g));
/* ??? dp.property("color", get(&????, g)); <= what to put here ? ref_property_map ? */
read_graphviz(i,g,dp,"index");
return i;
}
解决方案
推荐阅读
- r - 分类错误 新数据的因子水平与原始数据不匹配
- vb.net - vb.net:datetimerpicker mindate 触发值更改
- javascript - 带有 FileReader 的 JavaScript Promise
- java - Camel:迭代标题中的元素,并行处理
- php - 如何在 php 中集成 ccavenue 时在重定向 url 页面中获取 orderid
- ibm-mobilefirst - IBM Mobilefirst V8 - 使用 Ionic v3.20.0 的混合应用程序的自定义直接更新未发生
- php - Laravel 5.6 奇怪的行为 - 我重命名后 Laravel 看不到控制器
- aem - AEM /welcome 未重定向到 /libs/cq/core/content/welcome.html
- python - 将直线显示为斜坡的绘图 - Python
- asp.net-web-api - Coinigy v2 API - 如何使用 StartDate 和 EndDate 参数调用交易历史 API