| | |
- Node(object)
-
- SceneGraph(Traversable, Node)
- Traversable(object)
-
- SceneGraph(Traversable, Node)
class SceneGraph(Traversable, Node) |
| |
A VRML 97 sceneGraph
Attributes:
__gi__ -- constant string "sceneGraph"
DEF -- constant string ""
children -- Node list
List of the root children of the sceneGraph, nodes/scripts only
routes -- ROUTE list
List of the routes within the sceneGraph
defNames -- string DEFName: Node node
Mapping of DEF names to their respective nodes
protoTypes -- Namespace prototypes
Namespace (with chaining lookup) collection of prototypes
getattr( sceneGraph.protoTypes, 'nodeGI' ) retrieves a prototype |
| |
- Method resolution order:
- SceneGraph
- Traversable
- Node
- object
Methods defined here:
- __init__(self, root=None, protoTypes=None, routes=None, defNames=None, children=None, *args, **namedargs)
- root -- sceneGraph root or Dictionary root or Module root or None
Base object for root of protoType namespace hierarchy
protoTypes -- string nodeGI: Prototype PROTO
Dictionary of prototype definitions
routes -- ROUTE list or (string sourcenode, string sourceeventOut, string destinationnode, string destinationeventOut) list
List of route objects or tuples to be added to the sceneGraph
see attribute routes
defNames -- string DEFName: Node node
see attribute defNames
children -- Node list
see attribute children
- addProto(self, proto)
- Register a Prototype for this sceneGraph
proto -- Prototype PROTO
- addRoute(self, route, *args)
- Add a route to the scenegraph
route,args -- Possible forms:
ROUTE object -- added to routes
((source)node,field,(destination)node,field) -- ROUTE
created, nodes may be strings, in which case
getDEF( node ) is called for each
((source)node,field,target( signal, sender, value )) --
field.watch( target ) is called for the source
node (which can be a DEF name).
- copy(self, copier=None)
- Copy this node for copier
- getDEF(self, name)
- Get a node by DEF name
- getProto(self, name)
- Get a prototype by name
go up the scenegraph chain to try to resolve
- regDefName(self, defName, object)
- Register a DEF name for a particular object
defName -- string DEFName
object -- Node node
Eliminates previous references to the object by
its current DEFName and sets the object's new
DEFName.
Data descriptors defined here:
- baseURI
- exposedField SFString baseURI
- children
- exposedField MFNode children <class 'vrml.olist.O
- routes
- exposedField MFRoute routes <class 'vrml.olist.O
Data and other attributes defined here:
- PROTO = 'sceneGraph'
Data descriptors inherited from Traversable:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from Node:
- __repr__(self)
- Get a code-like representation of the Node
Basically every attribute except for sub-nodes values
are returned as a full representation.
- __str__(self)
- Get a friendly representation of the Node
- toString(self, **namedargs)
- Generate a VRML 97-syntax string representing this Prototype
**namedargs -- key:value
passed arguments for the linearisation object
see lineariser4.Lineariser
Data descriptors inherited from Node:
- DEF
- exposedField SFString DEF
- externalURL
- exposedField MFString externalURL []
- rootSceneGraph
- exposedField RootScenegraphNode SFNode NULL
| |