51 #include <visp3/core/vpConfig.h>
56 #include <visp3/core/vpImage.h>
57 #include <visp3/core/vpImageConvert.h>
58 #include <visp3/core/vpRGBa.h>
60 #include <visp3/core/vpImageTools.h>
61 #include <visp3/core/vpHomogeneousMatrix.h>
62 #include <visp3/core/vpRotationMatrix.h>
63 #include <visp3/core/vpRxyzVector.h>
66 #include <OgreFrameListener.h>
89 class VISP_EXPORT
vpAROgre :
public Ogre::FrameListener,
public Ogre::WindowEventListener
91 ,
public OIS::KeyListener
96 unsigned int width = 0,
unsigned int height = 0,
97 const char* resourcePath =
98 #ifdef VISP_HAVE_OGRE_RESOURCES_PATH
99 VISP_HAVE_OGRE_RESOURCES_PATH,
103 const char* pluginsPath =
104 #ifdef VISP_HAVE_OGRE_PLUGINS_PATH
105 VISP_HAVE_OGRE_PLUGINS_PATH
124 mOptionnalResourceLocation.push_back(resourceLocation);
127 void addRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
129 bool continueRendering(
void);
131 virtual bool customframeStarted(
const Ogre::FrameEvent& evt);
133 virtual bool customframeEnded(
const Ogre::FrameEvent& evt);
164 virtual void init(
vpImage<vpRGBa> &I,
bool bufferedKeys=
false,
bool hidden=
false);
177 virtual bool keyPressed(
const OIS::KeyEvent & ) {
return true; }
181 virtual bool keyReleased(
const OIS::KeyEvent & ) {
return true; }
184 void load(
const std::string &entityName,
const std::string &model);
199 updateCameraProjection();
208 mNearClipping = dist;
209 updateCameraProjection();
222 mPluginsPath = pluginsPath;
238 mResourcePath = resourcePath;
241 void setRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
243 void setScale(
const std::string &sceneName,
const float factorx,
const float factory,
const float factorz);
254 mshowConfigDialog = showConfigDialog;
257 void setVisibility(
const std::string &sceneName,
bool isVisible);
285 mWindow->reposition(static_cast<int>(win_x), static_cast<int>(win_y));
288 virtual void windowClosed(Ogre::RenderWindow* rw);
292 virtual void init(
bool bufferedKeys=
false,
bool hidden=
false);
293 virtual void createCamera(
void);
301 virtual void closeOIS(
void);
308 virtual bool updateScene(
const Ogre::FrameEvent & ) {
return true;};
326 mSceneMgr->destroyAllCameras ();
327 mSceneMgr->clearScene();
328 mRoot->destroySceneManager(mSceneMgr);
334 virtual void updateCameraProjection(
void);
346 bool frameStarted(
const Ogre::FrameEvent& evt);
348 bool frameEnded(
const Ogre::FrameEvent& evt);
350 bool stopTest(
const Ogre::FrameEvent& evt);
393 #endif // VISP_HAVE_OGRE
void setWindowName(const Ogre::String &n)
void setPluginsPath(const char *pluginsPath)
unsigned int mWindowWidth
Ogre::String mPluginsPath
void setNearClippingDistance(const double &dist)
unsigned int mBackgroundWidth
Ogre::Camera * getCamera()
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setShowConfigDialog(const bool showConfigDialog)
virtual bool destroyScene(void)
Ogre::String mResourcePath
error that can be emited by ViSP classes.
OIS::Keyboard * mKeyboard
Implementation of an augmented reality viewer using Ogre3D 3rd party.
Ogre::SceneManager * getSceneManager()
void setFarClippingDistance(const double &dist)
double getNearClippingDistance() const
vpImage< vpRGBa > mImageRGBA
Ogre::RenderWindow * mWindow
OIS::InputManager * mInputManager
Implementation of a rotation matrix and operations on such kind of matrices.
vpImage< unsigned char > mImage
virtual bool keyPressed(const OIS::KeyEvent &)
void setWindowPosition(const unsigned int win_x, const unsigned int win_y)
virtual bool processInputEvent(const Ogre::FrameEvent &)
Generic class defining intrinsic camera parameters.
virtual bool updateScene(const Ogre::FrameEvent &)
unsigned int mWindowHeight
void setResourcePath(const char *resourcePath)
double getFarClippingDistance() const
unsigned int mBackgroundHeight
Ogre::HardwarePixelBufferSharedPtr mPixelBuffer
Ogre::Rectangle2D * mBackground
virtual void createScene(void)
Ogre::SceneManager * mSceneMgr
void addResource(const std::string &resourceLocation)
std::list< std::string > mOptionnalResourceLocation
virtual bool keyReleased(const OIS::KeyEvent &)
Class that consider the case of a translation vector.