]> git.mxchange.org Git - flightgear.git/blob - src/Airports/parking.hxx
Update FGRunway to process information from threshold.xml files.
[flightgear.git] / src / Airports / parking.hxx
1 // parking.hxx - A class to handle airport startup locations in
2 // FlightGear. This code is intended to be used by AI code and
3 // initial user-startup location selection.
4 //
5 // Written by Durk Talsma, started December 2004.
6 //
7 // Copyright (C) 2004 Durk Talsma.
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 //
23 // $Id$
24
25 #ifndef _PARKING_HXX_
26 #define _PARKING_HXX_
27
28 #ifndef __cplusplus
29 # error This library requires C++
30 #endif
31
32 #include <simgear/compiler.h>
33
34 #include <string>
35 #include <vector>
36
37 #include "gnnode.hxx"
38
39 using std::string;
40 using std::vector;
41
42 class FGTaxiRoute;
43
44
45 class FGParking : public FGTaxiNode {
46 private:
47   double heading;
48   double radius;
49   string parkingName;
50   string type;
51   string airlineCodes;
52  
53   bool available;
54   int pushBackPoint;
55   FGTaxiRoute *pushBackRoute;
56
57 public:
58   FGParking() :
59       heading(0),
60       radius(0),
61       available(true),
62       pushBackPoint(0),
63       pushBackRoute(0)
64   {
65   };
66
67   FGParking(const FGParking &other) :
68       FGTaxiNode   (other),
69       heading      (other.heading),
70       radius       (other.radius),
71       parkingName  (other.parkingName),
72       type         (other.type),
73       airlineCodes (other.airlineCodes),
74       available    (other.available),
75       pushBackPoint(other.pushBackPoint),
76       pushBackRoute(other.pushBackRoute)
77   {
78   };
79
80
81   FGParking& operator =(const FGParking &other)
82   {
83       FGTaxiNode::operator=(other);
84       heading      = other.heading;
85       radius       = other.radius;
86       parkingName  = other.parkingName;
87       type         = other.type;
88       airlineCodes = other.airlineCodes;
89       available    = other.available;
90       pushBackPoint= other.pushBackPoint;
91       pushBackRoute= other.pushBackRoute;
92       return *this;
93   };
94   ~FGParking();
95 //   FGParking(double lat,
96 //          double lon,
97 //          double hdg,
98 //          double rad,
99 //          int idx,
100 //          const string& name,
101 //          const string& tpe,
102 //          const string& codes);
103
104   void setHeading  (double hdg)  { heading     = hdg;  };
105   void setRadius   (double rad)  { radius      = rad;  };
106
107   void setName     (const string& name) { parkingName = name; };
108   void setType     (const string& tpe)  { type        = tpe;  };
109   void setCodes    (const string& codes){ airlineCodes= codes;};
110
111   void setPushBackRoute(FGTaxiRoute *val) { pushBackRoute = val; };
112   void setPushBackPoint(int val)          { pushBackPoint = val; };
113
114   bool isAvailable ()         { return available;};
115   void setAvailable(bool val) { available = val; };
116   
117   double getHeading  () { return heading;     };
118   double getRadius   () { return radius;      };
119
120   string getType     () { return type;        };
121   string getCodes    () { return airlineCodes;};
122   string getName     () { return parkingName; };
123
124   FGTaxiRoute * getPushBackRoute () { return pushBackRoute; };
125
126   int getPushBackPoint () { return pushBackPoint; };
127
128   bool operator< (const FGParking &other) const {
129     return radius < other.radius; };
130 };
131
132 typedef vector<FGParking> FGParkingVec;
133 typedef vector<FGParking>::iterator FGParkingVecIterator;
134 typedef vector<FGParking>::const_iterator FGParkingVecConstIterator;
135
136 #endif