00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
00018 #define GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
00019
00020 #include <geos/algorithm/locate/PointOnGeometryLocator.h>
00021 #include <geos/index/ItemVisitor.h>
00022
00023 namespace geos {
00024 namespace algorithm {
00025 class RayCrossingCounter;
00026 }
00027 namespace geom {
00028 class Geometry;
00029 class Coordinate;
00030 class CoordinateSequence;
00031 }
00032 namespace index {
00033 namespace intervalrtree {
00034 class SortedPackedIntervalRTree;
00035 }
00036 }
00037 }
00038
00039 namespace geos {
00040 namespace algorithm {
00041 namespace locate {
00042
00053 class IndexedPointInAreaLocator : public PointOnGeometryLocator
00054 {
00055 private:
00056 class IntervalIndexedGeometry
00057 {
00058 private:
00059 index::intervalrtree::SortedPackedIntervalRTree * index;
00060
00061 void init( const geom::Geometry & g);
00062 void addLine( geom::CoordinateSequence * pts);
00063
00064 public:
00065 IntervalIndexedGeometry( const geom::Geometry & g);
00066 ~IntervalIndexedGeometry();
00067
00068 void query(double min, double max, index::ItemVisitor * visitor);
00069 };
00070
00071
00072 class SegmentVisitor : public index::ItemVisitor
00073 {
00074 private:
00075 algorithm::RayCrossingCounter * counter;
00076
00077 public:
00078 SegmentVisitor( algorithm::RayCrossingCounter * counter)
00079 : counter( counter)
00080 { }
00081
00082 ~SegmentVisitor()
00083 { }
00084
00085 void visitItem( void * item);
00086 };
00087
00088
00089 const geom::Geometry & areaGeom;
00090 IntervalIndexedGeometry * index;
00091
00092 void buildIndex( const geom::Geometry & g);
00093
00094
00095 protected:
00096 public:
00101 IndexedPointInAreaLocator( const geom::Geometry & g);
00102
00103 ~IndexedPointInAreaLocator();
00104
00111 int locate( const geom::Coordinate * p);
00112
00113 };
00114
00115 }
00116 }
00117 }
00118
00119 #endif // GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
00120
00121
00122
00123