17 #ifndef TYIGNLEVELCURVESPARSER_H
18 #define TYIGNLEVELCURVESPARSER_H
23 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
24 #include <CGAL/Polygon_2.h>
25 #include <CGAL/Constrained_Delaunay_triangulation_2.h>
26 #include <CGAL/Constrained_triangulation_plus_2.h>
27 #include <CGAL/Polyline_simplification_2/simplify.h>
28 #include <CGAL/Polyline_simplification_2/Squared_distance_cost.h>
29 #include <CGAL/Unique_hash_map.h>
31 namespace PS = CGAL::Polyline_simplification_2;
32 typedef CGAL::Exact_predicates_inexact_constructions_kernel
K;
33 typedef PS::Vertex_base_2<K>
Vb;
34 typedef CGAL::Constrained_triangulation_face_base_2<K>
Fb;
35 typedef CGAL::Triangulation_data_structure_2<Vb, Fb>
TDS;
36 typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS, CGAL::Exact_predicates_tag>
CDT;
37 typedef CGAL::Constrained_triangulation_plus_2<CDT>
CT;
48 static const size_t shift = (size_t)log2(1 +
sizeof(
Constraint_id));
49 id = (std::size_t)(constraint_id.second) >> shift;
54 return id == other.
id;
65 return std::hash<std::size_t>()(wrapper.
id);
73 typedef PS::Stop_below_count_ratio_threshold
Stop;
74 typedef PS::Scaled_squared_distance_cost
Cost;
CGAL::Constrained_triangulation_face_base_2< K > Fb
CT::Vertices_in_constraint_iterator Vertices_in_constraint_iterator
PS::Stop_below_count_ratio_threshold Stop
CGAL::Constrained_triangulation_plus_2< CDT > CT
CGAL::Triangulation_data_structure_2< Vb, Fb > TDS
CT::Constraint_iterator Constraint_iterator
CGAL::Exact_predicates_inexact_constructions_kernel K
CGAL::Constrained_Delaunay_triangulation_2< K, TDS, CGAL::Exact_predicates_tag > CDT
PS::Scaled_squared_distance_cost Cost
PS::Vertex_base_2< K > Vb
CT::Constraint_id Constraint_id
CT::Points_in_constraint_iterator Points_in_constraint_iterator
bool operator==(const ConstraintIdWrapper &other) const
ConstraintIdWrapper(const Constraint_id &constraint_id)
Holds the business logic of parsing the response of level curve IGN web service, in order to send sig...
QDomDocument m_xmlDocument
std::unordered_map< ConstraintIdWrapper, AltimetryInfo > & getConstraintToAltimetryInfoMap()
Getter for the constraint to AltimetryInfo map.
bool isXmlLoaded() const
Getter for the isXmlLoaded flag.
TYIGNLevelCurvesParser(QObject *parent=nullptr)
std::unordered_map< ConstraintIdWrapper, AltimetryInfo > m_constraintToAltimetryInfoMap
void courbeNiveauCreated(LPTYCourbeNiveau courbeNiveau)
static Point getCGALPoint(const QStringList &points, int index, const OCoord3D &SIGCoords, double altitude)
bool createLevelCurvesFromCT(const OCoord3D &SIGCoords, const OBox &selectedZone, double scaleFactor)
Create level curves from CGAL constrained triangulation.
QDomDocument getXmlDocument() const
Getter for the xmlDocument.
bool buildXmlDocument(const QString &text)
size_t simplifyPolylines()
bool buildCTFromXMLFile(const OCoord3D &SIGCoords)
Build constrained triangulation from IGN XML file containing level curves.
bool buildPolylineFromCourbe(const QDomElement &courbe, const OCoord3D &SIGCoords)
static TYPoint getPoint(const QStringList &points, int index, const OCoord3D &SIGCoords, double altitude)
void parseXmlData(const OCoord3D &SIGCoords, const OBox &selectedZone, double scaleFactor)
bool loadXmlFile(const QString &filePath)
const CT & getCT() const
Getter for the CT member.
bool hasRetrievedLevelCurves() const
Getter for the hasRetrievedLevelCurves flag.
bool m_hasRetrievedLevelCurves
static TYPoint convertLatLonToWebMercator(double latitude, double longitude)
AltimetryInfo(const QString &idVal, double altitudeVal)
std::size_t operator()(const ConstraintIdWrapper &wrapper) const