Home | Download/Install | Documentation | Packages | Screenshots | News | Forum/Mailing-lists | Contact | GForge

User Documentation

Predefined commands

Here comes the python commands that control the simulation.

The following commands can be redefined to initialize simulation state
def Start() is called at the beginning of the simulation.
def End() is called at the end of the simulation.
def StartEach() is called before each derivation step.
def EndEach([lstring,scene]) is called at the end of the simulation. One or two arguments can be optionally defined to receive the current lstring and its geometric interpretation.
Python commands that control the rule application
forward() Next iteration will be done in forward direction.
backward() Next iteration will be done in backward direction.
isForward() Test whether direction is forward.
getIterationNb() Return the id of the current iteration.
useGroup(int) Next iteration will use rules of given group and default 0 group.
getGroup() Gives which group will be used.
These commands have been added to the original cpfg-lpfg specification
context() Get context of execution of the L-system. To use with care.
The following objects and commands are also accessible from within the lpy shell
lstring contains the last computed lsystem string of the current simulation.
lsystem reference to the internal lsystem object representing the current simulation.
window reference to lpy widget object.
clear() to clear the shell.

All these functions are imported from openalea.lpy module. Other data structures and functionnalities are available in the module. You can check them with help(openalea.lpy).

System commands
registerPglPlotFunction register a new function to use to plot resulting PlantGL scene (usefull to use custom 3D viewer)
registerGetSelectionFunction register a new function to use to get selection from the viewer
cleanPglPlotFunction reuse default plantgl viewer
cleanGetSelectionFunction reuse default plantgl viewer selection
 
packages/vplants/lpy/doc/commands.txt · Last modified: 2008/09/11 17:23 by user   Back to top
INRIA   INRA     CIRAD     AGROPOLIS IBC
INRIA GForge RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki