• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

LineMerger.h

00001 /**********************************************************************
00002  * $Id: LineMerger.h 2652 2009-10-05 16:44:39Z 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 rev. 1.7 (JTS-1.10)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_OP_LINEMERGE_LINEMERGER_H
00021 #define GEOS_OP_LINEMERGE_LINEMERGER_H
00022 
00023 #include <geos/export.h>
00024 
00025 #include <geos/operation/linemerge/LineMergeGraph.h> // for composition
00026 
00027 #include <vector>
00028 
00029 // Forward declarations 
00030 namespace geos {
00031         namespace geom { 
00032                 class LineString;
00033                 class GeometryFactory;
00034                 class Geometry;
00035         }
00036         namespace planargraph {
00037                 class Node;
00038         }
00039         namespace operation { 
00040                 namespace linemerge { 
00041                         class EdgeString;
00042                         class LineMergeDirectedEdge;
00043                 }
00044         }
00045 }
00046 
00047 
00048 namespace geos {
00049 namespace operation { // geos::operation
00050 namespace linemerge { // geos::operation::linemerge
00051 
00072 class GEOS_DLL LineMerger {
00073 
00074 private:
00075 
00076         LineMergeGraph graph;
00077 
00078         std::vector<geom::LineString*> *mergedLineStrings;
00079 
00080         std::vector<EdgeString*> edgeStrings;
00081 
00082         const geom::GeometryFactory *factory;
00083 
00084         void merge();
00085 
00086         void buildEdgeStringsForObviousStartNodes();
00087 
00088         void buildEdgeStringsForIsolatedLoops();
00089 
00090         void buildEdgeStringsForUnprocessedNodes();
00091 
00092         void buildEdgeStringsForNonDegree2Nodes();
00093 
00094         void buildEdgeStringsStartingAt(planargraph::Node *node);
00095 
00096         EdgeString* buildEdgeStringStartingWith(LineMergeDirectedEdge *start);
00097 
00098 public:
00099         LineMerger();
00100         ~LineMerger();
00101 
00110         void add(std::vector<geom::Geometry*> *geometries);
00111 
00120         void add(const geom::Geometry *geometry);
00121 
00127         std::vector<geom::LineString*>* getMergedLineStrings();
00128 
00129         void add(const geom::LineString *lineString);
00130 
00131 };
00132 
00133 } // namespace geos::operation::linemerge
00134 } // namespace geos::operation
00135 } // namespace geos
00136 
00137 #endif // GEOS_OP_LINEMERGE_LINEMERGER_H
00138 
00139 /**********************************************************************
00140  * $Log$
00141  * Revision 1.1  2006/03/22 10:13:53  strk
00142  * opLinemerge.h split
00143  *
00144  **********************************************************************/

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1