KWScene/Documentation/Overall Design: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
No edit summary
Line 62: Line 62:
* Factories
* Factories
** Dynamically loadable
** Dynamically loadable
= Importing KWScene in ParaView =
* Add an entrie into the "File" menu of ParaView ("Import KWScene").
** Use the [http://www.itk.org/Wiki/Plugin_HowTo 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.

Revision as of 23:16, 19 January 2010

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


This is a graph with borders and nodes. Maybe there is an Imagemap used so the nodes may be linking to some Pages.


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

  1. MRML
  2. OpenSceneGraph
  3. 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

  1. VTK
  2. ParaView
  3. 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").
  • 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.