Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 5, 2012, 10:29:17 PM (12 years ago)
Author:
landauf
Message:

reformatted HUDNavigation… wtf happened here? do people know we have a style-guide?
no functional changes in code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/overlays/hud/HUDNavigation.h

    r9016 r9280  
    3636#include <string>
    3737
    38 
    3938#include "util/OgreForwardRefs.h"
    4039#include "tools/interfaces/Tickable.h"
     
    4443namespace orxonox
    4544{
    46 class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
    47 {
    48 public:
    49     HUDNavigation ( BaseObject* creator );
    50     virtual ~HUDNavigation();
     45    class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
     46    {
     47        public:
     48            HUDNavigation(BaseObject* creator);
     49            virtual ~HUDNavigation();
    5150
    52     void setConfigValues();
     51            void setConfigValues();
    5352
    54     virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode );
    55     virtual void tick ( float dt );
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual void tick(float dt);
    5655
    57     // RadarListener interface
    58     virtual void addObject ( RadarViewable* object );
    59     virtual void removeObject ( RadarViewable* viewable );
    60     virtual void objectChanged ( RadarViewable* viewable );
     56            // RadarListener interface
     57            virtual void addObject(RadarViewable* object);
     58            virtual void removeObject(RadarViewable* viewable);
     59            virtual void objectChanged(RadarViewable* viewable);
    6160
    62     virtual void changedOwner();
    63     virtual void sizeChanged();
    64     virtual void angleChanged() { }
    65     virtual void positionChanged() { }
    66     virtual void radarTick ( float dt ) {}
     61            virtual void changedOwner();
     62            virtual void sizeChanged();
     63            virtual void angleChanged() { }
     64            virtual void positionChanged() { }
     65            virtual void radarTick(float dt) {}
    6766
    68     inline float getRadarSensitivity() const
    69     { return 1.0f; }
     67            inline float getRadarSensitivity() const
     68                { return 1.0f; }
    7069
    71     unsigned int getMarkerLimit() { return this->markerLimit_; }
     70            inline unsigned int getMarkerLimit() const
     71                { return this->markerLimit_; }
    7272
    73 private:
    74     struct ObjectInfo
    75     {
    76         Ogre::PanelOverlayElement* panel_;
    77         Ogre::TextAreaOverlayElement* text_;
    78         bool outOfView_;
    79         bool wasOutOfView_;
     73        private:
     74            struct ObjectInfo
     75            {
     76                Ogre::PanelOverlayElement* panel_;
     77                Ogre::TextAreaOverlayElement* text_;
     78                bool outOfView_;
     79                bool wasOutOfView_;
     80            };
    8081
     82            bool showObject(RadarViewable* rv);
     83
     84            // XMLPort accessors
     85            inline void setNavMarkerSize(float size)
     86            {
     87                navMarkerSize_ = size;
     88                this->sizeChanged();
     89            }
     90            inline float getNavMarkerSize() const
     91                { return navMarkerSize_; }
     92            inline void setDetectionLimit(float limit)
     93                { this->detectionLimit_ = limit; }
     94            inline float getDetectionLimit() const
     95                { return this->detectionLimit_; }
     96
     97            void setTextSize(float size);
     98            float getTextSize() const;
     99
     100            void setFont(const std::string& font);
     101            const std::string& getFont() const;
     102
     103            float getArrowSizeX(int dist) const;
     104            float getArrowSizeY(int dist) const;
     105
     106            std::map<RadarViewable*, ObjectInfo> activeObjectList_;
     107            std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
     108
     109            float navMarkerSize_;
     110            std::string fontName_;
     111            float textSize_;
     112            bool showDistance_;
     113
     114            unsigned int markerLimit_;
     115            float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
    81116    };
    82 
    83     bool showObject( RadarViewable* rv );
    84 
    85     // XMLPort accessors
    86     void setNavMarkerSize ( float size )
    87         { navMarkerSize_ = size; this->sizeChanged(); }
    88     float getNavMarkerSize() const
    89         { return navMarkerSize_; }
    90     void setDetectionLimit( float limit )
    91         { this->detectionLimit_ = limit; }
    92     float getDetectionLimit() const
    93         { return this->detectionLimit_; }
    94 
    95     void setTextSize ( float size );
    96     float getTextSize() const;
    97 
    98     void setFont ( const std::string& font );
    99     const std::string& getFont() const;
    100 
    101     typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
    102     ObjectMap activeObjectList_;
    103 
    104     typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
    105     sortedList sortedObjectList_;
    106 
    107     float getArrowSizeX(int dist);   
    108     float getArrowSizeY(int dist);
    109 
    110     float navMarkerSize_;
    111     std::string fontName_;
    112     float textSize_;
    113     bool showDistance;
    114 
    115     unsigned int markerLimit_;
    116     float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
    117 
    118 };
    119117}
    120118
Note: See TracChangeset for help on using the changeset viewer.