1 #ifndef GRAPHBUILDER_SHP_H 2 #define GRAPHBUILDER_SHP_H 4 #include <ogrsf_frmts.h> 11 #if defined (__GNUC__) 12 #pragma GCC diagnostic push 13 #pragma GCC diagnostic ignored "-Wpragmas" 14 #pragma GCC diagnostic ignored "-Wshift-negative-value" 15 #pragma GCC diagnostic ignored "-Wunused-parameter" 18 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 19 #include <CGAL/Triangulation_vertex_base_with_info_2.h> 20 #include <CGAL/Delaunay_triangulation_2.h> 21 #include <CGAL/Constrained_Delaunay_triangulation_2.h> 23 #if defined (__GNUC__) 24 #pragma GCC diagnostic pop 28 namespace graphbuilders {
29 class GeographicGridBuilder;
38 virtual void setMax(
int m) = 0;
39 virtual void setStep(
int step) = 0;
84 void setLimits (
double lonMin,
double lonMax,
double latMin,
double latMax) ;
89 mRemoveEdgesInExcludeZone = en;
107 bool mCreateMode =
false;
109 std::shared_ptr<displace::graphbuilders::GeographicGridBuilder> createBuilder (
Type type,
double step);
112 void createMainGrid(GDALDriver *memdriver, GDALDataset *outdataset, OGRLayer *&resultLayer);
113 void loadMainGrid(GDALDriver *memdriver, GDALDataset *memdataset, OGRLayer *&resultLayer);
115 void createGrid(GDALDataset *tempDatasource,
116 std::shared_ptr<displace::graphbuilders::GeographicGridBuilder> builder,
119 OGRLayer *lyIncluded, OGRLayer *lyExclusion1, OGRLayer *lyExclusion2);
121 void clip(OGRLayer *in, OGRLayer *feature, OGRLayer *out, GDALDataset *tempds);
122 void diff(OGRLayer *in1, OGRLayer *in2, OGRLayer *out, GDALDataset *tempds);
123 void diffEdges(OGRLayer *in1, OGRLayer *in2, OGRLayer *out, GDALDataset *tempds);
124 void copyLayerContent(OGRLayer *src, OGRLayer *dst);
125 void makePartProgress(
double x);
126 void startNewPartProgress(QString msg);
127 OGRLayer *createGridLayer(GDALDataset *datasource,
const char *
const name);
128 OGRLayer *createEdgesLayer(GDALDataset *datasource,
const char *
const name);
129 void deleteLayer(GDALDataset *src, OGRLayer *layer);
131 int getFromFieldIndex (OGRLayer *layer);
132 int getToFieldIndex (OGRLayer *layer);
133 int getWeightFieldIndex (OGRLayer *layer);
134 int getPointFieldIndex (OGRLayer *layer);
140 bool mOutsideEnabled, mRemoveEdgesInExcludeZone;
141 double mStep, mStep1, mStep2;
142 double mLatMin, mLatMax, mLonMin, mLonMax;
144 int mMaxLinks, mMinLinks;
147 OGRSpatialReference mSpatialReference;
149 std::shared_ptr<GDALDataset> mShapefileInc1;
150 std::shared_ptr<GDALDataset> mShapefileInc2;
151 std::shared_ptr<GDALDataset> mShapefileExc;
155 using Timer = std::chrono::system_clock;
156 std::chrono::time_point<Timer> mFeedbackStartTime;
157 QString mFeedbackProgressMsg;
158 long mFeedbackPreviousETC;
160 static int waitfunc(
double progress,
const char *msg,
void *thiz);
163 #endif // GRAPHBUILDER_SHP_H void setOutsideEnabled(bool outsideEnabled)
Definition: graphbuilder_shp.cpp:700
GraphBuilder()
Definition: graphbuilder_shp.cpp:53
Definition: decisiontreemanager.h:13
virtual void setMainMessage(QString)=0
Definition: graphbuilder_shp.h:33
QList< Node > buildGraph()
Definition: graphbuilder_shp.cpp:199
static const double earthRadius
Definition: graphbuilder_shp.h:100
void setDistance2(double distance)
Definition: graphbuilder_shp.h:76
virtual void setStep(int step)=0
Node()
Definition: graphbuilder_shp.h:54
Definition: graphbuilder_shp.h:46
void setLimits(double lonMin, double lonMax, double latMin, double latMax)
Definition: graphbuilder_shp.cpp:64
void setFeedback(Feedback *feedback)
Definition: graphbuilder_shp.h:80
void setDistance1(double distance)
Definition: graphbuilder_shp.h:72
void actionLoad(QString path)
Definition: graphbuilder_shp.cpp:736
void setIncludingShapefile2(std::shared_ptr< GDALDataset > src)
Definition: graphbuilder_shp.cpp:77
Definition: graphbuilder_shp.h:36
void setLinkLimits(double limit_km)
Definition: graphbuilder_shp.cpp:705
QList< int > adiacencies
Definition: graphbuilder_shp.h:50
int harbour
Definition: graphbuilder_shp.h:49
Definition: graphbuilder_shp.h:44
void setDefaultDistance(double distance)
Definition: graphbuilder_shp.h:68
virtual void setMax(int m)=0
void setMinLinks(int num=-1)
Definition: graphbuilder_shp.h:94
void setType(Type type)
Definition: graphbuilder_shp.h:64
bg::model::point< double, 2, bg::cs::cartesian > point
Definition: diffusion.cpp:28
void setExcludeZoneEdgeRemovalEnabled(bool en)
Definition: graphbuilder_shp.h:88
QPointF point
Definition: graphbuilder_shp.h:48
void setExcludingShapefile(std::shared_ptr< GDALDataset > src)
Definition: graphbuilder_shp.cpp:82
bool outsideEnabled() const
Definition: graphbuilder_shp.cpp:695
Definition: graphbuilder_shp.h:44
Definition: graphbuilder_shp.h:44
void actionCreate()
Definition: graphbuilder_shp.cpp:731
void setMaxLinks(int num=-1)
Definition: graphbuilder_shp.h:91
void setIncludingShapefile1(std::shared_ptr< GDALDataset > src)
Definition: graphbuilder_shp.cpp:72
Type
Definition: graphbuilder_shp.h:44
Definition: graphbuilder_shp.h:44
QList< double > weight
Definition: graphbuilder_shp.h:51
bool good
Definition: graphbuilder_shp.h:52
virtual void setPartMessage(QString)=0