[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py
From: |
Asko Soukka |
Subject: |
[ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py |
Date: |
Fri, 15 Aug 2003 07:44:46 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Asko Soukka <address@hidden> 03/08/15 07:44:46
Modified files:
org/fenfire/view/lava: mindMapView2D.py
Log message:
text scales
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/lava/mindMapView2D.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/view/lava/mindMapView2D.py
diff -u fenfire/org/fenfire/view/lava/mindMapView2D.py:1.15
fenfire/org/fenfire/view/lava/mindMapView2D.py:1.16
--- fenfire/org/fenfire/view/lava/mindMapView2D.py:1.15 Fri Aug 15 06:45:55 2003
+++ fenfire/org/fenfire/view/lava/mindMapView2D.py Fri Aug 15 07:44:46 2003
@@ -67,10 +67,11 @@
x = r * Math.cos(angle) + x0
y = -r * Math.sin(angle) + y0
- cs = vs.orthoBoxCS(0, key, 0,x-bx/2,y-by/2, 1,1, bx,by)
+ cs = vs.orthoBoxCS(0, key, -100,x-bx/2,y-by/2, 1,1, bx,by)
self.place(key, vs, cs)
def place(self, node, vs, cs):
+ self.viewfunc.setScale(1.)
p = self.viewfunc.f(self.fen.graph, node)
cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0, 0, p.getWidth(),
p.getHeight())
@@ -148,22 +149,22 @@
wh[0], wh[1] = s, s
def getNodeSize(self, depth):
- """ good size 1-math.log10(depth) """
+ """Node size is relative to depth as 1-math.log10(depth)."""
assert depth <= self.maxDepth, 'Depth is greater than maxDepth.'
if depth < 1: depth = 1
if self.maxDepth > 10: depth = depth * (10/self.maxDepth)
- s =(self.box[1] * 1./15.0) * (1-math.log10(depth))
+ s =(self.box[1] * 1./17.5) * (1-math.log10(depth))
if dbg: p('size:', s)
return s
def getDistance(self, depth):
- """ good size 1-math.log10(depth) """
+ """Distance is relative to depth as 1-math.log10(depth)."""
assert depth <= self.maxDepth, 'Depth is greater than maxDepth.'
if depth == 0: return 0
if self.maxDepth > 10: depth = depth * (10/self.maxDepth)
- d = (self.box[0] * 1./4.) * (1-math.log10(depth))
+ d = (self.box[0] * 1./5.) * (1-math.log10(depth))
if dbg: p('dist: ', d)
return d
@@ -322,7 +323,7 @@
s = self.getNodeSize(depth)
if (dbg): print 'size', s
- cs = vs.orthoBoxCS(into,'foo'+str(key),0, x-s/2.0,y-s/2.0, 1,1, s,s)
+ cs = vs.orthoBoxCS(into,'foo'+str(key),depth, x-s/2.0,y-s/2.0, 1,1,
s,s)
if dbg:
p('come:',x0,y0, angle)
p(cs, xy, angle, s)
@@ -338,27 +339,31 @@
def putNodeContent(self, vs, node, cs):
- p = self.nodef.f(self.fen.graph, node)
+ into = jarray.zeros(3, 'f')
+ vs.coords.transformPoints3(cs, [0,0,0], into)
+
+ # scaling
+ scale = (100+into[2])+2
+ if self.maxDepth > 20: scale *= 20./self.maxDepth
+ scale = 1-math.log10(scale/2.)
- #box = jarray(2, 'f')
- #vs.coords.
+ self.nodef.setScale(scale)
+ p = self.nodef.f(self.fen.graph, node)
x = - p.getWidth()/2.0
y = - p.getHeight()/2.0
- cs_background = vs.orthoCS(cs,'background',0, x,y, p.getWidth(),
p.getHeight())
+ cs_background = vs.orthoCS(cs,'background',-100, x,y, p.getWidth(),
p.getHeight())
if self.context and self.context.getAccursed() == node:
vs.put(whiteground_accursed, cs_background)
else: vs.put(whiteground, cs_background)
- cs = vs.orthoBoxCS(cs, node,0, x,y, 1,1, p.getWidth(), p.getHeight())
+ cs = vs.orthoBoxCS(cs,node,-100, x,y, 1,1, p.getWidth(), p.getHeight())
p.place(vs, cs)
vs.coords.activate(cs)
# draw cursor
if self.context and self.context.getAccursed() == node:
- into = jarray.zeros(3, 'f')
- vs.coords.transformPoints3(cs, [0,0,0], into)
cs = vs.orthoCS(0, 0, -100, into[0], into[1], 1, 1)
self.context.drawCursor(vs, node, cs)
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Asko Soukka, 2003/08/14
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Asko Soukka, 2003/08/14
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Asko Soukka, 2003/08/15
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py,
Asko Soukka <=
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Matti Katila, 2003/08/17
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Matti Katila, 2003/08/17
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Matti Katila, 2003/08/17
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Matti Katila, 2003/08/18
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Matti Katila, 2003/08/19
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Asko Soukka, 2003/08/22
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Asko Soukka, 2003/08/26
- [ff-cvs] fenfire/org/fenfire/view/lava mindMapView2D.py, Asko Soukka, 2003/08/27