GEOS: SimplePointInAreaLocator.h Source File

GEOS 3.3.8

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

SimplePointInAreaLocator.h
1 /**********************************************************************
2 * $Id: SimplePointInAreaLocator.h 2120 2008-01-30 22:34:13Z benjubb $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************/
16
17 #ifndef GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
18 #define GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
19
20 #include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
21
22 // Forward declarations
23 namespace geos {
24 namespace geom {
25 class Geometry;
26 class Coordinate;
27 class Polygon;
28 }
29 }
30
31 namespace geos {
32 namespace algorithm { // geos::algorithm
33 namespace locate { // geos::algorithm::locate
34
48 class SimplePointInAreaLocator : public PointOnGeometryLocator
49 {
50
51 public:
52
53 static int locate(const geom::Coordinate& p,
54 const geom::Geometry *geom);
55
56 static bool containsPointInPolygon(const geom::Coordinate& p,
57 const geom::Polygon *poly);
58
59 SimplePointInAreaLocator( const geom::Geometry * g)
60 : g( g)
61 { }
62
63 int locate( const geom::Coordinate * p)
64 {
65 return locate( *p, g);
66 }
67
68 private:
69
70 static bool containsPoint(const geom::Coordinate& p,
71 const geom::Geometry *geom);
72
73 const geom::Geometry * g;
74
75 };
76
77 } // geos::algorithm::locate
78 } // geos::algorithm
79 } // geos
80
81
82 #endif // GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
83
84 /**********************************************************************
85 * $Log$
86 * Revision 1.1 2006/03/09 16:46:48 strk
87 * geos::geom namespace definition, first pass at headers split
88 *
89 **********************************************************************/
90