LineMerger.h

00001 /**********************************************************************
00002  * $Id: LineMerger.h 3309 2011-04-27 15:47:14Z strk $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2006 Refractions Research Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: operation/linemerge/LineMerger.java r378 (JTS-1.12)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_OP_LINEMERGE_LINEMERGER_H
00021 #define GEOS_OP_LINEMERGE_LINEMERGER_H
00022 
00023 #include <geos/export.h>
00024 #include <geos/operation/linemerge/LineMergeGraph.h> // for composition
00025 
00026 #include <vector>
00027 
00028 #ifdef _MSC_VER
00029 #pragma warning(push)
00030 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00031 #endif
00032 
00033 // Forward declarations 
00034 namespace geos {
00035         namespace geom { 
00036                 class LineString;
00037                 class GeometryFactory;
00038                 class Geometry;
00039         }
00040         namespace planargraph {
00041                 class Node;
00042         }
00043         namespace operation { 
00044                 namespace linemerge { 
00045                         class EdgeString;
00046                         class LineMergeDirectedEdge;
00047                 }
00048         }
00049 }
00050 
00051 
00052 namespace geos {
00053 namespace operation { // geos::operation
00054 namespace linemerge { // geos::operation::linemerge
00055 
00076 class GEOS_DLL LineMerger {
00077 
00078 private:
00079 
00080         LineMergeGraph graph;
00081 
00082         std::vector<geom::LineString*> *mergedLineStrings;
00083 
00084         std::vector<EdgeString*> edgeStrings;
00085 
00086         const geom::GeometryFactory *factory;
00087 
00088         void merge();
00089 
00090         void buildEdgeStringsForObviousStartNodes();
00091 
00092         void buildEdgeStringsForIsolatedLoops();
00093 
00094         void buildEdgeStringsForUnprocessedNodes();
00095 
00096         void buildEdgeStringsForNonDegree2Nodes();
00097 
00098         void buildEdgeStringsStartingAt(planargraph::Node *node);
00099 
00100         EdgeString* buildEdgeStringStartingWith(LineMergeDirectedEdge *start);
00101 
00102 public:
00103         LineMerger();
00104         ~LineMerger();
00105 
00114         void add(std::vector<geom::Geometry*> *geometries);
00115 
00124         void add(const geom::Geometry *geometry);
00125 
00132         std::vector<geom::LineString*>* getMergedLineStrings();
00133 
00134         void add(const geom::LineString *lineString);
00135 
00136 };
00137 
00138 } // namespace geos::operation::linemerge
00139 } // namespace geos::operation
00140 } // namespace geos
00141 
00142 #ifdef _MSC_VER
00143 #pragma warning(pop)
00144 #endif
00145 
00146 #endif // GEOS_OP_LINEMERGE_LINEMERGER_H
00147 
00148 /**********************************************************************
00149  * $Log$
00150  * Revision 1.1  2006/03/22 10:13:53  strk
00151  * opLinemerge.h split
00152  *
00153  **********************************************************************/

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