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>
86 class VISP_EXPORT
vpAROgre :
public Ogre::FrameListener,
public Ogre::WindowEventListener
88 ,
public OIS::KeyListener
93 unsigned int width = 0,
unsigned int height = 0,
94 const char* resourcePath =
95 #ifdef VISP_HAVE_OGRE_RESOURCES_PATH
96 VISP_HAVE_OGRE_RESOURCES_PATH,
100 const char* pluginsPath =
101 #ifdef VISP_HAVE_OGRE_PLUGINS_PATH
102 VISP_HAVE_OGRE_PLUGINS_PATH
121 mOptionnalResourceLocation.push_back(resourceLocation);
124 void addRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
126 bool continueRendering(
void);
128 virtual bool customframeStarted(
const Ogre::FrameEvent& evt);
130 virtual bool customframeEnded(
const Ogre::FrameEvent& evt);
161 virtual void init(
vpImage<vpRGBa> &I,
bool bufferedKeys=
false,
bool hidden=
false);
174 virtual bool keyPressed(
const OIS::KeyEvent & ) {
return true; }
178 virtual bool keyReleased(
const OIS::KeyEvent & ) {
return true; }
181 void load(
const std::string &entityName,
const std::string &model);
196 updateCameraProjection();
205 mNearClipping = dist;
206 updateCameraProjection();
219 mPluginsPath = pluginsPath;
235 mResourcePath = resourcePath;
238 void setRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
240 void setScale(
const std::string &sceneName,
const float factorx,
const float factory,
const float factorz);
251 mshowConfigDialog = showConfigDialog;
254 void setVisibility(
const std::string &sceneName,
bool isVisible);
282 mWindow->reposition(static_cast<int>(win_x), static_cast<int>(win_y));
285 virtual void windowClosed(Ogre::RenderWindow* rw);
289 virtual void init(
bool bufferedKeys=
false,
bool hidden=
false);
290 virtual void createCamera(
void);
298 virtual void closeOIS(
void);
305 virtual bool updateScene(
const Ogre::FrameEvent & ) {
return true;};
323 mSceneMgr->destroyAllCameras ();
324 mSceneMgr->clearScene();
325 mRoot->destroySceneManager(mSceneMgr);
331 virtual void updateCameraProjection(
void);
343 bool frameStarted(
const Ogre::FrameEvent& evt);
345 bool frameEnded(
const Ogre::FrameEvent& evt);
347 bool stopTest(
const Ogre::FrameEvent& evt);
390 #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.
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.