Core Scene Graph Data Structures in C++
The Virtual Reality Modeling Language (VRML’97) is the International Standard ISO/IEC 14772-1:1997. The VRML2 Cheat Sheet is a summary of all the VRML'97 nodes. The Core Scene Graph Data Structures, as implemented in the DGP2023 application, is an implementation of a minimal subset of the VRML'97 Standard.
A scene graph is a tree structure, which comprises a hierarchy of nodes, linked by relative geometric transformations between children and parents. The geometry information is stored in the leave nodes of the tree. This page describes how the scene graph data structures are implemented in the DGP2023 application.
The Node C++ class is the base class for all the scene graph nodes. This is an abstract class which does not correspond to any VRML node, but it is used to store information common to all the nodes. The DGP2023 Core Scene Graph Data Structures comprises the following classes, which are subclasses of Node: Group, Transform, SceneGraph, Shape, Appearance, Material, PixelTexture, ImageTexture, IndexedFaceSet, and IndexedLineSet. The following page describes the Node class:
The Node class
The DGP2023 Core Scene Graph Data Structures also comprises various data types used as node field values. In addition to int, float, bool, vector<int>, and vector<float>, the following page describes the these base classes:
Base Data Types
The DGP2023 scene graph is a tree structure which can be changed dynamically, and may contain an arbitrary number of Shape nodes as leaves. The Group and Transform nodes allow for grouping and for relative positioning and orientation of branches with respect to their parents in the tree. A single SceneGraph node is used to represent the root of the tree structure. The following page describes the Group, Transform, and SceneGraph nodes.
The Group nodes
The Group node and all its subclasses constitute the parent nodes of the scene graph tree structure. At the leaves of the tree structure we have Shape nodes. In addition to Group nodes and the Group subclasses, Shape nodes are also allowed to be children of the Group nodes. No other node type is allowed to be a child of a Group node. The following page describes the Shape node:
The Shape node
As defined in the VRML'97 Standard, a Shape node has two fields, appearance, and geometry, and both fields may contain NULL pointers. If not NULL, the appearance node is only allowed to have a pointer to an Appearance node as value.
The following page describes the Appearance node.
The Appearance node
In the DGP2023 implementation an Appearance node has two fields, material, and texture, and both fields may contain NULL pointers. If not NULL, the material field of an Appearance node is only allowed to have a pointer to a Material node as value. If not NULL, the texture node is only allowed to have a pointer to an ImageTexture node as value.
The following page describes the Material node.
The Material node
The following page describe the PixelTexture and the ImageTexture nodes.
The Texture nodes
In the DGP2023 implementation, if not NULL, the geometry field of a Shape node is only allowed to have a pointer to an IndexedFaceSet node or an IndexedLineSet as value.
The following page describes the IndexedFaceSet node.
The IndexedFaceSet node
The following page describes the IndexedLineSet node.