Beispiel #1
0
 def animate(self,lstring = None, nbsteps = 1, dt = 0.1):
     from openalea.plantgl.all import Sequencer
     s = Sequencer(dt)
     clstring = lstring
     for i in xrange(nbsteps):
         clstring = self.derive(clstring)
         self.plot(clstring)
         s.touch()
Beispiel #2
0
 def animate(self, lstring=None, nbsteps=1, dt=0.1):
     from openalea.plantgl.all import Sequencer
     s = Sequencer(dt)
     clstring = lstring
     for i in xrange(nbsteps):
         clstring = self.derive(clstring)
         self.plot(clstring)
         s.touch()
Beispiel #3
0
    def animate(self, nbiter=1, dt=0.1):
        from openalea.plantgl.all import Sequencer

        s = Sequencer(dt)
        self.init()
        self.plot()
        s.touch()
        for i in xrange(nbiter):
            self.iterate()
            self.plot()
            s.touch()
        if self.__dict__.has_key("end"):
            self.end(self.currentmtg)
        return self.currentmtg
Beispiel #4
0
 def animate(self, nbiter=1, dt=0.1):
     from openalea.plantgl.all import Sequencer
     s = Sequencer(dt)
     self.init()
     self.plot()
     s.touch()
     for i in xrange(nbiter):
         self.iterate()
         self.plot()
         s.touch()
     if self.__dict__.has_key('end'): self.end(self.currentmtg)
     return self.currentmtg
Beispiel #5
0
def xs_lpydisplay_hook(processname, scale = 1, delay = 0.02):
    """ Generate a hook to display the lpy simulation from process given by processname """
    import pgljupyter
    from IPython.display import display
    from xsimlab.monitoring import ProgressBar
    from openalea.plantgl.all import Sequencer

    view = pgljupyter.SceneWidget()
    display(view)
    s = Sequencer(delay)

    @xs.runtime_hook('run_step')
    def hook(model, context, state):
        s.touch()
        view.set_scenes([state[('devel', 'lscene')]], scales=scale)


    return [hook, ProgressBar()]