Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpAROgre Class Reference

#include <vpAROgre.h>

Inheritance diagram for vpAROgre:

Public Member Functions

 vpAROgre (const vpCameraParameters &cam=vpCameraParameters(), unsigned int width=0, unsigned int height=0, const char *resourcePath=VISP_HAVE_OGRE_RESOURCES_PATH, const char *pluginsPath=VISP_HAVE_OGRE_PLUGINS_PATH)
virtual ~vpAROgre (void)
void addResource (const std::string &resourceLocation)
void addRotation (const std::string &sceneName, const vpRotationMatrix &wRo)
bool continueRendering (void)
virtual bool customframeStarted (const Ogre::FrameEvent &evt)
virtual bool customframeEnded (const Ogre::FrameEvent &evt)
virtual void display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMw)
virtual void display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMw)
Ogre::Camera * getCamera ()
double getFarClippingDistance () const
double getNearClippingDistance () const
vpTranslationVector getPosition (const std::string &sceneName) const
void getRenderingOutput (vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo)
Ogre::SceneManager * getSceneManager ()
virtual void init (vpImage< unsigned char > &I, bool bufferedKeys=false, bool hidden=false)
virtual void init (vpImage< vpRGBa > &I, bool bufferedKeys=false, bool hidden=false)
bool isWindowHidden ()
virtual bool keyPressed (const OIS::KeyEvent &)
virtual bool keyReleased (const OIS::KeyEvent &)
void load (const std::string &entityName, const std::string &model)
bool renderOneFrame (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMw)
bool renderOneFrame (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMw)
void setCameraParameters (const vpCameraParameters &cameraP)
void setFarClippingDistance (const double &dist)
void setMaterial (const std::string &entityName, const std::string &materialName)
void setNearClippingDistance (const double &dist)
void setPluginsPath (const char *pluginsPath)
void setPosition (const std::string &sceneName, const vpTranslationVector &wTo)
void setPosition (const std::string &sceneName, const vpHomogeneousMatrix &wMo)
void setResourcePath (const char *resourcePath)
void setRotation (const std::string &sceneName, const vpRotationMatrix &wRo)
void setScale (const std::string &sceneName, float factorx, float factory, float factorz)
void setShowConfigDialog (bool showConfigDialog)
void setVisibility (const std::string &sceneName, bool isVisible)
void setWindowName (const Ogre::String &n)
void setWindowPosition (unsigned int win_x, unsigned int win_y)
virtual bool windowClosing (Ogre::RenderWindow *rw) VP_OVERRIDE
virtual void windowClosed (Ogre::RenderWindow *rw) VP_OVERRIDE

Protected Member Functions

virtual void init (bool bufferedKeys=false, bool hidden=false)
virtual void createCamera (void)
virtual void createScene (void)
virtual void closeOIS (void)
virtual bool updateScene (const Ogre::FrameEvent &)
virtual bool processInputEvent (const Ogre::FrameEvent &)
virtual bool destroyScene (void)
virtual void updateCameraParameters (const vpHomogeneousMatrix &cMo)
virtual void updateCameraProjection (void)
virtual void updateBackgroundTexture (const vpImage< unsigned char > &I)
virtual void updateBackgroundTexture (const vpImage< vpRGBa > &I)

Protected Attributes

Ogre::String name
bool mInitialized
Ogre::Root * mRoot
Ogre::Camera * mCamera
Ogre::String mSceneManagerName
Ogre::SceneManager * mSceneMgr
Ogre::RenderWindow * mWindow
Ogre::String mResourcePath
Ogre::String mPluginsPath
OIS::InputManager * mInputManager
OIS::Keyboard * mKeyboard
bool keepOn
vpImage< vpRGBamImageRGBA
vpImage< unsigned char > mImage
Ogre::HardwarePixelBufferSharedPtr mPixelBuffer
Ogre::Rectangle2D * mBackground
unsigned int mBackgroundHeight
unsigned int mBackgroundWidth
unsigned int mWindowHeight
unsigned int mWindowWidth
bool windowHidden
double mNearClipping
double mFarClipping
vpCameraParameters mcam
bool mshowConfigDialog
std::list< std::string > mOptionalResourceLocation

