OgreAdaptor.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OGREADAPTOR
00028 #define OGREADAPTOR
00029
00030 #include <X11/Xlib.h>
00031 #include <X11/Xutil.h>
00032
00033 #include "SingletonT.hh"
00034 #include "Pose3d.hh"
00035
00036 namespace Ogre
00037 {
00038 class Root;
00039 class SceneManager;
00040 class RenderWindow;
00041 class Viewport;
00042 class InputReader;
00043 class Window;
00044 class Camera;
00045 class SceneNode;
00046 class LogManager;
00047 class Overlay;
00048 class OverlayContainer;
00049 class SceneNode;
00050 class RenderTarget;
00051 class ColourValue;
00052 }
00053
00054 namespace gazebo
00055 {
00058
00059
00060 class XMLConfigNode;
00061 class OgreFrameListener;
00062 class Entity;
00063
00065 class OgreAdaptor : public SingletonT<OgreAdaptor>
00066 {
00068 private: OgreAdaptor();
00069
00071 private: virtual ~OgreAdaptor();
00072
00075 public: void Init(XMLConfigNode *node);
00076
00078 public: void Init(Display *display, XVisualInfo *visual, Window windowId, int width, int height);
00080 public: int Render();
00081
00083 public: void CreateLight(XMLConfigNode *node, Entity *entity);
00084
00086 public: void SetSceneNodePose( Ogre::SceneNode *node, const Pose3d &pose );
00087
00089 public: void SetSceneNodePosition(Ogre::SceneNode *node, const Vector3 &pos);
00090
00092 public: void SetSceneNodeRotation(Ogre::SceneNode *node, const Quatern &rot);
00093
00095 public: Ogre::Camera *CreateCamera(const std::string &name, double nearClip,
00096 double farClip, Ogre::RenderTarget *renderTarget);
00097
00099 public: void ResizeWindow(unsigned int w, unsigned int h);
00100
00101 private: void LoadPlugins();
00102 private: void SetupResources();
00103 private: void SetupRenderSystem(bool create);
00104 private: void CreateWindow();
00105 private: void DrawGrid();
00106
00108 public: Ogre::Root *root;
00109
00111 public: Ogre::SceneManager *sceneMgr;
00112
00114 public: Ogre::RenderWindow *window;
00115
00117 public: Ogre::Camera *camera;
00118
00120 public: Ogre::Viewport *viewport;
00121
00123 public: Ogre::InputReader *inputDevice;
00124
00125 private: Ogre::LogManager *logManager;
00126
00127
00128 private: OgreFrameListener *frameListener;
00129
00130 private: Ogre::ColourValue *backgroundColor;
00131
00132 private: std::string videoMode;
00133
00134 private: bool ogreWindow;
00135
00136 private: Vector3 terrainSize;
00137 private: unsigned int terrainVertSize;
00138 private: std::string terrainImage;
00139
00140 private: friend class DestroyerT<OgreAdaptor>;
00141 private: friend class SingletonT<OgreAdaptor>;
00142 };
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00158
00159 }
00160 #endif