2020-07-01 20:57:15 +01:00
|
|
|
// pavement.hxx - class to represent complex taxiway specified in v850 apt.dat
|
2009-06-14 11:08:21 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2009 Frederic Bouvier
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
#ifndef FG_PAVEMENT_HXX
|
|
|
|
#define FG_PAVEMENT_HXX
|
|
|
|
|
|
|
|
#include <Navaids/positioned.hxx>
|
|
|
|
|
|
|
|
class FGPavement : public FGPositioned
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/*
|
|
|
|
* 111 = Node (simple point).
|
|
|
|
* 112 = Node with Bezier control point.
|
|
|
|
* 113 = Node (close loop) point (to close a pavement boundary).
|
|
|
|
* 114 = Node (close loop) point with Bezier control point (to close a pavement boundary).
|
|
|
|
* 115 = Node (end) point to terminate a linear feature (so has no descriptive codes).
|
|
|
|
* 116 = Node (end) point with Bezier control point, to terminate a linear feature (so has no descriptive codes).
|
|
|
|
*/
|
|
|
|
struct NodeBase : public SGReferenced
|
|
|
|
{
|
|
|
|
SGGeod mPos;
|
|
|
|
bool mClose;
|
2020-07-01 20:57:15 +01:00
|
|
|
bool mLoop;
|
|
|
|
int mPaintCode;
|
|
|
|
int mLightCode;
|
2009-06-14 11:08:21 +00:00
|
|
|
virtual ~NodeBase(){} // To enable RTTI
|
|
|
|
};
|
2020-07-01 20:57:15 +01:00
|
|
|
struct SimpleNode : public NodeBase //111,113,115
|
2009-06-14 11:08:21 +00:00
|
|
|
{
|
2020-07-01 20:57:15 +01:00
|
|
|
SimpleNode(const SGGeod &aPos, bool aClose, bool aLoop, int aPaintCode, int aLightCode) {
|
2009-06-14 11:08:21 +00:00
|
|
|
mPos = aPos;
|
|
|
|
mClose = aClose;
|
2020-07-01 20:57:15 +01:00
|
|
|
mLoop = aLoop;
|
|
|
|
mPaintCode = aPaintCode;
|
|
|
|
mLightCode = aLightCode;
|
2009-06-14 11:08:21 +00:00
|
|
|
}
|
|
|
|
};
|
2020-07-01 20:57:15 +01:00
|
|
|
struct BezierNode : public NodeBase //112,114,116
|
2009-06-14 11:08:21 +00:00
|
|
|
{
|
2020-07-01 20:57:15 +01:00
|
|
|
BezierNode(const SGGeod &aPos, const SGGeod &aCtrlPt, bool aClose, bool aLoop, int aPaintCode, int aLightCode) {
|
2009-06-14 11:08:21 +00:00
|
|
|
mPos = aPos;
|
|
|
|
mClose = aClose;
|
2020-07-01 20:57:15 +01:00
|
|
|
mLoop = aLoop;
|
2009-06-14 11:08:21 +00:00
|
|
|
mControl = aCtrlPt;
|
2020-07-01 20:57:15 +01:00
|
|
|
mPaintCode = aPaintCode;
|
2020-08-29 11:03:31 -05:00
|
|
|
mLightCode = aLightCode;
|
2009-06-14 11:08:21 +00:00
|
|
|
}
|
|
|
|
SGGeod mControl;
|
|
|
|
};
|
|
|
|
typedef std::vector<SGSharedPtr<NodeBase> > NodeList;
|
|
|
|
|
|
|
|
|
2012-08-28 00:26:36 +01:00
|
|
|
FGPavement(PositionedID aGuid, const std::string& aIdent, const SGGeod& aPos);
|
2009-06-14 11:08:21 +00:00
|
|
|
|
2020-07-01 20:57:15 +01:00
|
|
|
void addNode(const SGGeod &aPos, bool aClose = false, bool aLoop = false, int paintCode = 0, int lightCode = 0);
|
|
|
|
void addBezierNode(const SGGeod &aPos, const SGGeod &aCtrlPt, bool aClose = false, bool aLoop = false, int paintCode = 0, int lightCode = 0);
|
2009-06-14 11:08:21 +00:00
|
|
|
|
|
|
|
const NodeList &getNodeList() const { return mNodes; }
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
NodeList mNodes;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // of FG_PAVEMENT_HXX
|