55 #include <visp/vpConfig.h>
60 #include <visp/vpImage.h>
61 #include <visp/vpImageConvert.h>
62 #include <visp/vpRGBa.h>
64 #include <visp/vpImageTools.h>
65 #include <visp/vpHomogeneousMatrix.h>
66 #include <visp/vpRotationMatrix.h>
67 #include <visp/vpRxyzVector.h>
70 #include <OgreFrameListener.h>
90 class VISP_EXPORT
vpAROgre :
public Ogre::FrameListener,
public Ogre::WindowEventListener
92 ,
public OIS::KeyListener
97 unsigned int width = 0,
unsigned int height = 0,
98 const char* resourcePath =
99 #ifdef VISP_HAVE_OGRE_RESOURCES_PATH
100 VISP_HAVE_OGRE_RESOURCES_PATH,
104 const char* pluginsPath =
105 #ifdef VISP_HAVE_OGRE_PLUGINS_PATH
106 VISP_HAVE_OGRE_PLUGINS_PATH
125 mOptionnalResourceLocation.push_back(resourceLocation);
130 bool continueRendering(
void);
132 virtual bool customframeStarted(
const Ogre::FrameEvent& evt);
134 virtual bool customframeEnded(
const Ogre::FrameEvent& evt);
151 virtual void init(
vpImage<vpRGBa> &I,
bool bufferedKeys=
false,
bool hidden=
false);
164 virtual bool keyPressed(
const OIS::KeyEvent & ) {
return true; }
168 virtual bool keyReleased(
const OIS::KeyEvent & ) {
return true; }
171 void load(
const std::string &name,
const std::string &model);
189 mPluginsPath = pluginsPath;
192 void setPosition(
const std::string &name,
206 mResourcePath = resourcePath;
211 void setScale(
const std::string &name,
const float factorx,
const float factory,
const float factorz);
222 mshowConfigDialog = showConfigDialog;
225 void setVisibility(
const std::string &name,
bool isVisible);
253 mWindow->reposition(static_cast<int>(win_x), static_cast<int>(win_y));
256 virtual void windowClosed(Ogre::RenderWindow* rw);
260 virtual void init(
bool bufferedKeys=
false,
bool hidden=
false);
261 virtual void createCamera(
void);
269 virtual void closeOIS(
void);
276 virtual bool updateScene(
const Ogre::FrameEvent & ) {
return true;};
294 virtual void updateCameraProjection(
void);
306 bool frameStarted(
const Ogre::FrameEvent& evt);
308 bool frameEnded(
const Ogre::FrameEvent& evt);
310 bool stopTest(
const Ogre::FrameEvent& evt);
351 #endif // VISP_HAVE_OGRE
void setWindowName(const Ogre::String &n)
void setPluginsPath(const char *pluginsPath)
unsigned int mWindowWidth
Ogre::String mPluginsPath
unsigned int mBackgroundWidth
Ogre::Camera * getCamera()
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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.
Ogre::SceneManager * getSceneManager()
vpImage< vpRGBa > mImageRGBA
Ogre::RenderWindow * mWindow
OIS::InputManager * mInputManager
The vpRotationMatrix considers the particular case of a rotation matrix.
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)
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.