openalea.core.world package#

Submodules#

openalea.core.world.world module#

class openalea.core.world.world.World(*args, **kw)[source]#

Bases: VPLScene, AbstractListener

Contain objects of the world.

When world changes, several events can be notified to listeners:
  • world_object_changed(world, changes)

  • world_object_replaced(world, key, old_object, new_object)

  • world_object_added(world, key, new_object)

  • world_object_removed(world, old_object)

A generic “world_changed” event is also notified for all previous changes.

Warning

currently only world_changed event is implemented

add(data, name=None, **kwargs)[source]#
Parameters:
  • transform (-) – method used to convert object before representing it

  • _repr_* (-) – define method used to convert object to a specific format (html, vtk, …)

change_object_attribute(name, attribute)[source]#
notify(sender, event=None)[source]#

This function is called by observed objects

Parameters:
  • sender – the observed object which send notification

  • event – the data associated to the notification

remove(name)[source]#
sync()[source]#
update_namespace(interpreter)[source]#
class openalea.core.world.world.WorldObject(name, data, **kwargs)[source]#

Bases: Observed

Object of the world.

WorldObject contains :
  • name : world object identifier

  • data : the object itself

  • attributes : list of (name, Interface, value)

WorldObject provides meta-information like …
  • origin

  • time required to compute object

  • visibility in scene

  • date when object has been added to scene

attribute(key)[source]#
property attributes#
clear_kwargs()[source]#
property data#
get(name, default_value=None)[source]#
property name#
notify_listeners(event=None)[source]#

Send a notification to all listeners

Parameters:

event – an object to pass to the notify function

property obj#
set_attribute(name, value, interface=None, label=None, constraints=None)[source]#
property silent#

Module contents#