gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz ./TODO gfx/demo/gldemo.py gfx/demo/xupdf.py...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/demo/gldemo.py gfx/demo/xupdf.py...
Date: Wed, 18 Sep 2002 21:20:05 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/09/18 21:20:05

Modified files:
        .              : TODO 
        gfx/demo       : gldemo.py xupdf.py 
        gfx/librenderables: renderables.py 
        gfx/libutil    : effects.py 
        gzz/client     : AbstractUpdateManager.java 
        gzz/vob/buoy   : Buoy3Floater.java 

Log message:
        Demo is now much further, still a lot TODO

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.113&tr2=1.114&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/gldemo.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/xupdf.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.50&tr2=1.51&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libutil/effects.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/AbstractUpdateManager.java.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/buoy/Buoy3Floater.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.113 gzz/TODO:1.114
*** gzz/TODO:1.113      Wed Sep 18 04:35:26 2002
--- gzz/TODO    Wed Sep 18 21:20:04 2002
***************
*** 42,51 ****
        - UML and APIs of ImageCache
        - implementation of ImageCache
      jvk:
-       - Distortion view coordinate systems: even at large zoom, avoid
-         going on top of self..
-       - python or java routines to compute distorted coordinates,
-         both forwards and backwards (forwards is more important)
        - think about the second row of 
          Documentation/Presentations/General2002/script.html
          How could we easiest show the basis textures and 
--- 42,47 ----
***************
*** 91,116 ****
          papertest.py and others.
      tjl:
        - distorted multi-page PDF view with xu links
!       - abstractUpdateManager: option to animate without
!         rebound (looks very silly for switching between zooms
!         in xupdf)
!       - limit mousing area to the real area of the paper.
!       - serialization
!         of xu links (as part of space?).
        - script the demo, determine in detail all features
          required.
-       - Buoy placement
-           - implement in Java, test
        - redesign mosaics to save memory and allow more internal
!         formats
      anybody:
-       - performance enhancements:
-           - different internalformats for TexRects
        - primitive uis to edit enough structure of xanalogical text and
          pdf spans, as well as connections so that we can build the
          focus+context structure
-       - Buoys + libpaper bg for PDF files, text stream
-       - further work on irregular frames - talk to Tjl
        - fix text quality on OpenGL: enabling __GL_FSAA_MODE=4 on
          NV17 (GeForce4Go) improves "make glinfo" appearance
          dramatically. This would happen by making the mipmaps
--- 87,126 ----
          papertest.py and others.
      tjl:
        - distorted multi-page PDF view with xu links
!           - placepapers always evenly
!           - exponential scale, exponential magnification in fisheye
!               --> far, far better interpolation
!           - use real coordinates when moving to / from buoy, 
!             i.e. buoy coords
!           - show right page of buoy
!           - source coordinates for xu links
!               - python or java routines to compute distorted coordinates,
!                 both forwards and backwards (forwards is more important)
! 
!           - text
!           - buoy edges? more magnification?
!           - mouse clicks on buoys to work
! 
!           - use libpaper for backgrounds !!! !!! !!!
!               - for tomorrow, only one pass (speed!!!) in the ones
!                 really used for the papers.
! 
!           - limit mousing area to the real area of the paper.
! 
!           - entry / link making bindings
! 
!           - better distortion 
! 
!           - multiple instances of same pdf / text visible? --> keys?
! 
        - script the demo, determine in detail all features
          required.
        - redesign mosaics to save memory and allow more internal
!         formats + at the same time, mipmapping improvements
      anybody:
        - primitive uis to edit enough structure of xanalogical text and
          pdf spans, as well as connections so that we can build the
          focus+context structure
        - fix text quality on OpenGL: enabling __GL_FSAA_MODE=4 on
          NV17 (GeForce4Go) improves "make glinfo" appearance
          dramatically. This would happen by making the mipmaps
***************
*** 163,168 ****
--- 173,182 ----
        + Go through test/ and convert tests to either .py or move to basalt/
        + Some basic tests for gfx/
        - check OpenGL texture size at run time, adjust mosaic and bg
+     
+       + code to see from PDF file the number of pages
+       + code to automatically start creating images on disk from
+         pdf files etc.
  
  0.8alpha6: Another doc round
      tjl:
