00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GEOS_OPERATION_SHAREDPATHSOP_H
00028 #define GEOS_OPERATION_SHAREDPATHSOP_H
00029
00030 #include <geos/export.h>
00031
00032 #include <vector>
00033
00034
00035 namespace geos {
00036 namespace geom {
00037 class LineString;
00038 class Geometry;
00039 class GeometryFactory;
00040 }
00041 }
00042
00043
00044 namespace geos {
00045 namespace operation {
00046 namespace sharedpaths {
00047
00065 class GEOS_DLL SharedPathsOp
00066 {
00067 public:
00068
00070 typedef std::vector<geom::LineString*> PathList;
00071
00073
00090 static void sharedPathsOp(const geom::Geometry& g1,
00091 const geom::Geometry& g2,
00092 PathList& sameDirection,
00093 PathList& oppositeDirection);
00094
00096
00103 SharedPathsOp(const geom::Geometry& g1, const geom::Geometry& g2);
00104
00106
00117 void getSharedPaths(PathList& sameDirection, PathList& oppositeDirection);
00118
00120 static void clearEdges(PathList& from);
00121
00122 private:
00123
00125
00130 void findLinearIntersections(PathList& to);
00131
00133
00136 bool isForward(const geom::LineString& edge,
00137 const geom::Geometry& geom);
00138
00141 bool isSameDirection(const geom::LineString& edge) {
00142 return (isForward(edge, _g1) == isForward(edge, _g2));
00143 }
00144
00146 void checkLinealInput(const geom::Geometry& g);
00147
00148 const geom::Geometry& _g1;
00149 const geom::Geometry& _g2;
00150 const geom::GeometryFactory& _gf;
00151
00152
00153 SharedPathsOp(const SharedPathsOp& other);
00154 SharedPathsOp& operator=(const SharedPathsOp& rhs);
00155
00156 };
00157
00158 }
00159 }
00160 }
00161
00162 #endif
00163