source:
orxonox.OLD/trunk/src/world_entities/elements/glgui_radar.h
@
10365
Last change on this file since 10365 was 8996, checked in by bensch, 18 years ago | |
---|---|
File size: 1.6 KB |
Rev | Line | |
---|---|---|
[4838] | 1 | /*! |
[8991] | 2 | * @file glgui_radar.h |
3 | * @brief Definition of an Radar, that displays a bar and a Text | |
[3245] | 4 | */ |
[1853] | 5 | |
[8991] | 6 | #ifndef _GLGUI_RADAR_H |
7 | #define _GLGUI_RADAR_H | |
[1853] | 8 | |
[8991] | 9 | #include "glgui_widget.h" |
[1853] | 10 | |
[8993] | 11 | class PNode; |
[8991] | 12 | class WorldEntity; |
13 | ||
[8972] | 14 | namespace OrxGui |
15 | { | |
[3543] | 16 | |
[8972] | 17 | //! A class for ... |
[8991] | 18 | class GLGuiRadar : public GLGuiWidget |
[8972] | 19 | { |
[8992] | 20 | public: |
21 | typedef enum { | |
22 | Linear, | |
23 | Exponential, | |
24 | } Attenuation; | |
[3543] | 25 | |
[8973] | 26 | public: |
[8991] | 27 | GLGuiRadar(); |
28 | virtual ~GLGuiRadar(); | |
[2036] | 29 | |
[8993] | 30 | void addEntityList(const std::list<WorldEntity*>* entityList, const Color& color); |
31 | void removeEntityList(const std::list<WorldEntity*>* entityList); | |
32 | ||
[8991] | 33 | void setRange(float range); |
[8992] | 34 | |
[8993] | 35 | void setCenterNode(const PNode* center); |
[8992] | 36 | void setUpdateInterval(float updateInterval) { this->_updateInterval = updateInterval; }; |
37 | void setAttenuation(Attenuation attenuation); | |
38 | ||
[8993] | 39 | |
[8991] | 40 | float range() const { return this->_range; } |
[8974] | 41 | |
[8993] | 42 | void updateRadar(); |
[8992] | 43 | |
[8996] | 44 | virtual void tick(float dt); |
[8992] | 45 | void draw() const; |
46 | ||
[8973] | 47 | protected: |
[8981] | 48 | virtual void resize(); |
[8975] | 49 | virtual void showing(); |
50 | virtual void hiding(); | |
[1853] | 51 | |
[8973] | 52 | private: |
[8993] | 53 | void init(); |
54 | ||
55 | private: | |
[8991] | 56 | typedef struct |
57 | { | |
[8992] | 58 | Color dotColor; |
[8993] | 59 | const std::list<WorldEntity*>* entityList; |
60 | std::vector<Vector2D> positions; | |
[8992] | 61 | } |
62 | DotList; | |
[1853] | 63 | |
[8993] | 64 | const PNode* _centerNode; |
65 | std::vector<DotList> _dotLists; | |
[8991] | 66 | |
[8993] | 67 | Attenuation _attenuation; |
68 | float _range; | |
[8991] | 69 | |
[8992] | 70 | |
[8993] | 71 | float _updateInterval; |
72 | float _timePassed; | |
[8972] | 73 | }; |
74 | } | |
[8991] | 75 | #endif /* _GLGUI_RADAR_H */ |
Note: See TracBrowser
for help on using the repository browser.