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

Input listener to show overlay information information. More...

#include <OMKOverlayExtension.h>

Inheritance diagram for OMK::Inp::OverlayExtension:

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

Collaboration graph
[legend]
List of all members.

Protected Member Functions

void action ()
 Show/Hide Overlay.
virtual bool loadExtensionParameters (const ConfigurationParameterDescriptor *node)
 Configuration parameters loader of Extension.
virtual void preComputeParameters ()
 Init Overlay.

Protected Attributes

Ogre::Overlay * _overlay
bool _show
bool _init
std::string _overlayName

Private Member Functions

 DECLARE_EXTENSION_FACTORY (OverlayExtension)
 Factory and constructor/destructor.

Detailed Description

Input listener to show overlay information information.

Date:
2007-03-28
Author:
Xavier Larrodé
Defines a extension which toggles the display of the Overlay

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
    {
       overlay
       {
       Class OverlayExtension
       OverlayName "Editor/DebugOverlay"
       Key d // the default is "d"
       VisuName visualisation 
       }
     ...
    }
 }

Definition at line 44 of file OMKOverlayExtension.h.


Member Function Documentation

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

Factory and constructor/destructor.

See Extension feature

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

Show/Hide Overlay.

This method toggles the display of the bouding boxes.

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

Definition at line 44 of file OMKOverlayExtension.cpp.

References _overlay, and _show.

00045     {
00046 
00047       //Have to wait for OgreVisInit
00048       if (_show)
00049         _overlay->hide();
00050       else 
00051         _overlay->show();
00052       _show =!_show;
00053     }

bool OMK::Inp::OverlayExtension::loadExtensionParameters ( const ConfigurationParameterDescriptor node  )  [protected, virtual]

Configuration parameters loader of Extension.

Retrieves the key (by default it is B), then creates the event listener and the key listener for the defined key.

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

Definition at line 55 of file OMKOverlayExtension.cpp.

References _overlayName, and OMK::ParametersAccessor::get().

00056     {
00057       bool ok = true ;
00058       ok = ParametersAccessor::get( node, "OverlayName", _overlayName ) ;
00059       return ok &&  GenericKeyExtension< OMK::Vis::OgreVis>::loadExtensionParameters(node) ;
00060     }

void OMK::Inp::OverlayExtension::preComputeParameters (  )  [protected, virtual]

Init Overlay.

Reimplemented from OMK::Extension.

Definition at line 31 of file OMKOverlayExtension.cpp.

References _init, _overlay, and _overlayName.

00032     {
00033       if (!_init){
00034         _overlay = Ogre::OverlayManager::getSingleton().getByName(_overlayName);
00035         _init = true;
00036         _overlay->show();
00037       }
00038 
00039     }


Member Data Documentation

Ogre::Overlay* OMK::Inp::OverlayExtension::_overlay [protected]

Definition at line 57 of file OMKOverlayExtension.h.

Referenced by action(), and preComputeParameters().

bool OMK::Inp::OverlayExtension::_show [protected]

Definition at line 58 of file OMKOverlayExtension.h.

Referenced by action().

bool OMK::Inp::OverlayExtension::_init [protected]

Definition at line 59 of file OMKOverlayExtension.h.

Referenced by preComputeParameters().

std::string OMK::Inp::OverlayExtension::_overlayName [protected]

Definition at line 60 of file OMKOverlayExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007