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_SINGLEINTERIORINTERSECTIONFINDER_H 00016 #define GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H 00017 00018 #include <geos/noding/SegmentIntersector.h> // for inheritance 00019 #include <geos/geom/Coordinate.h> // for composition 00020 00021 #include <vector> 00022 00023 // Forward declarations 00024 namespace geos { 00025 namespace algorithm { 00026 class LineIntersector; 00027 } 00028 namespace noding { 00029 class SegmentString; 00030 } 00031 } 00032 00033 namespace geos { 00034 namespace noding { // geos.noding 00035 00043 class SingleInteriorIntersectionFinder: public SegmentIntersector 00044 { 00045 00046 public: 00047 00054 SingleInteriorIntersectionFinder(algorithm::LineIntersector& newLi) 00055 : 00056 li(newLi), 00057 interiorIntersection(geom::Coordinate::getNull()) 00058 { 00059 } 00060 00066 bool hasIntersection() const 00067 { 00068 return !interiorIntersection.isNull(); 00069 } 00070 00077 const geom::Coordinate& getInteriorIntersection() const 00078 { 00079 return interiorIntersection; 00080 } 00081 00087 const std::vector<geom::Coordinate>& getIntersectionSegments() const 00088 { 00089 return intSegments; 00090 } 00091 00101 void processIntersections( 00102 SegmentString* e0, int segIndex0, 00103 SegmentString* e1, int segIndex1); 00104 00105 bool isDone() const 00106 { 00107 return !interiorIntersection.isNull(); 00108 } 00109 00110 private: 00111 algorithm::LineIntersector& li; 00112 geom::Coordinate interiorIntersection; 00113 std::vector<geom::Coordinate> intSegments; 00114 00115 // Declare type as noncopyable 00116 SingleInteriorIntersectionFinder(const SingleInteriorIntersectionFinder& other); 00117 SingleInteriorIntersectionFinder& operator=(const SingleInteriorIntersectionFinder& rhs); 00118 }; 00119 00120 } // namespace geos.noding 00121 } // namespace geos 00122 00123 #endif // GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H