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.
|
|
|
|
//
|
|
|
|
|
2007-07-04 17:42:20 +00:00
|
|
|
#ifndef _DYNAMIC_LOADER_HXX_
|
|
|
|
#define _DYNAMIC_LOADER_HXX_
|
|
|
|
|
2016-01-10 16:38:01 -06:00
|
|
|
#include <set>
|
|
|
|
|
2007-07-04 17:42:20 +00:00
|
|
|
#include <simgear/xml/easyxml.hxx>
|
|
|
|
|
2016-01-10 16:38:01 -06:00
|
|
|
#include "groundnetwork.hxx"
|
2015-12-01 00:01:27 +00:00
|
|
|
#include <Airports/parking.hxx>
|
2007-07-04 17:42:20 +00:00
|
|
|
|
2016-01-10 16:38:01 -06:00
|
|
|
class FGGroundNetXMLLoader : public XMLVisitor {
|
2007-07-04 17:42:20 +00:00
|
|
|
public:
|
2016-01-10 16:38:01 -06:00
|
|
|
FGGroundNetXMLLoader(FGGroundNetwork* gn);
|
2007-07-04 17:42:20 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void startXML ();
|
|
|
|
virtual void endXML ();
|
|
|
|
virtual void startElement (const char * name, const XMLAttributes &atts);
|
|
|
|
virtual void endElement (const char * name);
|
|
|
|
virtual void data (const char * s, int len);
|
|
|
|
virtual void pi (const char * target, const char * data);
|
|
|
|
virtual void warning (const char * message, int line, int column);
|
|
|
|
virtual void error (const char * message, int line, int column);
|
|
|
|
|
|
|
|
private:
|
2012-09-25 00:31:17 +01:00
|
|
|
void startParking(const XMLAttributes &atts);
|
|
|
|
void startNode(const XMLAttributes &atts);
|
|
|
|
void startArc(const XMLAttributes &atts);
|
|
|
|
|
2016-01-10 16:38:01 -06:00
|
|
|
FGGroundNetwork* _groundNetwork;
|
|
|
|
|
2013-11-11 19:55:54 +01:00
|
|
|
std::string value;
|
2012-10-01 17:18:36 +01:00
|
|
|
|
2015-12-01 00:01:27 +00:00
|
|
|
// map from local (groundnet.xml) ids to parking instances
|
|
|
|
typedef std::map<int, FGTaxiNodeRef> NodeIndexMap;
|
|
|
|
NodeIndexMap _indexMap;
|
2012-10-01 17:18:36 +01:00
|
|
|
|
|
|
|
// data integrity - watch for unreferenced nodes and duplicated edges
|
|
|
|
typedef std::pair<int, int> IntPair;
|
|
|
|
std::set<IntPair> _arcSet;
|
|
|
|
|
2015-12-01 00:01:27 +00:00
|
|
|
std::set<FGTaxiNodeRef> _unreferencedNodes;
|
2012-10-01 17:18:36 +01:00
|
|
|
|
|
|
|
// map from allocated parking position to its local push-back node
|
|
|
|
// used to defer binding the push-back node until we've processed
|
|
|
|
// all nodes
|
2015-12-01 00:01:27 +00:00
|
|
|
typedef std::map<FGParkingRef, int> ParkingPushbackIndex;
|
|
|
|
ParkingPushbackIndex _parkingPushbacks;
|
2007-07-04 17:42:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|