GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

LineBuilder.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 ***********************************************************************
14 *
15 * Last port: operation/overlay/LineBuilder.java rev. 1.15 (JTS-1.10)
16 *
17 **********************************************************************/
18
19 #ifndef GEOS_OP_OVERLAY_LINEBUILDER_H
20 #define GEOS_OP_OVERLAY_LINEBUILDER_H
21
22 #include <geos/export.h>
23
24 #include <geos/operation/overlay/OverlayOp.h> // for OverlayOp::OpCode enum
25
26 #include <vector>
27
28 #ifdef _MSC_VER
29 #pragma warning(push)
30 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
31 #endif
32
33 // Forward declarations
34 namespace geos {
35 namespace geom {
36 class GeometryFactory;
37 class CoordinateSequence;
38 class LineString;
39 }
40 namespace geomgraph {
41 class DirectedEdge;
42 class Edge;
43 }
44 namespace algorithm {
45 class PointLocator;
46 }
47 namespace operation {
48 namespace overlay {
49 class OverlayOp;
50 }
51 }
52 }
53
54 namespace geos {
55 namespace operation { // geos::operation
56 namespace overlay { // geos::operation::overlay
57
63 class GEOS_DLL LineBuilder {
64
65 public:
66
67 LineBuilder(OverlayOp *newOp,
68 const geom::GeometryFactory *newGeometryFactory,
69 algorithm::PointLocator *newPtLocator);
70
71 ~LineBuilder();
72
76 std::vector<geom::LineString*>* build(OverlayOp::OpCode opCode);
77
89 void collectLineEdge(geomgraph::DirectedEdge *de,
90 OverlayOp::OpCode opCode,
91 std::vector<geomgraph::Edge*>* edges);
92
93 private:
94 OverlayOp *op;
95 const geom::GeometryFactory *geometryFactory;
96 algorithm::PointLocator *ptLocator;
97 std::vector<geomgraph::Edge*> lineEdgesList;
98 std::vector<geom::LineString*>* resultLineList;
99 void findCoveredLineEdges();
100 void collectLines(OverlayOp::OpCode opCode);
101 void buildLines(OverlayOp::OpCode opCode);
102 void labelIsolatedLines(std::vector<geomgraph::Edge*> *edgesList);
103
114 void collectBoundaryTouchEdge(geomgraph::DirectedEdge *de,
115 OverlayOp::OpCode opCode,
116 std::vector<geomgraph::Edge*>* edges);
117
121 void labelIsolatedLine(geomgraph::Edge *e, int targetIndex);
122
123 /*
124 * If the given CoordinateSequence has mixed 3d/2d vertexes
125 * set Z for all vertexes missing it.
126 * The Z value is interpolated between 3d vertexes and copied
127 * from a 3d vertex to the end.
128 */
129 void propagateZ(geom::CoordinateSequence *cs);
130 };
131
132 } // namespace geos::operation::overlay
133 } // namespace geos::operation
134 } // namespace geos
135
136 #ifdef _MSC_VER
137 #pragma warning(pop)
138 #endif
139
140 #endif // ndef GEOS_OP_OVERLAY_LINEBUILDER_H