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 251 2008-01-31 12:23:30Z robotos $
00025  */
00026 
00027 #ifndef OGREHUD_HH
00028 #define OGREHUD_HH
00029 
00030 #include <OgrePrerequisites.h>
00031 #include <OgreColourValue.h>
00032 #include <OgrePanelOverlayElement.h>
00033 
00034 namespace gazebo
00035 {
00038 
00039   class CameraSensor;
00040   class OgreAdaptor;
00041 
00043   class OgreHUD
00044   {
00046     private: OgreHUD();
00047 
00049     private: ~OgreHUD();
00050 
00052     public: static OgreHUD *Instance();
00053 
00055     public: static void Close();
00056 
00058     public: void Update();
00059 
00061     public: void SetCamera(const CameraSensor *camera);
00062 
00064     public: void AddTextBox( const std::string& id,
00065                 const std::string &panelId,
00066                 const std::string& text,
00067                 Ogre::Real x, 
00068                 Ogre::Real y,
00069                 Ogre::Real width, 
00070                 Ogre::Real height,
00071                 const Ogre::ColourValue& color = 
00072                 Ogre::ColourValue(1.0, 1.0, 1.0, 1.0));
00073 
00075     public: void ToggleVisible();
00076 
00078     public: void ToggleHelp();
00079 
00081     public: void HideTextBox(const std::string &id);
00082 
00084     public: void ShowTextBox(const std::string &id);
00085 
00087     public: void RemoveTextBox(const std::string& id);
00088 
00090     public: void SetText(const std::string& id, const std::string& Text);
00091 
00093     private: void CreateTextBoxes();
00094 
00096     private: void CreateHelp();
00097 
00098     private: Ogre::OverlayManager *overlayMgr;
00099     private: Ogre::OverlayContainer *hudPanel;
00100 //    private: Ogre::OverlayContainer *cameraPanel;
00101     private: Ogre::PanelOverlayElement *cameraPanel;
00102     private: Ogre::OverlayContainer *helpPanel;
00103     private: Ogre::OverlayContainer *backgroundPanel;
00104 
00105     private: static OgreHUD *myself;
00106 
00107     private: OgreAdaptor *ogreAdaptor;
00108   };
00109 
00111 }
00112 #endif

Last updated Aug 04 2007