C++ 更改节点颜色OGDF库
我正试图使用以下代码更改节点颜色,但出现分段错误 我正在使用最新的OGDF快照C++ 更改节点颜色OGDF库,c++,ogdf,C++,Ogdf,我正试图使用以下代码更改节点颜色,但出现分段错误 我正在使用最新的OGDF快照 Graph G; GraphAttributes GA(G, GraphAttributes::nodeGraphics | GraphAttributes::edgeGraphics ); node left = G.newNode(); GA.strokeColor (left) = Color("red"); 属性GraphAttributes::nodeGraphics仅启用节点
Graph G;
GraphAttributes GA(G, GraphAttributes::nodeGraphics |
GraphAttributes::edgeGraphics );
node left = G.newNode();
GA.strokeColor (left) = Color("red");
属性
GraphAttributes::nodeGraphics
仅启用节点的坐标和形状,而不启用其颜色。对于笔划和填充样式,需要在构造函数中启用GraphAttributes::nodeStyle
:
Graph G;
GraphAttributes GA(G,
GraphAttributes::nodeGraphics |
GraphAttributes::nodeStyle | // <-- Enables node stroke and filling
GraphAttributes::edgeGraphics );
node left = G.newNode();
GA.strokeColor(left) = Color("red");
图G;
Graphattes GA(G,
GraphAttributes::nodeGraphics |
GraphAttributes::nodeStyle |/属性GraphAttributes::nodeGraphics
仅启用节点的坐标和形状,而不启用其颜色。对于笔划和填充样式,您需要在构造函数中启用GraphAttributes::nodeStyle
:
Graph G;
GraphAttributes GA(G,
GraphAttributes::nodeGraphics |
GraphAttributes::nodeStyle | // <-- Enables node stroke and filling
GraphAttributes::edgeGraphics );
node left = G.newNode();
GA.strokeColor(left) = Color("red");
图G;
Graphattes GA(G,
GraphAttributes::nodeGraphics |
GraphAttributes::nodeStyle|//