All geometry data sent to the NuGraf Toolkit is handled by the 'Hierarchical
Database Manager'. This manager controls all storage and retrieval of raw geometry,
objects, instances, their hierarchy, lights, cameras, materials and textures.
The basis of NuGraf's geometry sub-system is that of 'object instancing and linking'. All
raw primitive geometry (meshed polygons, NURB patches, etc.) are first stored inside a
conceptual shell called an 'object definition'. Once an object definition has
been created it can be placed into the scene one or more times by creating 'instances'
of it. An instance is basically a reference to the object definition but without the
duplication of the object's primitive data. The benefits of this object/instance system is
that multiple instances of the same object do not require multiple copies of the raw
geometry to be stored in memory. Once the instances have been defined the hierarchical
database manager allows them to be linked together in a hierarchical manner (in a directed-acyclic-graph).
This hierarchical linking capability is illustrated by the following diagram in which
three instances have been connected together to form the linked parts of a human leg. The
circles are the object definitions, the rectangles are the instances and the slanted
rectangles are 'null instances' or empty nodes. One linked together, transformations can
be applied to any node in the hierarchy tree for hierarchical object manipulation. In
addition, the database manager provides methods to propagate attributes down the tree from
a parent, such as a material definition or the 'hidden' flag.
Complete control is provided for interacting with a hierarchy tree.
This includes the vital 'Hierarchy Tree Walker' algorithm that allows the tree to be
walked and all node attributes to be returned to the host program (this mechanism is used
by NuGraf's "Selector Window" control). Additional controls
include 'tree searching' algorithms and the ability to render only a sub-set of the tree.