GEOS
3.3.5
|
00001 /********************************************************************** 00002 * $Id: SegmentIntersector.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 **********************************************************************/ 00016 00017 #ifndef GEOS_GEOMGRAPH_INDEX_SEGMENTINTERSECTOR_H 00018 #define GEOS_GEOMGRAPH_INDEX_SEGMENTINTERSECTOR_H 00019 00020 #include <geos/export.h> 00021 #include <vector> 00022 00023 #include <geos/geom/Coordinate.h> // for composition 00024 00025 #ifdef _MSC_VER 00026 #pragma warning(push) 00027 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00028 #endif 00029 00030 // Forward declarations 00031 namespace geos { 00032 namespace algorithm { 00033 class LineIntersector; 00034 } 00035 namespace geomgraph { 00036 class Node; 00037 class Edge; 00038 } 00039 } 00040 00041 namespace geos { 00042 namespace geomgraph { // geos::geomgraph 00043 namespace index { // geos::geomgraph::index 00044 00045 00046 class GEOS_DLL SegmentIntersector{ 00047 00048 private: 00049 00054 bool hasIntersectionVar; 00055 00056 bool hasProper; 00057 00058 bool hasProperInterior; 00059 00060 // the proper intersection point found 00061 geom::Coordinate properIntersectionPoint; 00062 00063 algorithm::LineIntersector *li; 00064 00065 bool includeProper; 00066 00067 bool recordIsolated; 00068 00069 //bool isSelfIntersection; 00070 00071 //bool intersectionFound; 00072 00073 int numIntersections; 00074 00076 std::vector<std::vector<Node*>*> bdyNodes; 00077 00078 bool isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1, int segIndex1); 00079 00080 bool isBoundaryPoint(algorithm::LineIntersector *li, 00081 std::vector<std::vector<Node*>*>& tstBdyNodes); 00082 00083 bool isBoundaryPoint(algorithm::LineIntersector *li, 00084 std::vector<Node*> *tstBdyNodes); 00085 00086 public: 00087 00088 static bool isAdjacentSegments(int i1,int i2); 00089 00090 // testing only 00091 int numTests; 00092 00093 //SegmentIntersector(); 00094 00095 virtual ~SegmentIntersector() {} 00096 00097 SegmentIntersector(algorithm::LineIntersector *newLi, 00098 bool newIncludeProper, bool newRecordIsolated) 00099 : 00100 hasIntersectionVar(false), 00101 hasProper(false), 00102 hasProperInterior(false), 00103 li(newLi), 00104 includeProper(newIncludeProper), 00105 recordIsolated(newRecordIsolated), 00106 numIntersections(0), 00107 bdyNodes(2), 00108 numTests(0) 00109 {} 00110 00114 void setBoundaryNodes(std::vector<Node*> *bdyNodes0, 00115 std::vector<Node*> *bdyNodes1); 00116 00117 geom::Coordinate& getProperIntersectionPoint(); 00118 00119 bool hasIntersection(); 00120 00121 bool hasProperIntersection(); 00122 00123 bool hasProperInteriorIntersection(); 00124 00125 void addIntersections(Edge *e0, int segIndex0, Edge *e1, int segIndex1); 00126 00127 }; 00128 00129 } // namespace geos.geomgraph.index 00130 } // namespace geos.geomgraph 00131 } // namespace geos 00132 00133 #ifdef _MSC_VER 00134 #pragma warning(pop) 00135 #endif 00136 00137 #endif 00138 00139 /********************************************************************** 00140 * $Log$ 00141 * Revision 1.1 2006/03/14 12:55:55 strk 00142 * Headers split: geomgraphindex.h, nodingSnapround.h 00143 * 00144 **********************************************************************/ 00145