import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.awt.geom.*; import java.math.*; public class Compute3D implements Runnable { Manager M; int CHOICE; int halt; public Compute3D() {} public Compute3D(int choice,Manager MM) { this.CHOICE=choice; this.M=MM; } public void run() { double t1=System.currentTimeMillis(); int act=M.C.CON_P.ACTION.mode; int obj=M.C.CON_P.OBJECT.mode; int ban=M.C.CON_P.BAND.mode; int link=M.C.LINK.L[0].on; if(obj<4) runTile(act,obj); if(obj>=4) runRenorm(ban,obj); M.repaint(); } public void runTile(int act,int obj) { if(obj==0) tilePartial(); if(act==0) { if(obj==1) tile(0,0); if(obj==2) tile(0,1); if(obj==3) tile(0,2); } if(act==1) { if(obj==1) orbit(0,0,true); if(obj==2) orbit(0,1,true); if(obj==3) orbit(0,2,true); } if(act==2) { if(obj==1) orbit(0,0,false); if(obj==2) orbit(0,1,false); if(obj==3) orbit(0,2,false); } } public void runRenorm(int ban,int obj) { if(ban==0) { if(obj==4) tile(1,1); if(obj==5) { double h=M.C.getOffsetY(CHOICE); int L=Characteristics.getCharB(h); int mode=3; if(L==0) mode=2; if(L==5) mode=2; tile(mode,2); } } if(ban==1) { if(obj==4) orbit(1,1,false); if(obj==5) { double h=M.C.getOffsetY(CHOICE); int L=Characteristics.getCharB(h); int mode=3; if(L==0) mode=2; if(L==5) mode=2; orbit(mode,2,false); } } if(ban==2) { if(obj==4) orbitPlus(1,1,false); if(obj==5) { double h=M.C.getOffsetY(CHOICE); int L=Characteristics.getCharB(h); int mode=3; if(L==0) mode=2; if(L==5) mode=2; orbitPlus(mode,2,false); } } if(ban==3) { if(obj==4) bandFillA(); if(obj==5) bandFillB(); } if(ban==4) { if(obj==4) periodFill(0); if(obj==5) periodFill(1); } if(ban==5) { if(obj==4) periodFill(0); if(obj==5) periodFill(1); if(obj==4) bandFillA(); if(obj==5) bandFillB(); } } /**Computes a partial tile: the result of doing k steps of the forward polyhedro exchange map**/ public void tilePartial() { int LIM=(int)(Math.pow(2,M.C.CON_P.ITER.val)); int dir=M.C.CON_P.PARTIAL.mode; Polyhedron P=new Polyhedron(); Vector V=initialVector(); if(dir==0) P=PolyhedronExchange.orbitTilePartial(V,LIM); if(dir==1) P=PolyhedronExchange.orbitTilePartialInverse(V,LIM); recordPoly(P); } /**computes the basic tile. 4 choices for the mode: mode=0 computes the ordinary tile mode=1 computes the A-tiles mode=2 computes the B-tiles in the iso-levels mode=3 computes the B-tiles in the expansion-levels. 3 choices for the chopping option q=0: no chopping q=1: tile chopped off at consecutive A levels. q=2: tile chopped off at consecutive B levels **/ public void tile(int mode,int q) { Polyhedron P=new Polyhedron(); Vector V=initialVector(); double[] d=getHeights(q); P=makeTile(mode,d[0],d[1]); recordPoly(P); } /**computes the orbit of a tile. Same choices as for the tile routine.*/ public void orbit(int mode,int q,boolean select) { Polyhedron P=new Polyhedron(); Vector V=initialVector(); double[] d=getHeights(q); P=makeTile(mode,d[0],d[1]); if((mode<=2)&&(P!=null)) drawOrbit(P,V,select); if((mode==3)&&(P!=null)) drawOrbitInverse(P,V,select); } /**computes the orbit of a tile, and adds an iterate at the end. We use this to show the first return map for the renorm tiles.**/ public void orbitPlus(int mode,int q,boolean select) { Polyhedron P=new Polyhedron(); Vector V=initialVector(); double[] d=getHeights(q); P=makeTile(mode,d[0],d[1]); ++P.orbit; if((mode<=2)&&(P!=null)) drawOrbit(P,V,select); if((mode==3)&&(P!=null)) drawOrbitInverse(P,V,select); } /**This routine is like the orbit routine, except that it works with a precomputed tile.**/ public void drawOrbit(Polyhedron P,Vector V0,boolean select) { Vector V=new Vector(V0); halt=1; int count=0; int history=-1; int type=0; int t=M.C.CON_P.ZONE.val; Polyhedron Q=new Polyhedron(P); while((halt==1)&&(count