Index: gzz/gfx/demo/gldemo.py
diff -c gzz/gfx/demo/gldemo.py:1.17 gzz/gfx/demo/gldemo.py:1.18
*** gzz/gfx/demo/gldemo.py:1.17 Wed Sep 18 03:20:06 2002
--- gzz/gfx/demo/gldemo.py      Wed Sep 18 21:20:04 2002
***************
*** 145,154 ****
        0, x, y, xx, xy, yx, yy)
      vs.map.put(vob, cs)
  
  transpush = None
  
- # Kludge...
- transmap = { }
  def transaffine(vs, key, x, y, xx, xy, yx, yy):
      cs = vs.coords.affineCoordsys(key,
        0, x, y, xx, xy, yx, yy)
--- 145,154 ----
        0, x, y, xx, xy, yx, yy)
      vs.map.put(vob, cs)
  
+ transmap = { }
+ 
  transpush = None
  
  def transaffine(vs, key, x, y, xx, xy, yx, yy):
      cs = vs.coords.affineCoordsys(key,
        0, x, y, xx, xy, yx, yy)
***************
*** 169,174 ****
--- 169,183 ----
      vs.map.put(rotatepush, cs)
      transmap[key] = cs
  
+ expscalepush = None
+ def expscale(vs, key, scale):
+     cs = vs.coords.affineCoordsys(key,
+       scale, 0, 0, 0, 0, 0, 0)
+     global expscalepush
+     if expscalepush == None:
+       expscalepush = GZZGL.createGLExpScalePush()
+     vs.map.put(expscalepush, cs)
+     transmap[key] = cs
  
  
  def poptrans(vs, key):
Index: gzz/gfx/demo/xupdf.py
diff -c gzz/gfx/demo/xupdf.py:1.12 gzz/gfx/demo/xupdf.py:1.13
*** gzz/gfx/demo/xupdf.py:1.12  Wed Sep 18 09:24:24 2002
--- gzz/gfx/demo/xupdf.py       Wed Sep 18 21:20:04 2002
***************
*** 4,9 ****
--- 4,13 ----
  # with Xanadu links between PDF and text.
  
  screensize = (1024, 768) # assuming XGA projector.
+ screenctr = (0.9 * screensize[0]/2, screensize[1]/2)
+ 
+ AbstractUpdateManager.defaultAnimationTime = 1000
+ AbstractUpdateManager.fractCalc = AbstractUpdateManager.LinearCalculator()
  
  from gzz.gfx.gl import GZZGL,GLSpans,Paper
  import gzz
***************
*** 26,31 ****
--- 30,39 ----
        gzz.mediaserver.Mediaserver.Id(
  
"0000000008000000E9573F40460004592C0AC2038D1250E0ED08F865D8C9148654B87A7AA82CC6"))
  
+ def enf2span(enf):
+     list = enf.getList()
+     return list[0]
+ 
  d1cell = space.N()
  d1 = space.getDim(d1cell)
  
***************
*** 55,83 ****
  
  def moveToCell(cell):
      global globalcursor, globalx, globaly, globalpap
  
      content = space.cellTexter.getEnfilade(cell, None)
  
      # Check type
      if 1: # PDF
!       list = content.getList()
!       print list
!       contentspan = list[0]
!       prect = [
!           GLSpans.getRect(contentspan.subSpan(i,i+1))
!               for i in range(0,content.length())]
!       globalpap = [
!           pdfpaper(p) for p in prect
!       ]
  
!     forw = xuindexer.getForwardIndex().getMatches(content)
!     back = xuindexer.getBackwardIndex().getMatches(content)
! 
!     print "Xu: ",forw,back
  
      java.lang.System.gc()
      AbstractUpdateManager.chg()
  
  
  def globalkey(key):
      if key == '1':
--- 63,96 ----
  
  def moveToCell(cell):
      global globalcursor, globalx, globaly, globalpap
+     global globalforw, globalback
+ 
+     globalcursor = cell
  
      content = space.cellTexter.getEnfilade(cell, None)
  
      # Check type
      if 1: # PDF
!       globalpap = getPDFPapers(content)
!     globalforw = xuindexer.getForwardIndex().getMatches(content)
!     globalback = xuindexer.getBackwardIndex().getMatches(content)
  
