Main Page | Modules | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

X3D scene graph API

Introduction

The X3D scene graph is the typed version of the XML DOM tree where all attributes are strings. It is the entry point of the library, an X3D file must be loaded into an X3D scene graph. Inversely, it is used to save X3D file.

It has no specific behaviour and is just a container. We present here the common interface X3DTK::X3D::X3DNode of all the node types of the X3D scene graph. Notice that X3DTK::X3D::X3DNode inherits X3DTK::X3DAbstractNode.

Special content

As the X3D scene graph is used to load and save an X3D file, it has the methods load and write, to load its attributes from strings, and to write them to a string. Here is an example:
 X3DTK::X3D::X3DNode N;
 // loads from an X3DFileElement which is a temporary structure used by the XML loader.
 X3DTK::X3DFileElement *e;
 N->load(e);
 // Writes the content of the node into a SFString.
 X3DTK::SFString content = N->write();

Nevertheless, you normally don't have to call explicitly these methods. They are called by the abstract factory X3DTK::X3DLoader and X3DTK::X3D::SceneSaver that writes the content of an X3D scene graph to an X3D file.

How to use it

A common way to use the library is to load the X3D file into an X3D scene graph, translate it into another structure that can be a GL scene graph, a MESH scene graph or a personal structure. At any time, you can save your structure to an X3D scene graph that can be saved as an X3D file.

At that moment, only the provided MESH scene graph can be translated into an X3D scene graph.


Generated on Wed Apr 7 12:15:26 2004 for X3DToolKit by doxygen 1.3.3