OpenSGSceneGraphInterface Class Reference

#include <OpenSGSceneGraphInterface.h>

Inherits SceneGraphInterface.

Collaboration diagram for OpenSGSceneGraphInterface:

List of all members.


Public Member Functions

 OpenSGSceneGraphInterface ()
virtual ~OpenSGSceneGraphInterface ()
virtual bool init ()
virtual bool loadConfig (std::string configFile)
virtual void cleanup ()
virtual std::string getName ()
virtual ModelInterfaceloadModel (std::string fileType, std::string url)
virtual bool attachEnvironment (Environment *env)
virtual bool attachEntity (Entity *ent)
virtual bool attachTile (Environment *env, Tile *tle, const TransformationData &trans)
virtual bool attachModelToEntity (Entity *ent, ModelInterface *model, const TransformationData &trans)
virtual bool attachModel (ModelInterface *model, const TransformationData &trans)
virtual bool detachEnvironment (Environment *env)
virtual bool detachEntity (Entity *ent)
virtual bool detachTile (Environment *env, Tile *tle)
virtual bool detachModel (ModelInterface *model)
virtual bool rayIntersect (ModelInterface *model, gmtl::Vec3f position, gmtl::Vec3f direction, float *dist, float maxDist)
virtual void updateModel (ModelInterface *model, const TransformationData &trans)
virtual void updateEntity (Entity *ent)
virtual void updateEnvironment (Environment *env)
virtual void updateTile (Tile *tle, const TransformationData &trans)
virtual void showEnvironment (Environment *env, bool showOrHide)
virtual void showModel (ModelInterface *model, bool showOrHide)
void enableOptimizedLoading ()
void disableOptimizedLoading ()
void optimize ()
void setCameraMatrix (OSG::Matrix m)
OSG::NodePtr getNodePtr ()
OSG::NodePtr getCameraTransformationNode ()

Static Protected Member Functions

static bool isNodeInSceneGraph (OSG::NodePtr node, OSG::NodePtr root)

Protected Attributes

OSG::NodePtr rootNode
OSG::GroupPtr rootCore
OSG::NodePtr cameraNode
OSG::TransformPtr cameraCore
bool optimizedLoadingEnabled
OSG::GraphOpSeq * graphOpSeq
OSG::SharePtrGraphOp * sharePtrGraphOp

Constructor & Destructor Documentation

OSG_USING_NAMESPACE OpenSGSceneGraphInterface::OpenSGSceneGraphInterface (  ) 

OpenSGSceneGraphInterface::~OpenSGSceneGraphInterface (  )  [virtual]


Member Function Documentation

bool OpenSGSceneGraphInterface::attachEntity ( Entity ent  )  [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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::attachEnvironment ( Environment env  )  [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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::attachModel ( ModelInterface model,
const TransformationData trans 
) [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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::attachModelToEntity ( Entity ent,
ModelInterface model,
const TransformationData trans 
) [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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::attachTile ( Environment env,
Tile tle,
const TransformationData trans 
) [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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::cleanup (  )  [virtual]

Instruct the module to free all memory allocated internally.

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::detachEntity ( Entity ent  )  [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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::detachEnvironment ( Environment env  )  [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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::detachModel ( ModelInterface model  )  [virtual]

Detaches a model.

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

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::detachTile ( Environment env,
Tile tle 
) [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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::disableOptimizedLoading (  ) 

void OpenSGSceneGraphInterface::enableOptimizedLoading (  ) 

OSG::NodePtr OpenSGSceneGraphInterface::getCameraTransformationNode (  ) 

std::string OpenSGSceneGraphInterface::getName (  )  [virtual]

Return the unique name of the module.

Implements SceneGraphInterface.

OSG::NodePtr OpenSGSceneGraphInterface::getNodePtr (  ) 

bool OpenSGSceneGraphInterface::init (  )  [virtual]

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

Returns:
returns true on success and false on failure

Implements SceneGraphInterface.

bool OpenSGSceneGraphInterface::isNodeInSceneGraph ( OSG::NodePtr  node,
OSG::NodePtr  root 
) [static, protected]

bool OpenSGSceneGraphInterface::loadConfig ( std::string  configFile  )  [virtual]

Instruct the module to read its configuration from a file.

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

Implements SceneGraphInterface.

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

Loads a model from the filesystem

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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::optimize (  ) 

bool OpenSGSceneGraphInterface::rayIntersect ( ModelInterface model,
gmtl::Vec3f  position,
gmtl::Vec3f  direction,
float *  dist,
float  maxDist 
) [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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::setCameraMatrix ( OSG::Matrix  m  ) 

void OpenSGSceneGraphInterface::showEnvironment ( Environment env,
bool  showOrHide 
) [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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::showModel ( ModelInterface model,
bool  showOrHide 
) [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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::updateEntity ( Entity ent  )  [virtual]

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

Parameters:
ent entity which will be updated

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::updateEnvironment ( Environment env  )  [virtual]

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

Parameters:
env environment

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::updateModel ( ModelInterface model,
const TransformationData trans 
) [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

Implements SceneGraphInterface.

void OpenSGSceneGraphInterface::updateTile ( Tile tle,
const TransformationData trans 
) [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)

Implements SceneGraphInterface.


Member Data Documentation

OSG::TransformPtr OpenSGSceneGraphInterface::cameraCore [protected]

OSG::NodePtr OpenSGSceneGraphInterface::cameraNode [protected]

OSG::GraphOpSeq* OpenSGSceneGraphInterface::graphOpSeq [protected]

OSG::GroupPtr OpenSGSceneGraphInterface::rootCore [protected]

OSG::NodePtr OpenSGSceneGraphInterface::rootNode [protected]

OSG::SharePtrGraphOp* OpenSGSceneGraphInterface::sharePtrGraphOp [protected]


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

Generated on Wed Oct 20 16:11:59 2010 for inVRs by doxygen 1.5.8