]> git.mxchange.org Git - flightgear.git/blob - src/Airports/parking.hxx
Make FGTaxiNode and FGParking inherit FGPositioned.
[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 #include <simgear/sg_inlines.h>
34
35 #include <string>
36 #include <vector>
37 #include <memory> // for std::auto_ptr
38
39 #include "gnnode.hxx"
40
41 class FGTaxiRoute;
42
43
44 class FGParking : public FGTaxiNode
45 {
46 private:
47   double heading;
48   double radius;
49   std::string parkingName;
50   std::string type;
51   std::string airlineCodes;
52  
53   bool available;
54   int pushBackPoint;
55   std::auto_ptr<FGTaxiRoute> pushBackRoute;
56
57   SG_DISABLE_COPY(FGParking);
58 public:
59   FGParking(PositionedID aGuid, int index, const SGGeod& pos,
60             double heading, double radius,
61             const std::string& name, const std::string& type,
62             const std::string& codes);
63   virtual ~FGParking();
64
65   void setHeading  (double hdg)  { heading     = hdg;  };
66   void setRadius   (double rad)  { radius      = rad;  };
67
68   void setName     (const std::string& name) { parkingName = name; };
69   void setType     (const std::string& tpe)  { type        = tpe;  };
70   void setCodes    (const std::string& codes){ airlineCodes= codes;};
71
72   void setPushBackRoute(std::auto_ptr<FGTaxiRoute> val) { pushBackRoute = val; };
73   void setPushBackPoint(int val)          { pushBackPoint = val; };
74
75   bool isAvailable ()   const { return available;};
76   void setAvailable(bool val) { available = val; };
77   
78   double getHeading  () const { return heading;     };
79   double getRadius   () const { return radius;      };
80
81   std::string getType     () const { return type;        };
82   std::string getCodes    () const { return airlineCodes;};
83   std::string getName     () const { return parkingName; };
84
85   FGTaxiRoute * getPushBackRoute () { return pushBackRoute.get(); };
86
87   int getPushBackPoint () { return pushBackPoint; };
88
89   bool operator< (const FGParking &other) const {
90     return radius < other.radius; };
91 };
92
93 typedef std::vector<FGParking*> FGParkingVec;
94 typedef FGParkingVec::iterator FGParkingVecIterator;
95 typedef FGParkingVec::const_iterator FGParkingVecConstIterator;
96
97 #endif