00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_ALGORITHM_MCPOINTINRING_H
00018 #define GEOS_ALGORITHM_MCPOINTINRING_H
00019
00020 #include <geos/export.h>
00021 #include <geos/index/chain/MonotoneChainSelectAction.h>
00022 #include <geos/algorithm/PointInRing.h>
00023 #include <geos/geom/Coordinate.h>
00024 #include <geos/index/bintree/Interval.h>
00025
00026 #include <vector>
00027
00028
00029 namespace geos {
00030 namespace geom {
00031 class Coordinate;
00032 class LineSegment;
00033 class LinearRing;
00034 class CoordinateSequence;
00035 class CoordinateSequence;
00036 }
00037 namespace index {
00038 namespace bintree {
00039 class Bintree;
00040 class Interval;
00041 }
00042 namespace chain {
00043 class MonotoneChain;
00044 }
00045 }
00046 }
00047
00048 namespace geos {
00049 namespace algorithm {
00050
00051 class GEOS_DLL MCPointInRing: public PointInRing {
00052 public:
00053 MCPointInRing(const geom::LinearRing *newRing);
00054 ~MCPointInRing();
00055 bool isInside(const geom::Coordinate& pt);
00056
00057 void testLineSegment(const geom::Coordinate& p,
00058 const geom::LineSegment& seg);
00059
00060 class MCSelecter: public index::chain::MonotoneChainSelectAction {
00061 using MonotoneChainSelectAction::select;
00062 private:
00063 geom::Coordinate p;
00064 MCPointInRing *parent;
00065 public:
00066 MCSelecter(const geom::Coordinate& newP, MCPointInRing *prt);
00067 void select(const geom::LineSegment& ls);
00068 };
00069
00070 private:
00071 const geom::LinearRing *ring;
00072 index::bintree::Interval interval;
00073 geom::CoordinateSequence *pts;
00074 index::bintree::Bintree *tree;
00075 int crossings;
00076 void buildIndex();
00077 void testMonotoneChain(geom::Envelope *rayEnv,
00078 MCSelecter *mcSelecter,
00079 index::chain::MonotoneChain *mc);
00080 };
00081
00082 }
00083 }
00084
00085 #endif // GEOS_ALGORITHM_MCPOINTINRING_H
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102