RelateComputer.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.refractions.net
00005  *
00006  * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
00007  * Copyright (C) 2006 Refractions Research Inc.
00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation. 
00013  * See the COPYING file for more information.
00014  *
00015  **********************************************************************
00016  *
00017  * Last port: operation/relate/RelateComputer.java rev. 1.24 (JTS-1.10)
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> // for RelateComputer composition
00027 #include <geos/algorithm/LineIntersector.h> // for RelateComputer composition
00028 #include <geos/geomgraph/NodeMap.h> // for RelateComputer composition
00029 #include <geos/geom/Coordinate.h> // for RelateComputer composition
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 // Forward declarations
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 { // geos::operation
00059 namespace relate { // geos::operation::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 } // namespace geos:operation:relate
00160 } // namespace geos:operation
00161 } // namespace geos
00162 
00163 #ifdef _MSC_VER
00164 #pragma warning(pop)
00165 #endif
00166 
00167 #endif // GEOS_OP_RELATE_RELATECOMPUTER_H
00168 
00169 /**********************************************************************
00170  * $Log$
00171  * Revision 1.1  2006/03/21 13:11:29  strk
00172  * opRelate.h header split
00173  *
00174  **********************************************************************/
00175 

Generated on Sat Aug 20 01:31:07 2011 for GEOS by  doxygen 1.4.7