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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef GEOS_OPERATION_H
00039 #define GEOS_OPERATION_H
00040
00041 #include <memory>
00042
00043
00044 #include <vector>
00045 #include <map>
00046
00047
00048 #include <geos/platform.h>
00049 #include <geos/geomgraph.h>
00050 #include <geos/geom.h>
00051 #include <geos/geosAlgorithm.h>
00052
00053 using namespace std;
00054
00055 namespace geos {
00056
00057
00058
00059
00060
00061 class GeometryGraphOperation {
00062 friend class Unload;
00063 public:
00064 GeometryGraphOperation(const Geometry *g0,const Geometry *g1);
00065 GeometryGraphOperation(const Geometry *g0);
00066 virtual ~GeometryGraphOperation();
00067 const Geometry* getArgGeometry(int i) const;
00068 protected:
00069 static CGAlgorithms *cga;
00070 static LineIntersector *li;
00071 const PrecisionModel* resultPrecisionModel;
00075 vector<GeometryGraph*> *arg;
00076 void setComputationPrecision(const PrecisionModel* pm);
00077 };
00078
00079 class EndpointInfo{
00080 public:
00081 Coordinate pt;
00082 bool isClosed;
00083 int degree;
00084 EndpointInfo(const Coordinate& newPt);
00085 void addEndpoint(bool newIsClosed);
00086 };
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 class IsSimpleOp {
00097 public:
00098 IsSimpleOp();
00099 bool isSimple(const LineString *geom);
00100 bool isSimple(const MultiLineString *geom);
00101 bool isSimple(const MultiPoint *mp);
00102 bool isSimpleLinearGeometry(const Geometry *geom);
00103 private:
00104 bool hasNonEndpointIntersection(GeometryGraph *graph);
00105 bool hasClosedEndpointIntersection(GeometryGraph *graph);
00106 void addEndpoint(map<Coordinate,EndpointInfo*,CoordLT> *endPoints, const Coordinate& p,bool isClosed);
00107 };
00108 }
00109 #endif