[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./CODING ./TODO gfx/demo/irregular2.py gfx/...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./CODING ./TODO gfx/demo/irregular2.py gfx/... |
Date: |
Thu, 26 Sep 2002 04:31:24 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/09/26 04:31:24
Modified files:
. : CODING TODO
gfx/demo : irregular2.py
gfx/libcoords : Coords.cxx Coords.hxx
gfx/librenderables: renderables.py
gfx/libutil : Vec23.hxx
Log message:
Start conversion of irregularquad
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/CODING.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.138&tr2=1.139&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregular2.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.hxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.62&tr2=1.63&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libutil/Vec23.hxx.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
Patches:
Index: gzz/CODING
diff -c gzz/CODING:1.21 gzz/CODING:1.22
*** gzz/CODING:1.21 Wed Aug 28 09:07:28 2002
--- gzz/CODING Thu Sep 26 04:31:23 2002
***************
*** 3,13 ****
Tuomas Lukka
Antti-Juhani Kaijanaho
! $Id: CODING,v 1.21 2002/08/28 13:07:28 benja Exp $
This document attempts to give a brief guide on how to write
Java code for this project.
- each Java file should contain the boilerplate copyright and
license notice (see e.g. gzz/Cell.java).
--- 3,16 ----
Tuomas Lukka
Antti-Juhani Kaijanaho
! $Id: CODING,v 1.22 2002/09/26 08:31:23 tjl Exp $
This document attempts to give a brief guide on how to write
Java code for this project.
+ Rules
+ -----
+
- each Java file should contain the boilerplate copyright and
license notice (see e.g. gzz/Cell.java).
***************
*** 37,47 ****
- Each class should start with the line (not indented to save space)
! public static final String rcsid = "$Id: CODING,v 1.21 2002/08/28 13:07:28
benja Exp $";
except interfaces, which should have
! String rcsid = "$Id: CODING,v 1.21 2002/08/28 13:07:28 benja Exp $";
instead.
--- 40,50 ----
- Each class should start with the line (not indented to save space)
! public static final String rcsid = "$Id: CODING,v 1.22 2002/09/26 08:31:23
tjl Exp $";
except interfaces, which should have
! String rcsid = "$Id: CODING,v 1.22 2002/09/26 08:31:23 tjl Exp $";
instead.
***************
*** 121,128 ****
- make your code such that it can be compiled in jikes +P (pedantic),
JDK1.1.8 and JDK1.2.2 without warnings or errors.
! - as an aside, I really recommend using a coloring editor since there are
many points where significant sections have been commented out. This
is bad practice but inevitable in a system that doesn't easily allow
us to attach the sections which are not useful now but might be later
to the text in a xanadu-like manner.
--- 124,149 ----
- make your code such that it can be compiled in jikes +P (pedantic),
JDK1.1.8 and JDK1.2.2 without warnings or errors.
! Tips (for speeding up work)
! ---------------------------
!
! - I really recommend using a coloring editor since there are
many points where significant sections have been commented out. This
is bad practice but inevitable in a system that doesn't easily allow
us to attach the sections which are not useful now but might be later
to the text in a xanadu-like manner.
+
+ - We use pretty long identifiers - make sure your editor's dynamic
+ abbreviations are turned on. For example, I type
+ Mod^P
+ and start getting the options
+ ModularSpace, ...
+ for the word. NEVER type the identifiers in whole.
+
+ - Use exuberant ctags. First, "make tags", then in vim, I
+ just do
+ :ta Aff<TAB>
+ which gives me the options AffineVobCoorder and AffineXYCoords.
+ Then, pressing enter takes me to the definition.
+ NEVER type the directory names for the classes.
+
Index: gzz/TODO
diff -c gzz/TODO:1.138 gzz/TODO:1.139
*** gzz/TODO:1.138 Wed Sep 25 14:10:21 2002
--- gzz/TODO Thu Sep 26 04:31:24 2002
***************
*** 10,15 ****
--- 10,23 ----
0.8alpha2: Crucial demos for continued funding preliminary work - until 28th
( unlike the other releases, the things here are in priority order )
+ tuukkah:
+ - unit tests for libcoords:
+ - a general test which tests that a CoordSys implementation
+ and its inverse match up (enabled for most coordsys).
+ - implement DistortCoords::createInverse(). This is not easy, and
+ it IS allowable to use numeric approximation for root-finding.
+ Make sure you abstract this into libdistort properly
+ (inverse should be in the functions themselves)
vegai:
- make papermill (libpaper)
into real python modules so
***************
*** 30,47 ****
- fix utf8 string non-null end bug found by Benja
- move mstmpimg/ to ..
tjl:
! - fix GL coords so that we have the hierarchy:
! floats -> coordsys -> renderables
! so that coordsys can know about other coordsys
! and be of different types, and renderables can know
! about the types. This way we can finally get
! hierarchies working the right way.
! This is needed to make distortion not look horrible
! when animating and to get stenciling irregular frames
! in distorted coordsys to work.
! As a bonus, ANYTHING can then be nonlinearly distorted!
! The different types of coordsys make it possible to give
! "shape" parameters so that there is no problem there either.
- distorted multi-page PDF view with xu links
- abstract distortion out into libfisheye, for buoy edges etc.
- use templates to make sure that we get performance
--- 38,49 ----
- fix utf8 string non-null end bug found by Benja
- move mstmpimg/ to ..
tjl:
! - fix things broken by new coordsys stuff
! + fix coordsys to take an iterator, which does the lerping,
! so we can store parameters more naturally and also create
! coordsys independently of the CoordSet stuff.
! - move coordsys into their own header file, or at least
! coords header file...
- distorted multi-page PDF view with xu links
- abstract distortion out into libfisheye, for buoy edges etc.
- use templates to make sure that we get performance
***************
*** 139,144 ****
--- 141,149 ----
- clarify Binder javadoc (Benja wasn't aware that the idea is
"one binder per window")
- overall document about the goals and visions for the project
+ - docxx Vec23, clean up vec23 by removing separation between Point
+ and Vector.
+ - 4-dimensional homogeneous type?
mudyc:
+ make libcallgl use GLX_ARB_get_proc_address for
the functions in
Index: gzz/gfx/demo/irregular2.py
diff -c gzz/gfx/demo/irregular2.py:1.15 gzz/gfx/demo/irregular2.py:1.16
*** gzz/gfx/demo/irregular2.py:1.15 Mon Sep 23 04:37:04 2002
--- gzz/gfx/demo/irregular2.py Thu Sep 26 04:31:24 2002
***************
*** 72,83 ****
#putnoc(vs, getDListNocoords("Translate -1000 -1000 0\nScale 4 4
4\n"))
! cs1 = vs.coords.affineCoordsys(0, "1", 10, self.x1, self.y1, self.xs,
0, 0, self.ys)
! cs2 = vs.coords.affineCoordsys(0, "2", 10, 600, 450,
self.scale * 150,
self.scale * 32.3,
self.scale * -14.2,
self.scale * 150)
#vs.map.put(self.mask, cs2)
if self.mode & 4:
--- 72,85 ----
#putnoc(vs, getDListNocoords("Translate -1000 -1000 0\nScale 4 4
4\n"))
! cs1 = vs.coords.affineCoordsys(0, 10, self.x1, self.y1, self.xs, 0,
0, self.ys)
! vs.matcher.add(cs1, "1")
! cs2 = vs.coords.affineCoordsys(0, 10, 600, 450,
self.scale * 150,
self.scale * 32.3,
self.scale * -14.2,
self.scale * 150)
+ vs.matcher.add(cs2, "2")
#vs.map.put(self.mask, cs2)
if self.mode & 4:
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.6 gzz/gfx/libcoords/Coords.cxx:1.7
*** gzz/gfx/libcoords/Coords.cxx:1.6 Wed Sep 25 13:07:50 2002
--- gzz/gfx/libcoords/Coords.cxx Thu Sep 26 04:31:24 2002
***************
*** 4,14 ****
namespace Coords {
DBGVAR(dbg, "Coords.general");
- bool CoordSys::performGL() {
- DBG(dbg) << "Potential problem: performGL default implementation
called, means incorrect rendering\n";
- return false;
- }
-
class RootCoords : public CoordSys {
public:
virtual ZPt transform(const ZPt &p) const {
--- 4,9 ----
***************
*** 211,216 ****
--- 206,221 ----
}
DBG(dbg) << "end\n";
}
+
+ bool CoordSys::performGL() {
+ DBG(dbg) << "Potential problem: performGL default implementation
called, means incorrect rendering\n";
+ return false;
+ }
+ CoordSys *CoordSys::createInverse() {
+ DBG(dbg) << "Potential problem: createInverse default implementation
called, means incorrect rendering\n";
+ return new RootCoords();
+ }
+
}
Index: gzz/gfx/libcoords/Coords.hxx
diff -c gzz/gfx/libcoords/Coords.hxx:1.5 gzz/gfx/libcoords/Coords.hxx:1.6
*** gzz/gfx/libcoords/Coords.hxx:1.5 Wed Sep 25 12:39:26 2002
--- gzz/gfx/libcoords/Coords.hxx Thu Sep 26 04:31:24 2002
***************
*** 8,17 ****
--- 8,20 ----
using std::vector;
using std::cout;
using namespace Vec23;
+
class CoordSys {
protected:
CoordSys *super;
float *params;
+ CoordSys *inverse;
+ virtual CoordSys *createInverse() ;
public:
virtual void setSuper(CoordSys *super) {
this->super = super;
***************
*** 20,25 ****
--- 23,40 ----
this->params = params;
}
+ /** Get the inverse of this coordinate system.
+ * Always returns non-null but it is not guaranteed
+ * that this will work properly. (XXX canInvert())
+ * The returned inverse is owned by this object and
+ * mustn't be deleted by the caller.
+ */
+ CoordSys *getInverse() {
+ if(!inverse)
+ inverse = createInverse();
+ return inverse;
+ }
+
// For Pt as well?
/** Call glVertex with the given ZPt transformed
***************
*** 55,61 ****
*/
virtual bool performGL() ;
! virtual ~CoordSys() { }
virtual void dump() {
cout << "Unknown coordsys\n";
--- 70,80 ----
*/
virtual bool performGL() ;
! CoordSys() : super(0), params(0), inverse(0) {
! }
! virtual ~CoordSys() {
! if(inverse) delete inverse;
! }
virtual void dump() {
cout << "Unknown coordsys\n";
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.62
gzz/gfx/librenderables/renderables.py:1.63
*** gzz/gfx/librenderables/renderables.py:1.62 Wed Sep 25 10:45:43 2002
--- gzz/gfx/librenderables/renderables.py Thu Sep 26 04:31:24 2002
***************
*** 520,544 ****
this->mode = mode;
setup = CallGLCode(string(setupcode.begin(),
setupcode.end()).c_str());
""",
- "ExtraClass" : """
- Pt lerp(float f, Pt a, Pt b) {
- return Pt((1 - f) * a.x + f * b.x,
- (1 - f) * a.y + f * b.y);
- }
- """,
"RenderCode" : "int i=0; i++;",
! "BLAH": """
DBG(dbg) << "Irregular quad\\n";
- AffineCoords &oldcs2 = coords2;
- {
- AffineCoords coords2(oldcs2.center, oldcs2.x * cs2p, oldcs2.y * cs2p);
-
setup();
GLERR;
! AffineCoords cs1inv = coords1.getInverse();
! AffineCoords cs2inv = coords2.getInverse();
// Normalize unit vectors inside coords2 to get border widths
float bx = border *
cs1inv.transform(coords2.transform(cs2inv.transform(coords1.x).normalize())).x;
--- 520,534 ----
this->mode = mode;
setup = CallGLCode(string(setupcode.begin(),
setupcode.end()).c_str());
""",
"RenderCode" : "int i=0; i++;",
! "BLAH" : """
DBG(dbg) << "Irregular quad\\n";
setup();
GLERR;
! CoordSys &cs1inv = *coords1.getInverse();
! CoordSys &cs2inv = *coords2.getInverse();
// Normalize unit vectors inside coords2 to get border widths
float bx = border *
cs1inv.transform(coords2.transform(cs2inv.transform(coords1.x).normalize())).x;
***************
*** 676,682 ****
glPopAttrib();
- }
""",
} ,
--- 666,671 ----
Index: gzz/gfx/libutil/Vec23.hxx
diff -c gzz/gfx/libutil/Vec23.hxx:1.8 gzz/gfx/libutil/Vec23.hxx:1.9
*** gzz/gfx/libutil/Vec23.hxx:1.8 Wed Sep 25 10:45:43 2002
--- gzz/gfx/libutil/Vec23.hxx Thu Sep 26 04:31:24 2002
***************
*** 178,184 ****
typedef Vector<float> Vec;
typedef Vector3<float> ZVec;
! template<class X, class Y, class Z> inline float lerp(X a, Y b, Z fract) {
return a + fract * (b-a);
}
--- 178,184 ----
typedef Vector<float> Vec;
typedef Vector3<float> ZVec;
! template<class X, class Y> inline X lerp(X a, Y b, double fract) {
return a + fract * (b-a);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./CODING ./TODO gfx/demo/irregular2.py gfx/...,
Tuomas J. Lukka <=