Scene Graph Base Classes
5
The csContainer Class
csContainer objects contain data associated with scene graphs. The data in csContainer
objects is grouped into fields (csField). Fields are not accessible directly to applications.
Instead, set() and get() methods are provided to set and return field values.
Each field contains either a single value of a simple data type, such as a float, or a group
of values, all of simple data types.
As an abstract, base class, csContainer provides functionality common to all objects
containing fields, such as generic access to the fields, creating and deleting field
connections, and managing reference counts when objects are added and removed as
fields.
The csField Class
Fields contain the data of csContainer objects; data generally associated with scene
graphs. All publicly-accessible fields in classes derived from csContainer should be
derived from csField.
Fields differ from standard C++ data members. Fields are not evaluated until they are
queried. Consequently, none of the meta information (for example, the field’s name)
exists unless you ask for it.
Field Access
Fields are compact but they still allow applications complete access in two ways:
• Indirect access. Methods for field access and modification are part of each class.
Most of the time, applications access fields using these get*() and set*() functions.
• Generic access. Applications can query any container object abstractly using
getFieldInfo() on any object that inherits from csContainer. This is useful for
getting information about unknown objects and makes it possible, for example, to
create a GUI for an application.