GEOS
3.4.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 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 //#include <geos/geom/Coordinate.h> 00027 00028 // Forward declarations 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 { // geos.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 // Declare type as noncopyable 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 } // namespace geos.noding 00111 } // namespace geos 00112 00113 #endif // GEOS_NODING_NODINGVALIDATOR_H