OMKSceneDetailsExtension.cpp

Go to the documentation of this file.
00001 #include "OMKSceneDetailsExtension.h"
00002 #include "OMKOgreVis.h"
00003 #include "dotSceneInterface.h"
00004 //-------------------------------------------------------------------------
00005 #ifdef _USE_DOT_OCTREE
00006         #include "DotSceneManager.h"
00007 #endif
00008 //-------------------------------------------------------------------------
00009 namespace OMK
00010 {
00011   namespace Inp
00012   {
00013 //-------------------------------------------------------------------------
00014 REGISTER_EXTENSION_FACTORY( SceneDetailsExtension, "SceneDetails" ) ;
00015 //-------------------------------------------------------------------------
00016 SceneDetailsExtension::SceneDetailsExtension( ExtensibleSimulatedObject* owner, const Name& id, bool registerExtension )
00017 : GenericKeyExtension< OMK::Vis::OgreVis >( owner, id, registerExtension, "R" ),
00018   _camera( 0 ),
00019   _sceneDetailIndex( 0 )
00020 {
00021 }
00022 //-------------------------------------------------------------------------
00023 SceneDetailsExtension::~SceneDetailsExtension()
00024 {
00025 }
00026 //-------------------------------------------------------------------------
00027 void SceneDetailsExtension::action() 
00028 {
00029   static Ogre::PolygonMode mode[] = { Ogre::PM_SOLID, Ogre::PM_WIREFRAME, Ogre::PM_POINTS } ;
00030 
00031   _sceneDetailIndex = ( 2 == _sceneDetailIndex ) ? 0 :( _sceneDetailIndex + 1 ) ;
00032   
00033   _camera = _camera ? _camera : ( _owner 
00034         && _owner->touchRoot().getAutoCreatedWindow() 
00035         && _owner->touchRoot().getAutoCreatedWindow()->getViewport( 0 ) ? 
00036         _owner->touchRoot().getAutoCreatedWindow()->getViewport( 0 )->getCamera() : 0 ) ;
00037   if( _camera ) _camera->setPolygonMode( mode[ _sceneDetailIndex ] ) ; 
00038 }
00039 //-------------------------------------------------------------------------
00040   }
00041 }
00042 

logo OpenMask

Documentation generated on Mon Jun 9 11:45:57 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007