!     print "Xu: ",globalforw,globalback
  
      java.lang.System.gc()
      AbstractUpdateManager.chg()
  
+ def getPDFPapers(content):
+     contentspan = enf2span(content)
+     prect = [
+       GLSpans.getRect(contentspan.subSpan(i,i+1))
+           for i in range(0,content.length())]
+     return [
+       pdfpaper(p) for p in prect
+     ]
+ 
+ 
+     
  
  def globalkey(key):
      if key == '1':
***************
*** 128,147 ****
                              0, 0,  0, 1])
      return (pap, pw, ph)
  
  def placepapers(vs, cs2, papers, key, x, y, paperx, papery, h, 
onlypages=None):
      # The height in coords
      ph = papers[0][2]
!     curx = x - h/ph * paperx
!     ycoord = y - h/ph * papery
      print "x,y for place: ",curx, ycoord
      for i in range(0, len(papers)):
        if onlypages == None or i in onlypages:
-           cs1 = vs.coords.affineCoordsys(0, key+"_"+str(i), 10,
-                   curx, ycoord, h/ph, 0, 0, h/ph)
            pq = GZZGL.createFisheyePaperQuad(
                papers[i][0], 0, 0, papers[i][1], papers[i][2], 21, 21, 3)
            vs.map.put(pq, cs1, cs2)
!       curx += 1.02 * h/ph * papers[i][1]
  
  def bg(vs):
      putnoc(vs, background((0.3,0.5,0.4)))
--- 141,164 ----
                              0, 0,  0, 1])
      return (pap, pw, ph)
  
+ 
  def placepapers(vs, cs2, papers, key, x, y, paperx, papery, h, 
onlypages=None):
      # The height in coords
      ph = papers[0][2]
!     expscale(vs, key+"__pscale_", h/ph)
!     curx = x - paperx
!     ycoord = y - papery
      print "x,y for place: ",curx, ycoord
      for i in range(0, len(papers)):
+       # create always all cs, gets interpolation better
+       cs1 = vs.coords.affineCoordsys(0, key+"_p_"+str(i), 10,
+               curx, ycoord, 1, 0, 0, 1)
        if onlypages == None or i in onlypages:
            pq = GZZGL.createFisheyePaperQuad(
                papers[i][0], 0, 0, papers[i][1], papers[i][2], 21, 21, 3)
            vs.map.put(pq, cs1, cs2)
!       curx += 1.02 *  papers[i][1]
!     poptrans(vs, key+"__pscale_")
  
  def bg(vs):
      putnoc(vs, background((0.3,0.5,0.4)))
***************
*** 158,169 ****
        Enable TEXTURE_2D
      """ % { "w": screensize[0], "h": screensize[1] } ) )
  
  class XuPDFScene_PDFContext:
      def __init__(self):
!       self.yheight = 50
        self.ctrx = screensize[0]/2
        self.ctry = screensize[1]/2
!       self.rad = screensize[1]/2
        self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
      def key(self, key):
        global currentScene
--- 175,215 ----
        Enable TEXTURE_2D
      """ % { "w": screensize[0], "h": screensize[1] } ) )
  
+ class PDFFloat(Runnable):
+     def __init__(self, vs, cell, linkspan):
+       self.vs = vs
+       self.cell = cell
+       self.linkspan = linkspan
+     def run(self):
+       vs = self.vs
+       pap = getPDFPapers(space.cellTexter.getEnfilade(self.cell, None))
+       cs2 = vs.coords.affineCoordsys(0, self.cell.getId()+"__bulg", 
+           10, 0, 0, 1, 0, 0, 1)
+       placepapers(vs, cs2, pap, self.cell.getId(),
+           0, 0, 
+           0, 0, 
+           100, [0])
+       
+ 
+ def addbuoy(vs, anchorX, anchorY, importance, floater, link):
+     print "Addbuoy ",link
+     linkspan = link.getList()[0]
+     mat = enfoverlap.getMatches(link)
+     l = []
+     for m in mat: l.append(m)
+     print l
+     if len(l) == 0: return
+     m = l[0]
+     print m
+     floater.addBuoy(anchorX, anchorY, importance, m.getId(), 
+           PDFFloat(vs, m, linkspan), 0, 0)
+ 
  class XuPDFScene_PDFContext:
      def __init__(self):
