- Timestamp:
- May 27, 2010, 3:58:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h
r6942 r6971 35 35 #include <string> 36 36 37 37 38 #include "util/OgreForwardRefs.h" 38 39 #include "tools/interfaces/Tickable.h" … … 42 43 namespace orxonox 43 44 { 44 class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener 45 class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener 46 { 47 public: 48 HUDNavigation ( BaseObject* creator ); 49 virtual ~HUDNavigation(); 50 51 virtual void XMLPort ( Element& xmlElement, XMLPort::Mode mode ); 52 virtual void tick ( float dt ); 53 54 virtual void addObject ( RadarViewable* object ); 55 virtual void removeObject ( RadarViewable* viewable ); 56 virtual void objectChanged ( RadarViewable* viewable ) {} 57 58 virtual void changedOwner(); 59 virtual void sizeChanged(); 60 virtual void angleChanged() { } 61 virtual void positionChanged() { } 62 virtual void radarTick ( float dt ) {} 63 64 inline float getRadarSensitivity() const 65 { return 1.0f; } 66 67 private: 68 struct ObjectInfo 45 69 { 46 public: 47 HUDNavigation(BaseObject* creator); 48 virtual ~HUDNavigation(); 70 Ogre::PanelOverlayElement* panel_; 71 Ogre::TextAreaOverlayElement* text_; 72 bool outOfView_; 73 bool wasOutOfView_; 49 74 50 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 51 virtual void tick(float dt); 75 }; 52 76 53 virtual void addObject(RadarViewable* object); 54 virtual void removeObject(RadarViewable* viewable); 55 virtual void objectChanged(RadarViewable* viewable) {} 77 // XMLPort accessors 78 void setNavMarkerSize ( float size ) 79 { navMarkerSize_ = size; this->sizeChanged(); } 80 float getNavMarkerSize() const 81 { return navMarkerSize_; } 56 82 57 virtual void changedOwner(); 58 virtual void sizeChanged(); 59 virtual void angleChanged() { } 60 virtual void positionChanged() { } 61 virtual void radarTick(float dt) {} 83 void setTextSize ( float size ); 84 float getTextSize() const; 62 85 63 inline float getRadarSensitivity() const64 { return 1.0f; }86 void setFont ( const std::string& font ); 87 const std::string& getFont() const; 65 88 66 private: 67 struct ObjectInfo 68 { 69 Ogre::PanelOverlayElement* panel_; 70 Ogre::TextAreaOverlayElement* text_; 71 bool outOfView_; 72 bool wasOutOfView_; 73 }; 89 typedef std::map<RadarViewable*, ObjectInfo > ObjectMap; 90 ObjectMap activeObjectList_; 74 91 75 // XMLPort accessors 76 void setNavMarkerSize(float size) 77 { navMarkerSize_ = size; this->sizeChanged(); } 78 float getNavMarkerSize() const 79 { return navMarkerSize_; } 92 typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList; 93 sortedList sortedObjectList_; 80 94 81 void setTextSize(float size);82 float getTextSize() const;83 95 84 void setFont(const std::string& font); 85 const std::string& getFont() const; 96 float navMarkerSize_; 97 std::string fontName_; 98 float textSize_; 86 99 87 typedef std::map<RadarViewable*, ObjectInfo > ObjectMap; 88 ObjectMap activeObjectList_; 100 static const unsigned int markerLimit_ = 5; //TODO: is it possible to set this over the console and/or the IG-Setting 89 101 90 float navMarkerSize_; 91 std::string fontName_; 92 float textSize_; 93 }; 102 103 }; 94 104 } 95 105
Note: See TracChangeset
for help on using the changeset viewer.