[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/libcoords/Coords.cxx gzz/view/xubuoy.py
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz gfx/libcoords/Coords.cxx gzz/view/xubuoy.py |
Date: |
Thu, 03 Oct 2002 08:12:53 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/03 08:12:53
Modified files:
gfx/libcoords : Coords.cxx
gzz/view : xubuoy.py
Log message:
Buoys somewhat working
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/xubuoy.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
Patches:
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.28 gzz/gfx/libcoords/Coords.cxx:1.29
*** gzz/gfx/libcoords/Coords.cxx:1.28 Thu Oct 3 07:23:36 2002
--- gzz/gfx/libcoords/Coords.cxx Thu Oct 3 08:12:53 2002
***************
*** 4,9 ****
--- 4,10 ----
namespace Coords {
DBGVAR(dbg, "Coords.general");
+ DBGVAR(dbg_buoy, "Coords.buoy");
// The (STL-like) concept of transform:
// enum { NParams = n };
***************
*** 298,310 ****
--- 299,316 ----
float c = amc.dot(amc) - radius*radius;
float det = b*b - 4*a*c;
+
+ DBG(dbg_buoy) << "eq: "<<anchor<<" "<<amc<<" "<<v<<" "<<a<<"
"<<b<<" "<<c<<"\n";
+
if(det <= 0) {
tr = ZVec(0,0,0);
+ DBG(dbg_buoy) << "No solution - zero\n";
return;
}
float ans = (-b + sqrt(det)) / (2*a);
ZPt pt = proj + ans * v;
+ DBG(dbg_buoy) << "solution: "<<pt<<"\n";
tr = pt;
}
virtual CoordSys *createInverse() {
Index: gzz/gzz/view/xubuoy.py
diff -c gzz/gzz/view/xubuoy.py:1.9 gzz/gzz/view/xubuoy.py:1.10
*** gzz/gzz/view/xubuoy.py:1.9 Thu Oct 3 08:00:53 2002
--- gzz/gzz/view/xubuoy.py Thu Oct 3 08:12:53 2002
***************
*** 105,119 ****
self.eye = 0.2
self.buoyscale = 400
! def add(self, vs, anchorX, anchorY, importance, floater,
! maincs = None, globalview = None,
globalusefancypaper = 0,
globalshowtessel = 0):
if not self.cell:
return
cell = self.cell
! cs1 = floater.addBuoy(anchorX, anchorY, importance, self.cell.getId(),
0, 0)
cs1_zoom= vs.coords.distort(cs1, 0, 0, self.eye, self.eye,
self.buoyscale, self.buoyscale)
vs.matcher.add(cs1_zoom, cell.getId()+"__bulg")
--- 105,136 ----
self.eye = 0.2
self.buoyscale = 400
! def add(self, vs, anchorX, anchorY, importance, buoyparams,
! maincs, globalview = None,
globalusefancypaper = 0,
globalshowtessel = 0):
if not self.cell:
return
cell = self.cell
! # Make a coordinate system at the anchor point.
! # this is the parent coordsys of the buoy
! mainlinkspan = self.link[1-self.linkindex].getList()[0]
! # XXX if cell not everything...
! mainpage = mainlinkspan.offset() - globalspan.offset()
! mainp = mainlinkspan.getLocation()
! mainoffsp = globalspan.getLocation()
! maind = mainlinkspan.getSize()
! mainpoint = globalview.paperpoint(mainpage,
mainp.x-mainoffsp.x+0.5*maind.width,
!
mainp.y-mainoffsp.y+0.5*maind.height)
!
! main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0],
mainpoint[1], 0, 0)
!
! # Then, make the buoy coordsys
!
! cs1 = vs.coords.buoyOnCircle(main_end_cs, *buoyparams)
! vs.matcher.add(cs1, cell.getId()+"__buo")
!
cs1_zoom= vs.coords.distort(cs1, 0, 0, self.eye, self.eye,
self.buoyscale, self.buoyscale)
vs.matcher.add(cs1_zoom, cell.getId()+"__bulg")
***************
*** 127,161 ****
fancy = globalusefancypaper, showTessel = globalshowtessel)
# Then, the xu link connector
! if maincs != None:
! mainlinkspan = self.link[1-self.linkindex].getList()[0]
! # XXX if cell not everything...
! mainpage = mainlinkspan.offset() - globalspan.offset()
! mainp = mainlinkspan.getLocation()
! mainoffsp = globalspan.getLocation()
! maind = mainlinkspan.getSize()
! mainpoint = globalview.paperpoint(mainpage,
mainp.x-mainoffsp.x+0.5*maind.width,
!
mainp.y-mainoffsp.y+0.5*maind.height)
!
! main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0],
mainpoint[1], 0, 0)
!
! link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0],
self.pctr[1], 0, 0)
!
! vs.matcher.add(main_end_cs,
"link"+str(self.link)+str(self.linkindex))
! vs.matcher.add(link_end_cs,
"link"+str(self.link)+str(1-self.linkindex))
!
! print "lineconn!"
! vs.map.put(GLCache.getCallList("""
! PushAttrib ENABLE_BIT
! Disable TEXTURE_2D
! LineWidth 5
! Enable BLEND
! Color 0 0 0 0.6
! """))
! vs.map.put(lineconn, main_end_cs, link_end_cs)
! vs.map.put(GLCache.getCallList("""
! PopAttrib
! """))
def hit(self, coords, point3):
return self.view.hitClip(coords, point3, self.cliprect)
--- 144,167 ----
fancy = globalusefancypaper, showTessel = globalshowtessel)
# Then, the xu link connector
!
! link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0],
self.pctr[1], 0, 0)
!
! vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))
! vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))
!
! print "lineconn!"
! vs.map.put(GLCache.getCallList("""
! PushAttrib ENABLE_BIT
! Disable TEXTURE_2D
! LineWidth 5
! Enable BLEND
! Color 0 0 0 0.6
! """))
! vs.map.put(lineconn, main_end_cs, link_end_cs)
! vs.map.put(GLCache.getCallList("""
! PopAttrib
! """))
def hit(self, coords, point3):
return self.view.hitClip(coords, point3, self.cliprect)
***************
*** 210,216 ****
self.ctrx = screensize[0]/2
self.ctry = screensize[1]/2
! self.rad = screensize[1]/2
self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
self.clip = 0
self.selectCS = None
--- 216,224 ----
self.ctrx = screensize[0]/2
self.ctry = screensize[1]/2
!
! self.rad = screensize[1] / 2
!
self.nadir = NadirAngler(self.ctrx, screensize[1]*2)
self.clip = 0
self.selectCS = None
***************
*** 325,337 ****
def scene(self, vs):
bg(vs)
! bf = effects.NadirCircleFloater_NoAnchor(vs, (self.ctrx, self.ctry),
self.rad,
! self.nadir, 1)
! bfforw = effects.NadirCircleFloater_NoAnchor(vs, (self.ctrx,
self.ctry), self.rad,
! self.nadir, -1)
print "Context"
! cs1 = bf.addCentralBuoy(self.cursor.getId())
if self.modes[0].movefocus:
--- 333,348 ----
def scene(self, vs):
bg(vs)
!
! fbuoyparams = (self.ctrx, self.ctry, self.rad,
! self.ctrx + 1.5*self.rad, self.ctry)
! bbuoyparams = (self.ctrx, self.ctry, self.rad,
! self.ctrx - 1.5*self.rad, self.ctry)
!
print "Context"
! cs1 = vs.coords.translateXYZ(0, self.ctrx, self.ctry, 100)
! vs.matcher.add(cs1, self.cursor.getId()+"__FOO")
if self.modes[0].movefocus:
***************
*** 373,379 ****
for forwlink in globalforw:
b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
enfoverlap = enfoverlap)
! b.add(vs, 0, 0, 1, bfforw, maincs = cs1_trans,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel)
--- 384,390 ----
for forwlink in globalforw:
b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
enfoverlap = enfoverlap)
! b.add(vs, 0, 0, 1, fbuoyparams, maincs = cs1_trans,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel)
***************
*** 381,387 ****
for backlink in globalback:
b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
enfoverlap = enfoverlap)
! b.add(vs, 0, 0, 1, bf, maincs = cs1_trans,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel)
--- 392,398 ----
for backlink in globalback:
b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
enfoverlap = enfoverlap)
! b.add(vs, 0, 0, 1, bbuoyparams, maincs = cs1_trans,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz gfx/libcoords/Coords.cxx gzz/view/xubuoy.py,
Tuomas J. Lukka <=