vrml.protofunctions
index
/home/mcfletch/pylive/vrml/protofunctions.py

Functions for manipulating prototypes (node classes)
 
Prototypes are implemented as classes, and so are
available from every instance node, but we often
want to be able to manipulate the classes themselves
without needing lots of class-methods
 
The protofunctions module allows us to abstract the
actual implementation of the prototype away.  If we
at some point want to create a real "prototype" class,
we could do so with most changes confined to this
module.

 
Functions
       
_getcls(cls)
Utility function returns class when passed instance or class
addField(cls, field)
Add a particular field/event to the class/prototype definition
 
At present this just calls setattr(cls,field.name,field)
builtin(cls)
Return whether the class is "built-in" to the system
defName(obj, value=None, *args, **named)
Get/set the VRML97 defName for the object
delExternalURL(cls)
Delete the externproto URL associated with a prototype
delSceneGraph(cls)
Delete the scenegraph associated with a prototype
getExternalURL(cls)
Get the externproto URL associated with a prototype (or [])
getField(cls, field)
Get a field/event object for the given name
 
field -- a field-name specifier, which may be any of
    the following, (with the various options checked in
    order, so that earlier options will take
    precedence over later options):
    
    * the exact name of the field/demand as specified
        in the class's namespace (fastest and first
        checked)
    * the "storage" name of a field, that is, the "name"
        attribute of a field where that name does not
        match the previous definition (commonly seen in
        non-standard fields on VRML97 standard nodes)
    * the "storage" name of an event
    * a pseudo-event with the prefix "set_" or the
        suffix "_changed", which will return the
        associated field/event as if the suffix were
        not present (does a recursive call with the
        truncated name)
getFields(cls, events=0)
Get all fields of the definition/prototype
 
if events is true, then return events
instead of fields.
getPrototype(cls)
Return the prototype for the node or class
returns either the argument (if it is a proto)
or the prototype of the argument
getSceneGraph(cls)
Get the scenegraph associated with a prototype (or None)
name(obj, value=None, *args, **named)
Get/set prototype name for prototypes, DEF name for nodes
protoName(obj, value=None, *args, **named)
Get/set the prototype name for the object
removeField(cls, field)
Remove a particular field/event to the class/prototype definition
 
If field is a string, calls delattr(cls,field) for the class
otherwise calls delattr( cls, field.name )
root(obj, value=None, *args, **named)
Get/set root-node reference for nodes/protos
setExternalURL(cls, url)
Set the externproto URL associated with a prototype
setSceneGraph(cls, sg)
Set the scenegraph associated with a prototype

 
Data
        __file__ = '/home/mcfletch/pylive/vrml/protofunctions.pyc'
__name__ = 'vrml.protofunctions'
__package__ = 'vrml'