2007-07-05 19:00:59 +00:00
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _GN_NODE_HXX_
|
|
|
|
#define _GN_NODE_HXX_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2008-12-30 07:41:15 +00:00
|
|
|
|
2007-07-05 19:00:59 +00:00
|
|
|
#include <simgear/compiler.h>
|
2012-09-25 00:31:17 +01:00
|
|
|
#include <simgear/structure/SGSharedPtr.hxx>
|
|
|
|
|
|
|
|
#include <Navaids/positioned.hxx>
|
2007-07-05 19:00:59 +00:00
|
|
|
|
|
|
|
class FGTaxiSegment;
|
2012-09-25 00:31:17 +01:00
|
|
|
|
2009-06-09 19:39:18 +00:00
|
|
|
typedef std::vector<FGTaxiSegment*> FGTaxiSegmentVector;
|
2007-07-05 19:00:59 +00:00
|
|
|
typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator;
|
|
|
|
|
2007-07-15 14:08:31 +00:00
|
|
|
bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b);
|
|
|
|
bool sortByLength (FGTaxiSegment *a, FGTaxiSegment *b);
|
2007-07-05 19:00:59 +00:00
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
class FGTaxiNode : public FGPositioned
|
2007-07-05 19:00:59 +00:00
|
|
|
{
|
2012-09-23 21:42:40 +01:00
|
|
|
protected:
|
2007-07-05 19:00:59 +00:00
|
|
|
int index;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
|
|
|
bool isOnRunway;
|
|
|
|
int holdType;
|
2007-07-05 19:00:59 +00:00
|
|
|
FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
// used in way finding - should really move to a dynamic struct
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
double pathScore;
|
|
|
|
FGTaxiNode* previousNode;
|
|
|
|
FGTaxiSegment* previousSeg;
|
|
|
|
|
2011-09-03 11:26:17 +02:00
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
public:
|
|
|
|
FGTaxiNode(PositionedID aGuid, int index, const SGGeod& pos, bool aOnRunway, int aHoldType);
|
|
|
|
virtual ~FGTaxiNode();
|
|
|
|
|
2011-04-17 10:19:58 +02:00
|
|
|
void setElevation(double val);
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
|
|
|
|
|
|
|
|
void setPathScore (double val) { pathScore = val; };
|
|
|
|
void setPreviousNode(FGTaxiNode *val) { previousNode = val; };
|
|
|
|
void setPreviousSeg (FGTaxiSegment *val) { previousSeg = val; };
|
|
|
|
|
|
|
|
FGTaxiNode *getPreviousNode() { return previousNode; };
|
|
|
|
FGTaxiSegment *getPreviousSegment() { return previousSeg; };
|
|
|
|
|
|
|
|
double getPathScore() { return pathScore; };
|
2008-12-30 07:41:15 +00:00
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
double getElevationM (double refelev);
|
|
|
|
double getElevationFt(double refelev);
|
|
|
|
|
2012-09-23 21:42:40 +01:00
|
|
|
int getIndex() const { return index; };
|
|
|
|
int getHoldPointType() const { return holdType; };
|
|
|
|
bool getIsOnRunway() const { return isOnRunway; };
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
const FGTaxiSegmentVector& arcs() const
|
|
|
|
{ return next; }
|
|
|
|
|
|
|
|
/// find the arg which leads from this node to another.
|
|
|
|
/// returns NULL if no such arc exists.
|
|
|
|
FGTaxiSegment* getArcTo(FGTaxiNode* aEnd) const;
|
|
|
|
|
2007-07-05 19:00:59 +00:00
|
|
|
bool operator<(const FGTaxiNode &other) const { return index < other.index; };
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
typedef SGSharedPtr<FGTaxiNode> FGTaxiNode_ptr;
|
|
|
|
typedef std::vector<FGTaxiNode_ptr> FGTaxiNodeVector;
|
2007-07-05 19:00:59 +00:00
|
|
|
typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;
|
|
|
|
|
|
|
|
#endif
|