/[fenfire]/fenfire/org/fenfire/demo/buoyoing.py
ViewVC logotype

Diff of /fenfire/org/fenfire/demo/buoyoing.py

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

revision 1.90 by mudyc, Mon Jul 14 14:08:40 2003 UTC revision 1.91 by jvk, Mon Jul 14 15:16:12 2003 UTC
# Line 364  class DoubleGeometer: Line 364  class DoubleGeometer:
364          return 1          return 1
365    
366    
367    class SingleGeometer(DoubleGeometer):
368        def __init__(self, mgr, context, nodeview):
369            DoubleGeometer.__init__(self, mgr, context, nodeview)
370    
371        def _doset(self, vs):
372            w,h = vs.size.width, vs.size.height
373    
374            w0 = w*3/4
375            h0 = h - 40
376            s0 = 1
377    
378            ctrx = w/2
379    
380            buoywidth0 = w0 * 1.2
381            buoyheight0 = h0 * 1.2
382    
383            if (dbg): pa("SET SINGLE ", h0, w0, s0, buoywidth0)
384    
385            vs.coords.setOrthoBoxParams(self.into1, 1,
386                          ctrx - .5*w0*s0,
387                          20,
388                          s0, s0,
389                          w0, h0)
390    
391            vs.coords.setOrthoBoxParams(self.buoyinto1, 1,
392                          ctrx - .5*buoywidth0, 0 +  .5*h0 - .5*buoyheight0,
393                          s0, s0,
394                          buoywidth0/s0, buoyheight0/s0)
395    
396        def place(self, vs):
397            self.height = vs.size.height
398            self.width = vs.size.width
399            self.into1 = vs.orthoBoxCS(0, "FocusFrame1", 0, 0, 0, 0, 0, 0, 0)
400            self.buoyinto1 = vs.orthoBoxCS(0, "BuoyFrame1", 0, 0, 0, 0, 0, 0, 0)
401    
402            self._doset(vs)
403    
404            return [(self.into1, self.buoyinto1)]
405    
406    
407    
408  class Scene(vob.buoy.buoymanager.MultiBuoyManager):  class Scene(vob.buoy.buoymanager.MultiBuoyManager):
409      def __init__(self):      def __init__(self, single = 0):
410          vob.buoy.buoymanager.MultiBuoyManager.__init__(self,          self.single = single
411            if single:
412                vob.buoy.buoymanager.MultiBuoyManager.__init__(self,
413                    [mainNode], [ppconnector, tconnector],
414                    SingleGeometer(self, context, nodeview),
415                    context=context)
416            else:
417                vob.buoy.buoymanager.MultiBuoyManager.__init__(self,
418                  [mainNode, mainNode2], [ppconnector, tconnector],                  [mainNode, mainNode2], [ppconnector, tconnector],
419                  DoubleGeometer(self, context, nodeview),                  DoubleGeometer(self, context, nodeview),
420                  context=context)                  context=context)
421                
422          w.setCursor('default')          w.setCursor('default')
423    
424  currentScene = Scene()  currentScene = Scene()
# Line 430  def globalkey(k): Line 479  def globalkey(k):
479          saveanim.saveframe("/tmp/buoyframeWithHand.png", w)          saveanim.saveframe("/tmp/buoyframeWithHand.png", w)
480                    
481      if k == "Ctrl-S":      if k == "Ctrl-S":
482          screenshots()          global currentScene
483            currentScene = Scene(1 - currentScene.single)
484            vob.AbstractUpdateManager.chg()
485            
486      if k == "Ctrl-PrinT":      if k == "Ctrl-PrinT":
487          screenshots()          screenshots()
488  #    if k == "Ctrl-B":  #    if k == "Ctrl-B":

Legend:
Removed from v.1.90  
changed lines
  Added in v.1.91

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