Static Protected Attributes

static unsigned int sID = 0
static unsigned int sRTSSUsers = 0

Detailed Description

Implementation of an augmented reality viewer using Ogre3D 3rd party.

Thus to be enabled this class requires Ogre3D 3rd party installation. Installation instructions are provided here https://visp.inria.fr/3rd_ogre.

This class provides methods to show a 3D scene in a real world. To do that you will need to initialise it with the parameters of your camera, then each frame you will need to compute a pose for your camera and give it to the application. With that information and the image to be shown in background it will set up the 3D scene correspondingly.

Tutorials & Examples

Tutorials
If you are interested in using Ogre3D in Augmented Reality applications, you may have a look at:

Examples
AROgre.cpp, AROgreBasic.cpp, HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 111 of file vpAROgre.h.

Constructor & Destructor Documentation

◆ vpAROgre()

vpAROgre::vpAROgre ( const vpCameraParameters & cam = vpCameraParameters(),
unsigned int width = 0,
unsigned int height = 0,
const char * resourcePath = VISP_HAVE_OGRE_RESOURCES_PATH,
const char * pluginsPath = VISP_HAVE_OGRE_PLUGINS_PATH )

Constructor.

Parameters
cam: Camera parameters.
width: Width of the window.
height: Height of the window.
resourcePath: Path to the resources.cfg file telling Ogre where to look for resources.
pluginsPath: Path to the plugins.cfg of plugins_d.cfg files telling Ogre where to look for renderer plugins.
Examples
HelloWorldOgreAdvanced.cpp.

Definition at line 80 of file vpAROgre.cpp.

References keepOn, mBackground, mBackgroundHeight, mBackgroundWidth, mcam, mCamera, mFarClipping, mImage, mImageRGBA, mInitialized, mInputManager, mKeyboard, mNearClipping, mOptionalResourceLocation, mPixelBuffer, mPluginsPath, mResourcePath, mRoot, mSceneManagerName, mSceneMgr, mshowConfigDialog, mWindow, mWindowHeight, mWindowWidth, name, sID, and windowHidden.

◆ ~vpAROgre()

vpAROgre::~vpAROgre ( void )
virtual

Destructor.

Definition at line 612 of file vpAROgre.cpp.

References closeOIS(), destroyScene(), mInitialized, mPixelBuffer, mRoot, mWindow, and windowClosed().

Member Function Documentation

◆ addResource()

void vpAROgre::addResource ( const std::string & resourceLocation)
inline

Add optional resource location. Since a resource file cannot be always sufficient to manage multiple location media (depending on the computer and the executable path), this method may be used to add such paths.

Warning
To be effective, this method must be called before the init() one.
Parameters
resourceLocation: The resource location (it may be a folder or a zip file).
Examples
tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 151 of file vpAROgre.h.

References mOptionalResourceLocation.

◆ addRotation()

void vpAROgre::addRotation ( const std::string & sceneName,
const vpRotationMatrix & wRo )

Add a rotation to a SceneNode.

Parameters
sceneName: Name of the SceneNode to rotate.
wRo: The rotation matrix representing the rotation to apply.

Definition at line 924 of file vpAROgre.cpp.

References mSceneMgr.

◆ closeOIS()

void vpAROgre::closeOIS ( void )
protectedvirtual

Close the OIS based input manager.

Warning
This method is only to call if OIS is installed and detected during ViSP configuration stage.

Definition at line 1160 of file vpAROgre.cpp.

References mInputManager, and mKeyboard.

Referenced by windowClosed(), and ~vpAROgre().

◆ continueRendering()

bool vpAROgre::continueRendering ( void )

Ask the program if we can continue to render.

Returns
True if nothing stopped the rendering loop.
Examples
HelloWorldOgre.cpp.

Definition at line 847 of file vpAROgre.cpp.

References keepOn.

◆ createCamera()

void vpAROgre::createCamera ( void )
protectedvirtual

Create the Ogre camera.

