Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/elements/glgui_radar.h @ 8992

Last change on this file since 8992 was 8992, checked in by bensch, 18 years ago

more radar work

File size: 1.2 KB
Line 
1/*!
2 * @file glgui_radar.h
3 * @brief Definition of an Radar, that displays a bar and a Text
4*/
5
6#ifndef _GLGUI_RADAR_H
7#define _GLGUI_RADAR_H
8
9#include "glgui_widget.h"
10
11class WorldEntity;
12
13namespace OrxGui
14{
15
16  //! A class for ...
17  class GLGuiRadar : public GLGuiWidget
18  {
19  public:
20    typedef enum {
21      Linear,
22      Exponential,
23    } Attenuation;
24
25  public:
26    GLGuiRadar();
27    virtual ~GLGuiRadar();
28
29    void setRange(float range);
30
31    void setUpdateInterval(float updateInterval) { this->_updateInterval = updateInterval; };
32    void setAttenuation(Attenuation attenuation);
33
34    float range() const { return this->_range; }
35
36
37    void tick(float dt);
38    void draw() const;
39
40  protected:
41    virtual void resize();
42    virtual void showing();
43    virtual void hiding();
44
45  private:
46    typedef struct
47    {
48      Color                           dotColor;
49      const std::list<WorldEntity*>&  entityList;
50      std::vector<Vector2D>           position;
51    }
52    DotList;
53
54    std::vector<DotList>        _dotLists;
55
56    Attenuation                 _attenuation;
57    float                       _range;
58
59
60    float                       _updateInterval;
61    float                       _timePassed;
62  };
63}
64#endif /* _GLGUI_RADAR_H */
Note: See TracBrowser for help on using the repository browser.