00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00018 #define GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00019
00020
00021
00022 namespace geos {
00023 namespace geom {
00024 class Coordinate;
00025 class CoordinateSequence;
00026 }
00027 }
00028
00029
00030 namespace geos {
00031 namespace algorithm {
00032
00060 class RayCrossingCounter
00061 {
00062 private:
00063 const geom::Coordinate * point;
00064
00065 int crossingCount;
00066
00067
00068 bool isPointOnSegment;
00069
00070 protected:
00071 public:
00080 static int locatePointInRing( const geom::Coordinate * p, const geom::CoordinateSequence * ring);
00081
00082 RayCrossingCounter( const geom::Coordinate * point)
00083 : point( point),
00084 crossingCount( 0),
00085 isPointOnSegment( false)
00086 { }
00087
00094 void countSegment( const geom::Coordinate * p1, const geom::Coordinate * p2);
00095
00105 bool isOnSegment()
00106 {
00107 return isPointOnSegment;
00108 }
00109
00120 int getLocation();
00121
00132 bool isPointInPolygon();
00133
00134 };
00135
00136 }
00137 }
00138
00139 #endif // GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00140
00141
00142
00143