ui-plan-*.ppm
ui-plan-*.crop-info
ui-plan-*.overlay-info
+ui-plan-*.matrix-info
parts.ps
*-a.ps
ours.graph.c
ours.redacted.neato.ps
ours.redacted.neato
ours.redacted.forsafety
+ours.redacted.for-ui
ours.redacted.shellvars
ours.layout-data.c
detectors.pin-info
M4INCS= parts.i4
-LAYOUT= ./layout -R270
+ROTATE= 270
+LAYOUT= ./layout -R$(ROTATE)
E_TRACK= ArsCLMNo
LAYOUTOPTS_ALL= -ep=*Cm
$(LAYOUTOPTS_PS)
PLANUI_PSDPI= 72
+PLANUI_WIDTH= 595
+PLANUI_HEIGHT= 842
LAYOUTOPTS_SEGS= '-e*=*rm' -Lsubseglwm=80 -Lsubseglwe=150 -Lsubseglwq=50
CPROGS= subseg2display compose-segenco
-CPPFLAGS += -DPLANUI_PSDPI=$(PLANUI_PSDPI)
-
default: $(CPROGS) for-test-ui layers extras
all: default lpages
for-pic: ours+pindata.asm
%.segenco.ppm: %.segenco.ps Makefile
gs -dNOPAUSE -dBATCH -dSAFER -q \
- -sDEVICE=ppmraw -r$(PLANUI_PSDPI) -g595x842 \
+ -sDEVICE=ppmraw -r$(PLANUI_PSDPI) \
+ -g$(PLANUI_WIDTH)x$(PLANUI_HEIGHT) \
-sOutputFile=$@.new $< && mv -f $@.new $@
ours.graph.c: extractgraph ours.dgram-bot.p0.segenco.ps
t.ppm: ours.dgram-bot.pa.segenco.ppm x.gdb subseg2display
gdb -x x.gdb
-ui-plan-%.ppm: ours.dgram-%.pa.segenco.ppm Makefile
+ui-plan-%.matrix-info: ours.dgram-%.p0.segenco.ps matrix-demonstrate.ps
+ sed -n '1,/^%L matrix here/p' matrix-demonstrate.ps >$@.ps.new
+ sed -n '/^%L matrix begin/,/^%L matrix end/p' $< >>$@.ps.new
+ sed -e '1,/^%L matrix here/d' matrix-demonstrate.ps >>$@.ps.new
+ gs -sDEVICE=nullpage -dBATCH=1 -q $@.ps.new $o
+
+ui-plan-%.ppm: ours.dgram-%.pa.segenco.ppm
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
@:
-ui-plan-%.overlay-info: ui-plan-%.crop-info ours.redacted.for-ui Makefile
- perl -ne 'm/^pnmcrop: cropping (\d+) \w+ off the (\w+)$$/' \
- -e ' and print "layout-dgram-cropped $$2 $$1\n";' \
- <ui-plan-$*.crop-info >$@.new
- egrep '^[^#]' <ours.redacted.for-ui >>$@.new
- mv -f $@.new $@
+ui-plan-%.overlay-info: genoverlayinfo \
+ ui-plan-%.crop-info ours.redacted.for-ui ui-plan-%.matrix-info
+ ./$^ $(PLANUI_HEIGHT) $(PLANUI_PSDPI) $o
subseg2display.o compose-segenco.o: segcmap.h
--- /dev/null
+#!/usr/bin/perl
+
+use IO::Handle;
+
+@ARGV==5 or die;
+($cropinfo,$forui,$matrixinfo, $height,$psdpi)=@ARGV;
+
+open M, $matrixinfo or die $!;
+$!=0; @matrix= <M>;
+@matrix==6 or die $!;
+map { die "$_ ?" unless m/^[-0-9.]+$/; } @matrix;
+M->error and die $!;
+close M or die $!;
+
+# inverting the matrix ??
+$d= 0;
+for ($i=0; $i<4; $i+=2) {
+ $d += $matrix[$i]*$matrix[$i];
+}
+$d= 1/$d;
+for ($i=0; $i<4; $i++) {
+ $matrix[$i] *= $d;
+}
+$matrix[1] *= -1;
+$matrix[2] *= -1;
+
+print STDERR join("\n",@matrix),"\n";
+
+open C, $cropinfo or die $!;
+while (<C>) {
+ next unless m/^pnmcrop: cropping (\d+) \w+ off the (\w+)$/;
+ $crop{$2}= $1;
+}
+C->error and die $!;
+close C or die $!;
+
+open U, $forui or die $!;
+while (<U>) {
+ chomp;
+ next unless m/^[^\#]/;
+ m/^(layout-subseg-end \w+ \w \w) ([0-9.]+) ([0-9.]+)$/ or die "$_ ?";
+ ($lhs, $xup,$yup) = ($1,$2,$3);
+
+ $xup -= $matrix[4];
+ $yup -= $matrix[5];
+
+ $x = $xup*$matrix[0] + $yup*$matrix[2];
+ $y = $xup*$matrix[1] + $yup*$matrix[3];
+
+ $x *= $psdpi / 72.0;
+ $y *= $psdpi / 72.0;
+
+ $y= $height - $y;
+# $x -= $crop{'left'};
+# $y -= $crop{'top'};
+
+ printf "%s %d %d\n", $lhs, $x, $y or die $!;
+}
+U->error and die $!;
+close U or die $!;
from the loc X0,Y0,A0 to X1,Y1,A1. I is a counter which starts
at 0 and is simply there to help cross-reference between
various programs and formats.
+ %L matrix begin
+ %L matrix end
Scope S is
O! when defining object or part O
o("%!\n".
" /lf /Courier-New findfont $lmu_marktpt scalefont def\n".
" /sf /Courier-Bold findfont $lmu_segtpt scalefont def\n".
+ "%L matrix begin\n".
"$shiftrotate".
" gsave\n");
o(" -$ps_page_xmul $page_x mul -$ps_page_ymul $page_y mul translate\n".
" $ptscale $ptscale scale\n");
+o("%L matrix end\n");
+
newctx();
open DEBUG, ($debug ? ">&2" : ">/dev/null") or die $!;
printf '#!/bin/sh -ex\n\$(LAYOUT) "\$\$@" %s \$<\n' "$args" >\$@.new
chmod +x \$@.new && mv -f \$@.new \$@
+$stem.dgram-$dgram.matrix-info: \
+ ours.dgram-%.p0.segenco.ps matrix-demonstrate.ps
+END
+ cat <<'END'
+ sed -n '1,/^%L matrix here/p' matrix-demonstrate.ps >$@.ps.new
+ sed -n '/^%L matrix begin/,/^%L matrix end/p' $< >>$@.ps.new
+ sed -e '1,/^%L matrix here/d' matrix-demonstrate.ps >>$@.ps.new
+ gs -sDEVICE=nullpage -dBATCH=1 -q $@.ps.new $o
+
+
END
done
--- /dev/null
+%!
+
+% Hideous linear algebra
+% may or may not be right but hacked until it worked
+% with genoverlayinfo
+
+/printflt { (......................) cvs print (\n) print } bind def
+
+ 0 0 transform
+ 0 1 dtransform
+ 1 0 dtransform
+
+%L matrix here
+
+ idtransform
+ exch printflt printflt
+
+ idtransform
+ exch printflt printflt
+
+ itransform
+ exch printflt printflt
edgeend->edge->subseg->segment->segname,
edgeend->edge->subseg->movfeat,
edgeend->edge->movpos,
- node->x * 72.0 / PLANUI_PSDPI,
- node->y * 72.0 / PLANUI_PSDPI);
+ node->x, node->y);
}
}
}