次のコードを使用してノードの色を変更しようとしていますが、セグメンテーション エラーが発生します。
最新の OGDF スナップショットを使用しています。
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");
使用できる属性のマッピングと、コンストラクター (またはそれ以降) で有効にする必要がある列挙値については、列挙型のドキュメントを参照してください。