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 #ifndef GEOS_NODING_SNAPROUND_H
00032 #define GEOS_NODING_SNAPROUND_H
00033
00034 #include <geos/platform.h>
00035 #include <geos/noding.h>
00036 #include <geos/geom.h>
00037 #include <vector>
00038
00039 using namespace std;
00040
00041 namespace geos {
00042
00043 class SegmentSnapper {
00044 private:
00045 static double TOLERANCE;
00046 public:
00050 static bool isWithinTolerance(const Coordinate& p,const Coordinate& p0,const Coordinate& p1);
00061 bool addSnappedNode(Coordinate& snapPt,SegmentString *segStr,int segIndex);
00062 };
00063
00064 class SimpleSegmentStringsSnapper {
00065 private:
00066 int nSnaps;
00071 void computeSnaps(SegmentString *e0, SegmentString *e1, SegmentSnapper *ss);
00072 public:
00073 SimpleSegmentStringsSnapper();
00074 int getNumSnaps();
00075 void computeNodes(vector<SegmentString*>* edges, SegmentSnapper *ss, bool testAllSegments);
00076 };
00077
00078
00079
00080
00081
00082 class SnapRounder {
00083 protected:
00084 LineIntersector *li;
00085 public:
00086 void setLineIntersector(LineIntersector *newLi);
00087 vector<SegmentString*>* node(vector<SegmentString*>* inputSegmentStrings);
00088 private:
00089 vector<SegmentString*>* fullyIntersectSegments(vector<SegmentString*>* segStrings, LineIntersector *aLi);
00094 vector<SegmentString*>* computeSnaps(vector<SegmentString*>* segStrings);
00095 };
00096
00097 }
00098 #endif
00099