00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_OP_RELATE_RELATECOMPUTER_H
00017 #define GEOS_OP_RELATE_RELATECOMPUTER_H
00018
00019 #include <geos/algorithm/PointLocator.h>
00020 #include <geos/algorithm/LineIntersector.h>
00021 #include <geos/geomgraph/NodeMap.h>
00022 #include <geos/geom/Coordinate.h>
00023
00024 #include <vector>
00025
00026
00027 namespace geos {
00028 namespace geom {
00029 class IntersectionMatrix;
00030 class Geometry;
00031 }
00032 namespace geomgraph {
00033 class GeometryGraph;
00034 class Edge;
00035 class EdgeEnd;
00036 class Node;
00037 namespace index {
00038 class SegmentIntersector;
00039 }
00040 }
00041 }
00042
00043
00044 namespace geos {
00045 namespace operation {
00046 namespace relate {
00047
00062 class RelateComputer {
00063 public:
00064
00065 virtual ~RelateComputer();
00066 RelateComputer(std::vector<geomgraph::GeometryGraph*> *newArg);
00067 geom::IntersectionMatrix* computeIM();
00068 private:
00069
00070 algorithm::LineIntersector li;
00071
00072 algorithm::PointLocator ptLocator;
00073
00075 std::vector<geomgraph::GeometryGraph*> *arg;
00076
00077 geomgraph::NodeMap nodes;
00078
00080 geom::IntersectionMatrix *im;
00081
00082 std::vector<geomgraph::Edge*> isolatedEdges;
00083
00085 geom::Coordinate invalidPoint;
00086
00087 void insertEdgeEnds(std::vector<geomgraph::EdgeEnd*> *ee);
00088
00089 void computeProperIntersectionIM(geomgraph::index::SegmentIntersector *intersector,
00090 geom::IntersectionMatrix *imX);
00091
00092 void copyNodesAndLabels(int argIndex);
00093 void computeIntersectionNodes(int argIndex);
00094 void labelIntersectionNodes(int argIndex);
00095 void computeDisjointIM(geom::IntersectionMatrix *imX);
00096 void labelNodeEdges();
00097 void updateIM(geom::IntersectionMatrix *imX);
00098 void labelIsolatedEdges(int thisIndex,int targetIndex);
00099 void labelIsolatedEdge(geomgraph::Edge *e,int targetIndex, const geom::Geometry *target);
00100 void labelIsolatedNodes();
00101 void labelIsolatedNode(geomgraph::Node *n,int targetIndex);
00102 };
00103
00104
00105 }
00106 }
00107 }
00108
00109 #endif // GEOS_OP_RELATE_RELATECOMPUTER_H
00110
00111
00112
00113
00114
00115
00116
00117