From: ian Date: Sun, 1 Jun 2008 01:04:39 +0000 (+0000) Subject: new printforui, use with ./ours.redactgraph trivpairnodes trivnullnodes printforui... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=088d1fad059ef9b3c54ce8cffa217b230e3848d0;p=trains.git new printforui, use with ./ours.redactgraph trivpairnodes trivnullnodes printforui |sort --- diff --git a/layout/.cvsignore b/layout/.cvsignore index ebb5ca0..2bec486 100644 --- a/layout/.cvsignore +++ b/layout/.cvsignore @@ -15,6 +15,7 @@ subseg2display compose-segenco tmp.* ui-plan-*.ppm +ui-plan-*.crop-info parts.ps *-a.ps ours.graph.c diff --git a/layout/Makefile b/layout/Makefile index 982d1b4..2af037c 100644 --- a/layout/Makefile +++ b/layout/Makefile @@ -13,6 +13,8 @@ LAYOUTOPTS_PS= -e'[sp]=*rm' -e'p=5C' XLAYOUTOPTS_LAYER= -e'=5AN' -E'*~=5rsm' -e'p~=5r' -e'*~=9C' -e'*=*l' \ $(LAYOUTOPTS_PS) +PLANUI_PSDPI= 72 + LAYOUTOPTS_SEGS= '-e*=*rm' -Lsubseglwm=80 -Lsubseglwe=150 -Lsubseglwq=50 LAYERS_LS= 0 4 10 26 30 @@ -27,6 +29,8 @@ LPAGES= $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p4-$xx$y.ps)) CPROGS= subseg2display compose-segenco +CPPFLAGS += -DPLANUI_PSDPI=$(PLANUI_PSDPI) + default: $(CPROGS) for-test-ui layers extras all: default lpages for-pic: ours+pindata.asm @@ -123,7 +127,7 @@ compose-segenco: compose-segenco.o %.segenco.ppm: %.segenco.ps Makefile gs -dNOPAUSE -dBATCH -dSAFER -q \ - -sDEVICE=ppmraw -r72 -g595x842 \ + -sDEVICE=ppmraw -r$(PLANUI_PSDPI) -g595x842 \ -sOutputFile=$@.new $< && mv -f $@.new $@ ours.graph.c: extractgraph ours.dgram-bot.p0.segenco.ps @@ -164,10 +168,13 @@ t.ppm: ours.dgram-bot.pa.segenco.ppm x.gdb subseg2display gdb -x x.gdb ui-plan-%.ppm: ours.dgram-%.pa.segenco.ppm Makefile - pnmcrop <$< >$@.1.new + pnmcrop -verbose 2>&1 <$< >$@.1.new | tee ui-plan-$*.crop-info pnmflip <$@.1.new -ccw >$@.2.new pnmpad <$@.2.new -white -l5 -r5 -t5 -b5 $o +ui-plan-%.crop-info: ui-plan-%.ppm + @: + subseg2display.o compose-segenco.o: segcmap.h clean: diff --git a/layout/redactgraph.c b/layout/redactgraph.c index 5ced177..f7a351f 100644 --- a/layout/redactgraph.c +++ b/layout/redactgraph.c @@ -740,7 +740,7 @@ static void printforshellscript(void) { output(segment->segname); if (segment->n_movfeats>1) { if (!segment->starfeature) { - fprintf(stderr,"printforforsafety before movfeatsplitedges!\n"); + fprintf(stderr,"printforshellscript before movfeatsplitedges!\n"); exit(8); } weight= 1; @@ -863,6 +863,24 @@ static void printforlayoutsegjoins(void) { output("ident $Revision$\n"); } +static void printforui(void) { + Node *node; + EdgeEnd *edgeend; + int side; + + FOR_ALL_NODES(node) { + FOR_NODE_EDGEENDS(side,edgeend, node) { + if (!edgeend->edge->subseg->movfeat) continue; + output("layout-subseg-end %s %s %d %f %f\n", + edgeend->edge->subseg->segment->segname, + edgeend->edge->subseg->movfeat, + edgeend->edge->movpos, + node->x * 72.0 / PLANUI_PSDPI, + node->y * 72.0 / PLANUI_PSDPI); + } + } +} + /*---------- main program ----------*/ typedef struct { @@ -876,6 +894,7 @@ static const OpInfo opinfos[]= { OI(printforforsafety) OI(printforshellscript) OI(printforlayoutsegjoins) + OI(printforui) OI(consistency) OI(movfeatsplitedges) OI(movfeatrmstubs)