00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00022 #define GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00023
00024 #include <geos/export.h>
00025
00026 #include <vector>
00027
00028
00029 namespace geos {
00030 namespace geom {
00031 class Coordinate;
00032 class CoordinateSequence;
00033 }
00034 }
00035
00036
00037 namespace geos {
00038 namespace algorithm {
00039
00067 class GEOS_DLL RayCrossingCounter
00068 {
00069 private:
00070 const geom::Coordinate& point;
00071
00072 int crossingCount;
00073
00074
00075 bool isPointOnSegment;
00076
00077
00078 RayCrossingCounter(const RayCrossingCounter& other);
00079 RayCrossingCounter& operator=(const RayCrossingCounter& rhs);
00080
00081 public:
00090 static int locatePointInRing(const geom::Coordinate& p,
00091 const geom::CoordinateSequence& ring);
00092
00094 static int locatePointInRing(const geom::Coordinate& p,
00095 const std::vector<const geom::Coordinate*>& ring);
00096
00097 RayCrossingCounter(const geom::Coordinate& point)
00098 : point( point),
00099 crossingCount( 0),
00100 isPointOnSegment( false)
00101 { }
00102
00109 void countSegment(const geom::Coordinate& p1,
00110 const geom::Coordinate& p2);
00111
00121 bool isOnSegment()
00122 {
00123 return isPointOnSegment;
00124 }
00125
00136 int getLocation();
00137
00148 bool isPointInPolygon();
00149
00150 };
00151
00152 }
00153 }
00154
00155 #endif // GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00156
00157
00158
00159