GEOS  3.3.3
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 
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 
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 
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:61
Computes the location of points relative to an areal Geometry, using a simple O(n) algorithm...
Definition: SimplePointInAreaLocator.h:48
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:36
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:168
Represents a linear polygon, which may include holes.
Definition: Polygon.h:67
int locate(const geom::Coordinate *p)
Definition: SimplePointInAreaLocator.h:63