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 geom::IntersectionMatrix* computeIM();
00079 private:
00080
00081 algorithm::LineIntersector li;
00082
00083 algorithm::PointLocator ptLocator;
00084
00086 std::vector<geomgraph::GeometryGraph*> *arg;
00087
00088 geomgraph::NodeMap nodes;
00089
00091 std::auto_ptr<geom::IntersectionMatrix> im;
00092
00093 std::vector<geomgraph::Edge*> isolatedEdges;
00094
00096 geom::Coordinate invalidPoint;
00097
00098 void insertEdgeEnds(std::vector<geomgraph::EdgeEnd*> *ee);
00099
00100 void computeProperIntersectionIM(
00101 geomgraph::index::SegmentIntersector *intersector,
00102 geom::IntersectionMatrix *imX);
00103
00104 void copyNodesAndLabels(int argIndex);
00105 void computeIntersectionNodes(int argIndex);
00106 void labelIntersectionNodes(int argIndex);
00107
00112 void computeDisjointIM(geom::IntersectionMatrix *imX);
00113
00114 void labelNodeEdges();
00115
00119 void updateIM(geom::IntersectionMatrix *imX);
00120
00129 void labelIsolatedEdges(int thisIndex,int targetIndex);
00130
00138 void labelIsolatedEdge(geomgraph::Edge *e,int targetIndex,
00139 const geom::Geometry *target);
00140
00150 void labelIsolatedNodes();
00151
00155 void labelIsolatedNode(geomgraph::Node *n,int targetIndex);
00156 };
00157
00158
00159 }
00160 }
00161 }
00162
00163 #ifdef _MSC_VER
00164 #pragma warning(pop)
00165 #endif
00166
00167 #endif // GEOS_OP_RELATE_RELATECOMPUTER_H
00168
00169
00170
00171
00172
00173
00174
00175