Gazebo

OgreHUD.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: Renders a Heads Up Display
00022  * Author: Nate Koenig
00023  * Date: 7 July 2007
00024  * SVN: $Id: OgreHUD.hh 123 2007-09-19 20:36:14Z natepak $
00025  */
00026 
00027 #ifndef OGREHUD_HH
00028 #define OGREHUD_HH
00029 
00030 #include <Ogre.h>
00031 #include <OgrePanelOverlayElement.h>
00032 
00033 namespace gazebo
00034 {
00037 
00038   class CameraSensor;
00039   class OgreAdaptor;
00040 
00042   class OgreHUD
00043   {
00045     private: OgreHUD();
00046 
00048     private: ~OgreHUD();
00049 
00051     public: static OgreHUD *Instance();
00052 
00054     public: void Update();
00055 
00057     public: void SetCamera(const CameraSensor *camera);
00058 
00060     public: void AddTextBox( const std::string& id,
00061                 const std::string &panelId,
00062                 const std::string& text,
00063                 Ogre::Real x, 
00064                 Ogre::Real y,
00065                 Ogre::Real width, 
00066                 Ogre::Real height,
00067                 const Ogre::ColourValue& color = 
00068                 Ogre::ColourValue(1.0, 1.0, 1.0, 1.0));
00069 
00071     public: void ToggleVisible();
00072 
00074     public: void ToggleHelp();
00075 
00077     public: void HideTextBox(const std::string &id);
00078 
00080     public: void ShowTextBox(const std::string &id);
00081 
00083     public: void RemoveTextBox(const std::string& id);
00084 
00086     public: void SetText(const std::string& id, const std::string& Text);
00087 
00089     private: void CreateTextBoxes();
00090 
00092     private: void CreateHelp();
00093 
00094     private: Ogre::OverlayManager *overlayMgr;
00095     private: Ogre::OverlayContainer *hudPanel;
00096 //    private: Ogre::OverlayContainer *cameraPanel;
00097     private: Ogre::PanelOverlayElement *cameraPanel;
00098     private: Ogre::OverlayContainer *helpPanel;
00099     private: Ogre::OverlayContainer *backgroundPanel;
00100 
00101     private: static OgreHUD *myself;
00102 
00103     private: OgreAdaptor *ogreAdaptor;
00104   };
00105 
00107 }
00108 #endif

Last updated Aug 04 2007