gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gfx/libcoords/Coords.cxx gfx/libcoor...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/libcoords/Coords.cxx gfx/libcoor...
Date: Wed, 02 Oct 2002 02:50:22 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/02 02:50:21

Modified files:
        .              : TODO 
        gfx/libcoords  : Coords.cxx Coords.hxx 

Log message:
        Fix nonlinearity, dicing not really good now because of the changes, 
but getting better.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.212&tr2=1.213&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.hxx.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.212 gzz/TODO:1.213
*** gzz/TODO:1.212      Wed Oct  2 02:18:17 2002
--- gzz/TODO    Wed Oct  2 02:50:20 2002
***************
*** 57,63 ****
          number of passes as much. However, this brings
          caching problems.
      tjl:
-       - fix nonlinearity()
        - xupdf: distorted multi-page PDF view with xu links
            - mouse click positioning in distorted cs: get
              position on paper, move there
--- 57,62 ----
***************
*** 70,75 ****
--- 69,75 ----
                - really USE hierarchical keys
            - clean up the xupdf.py file
            - frame rate ~= 25
+               - fix nonlinearity's effect: too much dicing now.
                - paperquad texture binding LOD?
            - better graphics for xu links
            - mouse clicks on buoys to work
***************
*** 135,140 ****
--- 135,147 ----
        - clean, rename and document Makefile targets (coordinate with mudyc:
          do we want to use something else instead of make?)
      tjl:
+       - fix the way nonlinearity of coordsys is handled.
+         Needs a slightly better approach, with also 
+         direction of nonlinearity taken into account.
+         If we can save a lot of dicing by thinking a little
+         more, we probably should.
+         Need to have alternative algorithms (fast/good) though, for 
+         different cases.
        - javadoc for gzz.vob.Vob* interfaces
        - clarify Binder javadoc (Benja wasn't aware that the idea is
          "one binder per window")
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.25 gzz/gfx/libcoords/Coords.cxx:1.26
*** gzz/gfx/libcoords/Coords.cxx:1.25   Tue Oct  1 06:45:21 2002
--- gzz/gfx/libcoords/Coords.cxx        Wed Oct  2 02:50:21 2002
***************
*** 8,13 ****
--- 8,14 ----
      // The (STL-like) concept of transform:
      // enum { NParams = n };
      // void tr(const ZPt &from, ZPt &to) const
+     // float tr_radius(const ZPt &from, float radius) const
      // bool canPerformGL()
      // bool performGL()
      // float nonlinearity(const ZPt &p, float radius)
***************
*** 60,65 ****
--- 61,77 ----
            return ret;
        }
  
+       virtual float nonlinearity(const ZPt &p, float radius) { 
+           ZPt mp;
+           t.tr(p, mp);
+           float srad = t.tr_radius(p, radius);
+           float snon = super->nonlinearity(mp, srad);
+           // Multiply to take into account shrinking / magnifying.
+           snon *= srad / radius;
+           float non = t.nonlinearity(p, radius);
+           return (non > snon ? non : snon);
+       }
+ 
      };
  
      template<class Transform> class InverseTransformCoordSys : public 
TransformCoordSysBase<Transform> {
***************
*** 124,129 ****
--- 136,147 ----
            to.y = params[1] + from.x * params[5] + from.y * params[6];
            to.z = params[2] + from.z;
        }
+       float tr_radius(const ZPt &from, float radius) const {
+           // XXX Oblique?!?!
+           float a = fabs(params[3]);
+           float b = fabs(params[6]);
+           return radius * (a > b ? a : b);
+       }
        bool canPerformGL() { return true; }
          bool performGL() {
              GLfloat matrix[16] = {
***************
*** 182,187 ****
--- 200,208 ----
            to.y = -s * from.x + c * from.y; 
            to.z = from.z;
        }
+       float tr_radius(const ZPt &from, float radius) const {
+           return radius;
+       }
        bool canPerformGL() { return true; }
          bool performGL() {
            glRotatef(a, 0, 0, 1);
***************
*** 232,237 ****
--- 253,261 ----
            ZVec ortho = para.crossp(vec).normalized();
            to = ZPt( same * vec + paral * (c * para - s * ortho) );
        }
+       float tr_radius(const ZPt &from, float radius) const {
+           return radius; // XXX !!!! ???
+       }
        virtual bool canPerformGL() { return true; }
          virtual bool performGL() {
            glRotatef(a, vec.x, vec.y, vec.z);
***************
*** 270,275 ****
--- 294,304 ----
            to.y = from.y * vec.y;
            to.z = from.z * vec.z;
        }
+       float tr_radius(const ZPt &from, float radius) const {
+           float a = fabs(vec.x);
+           float b = fabs(vec.y);
+           return radius * (a > b ? a : b);
+       }
        virtual bool canPerformGL() { return true; }
          virtual bool performGL() {
            glScalef(vec.x, vec.y, vec.z);
***************
*** 326,331 ****
--- 355,366 ----
                to.y *= mmin;
            }
            to.x += x; to.y += y;
+       }
+       float tr_radius(const ZPt &from, float radius) const {
+           // Distance from center
+           // float l = ZPt((from.x-x)/w, (from.y-y)/h, 0).length();
+           // XXX
+           return radius;
        }
        typedef DistortCoords<typename F::InverseType>  InverseType; // XXX !!!
        InverseType inverseTransform() {
Index: gzz/gfx/libcoords/Coords.hxx
diff -c gzz/gfx/libcoords/Coords.hxx:1.11 gzz/gfx/libcoords/Coords.hxx:1.12
*** gzz/gfx/libcoords/Coords.hxx:1.11   Tue Oct  1 06:45:21 2002
--- gzz/gfx/libcoords/Coords.hxx        Wed Oct  2 02:50:21 2002
***************
*** 59,65 ****
         * Returns 0 if dicing is required.
         */
        virtual float nonlinearity(const ZPt &p, float radius) { 
!           return super->nonlinearity(transform(p), radius); 
        }
  
        /** Whether this transformation can be performed by OpenGL
--- 59,65 ----
         * Returns 0 if dicing is required.
         */
        virtual float nonlinearity(const ZPt &p, float radius) { 
!           return 0;
        }
  
        /** Whether this transformation can be performed by OpenGL




reply via email to

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