X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ovsdb%2Fdot2pic;h=7b0ec36b3ab8e18f0fa262cd20af9191faddc837;hb=f40869bdf6feca4d3ff7c59a1fb1f7ac101bc967;hp=3e2f30893fc0a94fe3243627d357adb53b219b8c;hpb=fca64c1292812ebea45433b104b9549a02ea268d;p=sliver-openvswitch.git diff --git a/ovsdb/dot2pic b/ovsdb/dot2pic index 3e2f30893..7b0ec36b3 100755 --- a/ovsdb/dot2pic +++ b/ovsdb/dot2pic @@ -1,6 +1,6 @@ #! /usr/bin/perl -# Copyright (c) 2009, 2010 Nicira Networks +# Copyright (c) 2009, 2010, 2011 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,14 +21,22 @@ my ($scale) = 1; print ".PS\n"; print "linethick = 1;\n"; while (<>) { - if (/graph (\S+) (\S+) (\S+)/) { - $scale = $1; - } elsif (my ($name, $x, $y, $width, $height, $label, $style, $shape, $color, $fillcolor) = /node (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+)/) { + if (/^graph/) { + (undef, $scale) = split; + } elsif (/^node/) { + my (undef, $name, $x, $y, $width, $height, $label, $style, $shape, $color, $fillcolor) = split; $x *= $scale; $y *= $scale; $width *= $scale; $height *= $scale; + print "linethick = ", ($style eq 'bold' ? 0.5 : 1.0), ";\n"; print "box at $x,$y wid $width height $height \"$name\"\n"; + if ($style eq 'bold') { + my $inset = 2.0 / 72.0; + $width -= $inset * 2; + $height -= $inset * 2; + print "box at $x,$y wid $width height $height\n"; + } } elsif (/edge/) { my (undef, $tail, $head, $n, $rest) = split(' ', $_, 5); my @xy; @@ -50,6 +58,8 @@ while (<>) { } my ($style, $color) = split(' ', $rest); + print "linethick = ", ($style eq 'dotted' ? 0.5 : 1), ";\n"; + print "spline -> from $xy[0][0],$xy[0][1]"; for (my ($i) = 0; $i <= $#xy; $i++) { print " to $xy[$i][0],$xy[$i][1]";