GEOS 3.2.1
|
00001 /********************************************************************** 00002 * $Id: LineBuilder.h 2565 2009-06-08 16:26:36Z 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/overlay/LineBuilder.java rev. 1.15 (JTS-1.10) 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_OP_OVERLAY_LINEBUILDER_H 00021 #define GEOS_OP_OVERLAY_LINEBUILDER_H 00022 00023 #include <geos/export.h> 00024 00025 #include <geos/operation/overlay/OverlayOp.h> // for OverlayOp::OpCode enum 00026 00027 #include <vector> 00028 00029 // Forward declarations 00030 namespace geos { 00031 namespace geom { 00032 class GeometryFactory; 00033 class CoordinateSequence; 00034 class LineString; 00035 } 00036 namespace geomgraph { 00037 class DirectedEdge; 00038 class Edge; 00039 } 00040 namespace algorithm { 00041 class PointLocator; 00042 } 00043 namespace operation { 00044 namespace overlay { 00045 class OverlayOp; 00046 } 00047 } 00048 } 00049 00050 namespace geos { 00051 namespace operation { // geos::operation 00052 namespace overlay { // geos::operation::overlay 00053 00059 class GEOS_DLL LineBuilder { 00060 00061 public: 00062 00063 LineBuilder(OverlayOp *newOp, 00064 const geom::GeometryFactory *newGeometryFactory, 00065 algorithm::PointLocator *newPtLocator); 00066 00067 ~LineBuilder(); 00068 00072 std::vector<geom::LineString*>* build(OverlayOp::OpCode opCode); 00073 00085 void collectLineEdge(geomgraph::DirectedEdge *de, 00086 OverlayOp::OpCode opCode, 00087 std::vector<geomgraph::Edge*>* edges); 00088 00089 private: 00090 OverlayOp *op; 00091 const geom::GeometryFactory *geometryFactory; 00092 algorithm::PointLocator *ptLocator; 00093 std::vector<geomgraph::Edge*> lineEdgesList; 00094 std::vector<geom::LineString*>* resultLineList; 00095 void findCoveredLineEdges(); 00096 void collectLines(OverlayOp::OpCode opCode); 00097 void buildLines(OverlayOp::OpCode opCode); 00098 void labelIsolatedLines(std::vector<geomgraph::Edge*> *edgesList); 00099 00110 void collectBoundaryTouchEdge(geomgraph::DirectedEdge *de, 00111 OverlayOp::OpCode opCode, 00112 std::vector<geomgraph::Edge*>* edges); 00113 00117 void labelIsolatedLine(geomgraph::Edge *e, int targetIndex); 00118 00119 /* 00120 * If the given CoordinateSequence has mixed 3d/2d vertexes 00121 * set Z for all vertexes missing it. 00122 * The Z value is interpolated between 3d vertexes and copied 00123 * from a 3d vertex to the end. 00124 */ 00125 void propagateZ(geom::CoordinateSequence *cs); 00126 }; 00127 00128 00129 } // namespace geos::operation::overlay 00130 } // namespace geos::operation 00131 } // namespace geos 00132 00133 #endif // ndef GEOS_OP_OVERLAY_LINEBUILDER_H 00134 00135 /********************************************************************** 00136 * $Log$ 00137 * Revision 1.2 2006/06/05 15:36:34 strk 00138 * Given OverlayOp funx code enum a name and renamed values to have a lowercase prefix. Drop all of noding headers from installed header set. 00139 * 00140 * Revision 1.1 2006/03/17 13:24:59 strk 00141 * opOverlay.h header splitted. Reduced header inclusions in operation/overlay implementation files. ElevationMatrixFilter code moved from own file to ElevationMatrix.cpp (ideally a class-private). 00142 * 00143 **********************************************************************/ 00144