vrml.protofunctions
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
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)