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 <vector>
00021
00022 #include <geos/geom/Coordinate.h>
00023
00024
00025 namespace geos {
00026 namespace algorithm {
00027 class LineIntersector;
00028 }
00029 namespace geomgraph {
00030 class Node;
00031 class Edge;
00032 }
00033 }
00034
00035 namespace geos {
00036 namespace geomgraph {
00037 namespace index {
00038
00039
00040 class SegmentIntersector{
00041
00042 private:
00043
00048 bool hasIntersectionVar;
00049
00050 bool hasProper;
00051
00052 bool hasProperInterior;
00053
00054
00055 geom::Coordinate properIntersectionPoint;
00056
00057 algorithm::LineIntersector *li;
00058
00059 bool includeProper;
00060
00061 bool recordIsolated;
00062
00063
00064
00065
00066
00067 int numIntersections;
00068
00070 std::vector<std::vector<Node*>*> bdyNodes;
00071
00072 bool isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1, int segIndex1);
00073
00074 bool isBoundaryPoint(algorithm::LineIntersector *li,
00075 std::vector<std::vector<Node*>*>& tstBdyNodes);
00076
00077 bool isBoundaryPoint(algorithm::LineIntersector *li,
00078 std::vector<Node*> *tstBdyNodes);
00079
00080 public:
00081
00082 static bool isAdjacentSegments(int i1,int i2);
00083
00084
00085 int numTests;
00086
00087
00088
00089 virtual ~SegmentIntersector() {}
00090
00091 SegmentIntersector(algorithm::LineIntersector *newLi,
00092 bool newIncludeProper, bool newRecordIsolated)
00093 :
00094 hasIntersectionVar(false),
00095 hasProper(false),
00096 hasProperInterior(false),
00097 li(newLi),
00098 includeProper(newIncludeProper),
00099 recordIsolated(newRecordIsolated),
00100 numIntersections(0),
00101 bdyNodes(2),
00102 numTests(0)
00103 {}
00104
00108 void setBoundaryNodes(std::vector<Node*> *bdyNodes0,
00109 std::vector<Node*> *bdyNodes1);
00110
00111 geom::Coordinate& getProperIntersectionPoint();
00112
00113 bool hasIntersection();
00114
00115 bool hasProperIntersection();
00116
00117 bool hasProperInteriorIntersection();
00118
00119 void addIntersections(Edge *e0, int segIndex0, Edge *e1, int segIndex1);
00120
00121 };
00122
00123
00124 }
00125 }
00126 }
00127
00128 #endif
00129
00130
00131
00132
00133
00134
00135
00136