!       self.yheight = 25
        self.ctrx = screensize[0]/2
        self.ctry = screensize[1]/2
!       self.rad = screensize[0]/2
        self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
      def key(self, key):
        global currentScene
***************
*** 179,195 ****
            AbstractUpdateManager.chg()
      def scene(self, vs):
        bg(vs)
!       self.bf = NadirCircleFloater(vs, (self.ctrx, self.ctry), self.rad,
!                       (self.ctrx+1.5*self.rad, self.ctry), self.nadir)
        print "Context"
!       cs2 = vs.coords.affineCoordsys(0, "2", -3 -10, 
!               screensize[0]/2, 0.9 * screensize[1]/2, 50/5, 0,0,50/4)
! 
!       placepapers(vs, cs2, globalpap, "foo", 
!               screensize[0]/2, 0.9 * screensize[1]/2, 
!               globalx, globaly,
!               self.yheight)
!     
  
  class XuPDFScene_PDFZoom:
      def key(self, key):
--- 225,254 ----
            AbstractUpdateManager.chg()
      def scene(self, vs):
        bg(vs)
!       bf = NadirCircleFloater_NoAnchor(vs, (self.ctrx, self.ctry), self.rad,
!                       self.nadir, 1)
!       bfforw = NadirCircleFloater_NoAnchor(vs, (self.ctrx, self.ctry), 
self.rad,
!                       self.nadir, -1)
        print "Context"
!       # The non-moving bulge coordinate
!       cs2 = vs.coords.affineCoordsys(0, globalcursor.getId()+"__bulg", 
!                   4,
!                   0,  0,
!                   15, 0,0,30)
! 
!       class CentralB(Runnable):
!           def run(rself):
!               # A single paper, keyed by the cell ID
!               placepapers(vs, cs2, globalpap, globalcursor.getId(), 
!                       0, 0,
!                       globalx, globaly,
!                       self.yheight)
!       bf.addCentralBuoy(globalcursor.getId(), CentralB())
!           
!       for forwlink in globalforw:
!           addbuoy(vs, 0, 0, 1, bfforw, forwlink.to)
!       for backlink in globalback:
!           addbuoy(vs, 0, 0, 1, bf, getattr(backlink,"from"))
  
  class XuPDFScene_PDFZoom:
      def key(self, key):
***************
*** 209,221 ****
            AbstractUpdateManager.chg()
      def scene(self, vs):
        bg(vs)
!       cs2 = vs.coords.affineCoordsys(0, "2", 9.0, 
!               screensize[0]/2, globaly / globalpap[0][2] * screensize[1], 
!                   150, 0,0, 100)
!       placepapers(vs, cs2, globalpap, "foo", screensize[0]/2, 
!               globaly / globalpap[0][2] * screensize[1], 
!                   globalx, globaly, 
!                   768)
  
  currentScene = XuPDFScene_PDFZoom()
  moveToCell(c1)
--- 268,286 ----
            AbstractUpdateManager.chg()
      def scene(self, vs):
        bg(vs)
