46#include <visp3/core/vpConfig.h>
51#include <visp3/core/vpImage.h>
52#include <visp3/core/vpImageConvert.h>
53#include <visp3/core/vpRGBa.h>
55#include <visp3/core/vpHomogeneousMatrix.h>
56#include <visp3/core/vpImageTools.h>
57#include <visp3/core/vpRotationMatrix.h>
58#include <visp3/core/vpRxyzVector.h>
61#include <OgreFrameListener.h>
63#if (VISP_HAVE_OGRE_VERSION >= (1<<16 | 10 <<8 | 0))
64#include <Bites/OgreBitesConfigDialog.h>
67#if (VISP_HAVE_OGRE_VERSION >= (1<<16 | 11<<8 | 0))
68#include <Bites/OgreWindowEventUtilities.h>
71#if (VISP_HAVE_OGRE_VERSION >= (1<<16 | 12 <<8 | 0))
72#include <OgreComponents.h>
73#elif (VISP_HAVE_OGRE_VERSION >= (1<<16 | 10 <<8 | 0))
74#include <OgreBuildSettings.h>
77#if defined(OGRE_BUILD_COMPONENT_RTSHADERSYSTEM) & (VISP_HAVE_OGRE_VERSION >= (1<<16 | 10 <<8 | 0))
78#include <RTShaderSystem/OgreShaderGenerator.h>
79#include <Bites/OgreSGTechniqueResolverListener.h>
111class VISP_EXPORT
vpAROgre :
public Ogre::FrameListener,
112#if (VISP_HAVE_OGRE_VERSION >= (1<<16 | 11 <<8 | 0))
113 public OgreBites::WindowEventListener
115 public Ogre::WindowEventListener
119 public OIS::KeyListener
124 const char *resourcePath =
125#ifdef VISP_HAVE_OGRE_RESOURCES_PATH
126 VISP_HAVE_OGRE_RESOURCES_PATH,
130 const char *pluginsPath =
131#ifdef VISP_HAVE_OGRE_PLUGINS_PATH
132 VISP_HAVE_OGRE_PLUGINS_PATH
156 void addRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
158 bool continueRendering(
void);
160 virtual bool customframeStarted(
const Ogre::FrameEvent &evt);
162 virtual bool customframeEnded(
const Ogre::FrameEvent &evt);
191 virtual void init(
vpImage<vpRGBa> &I,
bool bufferedKeys =
false,
bool hidden =
false);
204 virtual bool keyPressed(
const OIS::KeyEvent & ) {
return true; }
211 void load(
const std::string &entityName,
const std::string &model);
230 void setMaterial(
const std::string &entityName,
const std::string &materialName);
272 void setRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
274 void setScale(
const std::string &sceneName,
float factorx,
float factory,
float factorz);
287 void setVisibility(
const std::string &sceneName,
bool isVisible);
313 mWindow->reposition(
static_cast<int>(win_x),
static_cast<int>(win_y));
316 virtual bool windowClosing(Ogre::RenderWindow *rw) VP_OVERRIDE;
318 virtual void windowClosed(Ogre::RenderWindow *rw) VP_OVERRIDE;
321 virtual void init(
bool bufferedKeys =
false,
bool hidden =
false);
322 virtual void createCamera(
void);
330 virtual void closeOIS(
void);
337 virtual bool updateScene(
const Ogre::FrameEvent & ) {
return true; }
365 virtual void updateCameraProjection(
void);
375 bool frameStarted(
const Ogre::FrameEvent &evt) VP_OVERRIDE;
377 bool frameEnded(
const Ogre::FrameEvent &evt) VP_OVERRIDE;
379 bool stopTest(
const Ogre::FrameEvent &evt);
381 bool initialiseRTShaderSystem();
383 void destroyRTShaderSystem();
407#if defined(OGRE_BUILD_COMPONENT_RTSHADERSYSTEM) & (VISP_HAVE_OGRE_VERSION >= (1<<16 | 10 <<8 | 0))
408 Ogre::RTShader::ShaderGenerator *mShaderGenerator;
409 OgreBites::SGTechniqueResolverListener *mMaterialMgrListener;
OIS::InputManager * mInputManager
double getNearClippingDistance() const
Ogre::SceneManager * getSceneManager()
virtual bool updateScene(const Ogre::FrameEvent &)
OIS::Keyboard * mKeyboard
void setWindowName(const Ogre::String &n)
virtual bool processInputEvent(const Ogre::FrameEvent &)
virtual bool keyReleased(const OIS::KeyEvent &)
unsigned int mBackgroundWidth
void setShowConfigDialog(bool showConfigDialog)
vpImage< vpRGBa > mImageRGBA
vpImage< unsigned char > mImage
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)
void setFarClippingDistance(const double &dist)
Ogre::Camera * getCamera()
void setNearClippingDistance(const double &dist)
Ogre::String mSceneManagerName
virtual bool keyPressed(const OIS::KeyEvent &)
void setWindowPosition(unsigned int win_x, unsigned int win_y)
virtual bool destroyScene(void)
virtual void updateCameraProjection(void)
static unsigned int sRTSSUsers
unsigned int mBackgroundHeight
void addResource(const std::string &resourceLocation)
Ogre::String mPluginsPath
Ogre::Rectangle2D * mBackground
virtual void createScene(void)
unsigned int mWindowHeight
void setPluginsPath(const char *pluginsPath)
double getFarClippingDistance() const
std::list< std::string > mOptionalResourceLocation
Ogre::SceneManager * mSceneMgr
Ogre::HardwarePixelBufferSharedPtr mPixelBuffer
Ogre::String mResourcePath
Ogre::RenderWindow * mWindow
void setResourcePath(const char *resourcePath)
unsigned int mWindowWidth
Generic class defining intrinsic camera parameters.
error that can be emitted by ViSP classes.
@ notInitialized
Used to indicate that a parameter is not initialized.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition of the vpImage class member functions.
Implementation of a rotation matrix and operations on such kind of matrices.
Class that consider the case of a translation vector.