DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
simplegeodesiclinegraphbuilder.h
Go to the documentation of this file.
1 #ifndef SIMPLEGEODESICLINEGRAPHBUILDER_H
2 #define SIMPLEGEODESICLINEGRAPHBUILDER_H
3 
5 
6 #include <GeographicLib/Geodesic.hpp>
7 #include <GeographicLib/GeodesicLine.hpp>
8 
9 namespace displace {
10 namespace graphbuilders {
11 
16 {
17 public:
18  enum Type { Hex, Quad };
19 
20  SimpleGeodesicLineGraphBuilder(Type type, double latMin_deg, double lonMin_deg, double latMax_deg, double lonMax_deg, double step);
21 
22  // GeographicGridBuilder interface
23 public:
24  bool beginCreateGrid();
25  QPointF getNext();
26  bool atEnd();
27  bool endCreateGrid();
28  bool isAtLineStart();
29 
30 private:
31  GeographicLib::Geodesic mGeodesic;
32 
33  // Parameters
34  double mLatMin, mLonMin, mLatMax, mLonMax;
35  double mStepX, mStepY;
36  bool mInterlace;
37 
38  // outer loop
39  double s12_y, azi1_y, azi2_y, a12_y, da_y, ds_y;
40  GeographicLib::GeodesicLine line_y;
41  int num_y;
42 
43  // inner loop
44  double s12, azi1, azi2, a12, da, ds;
45  GeographicLib::GeodesicLine line;
46  int num;
47 
48  int j,i;
49 };
50 
51 }
52 }
53 
54 #endif // SIMPLEGEODESICLINEGRAPHBUILDER_H
bool beginCreateGrid()
Initialize the object to iterate over the loop.
Definition: simplegeodesiclinegraphbuilder.cpp:50
Definition: decisiontreemanager.h:13
bool isAtLineStart()
Check if the loop is at the beginning of a "line" This is used to allow constrain creation for delaun...
Definition: simplegeodesiclinegraphbuilder.cpp:107
Definition: simplegeodesiclinegraphbuilder.h:18
QPointF getNext()
Calculate the next point and iterate the object state over the loop.
Definition: simplegeodesiclinegraphbuilder.cpp:65
An abstract class to build a grid of points on a map, based on certain parameters.
Definition: geographicgridbuilder.h:29
bool atEnd()
Check if the loop is completed.
Definition: simplegeodesiclinegraphbuilder.cpp:97
bool endCreateGrid()
Finalize the object when the loop is completed.
Definition: simplegeodesiclinegraphbuilder.cpp:102
Definition: simplegeodesiclinegraphbuilder.h:18
SimpleGeodesicLineGraphBuilder(Type type, double latMin_deg, double lonMin_deg, double latMax_deg, double lonMax_deg, double step)
Definition: simplegeodesiclinegraphbuilder.cpp:32
Type
Definition: simplegeodesiclinegraphbuilder.h:18
Implements a Simple Geodesic Grid.
Definition: simplegeodesiclinegraphbuilder.h:15