OgreHUD.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 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 
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