Definition at line 982 of file vpAROgre.cpp.

References mCamera, and mSceneMgr.

Referenced by init().

◆ createScene()

virtual void vpAROgre::createScene ( void )
inlineprotectedvirtual

Build the 3D scene Override this to show what you want

Examples
AROgre.cpp, and HelloWorldOgreAdvanced.cpp.

Definition at line 328 of file vpAROgre.h.

Referenced by init().

◆ customframeEnded()

bool vpAROgre::customframeEnded ( const Ogre::FrameEvent & evt)
virtual

Function telling what to do after each frame.

Parameters
evt: Frame event to process.
Returns
True if everything went well.
Examples
AROgre.cpp, and HelloWorldOgreAdvanced.cpp.

Definition at line 741 of file vpAROgre.cpp.

◆ customframeStarted()

bool vpAROgre::customframeStarted ( const Ogre::FrameEvent & evt)
virtual

Function telling what to do before each frame. This method is called before every frame rendered by Ogre.

Parameters
evt: Frame event to process
Returns
True if everything went well

Definition at line 721 of file vpAROgre.cpp.

References mKeyboard, and mWindow.

◆ destroyScene()

virtual bool vpAROgre::destroyScene ( void )
inlineprotectedvirtual

Clean up the 3D scene.

Returns
Always true.

Definition at line 351 of file vpAROgre.h.

References mRoot, and mSceneMgr.

Referenced by ~vpAROgre().

◆ display() [1/2]

void vpAROgre::display ( const vpImage< unsigned char > & I,
const vpHomogeneousMatrix & cMw )
virtual

Display a frame.

Parameters
I: Grey level image to show in background.
cMw: Camera pose as an homogeneous matrix.
Examples
HelloWorldOgre.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 814 of file vpAROgre.cpp.

References keepOn, mWindow, and renderOneFrame().

◆ display() [2/2]

void vpAROgre::display ( const vpImage< vpRGBa > & I,
const vpHomogeneousMatrix & cMw )
virtual

Display a frame.

Parameters
I: RGBa image to show in background.
cMw: Camera pose as an homogeneous matrix.

Definition at line 831 of file vpAROgre.cpp.

References keepOn, mWindow, and renderOneFrame().

◆ getCamera()

Ogre::Camera * vpAROgre::getCamera ( )
inline

Definition at line 168 of file vpAROgre.h.

References mCamera.

◆ getFarClippingDistance()

double vpAROgre::getFarClippingDistance ( ) const
inline

Get the far distance for clipping.

Returns
Far clipping value.

Definition at line 175 of file vpAROgre.h.

References mFarClipping.

◆ getNearClippingDistance()

double vpAROgre::getNearClippingDistance ( ) const
inline

Get the near distance for clipping.

Returns
Near clipping value.

Definition at line 182 of file vpAROgre.h.

References mNearClipping.

◆ getPosition()

vpTranslationVector vpAROgre::getPosition ( const std::string & sceneName) const

Get position of a SceneNode.

Parameters
sceneName: Name of the SceneNode in the scene graph.
Returns
The position of the node.

Definition at line 896 of file vpAROgre.cpp.

References mSceneMgr.

◆ getRenderingOutput()

void vpAROgre::getRenderingOutput ( vpImage< vpRGBa > & I,
const vpHomogeneousMatrix & cMo )

Get the result of the rendering loop.

Parameters
I: The image on which to copy the result of the rendering loop.
cMo: The desired camera pose.
Examples
tutorial-ibvs-4pts-ogre-tracking.cpp.

Definition at line 1282 of file vpAROgre.cpp.

References mPixelBuffer, mWindow, and updateCameraParameters().

◆ getSceneManager()

Ogre::SceneManager * vpAROgre::getSceneManager ( )
inline
Examples
tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 188 of file vpAROgre.h.

References mSceneMgr.

Referenced by init(), and init().

◆ init() [1/3]

void vpAROgre::init ( bool bufferedKeys = false,
bool hidden = false )
protectedvirtual

Initialisation of Ogre.

