SimplePointInAreaLocator.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2005-2006 Refractions Research Inc.
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************/
00015 
00016 #ifndef GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
00017 #define GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
00018 
00019 #include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
00020 
00021 // Forward declarations
00022 namespace geos {
00023         namespace geom {
00024                 class Geometry;
00025                 class Coordinate;
00026                 class Polygon;
00027         }
00028 }
00029 
00030 namespace geos {
00031 namespace algorithm { // geos::algorithm
00032 namespace locate { // geos::algorithm::locate
00033 
00047 class SimplePointInAreaLocator : public PointOnGeometryLocator
00048 {
00049 
00050 public:
00051 
00052         static int locate(const geom::Coordinate& p,
00053                         const geom::Geometry *geom);
00054 
00055         static bool containsPointInPolygon(const geom::Coordinate& p,
00056                         const geom::Polygon *poly);
00057 
00058         SimplePointInAreaLocator( const geom::Geometry * g) 
00059         :       g( g)
00060         { }
00061 
00062         int locate( const geom::Coordinate * p) 
00063         {
00064                 return locate( *p, g);
00065         }
00066 
00067 private:
00068 
00069         static bool containsPoint(const geom::Coordinate& p,
00070                         const geom::Geometry *geom);
00071 
00072         const geom::Geometry * g;
00073 
00074 };
00075 
00076 } // geos::algorithm::locate
00077 } // geos::algorithm
00078 } // geos
00079 
00080 
00081 #endif // GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H

Generated on 23 Sep 2013 for GEOS by  doxygen 1.4.7