/[gzz]/gzz/gfx/demo/calendarvobtest.py
ViewVC logotype

Diff of /gzz/gfx/demo/calendarvobtest.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by mudyc, Sat Nov 2 20:54:48 2002 UTC revision 1.14 by mudyc, Sun Nov 3 00:09:53 2002 UTC
# Line 21  class ViewScene: Line 21  class ViewScene:
21    
22          angle = 0          angle = 0
23          if self.rotate:          if self.rotate:
24              angle = 1 * self.rotate              angle = 0.81 * self.rotate
25    
26          print "ROTATE: ", angle          print "ROTATE: ", angle
27    
28            # Coordinate systems:
29          cs_home = vs.coords.affineCoordsys(0,0,          cs_home = vs.coords.affineCoordsys(0,0,
30                                             w/2 + self.tx*self.scale,                                             w/2 + self.tx*self.scale,
31                                             h/2 + self.ty*self.scale,                                             h/2 + self.ty*self.scale,
32                                             w*self.scale, 0,0, h*self.scale)                                             w*self.scale, 0,0, h*self.scale)
33    
34          home = vs.matcher.add(cs_home, "cs_home")          #home = vs.matcher.add(cs_home, "cs_home")
35            cs_rot = vs.coords.rotateXYZ(cs_home, angle, -1, 1, 1)
36            vs.matcher.add(cs_rot, "cs_koti_rot")
37    
38            cs_text = vs.coords.affineCoordsys(0, 0, 0, 0,w*self.scale, 0,0, h*self.scale)
39            # cs_text_match = vs.matcher.add(cs_text, "cs_text"+str(i))
40            cs_text_rot = vs.coords.rotateXYZ(cs_text, angle, -1, 1, 1)
41    
         cs_rot = vs.coords.rotateXYZ(home, angle, -1, 1, 1)  
   
         rot = vs.matcher.add(cs_rot, "cs_koti_rot")  
42    
43          # these don't efect          # these don't efect
44          gzz.vob.vobs.CalendarVob.setStatics(style_date, style_n, 0.05)          gzz.vob.vobs.CalendarVob.setStatics(style_date, style_n, 0.04)
45    
46          # week number width, weekday height, month name height          # week number width, weekday height, month name height
47          gzz.vob.vobs.CalendarVob.setBounds(0.5, 0.5, 1.0)          gzz.vob.vobs.CalendarVob.setBounds(0.37, 0.5, 1.0)
48    
49          # scales: date, weeknum, weekday, month          # scales: date, weeknum, weekday, month
50          gzz.vob.vobs.CalendarVob.setScales(1.1, 0.4, 0.24, 1.3)          gzz.vob.vobs.CalendarVob.setScales(1.4, 0.5, 0.34, 1.4)
51    
52          # shift(something(x,y)): date, weeknum, weekday, month          # shift(something(x,y)): date, weeknum, weekday, month
53          gzz.vob.vobs.CalendarVob.setShifting(0.05, 0.85, 0.2, 0.1)          gzz.vob.vobs.CalendarVob.setShifting(0.37, 0.85, 0.2, 0.1)
54                    
55                
56          # annual calendar          # annual calendar
# Line 54  class ViewScene: Line 58  class ViewScene:
58              cs_cal = vs.coords.affineCoordsys(cs_rot , 0, 0 , i*9,  1.5, 0, 0, 1.15)              cs_cal = vs.coords.affineCoordsys(cs_rot , 0, 0 , i*9,  1.5, 0, 0, 1.15)
59              vs.matcher.add(cs_cal, "cs_cal"+str(i))              vs.matcher.add(cs_cal, "cs_cal"+str(i))
60    
61              cs_text = vs.coords.affineCoordsys(0, 0, 0, 0,w*self.scale, 0,0, h*self.scale)              vs.matcher.add(cs_text_rot, "cs_text_rot"+str(i))
62                vs.map.put(gzz.vob.vobs.CalendarVob(2002, i), cs_cal, cs_text_rot)
             vs.matcher.add(cs_text, "cs_text"+str(i))  
   
             vs.map.put(gzz.vob.vobs.CalendarVob(2002, i), cs_cal, cs_text)  
63    
64    
65          if 0:          if 0:
# Line 77  class ViewScene: Line 78  class ViewScene:
78          cs1 = vs.coords.affineCoordsys(0, 10, 0, 0, tscale, 0, 0, tscale)          cs1 = vs.coords.affineCoordsys(0, 10, 0, 0, tscale, 0, 0, tscale)
79          vs.matcher.add(cs1, "1")          vs.matcher.add(cs1, "1")
80          putText(vs, cs1, '  Use keys: +, -, Left, Right, Up, Down,', color=(0,0,0), h=4, y = 3)          putText(vs, cs1, '  Use keys: +, -, Left, Right, Up, Down,', color=(0,0,0), h=4, y = 3)
81          putText(vs, cs1, '       PageUp, and PageDown', color=(0,0,0), h=4, y = 6)          putText(vs, cs1, '     Z, z, PageUp, and PageDown', color=(0,0,0), h=4, y = 6)
82    
83                    
84      def key(self, k):      def key(self, k):

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26