Load the plugins that are specified in the plugins.cfg or plugins_d.cfg files. These files are located in VISP_HAVE_OGRE_PLUGINS_PATH folder that is defined in vpConfig.h. Note that plugins.cfg file is always considered under Unix platforms. The file plugins_d.cfg is only considered under Windows when the build type is Debug.

Load also the resources that are defined in the resources.cfg file. This file is located in VISP_HAVE_OGRE_RESOURCES_PATH folder that is defined in vpConfig.h.

Parameters
bufferedKeys: If true, use of buffered input for the keyboard (see Ogre documentation). Note that this parameter is only useful if OIS is used.
hidden: If true, the created window will be hidden. Note that this functionnality requires Ogre3D 1.8.1 at least.
Exceptions
vpException::ioError: If the required plugins.cfg / plugins_d.cfg or resources.cfg files are not accessible.

Definition at line 288 of file vpAROgre.cpp.

References vpIoTools::checkDirectory(), vpIoTools::checkFilename(), createCamera(), createScene(), vpException::ioError, mBackgroundHeight, mBackgroundWidth, mCamera, mInitialized, mInputManager, mKeyboard, mOptionalResourceLocation, mPluginsPath, mResourcePath, mRoot, mSceneManagerName, mSceneMgr, mshowConfigDialog, mWindow, mWindowHeight, mWindowWidth, name, vpIoTools::splitChain(), updateCameraProjection(), and windowHidden.

◆ init() [2/3]

void vpAROgre::init ( vpImage< unsigned char > & I,
bool bufferedKeys = false,
bool hidden = false )
virtual

Initialisation of Ogre with a grey level background.

Load the plugins that are specified in the plugins.cfg or plugins_d.cfg files. These files are located in VISP_HAVE_OGRE_PLUGINS_PATH folder that is defined in vpConfig.h. Note that plugins.cfg file is always considered under Unix platforms. The file plugins_d.cfg is only considered under Windows when the build type is Debug.

Load also the resources that are defined in the resources.cfg file. This file is located in VISP_HAVE_OGRE_RESOURCES_PATH folder that is defined in vpConfig.h.

Create also the grey level background used to display the image.

Parameters
I: Image that is displayed in the background.
bufferedKeys: If true, use of buffered input for the keyboard (see Ogre documentation). Note that this parameter is only useful if OIS is used.
hidden: If true, the created window will be hidden. Note that this functionnality requires Ogre3D 1.8.1 at least.
Exceptions
vpException::ioError: If the required plugins.cfg / plugins_d.cfg or resources.cfg files are not accessible.
Examples
HelloWorldOgre.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 180 of file vpAROgre.cpp.

References getSceneManager(), init(), mBackgroundHeight, mBackgroundWidth, and mSceneManagerName.

Referenced by init(), and init().

◆ init() [3/3]

void vpAROgre::init ( vpImage< vpRGBa > & I,
bool bufferedKeys = false,
bool hidden = false )
virtual

Initialisation of Ogre with a color background.

Load the plugins that are specified in the plugins.cfg or plugins_d.cfg files. These files are located in VISP_HAVE_OGRE_PLUGINS_PATH folder that is defined in vpConfig.h. Note that plugins.cfg file is always considered under Unix platforms. The file plugins_d.cfg is only considered under Windows when the build type is Debug.

Load also the resources that are defined in the resources.cfg file. This file is located in VISP_HAVE_OGRE_RESOURCES_PATH folder that is defined in vpConfig.h.

Create also a color background used to display the image.

Parameters
I: Image that is displayed in the background.
bufferedKeys: If true, use of buffered input for the keyboard (see Ogre documentation). Note that this parameter is only useful if OIS is used.
hidden: If true, the created window will be hidden. Note that this functionnality requires Ogre3D 1.8.1 at least.
Exceptions
vpException::ioError: If the required plugins.cfg / plugins_d.cfg or resources.cfg files are not accessible.

Definition at line 236 of file vpAROgre.cpp.

References getSceneManager(), init(), mBackgroundHeight, mBackgroundWidth, and mSceneManagerName.

◆ isWindowHidden()

