OMK::Inp::SceneDetailsExtension Class Reference
[User inputs]

Input listener to control the detail level of the objects in the scene. More...

#include <OMKSceneDetailsExtension.h>

Inheritance diagram for OMK::Inp::SceneDetailsExtension:

Inheritance graph
[legend]
Collaboration diagram for OMK::Inp::SceneDetailsExtension:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

virtual void action ()
 The overwritten method.

Protected Attributes

Ogre::Camera * _camera
 The camera to update.
int _sceneDetailIndex
 The level of details.

Private Member Functions

 DECLARE_EXTENSION_FACTORY (SceneDetailsExtension)
 Factory and constructor/destructor.

Detailed Description

Input listener to control the detail level of the objects in the scene.

Date:
2007-03-14
Author:
Benoît Chanclou
Defines a extension which switches between display modes of a visualisation object. The level of details are: This extension must be used as an extension of the OgreVis object. The creation is done dynamically through the following configuration:
visualisation
{
  Class OgreVis
  ...
  Extensions
  {
    sceneDetails
    {
      Class SceneDetails
      Key f3 // the default is "B"
      VisuName visualisation // the default is "visualisation" needed to create the key listener
    }
    ...
  }
}
 *

There is two ways to change the display of the details.

Definition at line 56 of file OMKSceneDetailsExtension.h.


Member Function Documentation

OMK::Inp::SceneDetailsExtension::DECLARE_EXTENSION_FACTORY ( SceneDetailsExtension   )  [private]

Factory and constructor/destructor.

See Extension feature

void OMK::Inp::SceneDetailsExtension::action (  )  [protected, virtual]

The overwritten method.

Switches the details level.

Reimplemented from OMK::Inp::GenericKeyExtension< OMK::Vis::OgreVis >.

Definition at line 27 of file OMKSceneDetailsExtension.cpp.

References _camera, OMK::ExtensionT< OMK::Vis::OgreVis >::_owner, _sceneDetailIndex, and OMK::Vis::OgreVis::touchRoot().

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 }


Member Data Documentation

Ogre::Camera* OMK::Inp::SceneDetailsExtension::_camera [protected]

The camera to update.

It is retrieved by dynamically casting the owner of the extension in setTheOwner method.

Definition at line 66 of file OMKSceneDetailsExtension.h.

Referenced by action().

int OMK::Inp::SceneDetailsExtension::_sceneDetailIndex [protected]

The level of details.

Definition at line 71 of file OMKSceneDetailsExtension.h.

Referenced by action().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007