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 mOptionalResourceLocation.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);
Implementation of an augmented reality viewer using Ogre3D 3rd party.
OIS::InputManager * mInputManager
double getNearClippingDistance() const
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
void setFarClippingDistance(const double &dist)
void setNearClippingDistance(const double &dist)
virtual bool keyPressed(const OIS::KeyEvent &)
void setWindowPosition(unsigned int win_x, unsigned int win_y)
virtual bool destroyScene(void)
unsigned int mBackgroundHeight
void addResource(const std::string &resourceLocation)
Ogre::String mPluginsPath
Ogre::Rectangle2D * mBackground
virtual void createScene(void)
Ogre::SceneManager * getSceneManager()
unsigned int mWindowHeight
Ogre::Camera * getCamera()
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.
Implementation of a rotation matrix and operations on such kind of matrices.
Class that consider the case of a translation vector.