bool vpAROgre::isWindowHidden ( )
inline

Test if the window is hidden or not.

Warning
True if the window is hidden, false otherwise.

Definition at line 198 of file vpAROgre.h.

References windowHidden.

◆ keyPressed()

virtual bool vpAROgre::keyPressed ( const OIS::KeyEvent & )
inlinevirtual

Default event handler

Definition at line 204 of file vpAROgre.h.

◆ keyReleased()

virtual bool vpAROgre::keyReleased ( const OIS::KeyEvent & )
inlinevirtual

Default event handler

Definition at line 208 of file vpAROgre.h.

◆ load()

void vpAROgre::load ( const std::string & entityName,
const std::string & model )

Load a mesh in the 3D world.

Parameters
entityName: Name of the Entity and SceneNode to create.
model: 3D model to load.
Examples
HelloWorldOgre.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 859 of file vpAROgre.cpp.

References mSceneMgr.

◆ processInputEvent()

virtual bool vpAROgre::processInputEvent ( const Ogre::FrameEvent & )
inlineprotectedvirtual

Check for keyboard, mouse and joystick inputs.

Returns
Always true.
Examples
AROgre.cpp.

Definition at line 344 of file vpAROgre.h.

◆ renderOneFrame() [1/2]

bool vpAROgre::renderOneFrame ( const vpImage< unsigned char > & I,
const vpHomogeneousMatrix & cMw )

Render one frame.

Parameters
I: Grey level image to show in background.
cMw: Camera pose as an homogeneous matrix.

Definition at line 780 of file vpAROgre.cpp.

References mRoot, updateBackgroundTexture(), and updateCameraParameters().

Referenced by display(), and display().

◆ renderOneFrame() [2/2]

bool vpAROgre::renderOneFrame ( const vpImage< vpRGBa > & I,
const vpHomogeneousMatrix & cMw )

Render one frame.

Parameters
I: RGBa image to show in background.
cMw: Camera pose as an homogeneous matrix.

Definition at line 797 of file vpAROgre.cpp.

References mRoot, updateBackgroundTexture(), and updateCameraParameters().

◆ setCameraParameters()

void vpAROgre::setCameraParameters ( const vpCameraParameters & cameraP)

Set the camera intrinsic parameters

Examples
tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 852 of file vpAROgre.cpp.

References mcam.

◆ setFarClippingDistance()

void vpAROgre::setFarClippingDistance ( const double & dist)
inline

Set the far distance for clipping.

Parameters
dist: Far clipping value.

Definition at line 224 of file vpAROgre.h.

References mFarClipping, and updateCameraProjection().

◆ setMaterial()

void vpAROgre::setMaterial ( const std::string & entityName,
const std::string & materialName )

Change the material of an entity.

Parameters
entityName: Name of the Entity and SceneNode to create.
materialName: Name of the material to use, as known by the MaterialManager.
Examples
tutorial-ibvs-4pts-ogre-tracking.cpp.

Definition at line 871 of file vpAROgre.cpp.

References mSceneMgr.

◆ setNearClippingDistance()

void vpAROgre::setNearClippingDistance ( const double & dist)
inline

Set the near distance for clipping.

Parameters
dist: Near clipping value.

Definition at line 237 of file vpAROgre.h.

References mNearClipping, and updateCameraProjection().

◆ setPluginsPath()

void vpAROgre::setPluginsPath ( const char * pluginsPath)
inline

Set the plugins path used to locate the plugins.cfg file.

By default, this path is set to VISP_HAVE_OGRE_PLUGINS_PATH defined in vpConfig.h

Warning
To be effective, this method must be called before the init() one.
Parameters
pluginsPath: The new plugins path (must not have a terminate /).

Definition at line 254 of file vpAROgre.h.

References mPluginsPath.

◆ setPosition() [1/2]

void vpAROgre::setPosition ( const std::string & sceneName,
const vpHomogeneousMatrix & wMo )

Set the position and the orientation of a SceneNode.

Parameters
sceneName: Name of the SceneNode to rotate.
wMo: The homogeneous matrix representing the rotation and translation to apply.

