47 #include <visp3/core/vpConfig.h>
52 #include <visp3/core/vpImage.h>
53 #include <visp3/core/vpImageConvert.h>
54 #include <visp3/core/vpRGBa.h>
56 #include <visp3/core/vpHomogeneousMatrix.h>
57 #include <visp3/core/vpImageTools.h>
58 #include <visp3/core/vpRotationMatrix.h>
59 #include <visp3/core/vpRxyzVector.h>
62 #include <OgreFrameListener.h>
86 class VISP_EXPORT
vpAROgre :
public Ogre::FrameListener,
87 public Ogre::WindowEventListener
90 public OIS::KeyListener
95 const char *resourcePath =
96 #ifdef VISP_HAVE_OGRE_RESOURCES_PATH
97 VISP_HAVE_OGRE_RESOURCES_PATH,
101 const char *pluginsPath =
102 #ifdef VISP_HAVE_OGRE_PLUGINS_PATH
103 VISP_HAVE_OGRE_PLUGINS_PATH
124 mOptionalResourceLocation.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);
162 virtual void init(
vpImage<vpRGBa> &I,
bool bufferedKeys =
false,
bool hidden =
false);
175 virtual bool keyPressed(
const OIS::KeyEvent & ) {
return true; }
182 void load(
const std::string &entityName,
const std::string &model);
198 updateCameraProjection();
208 mNearClipping = dist;
209 updateCameraProjection();
223 inline void setPluginsPath(
const char *pluginsPath) { mPluginsPath = pluginsPath; }
239 inline void setResourcePath(
const char *resourcePath) { mResourcePath = resourcePath; }
241 void setRotation(
const std::string &sceneName,
const vpRotationMatrix &wRo);
243 void setScale(
const std::string &sceneName,
float factorx,
float factory,
float factorz);
256 void setVisibility(
const std::string &sceneName,
bool isVisible);
279 if (mWindow ==
nullptr) {
282 mWindow->reposition(
static_cast<int>(win_x),
static_cast<int>(win_y));
285 virtual void windowClosed(Ogre::RenderWindow *rw);
288 virtual void init(
bool bufferedKeys =
false,
bool hidden =
false);
289 virtual void createCamera(
void);
297 virtual void closeOIS(
void);
304 virtual bool updateScene(
const Ogre::FrameEvent & ) {
return true; };
324 mSceneMgr->destroyAllCameras();
325 mSceneMgr->clearScene();
326 mRoot->destroySceneManager(mSceneMgr);
332 virtual void updateCameraProjection(
void);
342 bool frameStarted(
const Ogre::FrameEvent &evt);
344 bool frameEnded(
const Ogre::FrameEvent &evt);
346 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.