GEOS: SharedPathsOp.h Source File

GEOS 3.3.8

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

- File List

SharedPathsOp.h
1 /**********************************************************************
2 * $Id$
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2010 Sandro Santilli <strk@keybit.net>
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: original work
17 *
18 * Developed by Sandro Santilli (strk@keybit.net)
19 * for Faunalia (http://www.faunalia.it)
20 * with funding from Regione Toscana - Settore SISTEMA INFORMATIVO
21 * TERRITORIALE ED AMBIENTALE - for the project: "Sviluppo strumenti
22 * software per il trattamento di dati geografici basati su QuantumGIS
23 * e Postgis (CIG 0494241492)"
24 *
25 **********************************************************************/
26
27 #ifndef GEOS_OPERATION_SHAREDPATHSOP_H
28 #define GEOS_OPERATION_SHAREDPATHSOP_H
29
30 #include <geos/export.h> // for GEOS_DLL
31
32 #include <vector>
33
34 // Forward declarations
35 namespace geos {
36 namespace geom {
37 class LineString;
38 class Geometry;
39 class GeometryFactory;
40 }
41 }
42
43
44 namespace geos {
45 namespace operation { // geos.operation
46 namespace sharedpaths { // geos.operation.sharedpaths
47
65 class GEOS_DLL SharedPathsOp
66 {
67 public:
68
70 typedef std::vector<geom::LineString*> PathList;
71
73 //
90 static void sharedPathsOp(const geom::Geometry& g1,
91 const geom::Geometry& g2,
92 PathList& sameDirection,
93 PathList& oppositeDirection);
94
96 //
103 SharedPathsOp(const geom::Geometry& g1, const geom::Geometry& g2);
104
106 //
117 void getSharedPaths(PathList& sameDirection, PathList& oppositeDirection);
118
120 static void clearEdges(PathList& from);
121
122 private:
123
125 //
130 void findLinearIntersections(PathList& to);
131
133 //
136 bool isForward(const geom::LineString& edge,
137 const geom::Geometry& geom);
138
141 bool isSameDirection(const geom::LineString& edge) {
142 return (isForward(edge, _g1) == isForward(edge, _g2));
143 }
144
146 void checkLinealInput(const geom::Geometry& g);
147
148 const geom::Geometry& _g1;
149 const geom::Geometry& _g2;
150 const geom::GeometryFactory& _gf;
151
152 // Declare type as noncopyable
153 SharedPathsOp(const SharedPathsOp& other);
154 SharedPathsOp& operator=(const SharedPathsOp& rhs);
155
156 };
157
158 } // namespace geos.operation.sharedpaths
159 } // namespace geos.operation
160 } // namespace geos
161
162 #endif
163