KWScene/Documentation/Overall Design
The purpose of KWScene is to serve as a translator between scene file formats and specific libraries that can manage the concept of a scene graph.
Given that the capabilities of different file formats and different libraries will not have a one-to-one correspondence, necessarily not all of the information contained in a given scene file may end up being converted to the destination library.
The overall design of KWScene involves three large units
- Input/Output
- Scene Graph internal representation
- Generators for other libraries
Input / Output
The IO classes will be responsible for reading scene graph representations from file formats commonly used in the community. In particular we will focus on
- MRML
- OpenSceneGraph
- Blender
In that order of priorities.
The IO classes will read the scene elements from a file and will convert them to the internal representation of the KWScene library.
The IO classes will be implemented in a modular design that will make very easy to add support for additional file formats in the future.
Internal Representation
The internal representation of the scene graph will use a typical tree structure in which nodes will be attached to parent nodes and their relative positions will be described by transforms
Generators
Generator classes will parse the internal representation of the scene graph and convert it to the appropriate classes of a destination library.
We will provide generators for the following libraries / applications
- VTK
- ParaView
- ITK
Generators will follow a modular design to make very easy to add new destination libraries in the future.
Design Features
The library will use the following techniques
- Smart Pointers
- Factories
- Dynamically loadable
Importing KWScene in ParaView
- Add an entrie into the "File" menu of ParaView ("Import KWScene").
- Use the plugin mechanism of ParaView,
- Selecting "Import KWScene", brings a dialog to select a scene file (*.mrml, ...)
- Instantiate a KWScene with a the filename
- Query KWScene for the number of objects
- For each object, get its filename and instantiate a ParaView Reader on the filename.
- Query KWScene for the transforms associated to each object. Set the transform to the ParaView Representation of the object.