52 #include <visp3/core/vpConfig.h> 57 #include <visp3/core/vpImage.h> 58 #include <visp3/core/vpImageConvert.h> 59 #include <visp3/core/vpRGBa.h> 61 #include <visp3/core/vpHomogeneousMatrix.h> 62 #include <visp3/core/vpImageTools.h> 63 #include <visp3/core/vpRotationMatrix.h> 64 #include <visp3/core/vpRxyzVector.h> 67 #include <OgreFrameListener.h> 90 class VISP_EXPORT
vpAROgre :
public Ogre::FrameListener,
91 public Ogre::WindowEventListener
94 public OIS::KeyListener
99 const char *resourcePath =
100 #ifdef VISP_HAVE_OGRE_RESOURCES_PATH
101 VISP_HAVE_OGRE_RESOURCES_PATH,
105 const char *pluginsPath =
106 #ifdef VISP_HAVE_OGRE_PLUGINS_PATH
107 VISP_HAVE_OGRE_PLUGINS_PATH
128 mOptionnalResourceLocation.push_back(resourceLocation);
131 void addRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
133 bool continueRendering(
void);
135 virtual bool customframeStarted(
const Ogre::FrameEvent &evt);
137 virtual bool customframeEnded(
const Ogre::FrameEvent &evt);
166 virtual void init(
vpImage<vpRGBa> &I,
bool bufferedKeys =
false,
bool hidden =
false);
179 virtual bool keyPressed(
const OIS::KeyEvent & ) {
return true; }
186 void load(
const std::string &entityName,
const std::string &model);
202 updateCameraProjection();
212 mNearClipping = dist;
213 updateCameraProjection();
227 inline void setPluginsPath(
const char *pluginsPath) { mPluginsPath = pluginsPath; }
243 inline void setResourcePath(
const char *resourcePath) { mResourcePath = resourcePath; }
245 void setRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
247 void setScale(
const std::string &sceneName,
float factorx,
float factory,
float factorz);
260 void setVisibility(
const std::string &sceneName,
bool isVisible);
283 if (mWindow == NULL) {
286 mWindow->reposition(static_cast<int>(win_x), static_cast<int>(win_y));
289 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; };
328 mSceneMgr->destroyAllCameras();
329 mSceneMgr->clearScene();
330 mRoot->destroySceneManager(mSceneMgr);
336 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);
395 #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 setWindowPosition(unsigned int win_x, unsigned int win_y)
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 &)
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
void setShowConfigDialog(bool showConfigDialog)
unsigned int mBackgroundHeight
Ogre::HardwarePixelBufferSharedPtr mPixelBuffer
Ogre::Rectangle2D * mBackground
virtual void createScene(void)
Ogre::SceneManager * mSceneMgr
Used to indicate that a parameter is not initialized.
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.