OMK::Vis::OgreObjectScene Class Reference

OgreObjectScene loads a dotScene file into the subtree of root _sceneNode. More...

#include <OMKOgreObjectScene.h>

Inheritance diagram for OMK::Vis::OgreObjectScene:

Inheritance graph
[legend]
Collaboration diagram for OMK::Vis::OgreObjectScene:

Collaboration graph
[legend]
List of all members.

Constructors and destructor.

std::string _resourceGroupName
 name of the resource group of the geometry file
std::string _geometryFileName
 name of the geometry file
 DECLARE_VISUAL_OBJECT_FACTORY (OgreObjectScene)
 OgreObjectScene (const OgreObjectScene &vis)
 Copy constructor, private and not defined to prevent from copying.
const OgreObjectSceneoperator= (const OgreObjectScene &vis)
 Assigment operator, private and not defined to prevent from copying.
void loadConfigurationParameters (const ConfigurationParameterDescriptor *node)
 Read the configuration parameters : geometryFileName.
void loadGeometry ()
 Load the geometry using the dotSceneInterface.

Detailed Description

OgreObjectScene loads a dotScene file into the subtree of root _sceneNode.

Author:
Michaël Rouillé, bunraku <michael.rouille@irisa.fr>

Definition at line 40 of file OMKOgreObjectScene.h.


Constructor & Destructor Documentation

OMK::Vis::OgreObjectScene::OgreObjectScene ( const OgreObjectScene vis  )  [private]

Copy constructor, private and not defined to prevent from copying.


Member Function Documentation

OMK::Vis::OgreObjectScene::DECLARE_VISUAL_OBJECT_FACTORY ( OgreObjectScene   )  [private]

void OgreObjectScene::loadConfigurationParameters ( const ConfigurationParameterDescriptor node  )  [protected]

Read the configuration parameters : geometryFileName.

Definition at line 61 of file OMKOgreObjectScene.cpp.

References _geometryFileName, _resourceGroupName, OMK::Vis::debugMsg(), OMK::ParametersAccessor::get(), OMK_DEBUG_VIS, OMK_DEBUG_VIS_EXEC, and OMTRACEID.

00062 {
00063   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Loading configuration for " << debugMsg( this ) ) ; 
00064 
00065   // Retrieve the resource group name
00066   if( !ParametersAccessor::get( node, "ResourceGroup", _resourceGroupName ) )
00067   {
00068     OMTRACEID( OMK_DEBUG_VIS, "Warning for " << debugMsg( this ) << std::endl
00069                << ">>> :-| no resource group name provided, will use \"General\" by default" ) ; 
00070   }
00071 
00072   // Retrieve geometry file name
00073   if( !ParametersAccessor::get( node, "GeometryFile", _geometryFileName ) )
00074   {
00075     OMTRACEID( OMK_DEBUG_VIS, "Warning for " << debugMsg( this ) << std::endl
00076                << ">>> :-| no geometry file name provided" ) ; 
00077   }
00078 }

void OgreObjectScene::loadGeometry (  )  [protected]

Load the geometry using the dotSceneInterface.

Definition at line 84 of file OMKOgreObjectScene.cpp.

References _geometryFileName, OMK::Vis::OgreObject::_ogreVis, _resourceGroupName, OMK::Vis::OgreObject::_sceneNode, OMK::Vis::debugMsg(), OMK_DEBUG_VIS_EXEC, OMTRACEID, and OMK::Vis::OgreVis::touchRoot().

00085 {
00086   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Loading geometry of the " << debugMsg( this ) ) ; 
00087 
00088   // load the scene associated to the simulated object OgreVis
00089   Ogre::Root& root( _ogreVis.touchRoot() ) ;
00090 
00091   Singleton< Ogre::dsi::dotSceneLoader >::getInstance().load(
00092     _geometryFileName,
00093     _resourceGroupName,
00094     root.getSceneManager( "sceneManager" ),
00095     root.getAutoCreatedWindow(),
00096     &_sceneNode,
00097     false,
00098     false,
00099     true ) ;
00100 
00101   // check for load errors
00102   Ogre::dsi::dotSceneInfo::itLoadLog it( Ogre::dsi::dotSceneInfo::getSceneLoadingLog() ) ;
00103   std::string errs ;
00104   while ( it.hasMoreElements() )
00105   {
00106     errs += it.getNext() + "\n";
00107   }
00108   if ( !errs.empty() )
00109   {
00110     OMTRACEID( OMK_DEBUG_VIS_EXEC, "Warning for " << debugMsg( this ) << std::endl
00111                << ">>> :-| errors occured during scene loading" << std::endl << errs ) ;
00112   }
00113 }

const OgreObjectScene& OMK::Vis::OgreObjectScene::operator= ( const OgreObjectScene vis  )  [private]

Assigment operator, private and not defined to prevent from copying.


Member Data Documentation

std::string OMK::Vis::OgreObjectScene::_resourceGroupName [protected]

name of the resource group of the geometry file

Definition at line 61 of file OMKOgreObjectScene.h.

Referenced by loadConfigurationParameters(), and loadGeometry().

std::string OMK::Vis::OgreObjectScene::_geometryFileName [protected]

name of the geometry file

Definition at line 64 of file OMKOgreObjectScene.h.

Referenced by loadConfigurationParameters(), and loadGeometry().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:05 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007