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 protected:
00078 public:
00087 static int locatePointInRing(const geom::Coordinate& p,
00088 const geom::CoordinateSequence& ring);
00089
00091 static int locatePointInRing(const geom::Coordinate& p,
00092 const std::vector<const geom::Coordinate*>& ring);
00093
00094 RayCrossingCounter(const geom::Coordinate& point)
00095 : point( point),
00096 crossingCount( 0),
00097 isPointOnSegment( false)
00098 { }
00099
00106 void countSegment(const geom::Coordinate& p1,
00107 const geom::Coordinate& p2);
00108
00118 bool isOnSegment()
00119 {
00120 return isPointOnSegment;
00121 }
00122
00133 int getLocation();
00134
00145 bool isPointInPolygon();
00146
00147 };
00148
00149 }
00150 }
00151
00152 #endif // GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
00153
00154
00155
00156