Definition at line 942 of file vpAROgre.cpp.

References vpHomogeneousMatrix::extract(), setPosition(), and setRotation().

◆ setPosition() [2/2]

void vpAROgre::setPosition ( const std::string & sceneName,
const vpTranslationVector & wTo )

Change position of a ScneneNode.

Parameters
sceneName: Name of the SceneNode to move.
wTo: New position of the node (translation between object frame and world frame).
Examples
tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 884 of file vpAROgre.cpp.

References mSceneMgr.

Referenced by setPosition().

◆ setResourcePath()

void vpAROgre::setResourcePath ( const char * resourcePath)
inline

Set the resource path used to locate the resource.cfg file.

By default, this path is set to VISP_HAVE_OGRE_RESOURCES_PATH defined in vpConfig.h

Warning
To be effective, this method must be called before the init() one.
Parameters
resourcePath: The new resource path (must not have a terminate /).

Definition at line 270 of file vpAROgre.h.

References mResourcePath.

◆ setRotation()

void vpAROgre::setRotation ( const std::string & sceneName,
const vpRotationMatrix & wRo )

Set the orientation of a SceneNode.

Parameters
sceneName: Name of the SceneNode to rotate.
wRo: The rotation matrix representing the rotation to apply.
Examples
HelloWorldOgre.cpp, and tutorial-ibvs-4pts-ogre-tracking.cpp.

Definition at line 907 of file vpAROgre.cpp.

References mSceneMgr.

Referenced by setPosition().

◆ setScale()

void vpAROgre::setScale ( const std::string & sceneName,
float factorx,
float factory,
float factorz )

Scale a SceneNode.

Parameters
sceneName: Name of the SceneNode.
factorx: Scale factor along the x-axis.
factory: Scale factor along the x-axis.
factorz: Scale factor along the x-axis.
Examples
HelloWorldOgre.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 971 of file vpAROgre.cpp.

References mSceneMgr.

◆ setShowConfigDialog()

void vpAROgre::setShowConfigDialog ( bool showConfigDialog)
inline

Enable/Disable the appearance of the config dialog on startup.

Warning
To be effective, this method must be called before the init() one.
Parameters
showConfigDialog: if true, shows the dialog window (used to set the display options)
Examples
tutorial-ibvs-4pts-ogre-tracking.cpp, and tutorial-ibvs-4pts-ogre.cpp.

Definition at line 285 of file vpAROgre.h.

References mshowConfigDialog.

◆ setVisibility()

void vpAROgre::setVisibility ( const std::string & sceneName,
bool isVisible )

Tell if a SceneNode is shown on the screen or not.

Parameters
sceneName: Name of the SceneNode.
isVisible: If true we show the node, if false we don't.

Definition at line 959 of file vpAROgre.cpp.

References mSceneMgr.

◆ setWindowName()

void vpAROgre::setWindowName ( const Ogre::String & n)
inline

Set the name of the window.

Warning
Has to be called before initialisation.
Parameters
n: Name of the window.

Definition at line 296 of file vpAROgre.h.

References name.

◆ setWindowPosition()

void vpAROgre::setWindowPosition ( unsigned int win_x,
unsigned int win_y )
inline

Set the window position in the screen.

Exceptions
vpException::notInitialisedif the window has not been created (using the init() method).
Parameters
win_x: x coordinate of the new top left corner of the window in the screen.
win_y: y coordinate of the new top left corner of the window in the screen.

Definition at line 308 of file vpAROgre.h.

References mWindow, and vpException::notInitialized.

◆ updateBackgroundTexture() [1/2]

void vpAROgre::updateBackgroundTexture ( const vpImage< unsigned char > & I)
protectedvirtual

Update the texture we see in background with a grey level image.

Definition at line 1200 of file vpAROgre.cpp.

References mBackgroundHeight, mBackgroundWidth, and mPixelBuffer.

Referenced by renderOneFrame(), and renderOneFrame().

◆ updateBackgroundTexture() [2/2]

void vpAROgre::updateBackgroundTexture ( const vpImage< vpRGBa > & I)
protectedvirtual

