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/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 MCPointInRing: public PointInRing {
00051 public:
00052 MCPointInRing(const geom::LinearRing *newRing);
00053 ~MCPointInRing();
00054 bool isInside(const geom::Coordinate& pt);
00055 void testLineSegment(geom::Coordinate& p, geom::LineSegment *seg);
00056
00057 class MCSelecter: public index::chain::MonotoneChainSelectAction {
00058 using MonotoneChainSelectAction::select;
00059 private:
00060 geom::Coordinate p;
00061 MCPointInRing *parent;
00062 public:
00063 MCSelecter(const geom::Coordinate& newP, MCPointInRing *prt);
00064 void select(geom::LineSegment *ls);
00065 };
00066
00067 private:
00068 const geom::LinearRing *ring;
00069 index::bintree::Interval interval;
00070 geom::CoordinateSequence *pts;
00071 index::bintree::Bintree *tree;
00072 int crossings;
00073 void buildIndex();
00074 void testMonotoneChain(geom::Envelope *rayEnv,
00075 MCSelecter *mcSelecter,
00076 index::chain::MonotoneChain *mc);
00077 };
00078
00079 }
00080 }
00081
00082 #endif // GEOS_ALGORITHM_MCPOINTINRING_H
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099