00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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>
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
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 {
00043 namespace 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
00061 geom::Coordinate properIntersectionPoint;
00062
00063 algorithm::LineIntersector *li;
00064
00065 bool includeProper;
00066
00067 bool recordIsolated;
00068
00069
00070
00071
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
00091 int numTests;
00092
00093
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 }
00130 }
00131 }
00132
00133 #ifdef _MSC_VER
00134 #pragma warning(pop)
00135 #endif
00136
00137 #endif
00138
00139
00140
00141
00142
00143
00144
00145