Update the texture we see in background with a RGBa image.

Definition at line 1220 of file vpAROgre.cpp.

References mBackgroundHeight, mBackgroundWidth, and mPixelBuffer.

◆ updateCameraParameters()

void vpAROgre::updateCameraParameters ( const vpHomogeneousMatrix & cMw)
protectedvirtual

Update Camera parameters from a pose calculation.

Definition at line 1257 of file vpAROgre.cpp.

References mCamera.

Referenced by getRenderingOutput(), renderOneFrame(), and renderOneFrame().

◆ updateCameraProjection()

void vpAROgre::updateCameraProjection ( void )
protectedvirtual

Update the projection parameters of the camera.

Definition at line 1177 of file vpAROgre.cpp.

References mBackgroundHeight, mBackgroundWidth, mcam, mCamera, mFarClipping, and mNearClipping.

Referenced by init(), setFarClippingDistance(), and setNearClippingDistance().

◆ updateScene()

virtual bool vpAROgre::updateScene ( const Ogre::FrameEvent & )
inlineprotectedvirtual

Update the 3D scene

Returns
Always true.

Definition at line 337 of file vpAROgre.h.

◆ windowClosed()

void vpAROgre::windowClosed ( Ogre::RenderWindow * rw)
virtual

Unattach OIS (Object-oriented Input System library) before window shutdown (very important under Linux).

Warning
This method is only available if OIS is installed and detected during ViSP configuration stage.
Parameters
rw: RenderWindow to close.

Definition at line 768 of file vpAROgre.cpp.

References closeOIS(), and mWindow.

Referenced by ~vpAROgre().

◆ windowClosing()

bool vpAROgre::windowClosing ( Ogre::RenderWindow * rw)
virtual

Check if the window that is currently closing is the one attached to the object.

Parameters
[in]rwThe RenderWindow that is closing.
Returns
true It corresponds to the vpAROgre object.
false It is another window that is closing.

Definition at line 750 of file vpAROgre.cpp.

References keepOn, and mWindow.

Member Data Documentation

◆ keepOn

bool vpAROgre::keepOn
protected

Definition at line 413 of file vpAROgre.h.

Referenced by continueRendering(), display(), display(), vpAROgre(), and windowClosing().

◆ mBackground

Ogre::Rectangle2D* vpAROgre::mBackground
protected

Pointer to the pixel buffer

Definition at line 418 of file vpAROgre.h.

Referenced by vpAROgre().

◆ mBackgroundHeight

unsigned int vpAROgre::mBackgroundHeight
protected

Background image

Definition at line 419 of file vpAROgre.h.

Referenced by init(), init(), init(), updateBackgroundTexture(), updateBackgroundTexture(), updateCameraProjection(), and vpAROgre().

◆ mBackgroundWidth

unsigned int vpAROgre::mBackgroundWidth
protected

Height of the acquired image

Definition at line 420 of file vpAROgre.h.

Referenced by init(), init(), init(), updateBackgroundTexture(), updateBackgroundTexture(), updateCameraProjection(), and vpAROgre().

◆ mcam

vpCameraParameters vpAROgre::mcam
protected

Far Clipping Distance

Definition at line 428 of file vpAROgre.h.

Referenced by setCameraParameters(), updateCameraProjection(), and vpAROgre().

◆ mCamera

Ogre::Camera* vpAROgre::mCamera
protected

Application's root

Definition at line 394 of file vpAROgre.h.

Referenced by createCamera(), getCamera(), init(), updateCameraParameters(), updateCameraProjection(), and vpAROgre().

◆ mFarClipping

double vpAROgre::mFarClipping
protected

Near Clipping Distance

Definition at line 427 of file vpAROgre.h.

Referenced by getFarClippingDistance(), setFarClippingDistance(), updateCameraProjection(), and vpAROgre().

◆ mImage

vpImage<unsigned char> vpAROgre::mImage
protected

vpImage to store grabbed image

Definition at line 416 of file vpAROgre.h.

Referenced by vpAROgre().

◆ mImageRGBA

