| 1 | #include <ogdf/basic/GraphAttributes.h> |
|---|---|
| 2 | #include <ogdf/fileformats/GraphIO.h> |
| 3 | |
| 4 | using namespace ogdf; |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | Graph G; |
| 9 | GraphAttributes GA(G, |
| 10 | GraphAttributes::nodeGraphics | GraphAttributes::edgeGraphics); |
| 11 | |
| 12 | const int LEN = 11; |
| 13 | for(int i = 1; i < LEN; ++i) { |
| 14 | node left = G.newNode(); |
| 15 | GA.x(left) = -5*(i+1); |
| 16 | GA.y(left) = -20*i; |
| 17 | GA.width(left) = 10*(i+1); |
| 18 | GA.height(left) = 15; |
| 19 | |
| 20 | node bottom = G.newNode(); |
| 21 | GA.x(bottom) = 20*(LEN-i); |
| 22 | GA.y(bottom) = 5*(LEN+1-i); |
| 23 | GA.width(bottom) = 15; |
| 24 | GA.height(bottom) = 10*(LEN+1-i); |
| 25 | |
| 26 | edge e = G.newEdge(left,bottom); |
| 27 | DPolyline &p = GA.bends(e); |
| 28 | p.pushBack(DPoint(10,-20*i)); |
| 29 | p.pushBack(DPoint(20*(LEN-i),-10)); |
| 30 | } |
| 31 | |
| 32 | GraphIO::write(GA, "output-manual.gml", GraphIO::writeGML); |
| 33 | GraphIO::write(GA, "output-manual.svg", GraphIO::drawSVG); |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 |