Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hudelements/src/orxonox/interfaces/RadarViewable.h @ 6727

Last change on this file since 6727 was 6727, checked in by scheusso, 14 years ago

HUDRadar now working again

  • Property svn:eol-style set to native
File size: 3.9 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _RadarViewable_H__
30#define _RadarViewable_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include <string>
35#include <cassert>
36
37#include "util/Math.h"
38#include "core/OrxonoxClass.h"
39
40namespace orxonox
41{
42    class BaseObject;
43
44    /**
45    @brief Interface for receiving window events.
46    */
47    class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
48    {
49    public:
50        enum Shape
51        {
52            Square,
53            Dot,
54            Triangle
55        };
56
57
58    public:
59        RadarViewable(BaseObject* creator);
60        virtual ~RadarViewable();
61
62        inline void setRadarObjectCamouflage(float camouflage)
63            {
64                if( this->radarObjectCamouflage_ != camouflage )
65                {
66                    this->radarObjectCamouflage_ = camouflage;
67                    this->settingsChanged();
68                }
69            }
70        inline float getRadarObjectCamouflage() const
71            { return this->radarObjectCamouflage_; }
72
73        inline void setRadarObjectColour(const ColourValue& colour)
74            {
75                if(this->radarObjectColour_ != colour)
76                {
77                    this->radarObjectColour_ = colour;
78                    this->settingsChanged();
79                }
80            }
81        inline const ColourValue& getRadarObjectColour() const
82            { return this->radarObjectColour_; }
83
84//         void setRadarObjectDescription(const std::string& str);
85//         inline const std::string& getRadarObjectDescription() const
86//             { return this->radarObjectDescription_; }
87
88        inline void setRadarVisibility(bool b)
89            { 
90                if(b!=this->bVisibility_)
91                {
92                    this->bVisibility_ = b;
93                    this->settingsChanged();
94                }
95            }
96        inline bool getRadarVisibility() const
97            { return this->bVisibility_; }
98
99        virtual const WorldEntity* getWorldEntity() const = 0;
100
101        const Vector3& getRVWorldPosition() const;
102        Vector3 getRVOrientedVelocity() const;
103
104        inline void setRadarObjectShape(Shape shape)
105            {
106                if( this->radarObjectShape_ != shape )
107                {
108                    this->radarObjectShape_ = shape;
109                    this->settingsChanged();
110                }
111            }
112        inline Shape getRadarObjectShape() const
113            { return this->radarObjectShape_; }
114        void settingsChanged();
115
116
117        bool isHumanShip_;
118        inline const std::string& getUniqueId()
119        {
120            return this->uniqueId_;
121        }
122        //friend class Map;
123
124    private:
125        void validate(const WorldEntity* object) const;
126        bool bVisibility_;
127        bool bInitialized_;
128        //Map
129        std::string uniqueId_;
130        BaseObject* creator_;
131
132
133        //Radar
134        float radarObjectCamouflage_;
135        Shape radarObjectShape_;
136        std::string radarObjectDescription_;
137        ColourValue radarObjectColour_;
138
139    };
140}
141
142#endif /* _RadarViewable_H__ */
Note: See TracBrowser for help on using the repository browser.