[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./TODO gfx/demo/fillets.py gfx/libcoords/Co...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./TODO gfx/demo/fillets.py gfx/libcoords/Co... |
Date: |
Mon, 07 Oct 2002 03:40:03 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/07 03:40:03
Modified files:
. : TODO
gfx/demo : fillets.py
gfx/libcoords : Coords.cxx Coords.hxx
gzz/gfx/gl : GLVobCoorder.java
Log message:
Pave the way for several cs.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.248&tr2=1.249&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fillets.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.hxx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.248 gzz/TODO:1.249
*** gzz/TODO:1.248 Mon Oct 7 02:27:11 2002
--- gzz/TODO Mon Oct 7 03:40:03 2002
***************
*** 79,86 ****
- UML and APIs of ImageCache
- implementation of ImageCache
tjl:
- - change GLVobCoorder coordinate system codes from consecutive ints
- to indices in integer array; this way can have more than one parent.
- coordinate system concatenation!
- PP [deadline 9.10]
- make it work again
--- 79,84 ----
Index: gzz/gfx/demo/fillets.py
diff -c gzz/gfx/demo/fillets.py:1.8 gzz/gfx/demo/fillets.py:1.9
*** gzz/gfx/demo/fillets.py:1.8 Fri Oct 4 18:16:34 2002
--- gzz/gfx/demo/fillets.py Mon Oct 7 03:40:03 2002
***************
*** 204,212 ****
wid, h = (600, 600)
l = 300
cc=[(vs.matcher.addSub(into,
! vs.coords.coordsys(into, d, -wid/2, -l-h, wid,
h),"foo"+str(d)),
vs.matcher.addSub(into,
! vs.coords.coordsys(into, d, -wid/2-0.75*wid*self.movel,
l, wid, h), "bar"+str(d)))
for d in (600, 800)]
putnoc(vs, getDList("""
--- 204,212 ----
wid, h = (600, 600)
l = 300
cc=[(vs.matcher.addSub(into,
! vs.coords.coordsys(into, d, 0, -2*l, wid/2,
h/2),"foo"+str(d)),
vs.matcher.addSub(into,
! vs.coords.coordsys(into, d, -0.75*wid*self.movel, 2*l,
wid/2, h/2), "bar"+str(d)))
for d in (600, 800)]
putnoc(vs, getDList("""
***************
*** 501,507 ****
for y in (2-dy,2,2+dy)]
cs = []
for ctr in ctrs:
! coordsys = vs.coords.coordsys(0, 20, ctr[0]-w/2, ctr[1]-h/2, w, h)
vs.matcher.add(coordsys, str(dx)+str(ctr[1]))
cs.append((coordsys, ctr))
for c in cs:
--- 501,507 ----
for y in (2-dy,2,2+dy)]
cs = []
for ctr in ctrs:
! coordsys = vs.coords.coordsys(0, 20, ctr[0], ctr[1], w/2, h/2)
vs.matcher.add(coordsys, str(dx)+str(ctr[1]))
cs.append((coordsys, ctr))
for c in cs:
***************
*** 519,525 ****
Disable TEXTURE_2D
Color 0 0 0
Begin LINE_STRIP
! Vertex -1 -1
Vertex 1 1
End
Color 1 1 1
--- 519,525 ----
Disable TEXTURE_2D
Color 0 0 0
Begin LINE_STRIP
! Vertex 0 0
Vertex 1 1
End
Color 1 1 1
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.31 gzz/gfx/libcoords/Coords.cxx:1.32
*** gzz/gfx/libcoords/Coords.cxx:1.31 Fri Oct 4 02:54:11 2002
--- gzz/gfx/libcoords/Coords.cxx Mon Oct 7 03:40:03 2002
***************
*** 519,534 ****
--- 519,538 ----
struct SomeFactory {
virtual int nparams() = 0;
+ virtual int nprevious() = 0;
virtual CoordSys *create() = 0;
};
+
template<class C> class Factory : public SomeFactory {
public:
virtual int nparams() { return C::NParams; }
+ virtual int nprevious() { return 1; }
virtual CoordSys *create() { return new TransformCoordSys<C>(); }
};
template<class C> class NoTransFactory : public SomeFactory {
public:
virtual int nparams() { return C::NParams; }
+ virtual int nprevious() { return 1; }
virtual CoordSys *create() { return new C(); }
};
***************
*** 549,554 ****
--- 553,561 ----
0
};
+ int CoordSet::nprevious(int typecode) {
+ return facs[typecode]->nprevious();
+ }
int CoordSet::nparams(int typecode) {
return facs[typecode]->nparams();
}
***************
*** 571,597 ****
<< show1 << "\n" ;
params.resize(0);
DBG(dbg) << "Resized\n";
! params.reserve(7*ninds);
DBG(dbg) << "Reserved\n";
! cs.resize(ninds/3);
DBG(dbg) << "Resized2\n";
cs[0] = new RootCoords();
DBG(dbg) << "setroot\n";
! for(int i=3; i+3<=ninds; i+=3) {
DBG(dbg) << "loop "<<i<<"\n";
int parind = params.size();
int tp = inds1[i];
int npars = nparams(tp);
! int parent = inds1[i+1];
! CoordSys *parentcs = cs[parent];
! if(parentcs == 0) {
! DBG(dbg) << "Parent not interp\n";
! continue; // If parent's not interpolating, neither are we.
}
! int ind1 = inds1[i+2];
! int csind2 = ((interpinds && i/3 < interpinds[0]) ? interpinds[i/3]
: -1);
DBG(dbg) << "inds: "<<parind<<" typ:"<<tp<<" npars:"<<npars<<
! " parent:"<<parent<<" "<<parentcs<<
" ind1:"<<ind1<<" "<<csind2<<"\n";
if(csind2 <= 0) {
if(show1) {
--- 578,617 ----
<< show1 << "\n" ;
params.resize(0);
DBG(dbg) << "Resized\n";
! params.reserve(3*ninds);
DBG(dbg) << "Reserved\n";
! cs.resize(ninds);
DBG(dbg) << "Resized2\n";
cs[0] = new RootCoords();
DBG(dbg) << "setroot\n";
! int lastIndSize = 1;
! for(int i=1; i<ninds; i+=lastIndSize) {
DBG(dbg) << "loop "<<i<<"\n";
int parind = params.size();
int tp = inds1[i];
int npars = nparams(tp);
! int nprev = nprevious(tp);
! int ind1;
! int csind2;
!
! lastIndSize = nprev + 2; // typecode, prevs and paramind
!
! CoordSys *prev[nprev];
!
! for(int j=0; j<nprev; j++) {
! int parent = inds1[i+1+j];
! CoordSys *parentcs = cs[parent];
! if(parentcs == 0) {
! DBG(dbg) << "Parent "<<j<<" not interp\n";
! goto nextInd; // If parent's not interpolating, neither are
we.
! }
! prev[j] = parentcs;
}
!
! ind1 = inds1[i+1+nprev];
! csind2 = ((interpinds && i < interpinds[0]) ? interpinds[i] : -1);
DBG(dbg) << "inds: "<<parind<<" typ:"<<tp<<" npars:"<<npars<<
! " parent:"<<prev[0]<<" "<<
" ind1:"<<ind1<<" "<<csind2<<"\n";
if(csind2 <= 0) {
if(show1) {
***************
*** 602,618 ****
continue;
}
} else {
! int ind2 = inds2[3*csind2 + 2];
for(int j = 0; j<npars; j++) {
DBG(dbg) << "Interpolating "<<(ind1+j)<<" "<<(ind2+j)<<" =
"<<
points1[ind1+j]<<" "<< points2[ind2+j]<<"\n";
params.push_back(lerp(points1[ind1 + j], points2[ind2 + j],
fract));
}
}
! CoordSys *c = create(tp);
! cs[i/3] = c;
! c->setSuper(parentcs);
! c->setParams(&(params[0]) + parind);
}
DBG(dbg) << "end\n";
}
--- 622,641 ----
continue;
}
} else {
! int ind2 = inds2[csind2 + 2];
for(int j = 0; j<npars; j++) {
DBG(dbg) << "Interpolating "<<(ind1+j)<<" "<<(ind2+j)<<" =
"<<
points1[ind1+j]<<" "<< points2[ind2+j]<<"\n";
params.push_back(lerp(points1[ind1 + j], points2[ind2 + j],
fract));
}
}
! {
! CoordSys *c = create(tp);
! cs[i] = c;
! c->setSuper(prev);
! c->setParams(&(params[0]) + parind);
! }
! nextInd:;
}
DBG(dbg) << "end\n";
}
Index: gzz/gfx/libcoords/Coords.hxx
diff -c gzz/gfx/libcoords/Coords.hxx:1.12 gzz/gfx/libcoords/Coords.hxx:1.13
*** gzz/gfx/libcoords/Coords.hxx:1.12 Wed Oct 2 02:50:21 2002
--- gzz/gfx/libcoords/Coords.hxx Mon Oct 7 03:40:03 2002
***************
*** 17,24 ****
CoordSys() : super(0), inverse(0), ownInverse(1) {
}
! virtual void setSuper(CoordSys *super) {
! this->super = super;
}
/** Always call setSuper first!
*/
--- 17,24 ----
CoordSys() : super(0), inverse(0), ownInverse(1) {
}
! virtual void setSuper(CoordSys **super) {
! this->super = super[0];
}
/** Always call setSuper first!
*/
***************
*** 92,97 ****
--- 92,98 ----
vector<float> params;
int nparams(int typecode) ;
+ int nprevious(int typecode) ;
CoordSys *create(int typecode) ;
public:
~CoordSet() {
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -c gzz/gzz/gfx/gl/GLVobCoorder.java:1.36
gzz/gzz/gfx/gl/GLVobCoorder.java:1.37
*** gzz/gzz/gfx/gl/GLVobCoorder.java:1.36 Thu Oct 3 12:50:30 2002
--- gzz/gzz/gfx/gl/GLVobCoorder.java Mon Oct 7 03:40:03 2002
***************
*** 29,35 ****
import gzz.client.gl.*;
public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.36 2002/10/03
16:50:30 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 29,35 ----
import gzz.client.gl.*;
public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.37 2002/10/07
07:40:03 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 37,43 ****
int nfloats = 0;
int[] inds = new int[5000];
! int ninds = 3; // first 3 ignored.
public int getCSIndexAt(float x, float y) { return -1; }
--- 37,43 ----
int nfloats = 0;
int[] inds = new int[5000];
! int ninds = 1; // zero is special (the root)
public int getCSIndexAt(float x, float y) { return -1; }
***************
*** 47,53 ****
float x_x, float x_y,
float y_x, float y_y
) {
! if(dbg) pa("AffineCoordSys "+ninds/3+": "+into+" '"+depth+" --- "+
cx+" "+cy+" "+x_x+" "+x_y+" "+y_x+" "+y_y);
int paramInd = nfloats;
--- 47,53 ----
float x_x, float x_y,
float y_x, float y_y
) {
! if(dbg) pa("AffineCoordSys "+ninds+": "+into+" '"+depth+" --- "+
cx+" "+cy+" "+x_x+" "+x_y+" "+y_x+" "+y_y);
int paramInd = nfloats;
***************
*** 57,63 ****
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
setAffineParams(was, depth, cx, cy, x_x, x_y, y_x, y_y);
--- 57,63 ----
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
setAffineParams(was, depth, cx, cy, x_x, x_y, y_x, y_y);
***************
*** 68,74 ****
public void setAffineParams(
int cs, float depth, float cx, float cy,
float x_x, float x_y, float y_x, float y_y) {
! int ind = inds[3*cs + 2];
floats[ind + 0] = cx;
floats[ind + 1] = cy;
floats[ind + 2] = depth;
--- 68,74 ----
public void setAffineParams(
int cs, float depth, float cx, float cy,
float x_x, float x_y, float y_x, float y_y) {
! int ind = inds[cs + 2];
floats[ind + 0] = cx;
floats[ind + 1] = cy;
floats[ind + 2] = depth;
***************
*** 86,92 ****
inds[ninds + 0] = 2; // rotation = 2
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
return was;
--- 86,92 ----
inds[ninds + 0] = 2; // rotation = 2
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
return was;
***************
*** 103,109 ****
inds[ninds + 0] = 4; // rotation xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
return was;
--- 103,109 ----
inds[ninds + 0] = 4; // rotation xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
return was;
***************
*** 119,125 ****
inds[ninds + 0] = 6; // translation xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
return was;
--- 119,125 ----
inds[ninds + 0] = 6; // translation xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
return was;
***************
*** 140,146 ****
inds[ninds + 0] = 7; // buoy xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
return was;
--- 140,146 ----
inds[ninds + 0] = 7; // buoy xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
return was;
***************
*** 158,164 ****
inds[ninds + 0] = 5; // rotation xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
return was;
--- 158,164 ----
inds[ninds + 0] = 5; // rotation xyz
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
return was;
***************
*** 181,199 ****
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds / 3;
ninds += 3;
return was;
}
public void dump() {
pa("GLVobCoorder: ");
! for(int i=0; i<ninds/3; i++) {
! int ind = i*3;
! String s = "";
! for(int u = ind; u<ind+3; u++)
! s = s + " " + inds[u];
! pa(" cs: "+s);
}
}
--- 181,195 ----
inds[ninds + 1] = into;
inds[ninds + 2] = paramInd;
! int was = ninds;
ninds += 3;
return was;
}
public void dump() {
pa("GLVobCoorder: ");
! for(int i=0; i<ninds; i++) {
! pa(" "+i);
}
}