vrml.field
index
p:\vrml\field.py

property sub-class providing VRML field semantics

 
Modules
            
vrml.dispatcher
vrml.protonamespace
weakref
 
Classes
            
object
Event
WeakField
property(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:
__init__(self, name, direction=1)
Initialise the field object
 
name -- string name
direction -- 0 == in, 1 == out
__str__(self)
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

Data and non-method functions defined here:
__dict__ = <dict-proxy object at 0x07643C20>
__doc__ = 'An Event-handling Port definition\n\n\tThe event is...content to parse and be represented\n\tin-memory.\n\t'
__module__ = 'vrml.field'
__weakref__ = <member '__weakref__' of 'Event' objects>

Methods inherited from object:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
helper for pickle
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Data and non-method functions inherited from object:
__class__ = <type 'type'>
__new__ = <built-in method __new__ of type object at 0x1E0BD978>
T.__new__(S, ...) -> a new object with type S, a subtype of T
 
class Field(property)
      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
property
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)
check(self, value)
Raise ValueError if isn't correct type
coerce(self, value)
Coerce the given value to our type
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
fdel(self, client, notify=1)
Delete the client's value for this property
 
if notify is true send a notification event.
fget(self, client)
Get the client's value for this property
 
if notify is true send a notification event.
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.
fset(self, client, value, notify=1)
Set the client's value for this property
 
if notify is true send a notification event.
getDefault(self, client=None)
Get the default value of this field
 
if client, set client's attribute to default
without sending a notification event.
typeName(self)
Get the typeName of this field
vrmlstr(self, value, lineariser)
Convert the given value to a VRML97 representation

Data and non-method functions defined here:
__dict__ = <dict-proxy object at 0x076836A0>
__doc__ = 'Property sub-class with VRML field semantics\n\n\tT... in the OpenGLContext.scenegraph.cache\n\tmodule.\n\t'
__module__ = 'vrml.field'
__weakref__ = <member '__weakref__' of 'Field' objects>
defaultDefault = None
nodes = 0

Methods inherited from property:
__delete__(...)
descr.__delete__(obj)
__get__(...)
descr.__get__(obj[, type]) -> value
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__set__(...)
descr.__set__(obj, value)

Data and non-method functions inherited from property:
__new__ = <built-in method __new__ of type object at 0x1E09F220>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from object:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
helper for pickle
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Data and non-method functions inherited from object:
__class__ = <type 'type'>
 
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 and non-method functions defined here:
__dict__ = <dict-proxy object at 0x07643C20>
__doc__ = 'A Mix-in for fields which stores weak-references to values'
__module__ = 'vrml.field'
__weakref__ = <member '__weakref__' of 'WeakField' objects>

Methods inherited from object:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
__reduce__(...)
helper for pickle
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__str__(...)
x.__str__() <==> str(x)

Data and non-method functions inherited from object:
__class__ = <type 'type'>
__new__ = <built-in method __new__ of type object at 0x1E0BD978>
T.__new__(S, ...) -> a new object with type S, a subtype of T
 
Functions
            
newEvent(name, dataType, direction=1)
Create a new event object (a specialised Field)
name -- string name
dataType -- 
direction -- 0 == in, 1 == out
newField(name, dataType, exposure=1, default=[])
Create a new field with support for using strings to specify type
 
name -- string name
dataType -- string (or Field sub-class) specifying datatype
exposure -- boolean (0/1) indicating whether this is an exposed field
default -- default value for the field
register(cls)
Register a new Field or Event class
typeName(cls)
Get the name of a field/event
 
Data
             NUMERIC_TYPES = (<type 'int'>, <type 'float'>, <type 'long'>)
SEQUENCE_TYPES = (<type 'tuple'>, <type 'list'>)
_NULL = []
baseEventTypes = {'MFString': <class 'vrml.fieldtypes.MFStringEvt...32Evt'>, 'SFNode': <class 'vrml.node.SFNodeEvt'>}
baseFieldTypes = {'MFString': <class 'vrml.fieldtypes.MFString'>,....SFInt32'>, 'SFNode': <class 'vrml.node.SFNode'>}
fieldaccel = None