00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_OP_RELATE_RELATECOMPUTER_H
00022 #define GEOS_OP_RELATE_RELATECOMPUTER_H
00023
00024 #include <geos/export.h>
00025
00026 #include <geos/algorithm/PointLocator.h>
00027 #include <geos/algorithm/LineIntersector.h>
00028 #include <geos/geomgraph/NodeMap.h>
00029 #include <geos/geom/Coordinate.h>
00030
00031 #include <vector>
00032 #include <memory>
00033
00034 #ifdef _MSC_VER
00035 #pragma warning(push)
00036 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00037 #endif
00038
00039
00040 namespace geos {
00041 namespace geom {
00042 class IntersectionMatrix;
00043 class Geometry;
00044 }
00045 namespace geomgraph {
00046 class GeometryGraph;
00047 class Edge;
00048 class EdgeEnd;
00049 class Node;
00050 namespace index {
00051 class SegmentIntersector;
00052 }
00053 }
00054 }
00055
00056
00057 namespace geos {
00058 namespace operation {
00059 namespace relate {
00060
00075 class GEOS_DLL RelateComputer {
00076 public:
00077 RelateComputer(std::vector<geomgraph::GeometryGraph*> *newArg);
00078 ~RelateComputer();
00079
00080 geom::IntersectionMatrix* computeIM();
00081 private:
00082
00083 algorithm::LineIntersector li;
00084
00085 algorithm::PointLocator ptLocator;
00086
00088 std::vector<geomgraph::GeometryGraph*> *arg;
00089
00090 geomgraph::NodeMap nodes;
00091
00093 std::auto_ptr<geom::IntersectionMatrix> im;
00094
00095 std::vector<geomgraph::Edge*> isolatedEdges;
00096
00098 geom::Coordinate invalidPoint;
00099
00100 void insertEdgeEnds(std::vector<geomgraph::EdgeEnd*> *ee);
00101
00102 void computeProperIntersectionIM(
00103 geomgraph::index::SegmentIntersector *intersector,
00104 geom::IntersectionMatrix *imX);
00105
00106 void copyNodesAndLabels(int argIndex);
00107 void computeIntersectionNodes(int argIndex);
00108 void labelIntersectionNodes(int argIndex);
00109
00114 void computeDisjointIM(geom::IntersectionMatrix *imX);
00115
00116 void labelNodeEdges();
00117
00121 void updateIM(geom::IntersectionMatrix& imX);
00122
00131 void labelIsolatedEdges(int thisIndex,int targetIndex);
00132
00140 void labelIsolatedEdge(geomgraph::Edge *e,int targetIndex,
00141 const geom::Geometry *target);
00142
00152 void labelIsolatedNodes();
00153
00157 void labelIsolatedNode(geomgraph::Node *n,int targetIndex);
00158 };
00159
00160
00161 }
00162 }
00163 }
00164
00165 #ifdef _MSC_VER
00166 #pragma warning(pop)
00167 #endif
00168
00169 #endif // GEOS_OP_RELATE_RELATECOMPUTER_H