3
ドット(graphviz)のブーストグラフライブラリを使用して書式設定された入力ファイルのグラフラベルにアクセスしようとしています。下のグラフタイプのtypedefです:BGL GraphPropertyへのアクセス
struct DotVertex {
std::string label;
};
struct DotEdge {
std::string label;
};
struct DotGraph {
std::string label;
};
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
DotVertex, DotEdge, DotGraph> graph_t;
そして、これは私がダイナミックプロパティを割り当てる方法を示します。
graph_t graphviz;
boost::dynamic_properties dp(boost::ignore_other_properties);
dp.property("label", boost::get(&DotGraph::label, graphviz));
dp.property("label", boost::get(&DotVertex::label, graphviz));
dp.property("label", boost::get(&DotEdge::label, graphviz));
std::ifstream ifs("sample.dot");
bool status = boost::read_graphviz(ifs, graphviz, dp);
コンパイラがエラーとDotGraph ::ラベルの割り当てについて不平を言いますメッセージ:
read_graph.cc:25:30: error: no matching function for call to 'get' dp.property("label", boost::get(&DotGraph::label, graphviz));
この場合、グラフラベルを読み取る便利な方法は何ですか?ありがとう!
答えは: – sehe