00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GEOS_NODING_NODINGVALIDATOR_H
00016 #define GEOS_NODING_NODINGVALIDATOR_H
00017
00018 #include <geos/export.h>
00019
00020 #include <vector>
00021 #include <iostream>
00022
00023 #include <geos/inline.h>
00024
00025 #include <geos/algorithm/LineIntersector.h>
00026
00027
00028
00029 namespace geos {
00030 namespace geom {
00031 class Coordinate;
00032 }
00033 namespace noding {
00034 class SegmentString;
00035 }
00036 }
00037
00038 namespace geos {
00039 namespace noding {
00040
00048 class GEOS_DLL NodingValidator {
00049 private:
00050 algorithm::LineIntersector li;
00051 const std::vector<SegmentString*>& segStrings;
00052
00057 void checkCollapses() const;
00058
00059 void checkCollapses(const SegmentString& ss) const;
00060
00061 void checkCollapse(const geom::Coordinate& p0, const geom::Coordinate& p1,
00062 const geom::Coordinate& p2) const;
00063
00068 void checkInteriorIntersections();
00069
00070 void checkInteriorIntersections(const SegmentString& ss0,
00071 const SegmentString& ss1);
00072
00073 void checkInteriorIntersections(
00074 const SegmentString& e0, unsigned int segIndex0,
00075 const SegmentString& e1, unsigned int segIndex1);
00076
00081 void checkEndPtVertexIntersections() const;
00082
00083 void checkEndPtVertexIntersections(const geom::Coordinate& testPt,
00084 const std::vector<SegmentString*>& segStrings) const;
00085
00090 bool hasInteriorIntersection(const algorithm::LineIntersector& aLi,
00091 const geom::Coordinate& p0, const geom::Coordinate& p1) const;
00092
00093
00094 NodingValidator(const NodingValidator& other);
00095 NodingValidator& operator=(const NodingValidator& rhs);
00096
00097 public:
00098
00099 NodingValidator(const std::vector<SegmentString*>& newSegStrings):
00100 segStrings(newSegStrings)
00101 {}
00102
00103 ~NodingValidator() {}
00104
00105 void checkValid();
00106
00107 };
00108
00109
00110 }
00111 }
00112
00113 #endif // GEOS_NODING_NODINGVALIDATOR_H