SceneGraphInterface Class Reference

#include <SceneGraphInterface.h>

Inherits ModuleInterface.

Inherited by OpenSGSceneGraphInterface.

Collaboration diagram for SceneGraphInterface:

List of all members.


Public Member Functions

 SceneGraphInterface ()
virtual ~SceneGraphInterface ()
virtual bool init ()=0
virtual bool loadConfig (std::string configFile)=0
virtual void cleanup ()=0
virtual std::string getName ()=0
virtual EventcreateSyncEvent ()
virtual ModelInterfaceloadModel (std::string fileType, std::string url)=0
virtual bool attachEnvironment (Environment *env)=0
virtual bool attachEntity (Entity *ent)=0
virtual bool attachTile (Environment *env, Tile *tle, const TransformationData &trans)=0
virtual bool attachModel (ModelInterface *model, const TransformationData &trans)=0
virtual bool attachModelToEntity (Entity *ent, ModelInterface *model, const TransformationData &trans)=0
virtual bool detachEnvironment (Environment *env)=0
virtual bool detachEntity (Entity *ent)=0
virtual bool detachTile (Environment *env, Tile *tle)=0
virtual bool detachModel (ModelInterface *model)=0
virtual bool rayIntersect (ModelInterface *model, gmtl::Vec3f position, gmtl::Vec3f direction, float *dist, float maxDist)=0
virtual void updateModel (ModelInterface *model, const TransformationData &trans)=0
virtual void updateEntity (Entity *ent)=0
virtual void updateEnvironment (Environment *env)=0
virtual void updateTile (Tile *tle, const TransformationData &trans)=0
virtual void showEnvironment (Environment *env, bool showOrHide)=0
virtual void showModel (ModelInterface *model, bool showOrHide)=0

Constructor & Destructor Documentation

SceneGraphInterface::SceneGraphInterface (  ) 

SceneGraphInterface::~SceneGraphInterface (  )  [virtual]


Member Function Documentation

virtual bool SceneGraphInterface::attachEntity ( Entity ent  )  [pure virtual]

Attaches an entity (more precisely its model) to the environment it resides on. This is not necessarily the environment identified by the environment id of the entity. The environment must be attached already.

Parameters:
ent entity which should be attached
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::attachEnvironment ( Environment env  )  [pure virtual]

Attaches an environment to the scene graph. Entities and tiles can only be attached to environments which in turn have been attached already

Parameters:
env environment which should be attached.
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::attachModel ( ModelInterface model,
const TransformationData trans 
) [pure virtual]

Attaches a model. The model is not attached to a specific environment but directly to the root of the scene graph. Additionally it can undergo a transformation which doesn't affect any other instances created via clone()

Parameters:
model model which should be attached
trans additional transformation applied to the model (after the modeltransformation)
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::attachModelToEntity ( Entity ent,
ModelInterface model,
const TransformationData trans 
) [pure virtual]

Attaches a model to an entity.

Parameters:
ent entity the model is attached to (must be already attached to the scenegraph)
model model which should be attached
trans transformation relative to the entity the model is attached to
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::attachTile ( Environment env,
Tile tle,
const TransformationData trans 
) [pure virtual]

Attaches te model of a tile to scene graph.

Parameters:
env the environment the tile is attached to. Must be in the scene graph already
tle the tile whos model should be attached
trans the transformation of the tile (necessary because the tile itself doesn't know where it is located within the environmet)
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::cleanup (  )  [pure virtual]

Instruct the module to free all memory allocated internally.

Reimplemented from ModuleInterface.

Implemented in OpenSGSceneGraphInterface.

virtual Event* SceneGraphInterface::createSyncEvent (  )  [inline, virtual]

Todo:
write doku

Reimplemented from ModuleInterface.

virtual bool SceneGraphInterface::detachEntity ( Entity ent  )  [pure virtual]

Detaches an entity. This only affects the visual representation of the entity.

Parameters:
ent entity which should be detached
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::detachEnvironment ( Environment env  )  [pure virtual]

Detaches an environment form the scene graph. The environment must not contain any attached tiles or entities.

Parameters:
env environment which should be detached from the scene graph
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::detachModel ( ModelInterface model  )  [pure virtual]

Detaches a model.

Parameters:
model model which should be detached
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::detachTile ( Environment env,
Tile tle 
) [pure virtual]

Detaches a tile from a environment

Parameters:
env environment where the tle is attached to
tle tile which should be detached
Returns:
true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual std::string SceneGraphInterface::getName (  )  [pure virtual]

Return the unique name of the module.

Implements ModuleInterface.

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::init (  )  [pure virtual]

Must be invoked before any of the other methods can be called

Returns:
returns true on success and false on failure

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::loadConfig ( std::string  configFile  )  [pure virtual]

Instruct the module to read its configuration from a file.

Returns:
true on success.
Parameters:
configFile path of the XML-file.

Implements ModuleInterface.

Implemented in OpenSGSceneGraphInterface.

virtual ModelInterface* SceneGraphInterface::loadModel ( std::string  fileType,
std::string  url 
) [pure virtual]

Loads a model from the filesystem

Parameters:
url complete path pointing to the modelfile
Returns:
returns the newly created instance

Implemented in OpenSGSceneGraphInterface.

virtual bool SceneGraphInterface::rayIntersect ( ModelInterface model,
gmtl::Vec3f  position,
gmtl::Vec3f  direction,
float *  dist,
float  maxDist 
) [pure virtual]

Intersects a model (also considering the modeltransformation) with a ray given by position and direction

Parameters:
position in model space
direction in model space
dist position + dist*direction is the intersection point
Returns:
returns true if model is hit by the ray within maxDist

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::showEnvironment ( Environment env,
bool  showOrHide 
) [pure virtual]

Shows or hides an environment and all objects which are attached to it.

Parameters:
env environment which should become either visible or invisible
showOrHide if set to true the env will be shown and vice versa

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::showModel ( ModelInterface model,
bool  showOrHide 
) [pure virtual]

Shows or hides a model

Parameters:
model model whos visibility state is being set
showOrHide if set to true the env will be shown and vice versa

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::updateEntity ( Entity ent  )  [pure virtual]

Updates the transformation of the model of the entity relative to its environment

Parameters:
ent entity which will be updated

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::updateEnvironment ( Environment env  )  [pure virtual]

Adjusts the scene graph such that it matches again to the transformation of the environment relative to the world

Parameters:
env environment

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::updateModel ( ModelInterface model,
const TransformationData trans 
) [pure virtual]

Sets the transformation of the model in the scene graph (applied after the modeltransformation) to trans

Parameters:
trans the new transformation of the model

Implemented in OpenSGSceneGraphInterface.

virtual void SceneGraphInterface::updateTile ( Tile tle,
const TransformationData trans 
) [pure virtual]

Sets the transformation of the model belonging to a tile relative to its environment to trans

Parameters:
tile tile in the scene graph
trans new transformation of the model of the tile (applied after the modeltransformation)

Implemented in OpenSGSceneGraphInterface.


The documentation for this class was generated from the following files:

Generated on Wed Oct 20 16:12:00 2010 for inVRs by doxygen 1.5.8