!       cs2 = vs.coords.affineCoordsys(0, globalcursor.getId()+"__bulg", 0.5, 
!               0, globaly / globalpap[0][2] * screensize[1] - screensize[1]/2, 
!                   20, 0,0, 40)
!       bf = NadirCircleFloater_NoAnchor(vs, 
!               screenctr,  100, None, 1)
!       class CentralB(Runnable):
!           def run(self):
!               placepapers(vs, cs2, globalpap, globalcursor.getId(), 0,
!                       globaly / globalpap[0][2] * screensize[1] - 
!                                                       screenctr[1], 
!                           globalx, globaly, 
!                           screensize[1] * 0.7)
!       bf.addCentralBuoy(globalcursor.getId(), CentralB())
  
  currentScene = XuPDFScene_PDFZoom()
  moveToCell(c1)
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.50 
gzz/gfx/librenderables/renderables.py:1.51
*** gzz/gfx/librenderables/renderables.py:1.50  Wed Sep 18 09:06:25 2002
--- gzz/gfx/librenderables/renderables.py       Wed Sep 18 21:20:04 2002
***************
*** 130,135 ****
--- 130,154 ----
  
  {
      "Type": "1",
+     "Name" : "GLExpScalePush",
+     "Data" : "",
+     "Params" : "",
+     "ParamCode" : """
+               """,
+     "RenderCode" : """
+           glPushMatrix();
+           glScalef(
+               exp(coords1.z),
+               exp(coords1.z),
+               1
+               );
+           GLERR
+           """,
+ },
+ 
+ 
+ {
+     "Type": "1",
      "Name" : "GLTransformPushPDiv",
      "Data" : "",
      "Params" : "",
***************
*** 468,474 ****
                  case 3:
                      // Anistropic PDF zoom
                      {
!                         v.x += v.z * atan(v.x);
                          if (r2 > 0) {
                              float r = sqrt(r2);
                              v.y *= 1 + v.z * atan(r) / r;
--- 487,493 ----
                  case 3:
                      // Anistropic PDF zoom
                      {
!                         v.x += v.z * atan(v.x / (1+v.y*v.y) );
                          if (r2 > 0) {
                              float r = sqrt(r2);
                              v.y *= 1 + v.z * atan(r) / r;
***************
*** 537,542 ****
--- 556,562 ----
                        
                        ZPt pos = coords1.transform(Pt(x,y));
                        ZPt v = cs2inv.transform(pos);
+                     v.z = exp(coords2.z);
                        coords2.vertex(bulge(v));
                      }
                    }
Index: gzz/gfx/libutil/effects.py
diff -c gzz/gfx/libutil/effects.py:1.1 gzz/gfx/libutil/effects.py:1.2
*** gzz/gfx/libutil/effects.py:1.1      Wed Sep 18 06:01:26 2002
--- gzz/gfx/libutil/effects.py  Wed Sep 18 21:20:04 2002
***************
*** 54,59 ****
--- 54,107 ----
        bc = vs.coords.coordsys(0, str(key)+"_6", 10, b[0], b[1], 0, 0)
        vs.map.put(self.linecon, ac, bc)
  
+ 
+ # Prototype: just start from the middle, then up & down
+ class NadirCircleFloater_NoAnchor(Buoy3Floater):
+     def __init__(self, vs, center, radius, nadir, dir):
+       self.vs, self.c, self.r, self.nadir = vs, center, radius, nadir
+       self.dir = dir
+       self.ind = 0
+     def addBuoy(self, anchorX, anchorY, importance, key, buoy, w, h):
+       size = importance
+ 
+       # 1. find the buoy point
+ 
+       angle = 2.6*math.pi/2 + self.ind / 5
+       angle *= self.dir
+       self.ind += 1
+ 
+       b = (self.c[0] + self.r * math.sin(angle),
+            self.c[1] + self.r * math.cos(angle))
+ 
+       print "Buoy: (%s,%s): (%s,%s)\n"%(
+           anchorX, anchorY, b[0], b[1])
+ 
+       # Create the coordinate system
+ 
+       vs = self.vs
+       transaffine(vs, str(key)+"_1", b[0], b[1], size, 0, 0, size)
+       rotate(vs, str(key)+"_2", 360 * self.nadir.getAngleRad(b[0], b[1]) / 
+                                       (2 * math.pi), 0, 0, 1)
+       buoy.run()
+       poptrans(vs, str(key)+"_2")
+       poptrans(vs, str(key)+"_1")
+ 
+       # ac = vs.coords.coordsys(0, str(key)+"_5", 10, anchorX, anchorY, 0, 0)
+       # bc = vs.coords.coordsys(0, str(key)+"_6", 10, b[0], b[1], 0, 0)
+       # vs.map.put(self.linecon, ac, bc)
+     def addCentralBuoy(self, key, buoy):
+ 
+       b = self.c
+       size = 1
+       vs = self.vs
+       transaffine(vs, str(key)+"_1", b[0], b[1], size, 0, 0, size)
+       rotate(vs, str(key)+"_2", 0, 0, 0, 1)
+       buoy.run()
+       poptrans(vs, str(key)+"_2")
+       poptrans(vs, str(key)+"_1")
+ 
+       
+ 
  class IrreguFrame:
  
      tex = GZZGL.createTexture()
Index: gzz/gzz/client/AbstractUpdateManager.java
diff -c gzz/gzz/client/AbstractUpdateManager.java:1.20 
gzz/gzz/client/AbstractUpdateManager.java:1.21
*** gzz/gzz/client/AbstractUpdateManager.java:1.20      Thu Sep  5 07:54:36 2002
--- gzz/gzz/client/AbstractUpdateManager.java   Wed Sep 18 21:20:05 2002
***************
*** 41,47 ****
   */
  
  public abstract class AbstractUpdateManager implements Runnable {
! public static final String rcsid = "$Id: AbstractUpdateManager.java,v 1.20 
2002/09/05 11:54:36 tjl Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
--- 41,47 ----
   */
  
  public abstract class AbstractUpdateManager implements Runnable {
! public static final String rcsid = "$Id: AbstractUpdateManager.java,v 1.21 
2002/09/19 01:20:05 tjl Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 183,188 ****
--- 183,194 ----
      protected void setAnimationTimeImpl(int millis) {
        animationtime = millis;
      }
+     public static int getAnimationTime() {
+       return instance.getAnimationTimeImpl(); 
+     }
+     protected int getAnimationTimeImpl() {
+       return animationtime;
+     }
  
      /* Called by a space to inform that some cells have been 
       * changed 
***************
*** 230,241 ****
        boolean isOver(long time);
        void callRender(long time, Window w);
      }
!     public class SimpleCalculator implements FractCalculator {
        protected float r = 10, n = 2;
        int millis = 0; // see defaultAnimationTime
        protected long startTime = 0;
        public void eventAt(long time) {
            startTime = time;
        }
        private float fract(long time) {
            float x = (time-startTime)/((float)millis);
--- 236,271 ----
        boolean isOver(long time);
        void callRender(long time, Window w);
      }
! 
!     static public class LinearCalculator implements FractCalculator {
!       int millis = 0; // see defaultAnimationTime
!       protected long startTime = 0;
!       public void eventAt(long time) {
!           startTime = time;
!           millis = getAnimationTime();
!       }
!       private float fract(long time) {
!           float x = (time-startTime)/((float)millis);
!           if(x >= 1) return 1;
!           return x;
!       }
!       public boolean isOver(long time) {
!           float x = (time-startTime)/((float)millis);
!           return x >= 1;
!       }
! 
!       public void callRender(long time, Window w) {
!           float f = fract(time);
!           w.renderAnim(f, 1, f >= 0.50);
!       }
!     }
!     static public class SimpleCalculator implements FractCalculator {
        protected float r = 10, n = 2;
        int millis = 0; // see defaultAnimationTime
        protected long startTime = 0;
        public void eventAt(long time) {
            startTime = time;
+           millis = getAnimationTime();
        }
        private float fract(long time) {
            float x = (time-startTime)/((float)millis);
***************
*** 255,261 ****
            w.renderAnim(f, 1, f >= 0.85);
        }
      }
!     public SimpleCalculator fractCalc = new SimpleCalculator();
  
  
      /** For subclasses to override: process incoming events.
--- 285,291 ----
            w.renderAnim(f, 1, f >= 0.85);
        }
      }
!     static public FractCalculator fractCalc = new SimpleCalculator();
  
  
      /** For subclasses to override: process incoming events.
***************
*** 345,351 ****
                                if (animationtime != 0
                                        && wins[0].animUseful())
                                    firstWinAnim = true;
-                               fractCalc.millis = animationtime;
                                animationtime = defaultAnimationTime;
                            }
                            if(dbg) pa("Finished end state for window 0");
--- 375,380 ----
Index: gzz/gzz/vob/buoy/Buoy3Floater.java
diff -c gzz/gzz/vob/buoy/Buoy3Floater.java:1.2 
gzz/gzz/vob/buoy/Buoy3Floater.java:1.3
*** gzz/gzz/vob/buoy/Buoy3Floater.java:1.2      Fri Sep 13 07:48:32 2002
--- gzz/gzz/vob/buoy/Buoy3Floater.java  Wed Sep 18 21:20:05 2002
***************
*** 39,42 ****
--- 39,49 ----
       */
      void addBuoy(float anchorX, float anchorY, float importance,
                    Object key, Runnable buoy, float w, float h);
+ 
+     /** Add the given "buoy" as a central system (the coordinates
+      * are not modified except by translation). 
+      * This is so that it will be easy to animate
+      * between buoy coord systems and the center.
+      */
+     void addCentralBuoy(Object key, Runnable buoy);
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]