DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
inputfileparser.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // DISPLACE: DYNAMIC INDIVIDUAL VESSEL-BASED SPATIAL PLANNING
3 // AND EFFORT DISPLACEMENT
4 // Copyright (c) 2012-2019 Francois Bastardie <fba@aqua.dtu.dk>
5 
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // --------------------------------------------------------------------------
20 
21 /* --------------------------------------------------------------------------
22  * DISPLACE: DYNAMIC INDIVIDUAL VESSEL-BASED SPATIAL PLANNING
23  * AND EFFORT DISPLACEMENT
24  * Copyright (c) 2012, 2013, 2014 Francois Bastardie <fba@aqua.dtu.dk>
25  *
26  * This program is free software; you can redistribute it and/or modify
27  * it under the terms of the GNU General Public License as published by
28  * the Free Software Foundation; either version 2 of the License, or
29  * (at your option) any later version.
30  *
31  * This program is distributed in the hope that it will be useful,
32  * but WITHOUT ANY WARRANTY; without even the implied warranty of
33  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34  * GNU General Public License for more details.
35  *
36  * You should have received a copy of the GNU General Public License along
37  * with this program; if not, write to the Free Software Foundation, Inc.,
38  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
39  * --------------------------------------------------------------------------
40  */
41 #ifndef INPUTFILEPARSER_H
42 #define INPUTFILEPARSER_H
43 
44 #include <idtypes.h>
45 #include <memory>
46 
47 #include <QList>
48 #include <QString>
49 #include <QPair>
50 #include <QSet>
51 #include <QMap>
52 
53 #include <graphbuilder_shp.h>
54 
55 class HarbourData;
56 
58 {
59 public:
61 
62  bool parseHarbourFile (const QString &path, QList<std::shared_ptr<HarbourData> > &list, QString *error);
63  bool parseShortestPath (const QString &path, int nodeid, QList<QPair<int, int> > &graph);
64  bool isShortestPathPresent (const QString &path, types::NodeId nodeid);
65 
66  bool parseGraph(const QString &graphpath, const QString &coordsPath, QList<GraphBuilder::Node> &nodes, QString *error);
67 
68  bool pathParseRelevantNodes (const QString &refpath, QString &fnodePath, QString &harbPath);
69  bool pathParseRelevantInterNodes (const QString &refpath, QString &fnodePath, QString &harbPath);
70  bool parseRelevantNodes (const QString &file, QSet<int> &nodes);
71  bool parseRelevantInterNodes (const QString &file, QVector<int> &nodeids);
72 
73  bool parseStockNamesFile (const QString &path, QMap<QString,int> &names);
74 };
75 
76 #endif // INPUTFILEPARSER_H
bool pathParseRelevantNodes(const QString &refpath, QString &fnodePath, QString &harbPath)
Definition: inputfileparser.cpp:245
Definition: harbourdata.h:29
vector< Node * > nodes
Definition: main.cpp:270
Definition: idtypes.h:52
bool isShortestPathPresent(const QString &path, types::NodeId nodeid)
Definition: inputfileparser.cpp:91
bool parseStockNamesFile(const QString &path, QMap< QString, int > &names)
Definition: inputfileparser.cpp:340
bool parseGraph(const QString &graphpath, const QString &coordsPath, QList< GraphBuilder::Node > &nodes, QString *error)
Definition: inputfileparser.cpp:97
bool parseRelevantNodes(const QString &file, QSet< int > &nodes)
Definition: inputfileparser.cpp:269
bool parseHarbourFile(const QString &path, QList< std::shared_ptr< HarbourData > > &list, QString *error)
Definition: inputfileparser.cpp:38
bool pathParseRelevantInterNodes(const QString &refpath, QString &fnodePath, QString &harbPath)
Definition: inputfileparser.cpp:262
Definition: inputfileparser.h:57
InputFileParser()
Definition: inputfileparser.cpp:34
bool parseShortestPath(const QString &path, int nodeid, QList< QPair< int, int > > &graph)
Definition: inputfileparser.cpp:81
bool parseRelevantInterNodes(const QString &file, QVector< int > &nodeids)
Definition: inputfileparser.cpp:304