# LineBuilder.h

    00001 /**********************************************************************
    00002  * $Id: LineBuilder.h 1820 2006-09-06 16:54:23Z mloskot $
    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 #ifndef GEOS_OP_OVERLAY_LINEBUILDER_H
    00017 #define GEOS_OP_OVERLAY_LINEBUILDER_H
    00018
    00019 #include <geos/operation/overlay/OverlayOp.h> // for OverlayOp::OpCode enum
    00020
    00021 #include <vector>
    00022
    00023 // Forward declarations
    00024 namespace geos {
    00025         namespace geom {
    00026                 class GeometryFactory;
    00027                 class CoordinateSequence;
    00028                 class LineString;
    00029         }
    00030         namespace geomgraph {
    00031                 class DirectedEdge;
    00032                 class Edge;
    00033         }
    00034         namespace algorithm {
    00035                 class PointLocator;
    00036         }
    00037         namespace operation {
    00038                 namespace overlay {
    00039                         class OverlayOp;
    00040                 }
    00041         }
    00042 }
    00043
    00044 namespace geos {
    00045 namespace operation { // geos::operation
    00046 namespace overlay { // geos::operation::overlay
    00047
    00053 class LineBuilder {
    00054
    00055 public:
    00056
    00057         LineBuilder(OverlayOp *newOp,
    00058                         const geom::GeometryFactory *newGeometryFactory,
    00059                         algorithm::PointLocator *newPtLocator);
    00060
    00061         ~LineBuilder();
    00062
    00066         std::vector<geom::LineString*>* build(OverlayOp::OpCode opCode);
    00067
    00075         void collectLineEdge(geomgraph::DirectedEdge *de,
    00076                         OverlayOp::OpCode opCode,
    00077                         std::vector<geomgraph::Edge*>* edges);
    00078
    00089         void collectBoundaryTouchEdge(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
    00107         void labelIsolatedLine(geomgraph::Edge *e, int targetIndex);
    00108
    00109         /*
    00110          * If the given CoordinateSequence has mixed 3d/2d vertexes
    00111          * set Z for all vertexes missing it.
    00112          * The Z value is interpolated between 3d vertexes and copied
    00113          * from a 3d vertex to the end.
    00114          */
    00115         void propagateZ(geom::CoordinateSequence *cs);
    00116 };
    00117
    00118
    00119 } // namespace geos::operation::overlay
    00120 } // namespace geos::operation
    00121 } // namespace geos
    00122
    00123 #endif // ndef GEOS_OP_OVERLAY_LINEBUILDER_H
    00124
    00125 /**********************************************************************
    00126  * $Log$
    00127  * Revision 1.2  2006/06/05 15:36:34  strk
    00128  * Given OverlayOp funx code enum a name and renamed values to have a lowercase prefix. Drop all of noding headers from installed header set.
    00129  *
    00130  * Revision 1.1  2006/03/17 13:24:59  strk
    00131  * 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).
    00132  *
    00133  **********************************************************************/
    00134