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