Updraft  1.0
Open source glider flight visualisation tool.
airspace.h
Go to the documentation of this file.
00001 // UserAirspace.h
00002 
00003 #ifndef UPDRAFT_SRC_LIBRARIES_OPENAIRSPACE_AIRSPACE_H_
00004 #define UPDRAFT_SRC_LIBRARIES_OPENAIRSPACE_AIRSPACE_H_
00005 
00006 #include "openairspace_global.h"
00007 #include "geometry.h"
00008 
00009 
00074 namespace OpenAirspace {
00075 
00078 class OPENAIRSPACE_EXPORT Airspace {
00079  public :
00081 
00091     enum ACType { R, Q, P, A, B, C, D, E, GP, CTR, W, NA };
00092 
00094     struct SP_str {
00095       int style;
00096       int width;
00097       int R, G, B;
00098     };
00099 
00101     struct SB_str {
00102       int R, G, B;
00103     };
00104 
00110     Airspace(QTextStream* ts, bool* acOn);
00111 
00113     inline const QString* const GetName() const { return this->AN; }
00114 
00116     inline const OpenAirspace::Airspace::ACType& GetClass() {
00117       return this->AC;
00118     }
00119     inline const QString& GetClassName() {
00120       if (!this->ACstring)
00121         this->ACstring = new QString("NA");
00122       return *this->ACstring;
00123     }
00124 
00126     inline const QString* const GetFloor() const { return this->AL; }
00127 
00129     inline const QString* const GetCeiling() const { return this->AH; }
00130 
00132     inline const QVector<Position*>& GetTagCoor() {
00133       return *this->AT; }
00134 
00136     inline int GetGeometrySize() {
00137       return (geometry) ? this->geometry->size() : 0; }
00138 
00140     inline const QVector<OpenAirspace::Geometry*>& GetGeometry() {
00141       return *this->geometry; }
00142 
00144     inline const QVector<Position*>& GetAirWay() {
00145       return *this->DY; }
00146 
00148     inline const SP_str* GetPen() const {
00149       if (this->SP)
00150         return SP;
00151       else
00152         return NULL; }
00154     inline const SB_str* GetBrush() const {
00155       if (this->SB)
00156         return SB;
00157       else
00158         return NULL; }
00159 
00161     ~Airspace();
00162 
00164     static Position X;
00165     static bool validX;
00166 
00173     int ParseHeight(bool floor, bool* agl);
00174 
00175   private :
00180     Position ParseCoord(const QString& parse);
00181 
00183     ACType AC;
00184     QString* ACstring;
00185 
00189     QString* AN;
00190 
00194     QString* AL;
00195 
00199     QString* AH;
00200 
00204     QVector<Position*>* AT;
00205 
00208     QString* TO;
00209 
00211     QString* TC;
00212 
00214     SP_str* SP;
00215     SB_str* SB;
00216 
00220     bool CW;
00221 
00223     double Wi;
00224 
00227     float Z;
00228 
00230     QVector<Position*>* DY;
00232 
00234     QVector<Geometry*>* geometry;
00235   };  // Airspace
00236 }  // OpenAirspace
00237 
00238 
00239 #endif  // UPDRAFT_SRC_LIBRARIES_OPENAIRSPACE_AIRSPACE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines