| |
- object
-
- Event
- WeakField
- BaseField(object)
-
- Field
class Event(object) |
|
An Event-handling Port definition
The event is currently non-functional, it's just
here to allow VRML content to parse and be represented
in-memory. |
|
Methods defined here:
- __get__(self, client=None, cls=None)
- Get an event's last value
- __init__(self, name, direction=1)
- Initialise the field object
name -- string name
direction -- 0 == in, 1 == out
- __set__(self, client, value, notify=1)
- Set an event value
- __str__(self)
- Get a human-friendly representation of the event
- clone(self, name=None, direction=None)
- Clone this property
- eventVrmlstr(self, lineariser)
- Write the event's definition to the lineariser
Basically this gives you a VRML97 fragment
which can be used for creating a PROTO which
will have the equivalent of this event available.
- typeName(self)
- Get the typeName of this field
- watch(self, node, receiver, signal=_Any)
- Make receiver receive all update events for this field+node
receiver( signal, sender, value=None )
signal -- ('del',self), ('set',self) etc...
sender -- node
value -- new value set (for set values)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Field(BaseField) |
|
Property sub-class with VRML field semantics
The field basically binds a name, a dataType, and
a default value (with some other meta-data that isn't
actually used by the current implementation).
Fields are normally accessed through the protofunctions
module, which retrieves field objects from node or
prototype objects.
The field offers vrml.dispatcher notification of
changes to values (see fget, fset and fdel methods).
Which allows code to watch for those changes, a
facility you can see in the OpenGLContext.scenegraph.cache
module. |
|
- Method resolution order:
- Field
- BaseField
- object
Methods defined here:
- __init__(self, name, exposure=1, default=[])
- Initialise the field object
name -- string name
exposure -- boolean (0/1) indicating whether this is an exposed field
default -- default value for the field
- __str__(self)
- Get a human-friendly representation of the field
- copy(self, client=None, copier=None)
- Copy this property's value/definition for client node/proto
if client is a prototype, copy this field definition
for use in a new prototype.
if client is a node, and it has a set value for this
field, then returns copyValue( currentValue )
otherwise returns _NULL, a singleton object which
shouldn't turn up anywhere else.
- copyValue(self, value, copier=None)
- Copy a value for copier
- fhas(self, client)
- Determine whether the client currently has a non-default value
- fieldVrmlstr(self, lineariser)
- Write the field's definition to the lineariser
Basically this gives you a VRML97 fragment
which can be used for creating a PROTO which
will have the equivalent of this field available.
- typeName(self)
- Get the typeName of this field
- vrmlstr(self, value, lineariser)
- Convert the given value to a VRML97 representation
- watch(self, node, receiver, signal=_Any)
- Make receiver receive all update events for this field+node
receiver( signal, sender, value=None )
signal -- ('del',self), ('set',self) etc...
sender -- node
value -- new value set (for set values)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- defaultDefault = None
- nodes = 0
Methods inherited from BaseField:
- __del__(...)
- Delete our value from client's dictionary (notifies)
- __delete__(...)
- descr.__delete__(obj)
- __get__(...)
- descr.__get__(obj[, type]) -> value
- __set__(...)
- descr.__set__(obj, value)
- check(...)
- Raise ValueError if isn't correct type
- coerce(...)
- Coerce the given value to our type
- fdel(...)
- Delete with option to notify
- fget = __get__(...)
- descr.__get__(obj[, type]) -> value
- fset(...)
- Set value, with option to notify
- getDefault(...)
- Get the default value of this field
if client, set client's attribute to default
without sending a notification event.
Data descriptors inherited from BaseField:
- call_default
- defaultobj
- name
Data and other attributes inherited from BaseField:
- __new__ = <built-in method __new__ of type object at 0x7f8ea99534e0>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
- __pyx_vtable__ = <PyCObject object at 0x3084e68>
|
class WeakField(object) |
|
A Mix-in for fields which stores weak-references to values |
|
Methods defined here:
- fget(self, client)
- Get the client's value for this property
if notify is true send a notification event.
- fset(self, client, value, notify=1)
- Set the client's value for this property
if notify is true send a notification event.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |