The Inventor scene database consists of information representing one or more 3D scenes. This database, SoDB, can contain several scene graphs, as shown in An Inventor Database . Each scene graph consists of a related set of 3D objects and attributes. In An Inventor Database , for example, the scene graphs might represent a car, a small house, another car, a large house, and a person.
You can perform two basic operations, or methods, directly on the scene database. First, you initialize it:
C++ :
This must be the first Inventor call you make. If you use the Inventor Component Library, the database is initialized automatically when you call SoXt::init() (see Open Inventor Component Library). If you are not using components, but you are using interaction or node kits, or both, call SoInteraction::init(), which initializes the database, interaction, and node kits.
Second, you can read from a file into the scene database, which adds new scene graphs to it:
C++ :
C# :
Java :
or
C++ :
C# :
Java :
Using the first syntax, Inventor reads all graphs from a file specified by in and returns a pointer to a separator that contains the root nodes of all the scene graphs in the file. Using the second syntax, Inventor reads from a file specified by in and returns a pointer to the resulting root node (rootNode). Using the third syntax, Inventor reads a file specified by in and returns a pointer to the resulting path (path). (See Paths.) If an error occurs, the methods return FALSE. (Also see Importing data for more information on SoInput.)