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 #ifndef GEOS_OPERATION_SHAREDPATHSOP_H
00027 #define GEOS_OPERATION_SHAREDPATHSOP_H
00028
00029 #include <geos/export.h>
00030
00031 #include <vector>
00032
00033
00034 namespace geos {
00035 namespace geom {
00036 class LineString;
00037 class Geometry;
00038 class GeometryFactory;
00039 }
00040 }
00041
00042
00043 namespace geos {
00044 namespace operation {
00045 namespace sharedpaths {
00046
00064 class GEOS_DLL SharedPathsOp
00065 {
00066 public:
00067
00069 typedef std::vector<geom::LineString*> PathList;
00070
00072
00089 static void sharedPathsOp(const geom::Geometry& g1,
00090 const geom::Geometry& g2,
00091 PathList& sameDirection,
00092 PathList& oppositeDirection);
00093
00095
00102 SharedPathsOp(const geom::Geometry& g1, const geom::Geometry& g2);
00103
00105
00116 void getSharedPaths(PathList& sameDirection, PathList& oppositeDirection);
00117
00119 static void clearEdges(PathList& from);
00120
00121 private:
00122
00124
00129 void findLinearIntersections(PathList& to);
00130
00132
00135 bool isForward(const geom::LineString& edge,
00136 const geom::Geometry& geom);
00137
00140 bool isSameDirection(const geom::LineString& edge) {
00141 return (isForward(edge, _g1) == isForward(edge, _g2));
00142 }
00143
00145 void checkLinealInput(const geom::Geometry& g);
00146
00147 const geom::Geometry& _g1;
00148 const geom::Geometry& _g2;
00149 const geom::GeometryFactory& _gf;
00150
00151
00152 SharedPathsOp(const SharedPathsOp& other);
00153 SharedPathsOp& operator=(const SharedPathsOp& rhs);
00154
00155 };
00156
00157 }
00158 }
00159 }
00160
00161 #endif
00162