41 #ifndef GRAPHBUILDER_H 42 #define GRAPHBUILDER_H 48 #include <ogrsf_frmts.h> 50 #pragma GCC diagnostic push 51 #pragma GCC diagnostic ignored "-Wpragmas" 52 #pragma GCC diagnostic ignored "-Wshift-negative-value" 53 #pragma GCC diagnostic ignored "-Wunused-parameter" 54 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 55 #include <CGAL/Triangulation_vertex_base_with_info_2.h> 56 #include <CGAL/Delaunay_triangulation_2.h> 57 #include <CGAL/Constrained_Delaunay_triangulation_2.h> 58 #pragma GCC diagnostic pop 63 namespace graphbuilders {
64 class GeographicGridBuilder;
75 virtual void setMax(
int m) = 0;
76 virtual void setStep(
int step) = 0;
79 enum Type { Hex, Quad, HexTrivial, QuadTrivial };
90 :
point(), harbour(0), adiacencies(), weight(), good(false) {
113 mFeedback = feedback;
116 void setLimits (
double lonMin,
double lonMax,
double latMin,
double latMax) ;
117 void setIncludingShapefile1 (std::shared_ptr<OGRDataSource> src);
118 void setIncludingShapefile2 (std::shared_ptr<OGRDataSource> src);
119 void setExcludingShapefile (std::shared_ptr<OGRDataSource> src);
121 mRemoveEdgesInExcludeZone = en;
130 QList<Node> buildGraph();
132 static void pointSumWithBearing (
const QPointF &p1,
double dist,
double bearing, QPointF &p2);
135 bool outsideEnabled()
const;
136 void setOutsideEnabled(
bool outsideEnabled);
137 void setLinkLimits(
double limit_km);
140 typedef CGAL::Exact_predicates_inexact_constructions_kernel
K;
141 typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned, K>
Vb;
147 typedef CGAL::Constrained_triangulation_face_base_2<K>
Fb;
148 typedef CGAL::Triangulation_data_structure_2<Vb,Fb>
TDS;
149 typedef CGAL::Exact_predicates_tag
Itag;
150 typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS, Itag>
CDT;
154 void fillWithNodes(
displace::graphbuilders::GeographicGridBuilder *builder, QList<Node> &res, CDT &tri, std::vector<std::shared_ptr<OGRDataSource> > including, std::vector<std::shared_ptr<OGRDataSource> > excluding,
bool outside,
int &progress);
155 void pushAd(QList<Node> &node,
int source,
int target);
158 bool mOutsideEnabled, mRemoveEdgesInExcludeZone;
159 double mStep, mStep1, mStep2;
160 double mLatMin, mLatMax, mLonMin, mLonMax;
162 int mMaxLinks, mMinLinks;
164 std::shared_ptr<OGRDataSource> mShapefileInc1;
165 std::shared_ptr<OGRDataSource> mShapefileInc2;
166 std::shared_ptr<OGRDataSource> mShapefileExc;
172 #endif // GRAPHBUILDER_H CGAL::Exact_predicates_inexact_constructions_kernel K
Definition: graphbuilder_shp.cpp:42
void setFeedback(Feedback *feedback)
Definition: graphbuilder.h:112
double dist(double x1, double y1, double x2, double y2)
Definition: myRutils.h:109
Definition: decisiontreemanager.h:13
CGAL::Triangulation_data_structure_2< Vb, Fb > TDS
Definition: graphbuilder_shp.cpp:46
Type
Definition: graphbuilder.h:79
An abstract class to build a grid of points on a map, based on certain parameters.
Definition: geographicgridbuilder.h:29
Node()
Definition: graphbuilder.h:89
Definition: graphbuilder.h:81
CDT::Point Point
Definition: graphbuilder_shp.cpp:50
Definition: graphbuilder.h:70
CGAL::Constrained_triangulation_face_base_2< K > Fb
Definition: graphbuilder_shp.cpp:45
QList< double > weight
Definition: graphbuilder.h:86
bool good
Definition: graphbuilder.h:87
int harbour
Definition: graphbuilder.h:84
CGAL::Triangulation_vertex_base_with_info_2< unsigned, K > Vb
Definition: graphbuilder_shp.cpp:43
void setDefaultDistance(double distance)
Definition: graphbuilder.h:100
QPointF point
Definition: graphbuilder.h:83
Definition: graphbuilder.h:68
void setExcludeZoneEdgeRemovalEnabled(bool en)
Definition: graphbuilder.h:120
void setMinLinks(int num=-1)
Definition: graphbuilder.h:126
bg::model::point< double, 2, bg::cs::cartesian > point
Definition: diffusion.cpp:28
void setMaxLinks(int num=-1)
Definition: graphbuilder.h:123
void setType(Type type)
Definition: graphbuilder.h:96
CGAL::Exact_predicates_tag Itag
Definition: graphbuilder_shp.cpp:47
static const double earthRadius
Definition: graphbuilder.h:133
Definition: graphbuilder.h:73
CGAL::Constrained_Delaunay_triangulation_2< K, TDS, Itag > CDT
Definition: graphbuilder_shp.cpp:48
double bearing(double x1, double y1, double x2, double y2)
Definition: myRutils.h:119
void setDistance2(double distance)
Definition: graphbuilder.h:108
QList< int > adiacencies
Definition: graphbuilder.h:85
void setDistance1(double distance)
Definition: graphbuilder.h:104