Gazebo

OgreAdaptor.hh

00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 /* Desc: Middleman between OGRE and Gazebo
00022  * Author: Nate Koenig
00023  * Date: 13 Feb 2006
00024  * SVN: $Id: OgreAdaptor.hh 6283 2008-04-08 00:58:08Z natepak $
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 Node;
00047   class LogManager;
00048   class Overlay;
00049   class OverlayContainer;
00050   class SceneNode;
00051   class RenderTarget;
00052   class ColourValue;
00053   class RenderSystem;
00054 }
00055 
00056 namespace gazebo
00057 {
00060 
00061 
00062 class XMLConfigNode;
00063 class OgreFrameListener;
00064 class Entity;
00065 
00067 class OgreAdaptor : public SingletonT<OgreAdaptor>
00068 {
00069 
00071   private: OgreAdaptor();
00072 
00074   private: virtual ~OgreAdaptor();
00075 
00077   public: void Close();
00078 
00081   public: void Init(XMLConfigNode *rootNode);
00082 
00084   public: void Save(XMLConfigNode *node);
00085 
00087   public: void Init(Display *display, XVisualInfo *visual, Window windowId, int width, int height); 
00089   public: int Render();
00090 
00092   public: void ResizeWindow(unsigned int w, unsigned int h);
00093 
00094   private: void LoadPlugins();
00095   private: void SetupResources();
00096   private: void SetupRenderSystem(bool create);
00097   private: void CreateWindow();
00098 
00100   public: Ogre::Root *root;
00101 
00103   public: Ogre::SceneManager *sceneMgr;
00104 
00106   public: Ogre::RenderSystem *renderSys;
00107 
00109   public: Ogre::RenderWindow *window;
00110 
00112   public: Ogre::Camera *camera;
00113 
00115   public: Ogre::Viewport *viewport;
00116 
00118   public: Ogre::InputReader *inputDevice;
00119 
00120   private: Ogre::LogManager *logManager;
00121 
00122   // Our custom frame listener
00123   private: OgreFrameListener *frameListener;
00124 
00125   public: Ogre::ColourValue *backgroundColor;
00126 
00127   private: std::string videoMode;
00128 
00129   private: bool ogreWindow;
00130   
00131   //bsp attributes saved to write XML file back
00132   private: int sceneType;
00133   private: std::string worldGeometry;
00134 
00135   private: Vector3 terrainSize;
00136   private: unsigned int terrainVertSize;
00137   private: std::string terrainImage;
00138   
00139   private: friend class DestroyerT<OgreAdaptor>;
00140   private: friend class SingletonT<OgreAdaptor>;
00141 
00142 };
00143 
00144 /*/// \brief 
00145 class OgreGLXWindowInterface
00146 {
00147   public: virtual ~OgreGLXWindowInterface() = 0;
00148 
00149   // Call this with true when the window is mapped/visible, false when the window is unmapped/invisible
00150   public: virtual void exposed(bool active) = 0;
00151 
00152   // Call this to notify the window was resized
00153   public: virtual void resized(size_t width, size_t height) = 0;
00154 };
00155 */
00156 
00158 
00159 }
00160 #endif

Last updated Aug 04 2007