chiark / gitweb /
new printforui, use with ./ours.redactgraph trivpairnodes trivnullnodes printforui...
authorian <ian>
Sun, 1 Jun 2008 01:04:39 +0000 (01:04 +0000)
committerian <ian>
Sun, 1 Jun 2008 01:04:39 +0000 (01:04 +0000)
layout/.cvsignore
layout/Makefile
layout/redactgraph.c

index ebb5ca02eb9495ac2d232c6cf45be3a232f3f9be..2bec486a322b011b194f7dcd83d37acf749bd453 100644 (file)
@@ -15,6 +15,7 @@ subseg2display
 compose-segenco
 tmp.*
 ui-plan-*.ppm
+ui-plan-*.crop-info
 parts.ps
 *-a.ps
 ours.graph.c
index 982d1b44cdc4ae0b762fbb2cd071f4ebe8da1446..2af037c4f0832e16a0f2d42d29abeb64239650eb 100644 (file)
@@ -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:
index 5ced177a67baee413eadd505f2d83031111f34ac..f7a351f6fa48c47af69c25c8f68885ec4f4996f0 100644 (file)
@@ -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)