GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 *********************************************************************** 00014 * 00015 * Last port: operation/overlay/LineBuilder.java rev. 1.15 (JTS-1.10) 00016 * 00017 **********************************************************************/ 00018 00019 #ifndef GEOS_OP_OVERLAY_LINEBUILDER_H 00020 #define GEOS_OP_OVERLAY_LINEBUILDER_H 00021 00022 #include <geos/export.h> 00023 00024 #include <geos/operation/overlay/OverlayOp.h> // for OverlayOp::OpCode enum 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 GeometryFactory; 00037 class CoordinateSequence; 00038 class LineString; 00039 } 00040 namespace geomgraph { 00041 class DirectedEdge; 00042 class Edge; 00043 } 00044 namespace algorithm { 00045 class PointLocator; 00046 } 00047 namespace operation { 00048 namespace overlay { 00049 class OverlayOp; 00050 } 00051 } 00052 } 00053 00054 namespace geos { 00055 namespace operation { // geos::operation 00056 namespace overlay { // geos::operation::overlay 00057 00063 class GEOS_DLL LineBuilder { 00064 00065 public: 00066 00067 LineBuilder(OverlayOp *newOp, 00068 const geom::GeometryFactory *newGeometryFactory, 00069 algorithm::PointLocator *newPtLocator); 00070 00071 ~LineBuilder(); 00072 00076 std::vector<geom::LineString*>* build(OverlayOp::OpCode opCode); 00077 00089 void collectLineEdge(geomgraph::DirectedEdge *de, 00090 OverlayOp::OpCode opCode, 00091 std::vector<geomgraph::Edge*>* edges); 00092 00093 private: 00094 OverlayOp *op; 00095 const geom::GeometryFactory *geometryFactory; 00096 algorithm::PointLocator *ptLocator; 00097 std::vector<geomgraph::Edge*> lineEdgesList; 00098 std::vector<geom::LineString*>* resultLineList; 00099 void findCoveredLineEdges(); 00100 void collectLines(OverlayOp::OpCode opCode); 00101 void buildLines(OverlayOp::OpCode opCode); 00102 void labelIsolatedLines(std::vector<geomgraph::Edge*> *edgesList); 00103 00114 void collectBoundaryTouchEdge(geomgraph::DirectedEdge *de, 00115 OverlayOp::OpCode opCode, 00116 std::vector<geomgraph::Edge*>* edges); 00117 00121 void labelIsolatedLine(geomgraph::Edge *e, int targetIndex); 00122 00123 /* 00124 * If the given CoordinateSequence has mixed 3d/2d vertexes 00125 * set Z for all vertexes missing it. 00126 * The Z value is interpolated between 3d vertexes and copied 00127 * from a 3d vertex to the end. 00128 */ 00129 void propagateZ(geom::CoordinateSequence *cs); 00130 }; 00131 00132 } // namespace geos::operation::overlay 00133 } // namespace geos::operation 00134 } // namespace geos 00135 00136 #ifdef _MSC_VER 00137 #pragma warning(pop) 00138 #endif 00139 00140 #endif // ndef GEOS_OP_OVERLAY_LINEBUILDER_H