[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./Makefile gzz/vob/impl/DefaultVobMatcher.j...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./Makefile gzz/vob/impl/DefaultVobMatcher.j... |
Date: |
Mon, 06 Jan 2003 06:52:01 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 03/01/06 06:51:59
Modified files:
. : Makefile
gzz/vob/impl : DefaultVobMatcher.java
test/gzz/gfx/gl: glvobcoorder.test
test/gzz/vob : vobcoorder.test
Log message:
Coordinate system explicit mapping for DefaultVobMatcher.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.234&tr2=1.235&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/impl/DefaultVobMatcher.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/glvobcoorder.test.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/vob/vobcoorder.test.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: gzz/Makefile
diff -u gzz/Makefile:1.234 gzz/Makefile:1.235
--- gzz/Makefile:1.234 Sat Jan 4 07:12:30 2003
+++ gzz/Makefile Mon Jan 6 06:51:59 2003
@@ -215,17 +215,19 @@
ready_to_compile: $(GZZ_DEPENDS)/jython.jar $(GZZ_DEPENDS)/jythonlib.jar
$(GENERATED)
+RAWSRC = `find gzz/ -name "*.java"` `find test/gzz/ -name "*.java"`
+
compile: ready_to_compile
mkdir -p $(CLASSDIR)
echo $$CLASSPATH
# $(JAVAC) -deprecation $(DEBUG) -d $(CLASSDIR) BuildInfo.java
# fix circular dependency problem in clean builds
# -deprecation
- $(JAVAC) $(DEBUG) -d $(CLASSDIR) `find gzz/ -name "*.java"` `find
test/gzz/ -name "*.java"`
+ $(JAVAC) $(DEBUG) -d $(CLASSDIR) $(RAWSRC)
$(archcompile)
qc: ready_to_compile
- perl changedJava.pl $(SRC) | xargs $(JAVAC) $(DEBUG) -d $(CLASSDIR)
+ perl changedJava.pl $(RAWSRC) | xargs $(JAVAC) $(DEBUG) -d $(CLASSDIR)
indyjar:
mkdir independent
Index: gzz/gzz/vob/impl/DefaultVobMatcher.java
diff -u gzz/gzz/vob/impl/DefaultVobMatcher.java:1.7
gzz/gzz/vob/impl/DefaultVobMatcher.java:1.8
--- gzz/gzz/vob/impl/DefaultVobMatcher.java:1.7 Sun Jan 5 11:32:51 2003
+++ gzz/gzz/vob/impl/DefaultVobMatcher.java Mon Jan 6 06:51:59 2003
@@ -43,6 +43,7 @@
class Key {
Object key; int parent;
+ int interpolateTo;
Key(Object k, int p) { key=k; parent=p; }
public int hashCode() { return key.hashCode() ^ parent; }
public boolean equals(Object o) {
@@ -138,6 +139,10 @@
return o;
}
+ public void keymapSingleCoordsys(int mine, int other) {
+ keyByCs[mine].interpolateTo = other;
+ }
+
public int[] interpList(VobMatcher other0, boolean towardsOther) {
DefaultVobMatcher other = (DefaultVobMatcher)other0;
int[] interpList = new int[maxcs+1];
@@ -147,6 +152,18 @@
interpList[i] = -1;
else {
Key k = keyByCs[i];
+ if(!towardsOther && k.interpolateTo > 0) {
+ int csTo = k.interpolateTo;
+ Key kOther = other.keyByCs[csTo];
+ // Need to check; otherwise can get core dumps
+ if(kOther == null) {
+ pa("??!!! interp wrong");
+ } else {
+ if(dbg) pa(i+" overridden into "+csTo);
+ interpList[i] = csTo;
+ }
+ continue;
+ }
if(k.parent < 0 || k.parent >= i)
throw new Error("argh "+k.parent);
Index: gzz/test/gzz/gfx/gl/glvobcoorder.test
diff -u gzz/test/gzz/gfx/gl/glvobcoorder.test:1.29
gzz/test/gzz/gfx/gl/glvobcoorder.test:1.30
--- gzz/test/gzz/gfx/gl/glvobcoorder.test:1.29 Mon Dec 23 05:34:51 2002
+++ gzz/test/gzz/gfx/gl/glvobcoorder.test Mon Jan 6 06:51:59 2003
@@ -281,7 +281,7 @@
vs2 = getvs()
cs2 = vs2.rotateCS(0, "FOO", 90)
- interp = vs.matcher.interpList(vs2.matcher)
+ interp = vs.matcher.interpList(vs2.matcher, 0)
interp[0] = len(interp)
failUnlessEqual(interp[cs1], cs2)
checkInterp(vs, vs2, interp , 0, cs1, [0, 1, 0], [0, 2, 0])
Index: gzz/test/gzz/vob/vobcoorder.test
diff -u gzz/test/gzz/vob/vobcoorder.test:1.12
gzz/test/gzz/vob/vobcoorder.test:1.13
--- gzz/test/gzz/vob/vobcoorder.test:1.12 Sun Jan 5 06:15:15 2003
+++ gzz/test/gzz/vob/vobcoorder.test Mon Jan 6 06:51:59 2003
@@ -127,7 +127,7 @@
cs2 = vs2.translateCS(0, "A", 100, 100, 0)
cs2_1 = vs2.orthoCS(cs2, "B", 0, 100, 100, 1, 1)
- interp = vs.matcher.interpList(vs2.matcher)
+ interp = vs.matcher.interpList(vs2.matcher, 0)
interp[0] = len(interp)
checkInterp(vs, vs2, interp , .5, cs1_1, [0, 0, 0], [175, 175, 0])
@@ -146,10 +146,36 @@
cs2 = c2.translate(0, 200, 100, 0)
vs2.matcher.add(cs2, "FOO")
- interp = vs.matcher.interpList(vs2.matcher)
+ interp = vs.matcher.interpList(vs2.matcher, 0)
interp[0] = len(interp)
failUnlessEqual(interp[cs1_1], cs2)
checkInterp(vs, vs2, interp , .5, cs1_1, [0, 0, 0], [175, 125, 0])
+
+def testInterpolateKeymap():
+ """Test that vobs get according to keymap.
+
+ fail: AWT
+ """
+ cs1 = vs.translateCS(0, "A", 100, 100, 0)
+ cs1_1 = vs.translateCS(cs1, "B", 50, 50, 0)
+
+ vs2 = getvs()
+ cs2_w = vs2.translateCS(0, "A", 0, 0, 0)
+ cs2_w_1 = vs2.translateCS(cs2_w, "B", 0, 0, 0)
+
+ cs2_r = vs2.translateCS(0, "X", 500,500,0)
+
+ interp = vs.matcher.interpList(vs2.matcher, 0)
+ failUnlessEqual(interp[cs1], cs2_w)
+ failUnlessEqual(interp[cs1_1], cs2_w_1)
+
+ vs.matcher.keymapSingleCoordsys(cs1_1, cs2_r)
+
+ interp = vs.matcher.interpList(vs2.matcher, 0)
+ failUnlessEqual(interp[cs1], cs2_w)
+ failUnlessEqual(interp[cs1_1], cs2_r)
+
+
# : vim: set syntax=python :
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./Makefile gzz/vob/impl/DefaultVobMatcher.j...,
Tuomas J. Lukka <=