]> git.mxchange.org Git - flightgear.git/blob - src/Airports/pavement.hxx
Merge branch 'next' into durk-atc
[flightgear.git] / src / Airports / pavement.hxx
1 // pavement.hxx - class to represent complex taxiway specified in v850 apt.dat 
2 //
3 // Copyright (C) 2009 Frederic Bouvier
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 //
19 // $Id$
20
21 #ifndef FG_PAVEMENT_HXX
22 #define FG_PAVEMENT_HXX
23
24 #include <Navaids/positioned.hxx>
25
26 class FGPavement : public FGPositioned
27 {
28 public:
29   /*
30    * 111 = Node (simple point).
31    * 112 = Node with Bezier control point.
32    * 113 = Node (close loop) point (to close a pavement boundary).
33    * 114 = Node (close loop) point with Bezier control point (to close a pavement boundary).
34    * 115 = Node (end) point to terminate a linear feature (so has no descriptive codes).
35    * 116 = Node (end) point with Bezier control point, to terminate a linear feature (so has no descriptive codes).
36    */
37   struct NodeBase : public SGReferenced
38   {
39     SGGeod mPos;
40     bool mClose;
41     virtual ~NodeBase(){} // To enable RTTI
42   };
43   struct SimpleNode : public NodeBase //111,113
44   {
45     SimpleNode(const SGGeod &aPos, bool aClose) {
46       mPos = aPos;
47       mClose = aClose;
48     }
49   };
50   struct BezierNode : public NodeBase //112,114
51   {
52     BezierNode(const SGGeod &aPos, const SGGeod &aCtrlPt, bool aClose) {
53       mPos = aPos;
54       mClose = aClose;
55       mControl = aCtrlPt;
56     }
57     SGGeod mControl;
58   };
59   typedef std::vector<SGSharedPtr<NodeBase> > NodeList;
60
61
62   FGPavement(const std::string& aIdent, const SGGeod& aPos);
63
64   void addNode(const SGGeod &aPos, bool aClose = false);
65   void addBezierNode(const SGGeod &aPos, const SGGeod &aCtrlPt, bool aClose = false);
66
67   const NodeList &getNodeList() const { return mNodes; }
68
69
70 private:
71   NodeList mNodes;
72 };
73
74 #endif // of FG_PAVEMENT_HXX