vpImage<vpRGBa> vpAROgre::mImageRGBA
protected

Has the application received a signal to stop(false) or not (true)

Definition at line 415 of file vpAROgre.h.

Referenced by vpAROgre().

◆ mInitialized

bool vpAROgre::mInitialized
protected

Name of th Window

Definition at line 390 of file vpAROgre.h.

Referenced by init(), vpAROgre(), and ~vpAROgre().

◆ mInputManager

OIS::InputManager* vpAROgre::mInputManager
protected

Path to plugins.cfg

Definition at line 403 of file vpAROgre.h.

Referenced by closeOIS(), init(), and vpAROgre().

◆ mKeyboard

OIS::Keyboard* vpAROgre::mKeyboard
protected

Definition at line 404 of file vpAROgre.h.

Referenced by closeOIS(), customframeStarted(), init(), and vpAROgre().

◆ mNearClipping

double vpAROgre::mNearClipping
protected

Is window hidden

Definition at line 426 of file vpAROgre.h.

Referenced by getNearClippingDistance(), setNearClippingDistance(), updateCameraProjection(), and vpAROgre().

◆ mOptionalResourceLocation

std::list<std::string> vpAROgre::mOptionalResourceLocation
protected

if true, shows the dialog window (used to set the display options)

Definition at line 433 of file vpAROgre.h.

Referenced by addResource(), init(), and vpAROgre().

◆ mPixelBuffer

Ogre::HardwarePixelBufferSharedPtr vpAROgre::mPixelBuffer
protected

vpImage to store grabbed image

Definition at line 417 of file vpAROgre.h.

Referenced by getRenderingOutput(), updateBackgroundTexture(), updateBackgroundTexture(), vpAROgre(), and ~vpAROgre().

◆ mPluginsPath

Ogre::String vpAROgre::mPluginsPath
protected

Path to resources.cfg

Definition at line 399 of file vpAROgre.h.

Referenced by init(), setPluginsPath(), and vpAROgre().

◆ mResourcePath

Ogre::String vpAROgre::mResourcePath
protected

Display window

Definition at line 398 of file vpAROgre.h.

Referenced by init(), setResourcePath(), and vpAROgre().

◆ mRoot

Ogre::Root* vpAROgre::mRoot
protected

True once init(bool, bool) has been called.

Definition at line 393 of file vpAROgre.h.

Referenced by destroyScene(), init(), renderOneFrame(), renderOneFrame(), vpAROgre(), and ~vpAROgre().

◆ mSceneManagerName

Ogre::String vpAROgre::mSceneManagerName
protected

Camera

Definition at line 395 of file vpAROgre.h.

Referenced by init(), init(), init(), and vpAROgre().

◆ mSceneMgr

Ogre::SceneManager* vpAROgre::mSceneMgr
protected

◆ mshowConfigDialog

bool vpAROgre::mshowConfigDialog
protected

The intrinsic camera parameters

Definition at line 430 of file vpAROgre.h.

Referenced by init(), setShowConfigDialog(), and vpAROgre().

◆ mWindow

Ogre::RenderWindow* vpAROgre::mWindow
protected

◆ mWindowHeight

unsigned int vpAROgre::mWindowHeight
protected

Width of the acquired image

Definition at line 421 of file vpAROgre.h.

Referenced by init(), and vpAROgre().

◆ mWindowWidth

unsigned int vpAROgre::mWindowWidth
protected

Height of the window

Definition at line 422 of file vpAROgre.h.

Referenced by init(), and vpAROgre().

◆ name

◆ sID

BEGIN_VISP_NAMESPACE unsigned int vpAROgre::sID = 0
staticprotected

Definition at line 386 of file vpAROgre.h.

Referenced by vpAROgre().

◆ sRTSSUsers

unsigned int vpAROgre::sRTSSUsers = 0
staticprotected

Definition at line 387 of file vpAROgre.h.

◆ windowHidden

bool vpAROgre::windowHidden
protected

Width of the window

Definition at line 423 of file vpAROgre.h.

Referenced by init(), isWindowHidden(), and vpAROgre().