GEOS  3.6.1
InteriorPointArea.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2013 Sandro Santilli <strk@keybit.net>
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  * Last port: algorithm/InteriorPointArea.java r728 (JTS-1.13+)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_ALGORITHM_INTERIORPOINTAREA_H
22 #define GEOS_ALGORITHM_INTERIORPOINTAREA_H
23 
24 #include <geos/export.h>
25 #include <geos/geom/Coordinate.h>
26 
27 // Forward declarations
28 namespace geos {
29  namespace geom {
30  class Geometry;
31  class LineString;
32  class GeometryFactory;
33  class GeometryCollection;
34  }
35 }
36 
37 
38 namespace geos {
39 namespace algorithm { // geos::algorithm
40 
63 class GEOS_DLL InteriorPointArea {
64 
65 private:
66 
67  bool foundInterior;
68 
69  const geom::GeometryFactory *factory;
70 
71  geom::Coordinate interiorPoint;
72 
73  double maxWidth;
74 
75  void add(const geom::Geometry *geom);
76 
77  const geom::Geometry *widestGeometry(const geom::Geometry *geometry);
78 
79  const geom::Geometry *widestGeometry(const geom::GeometryCollection *gc);
80 
81  geom::LineString *horizontalBisector(const geom::Geometry *geometry);
82 
83 public:
84 
92 
94 
100  bool getInteriorPoint(geom::Coordinate& ret) const;
101 
102 private:
103 
111  void addPolygon(const geom::Geometry *geometry);
112 
113 };
114 
115 } // namespace geos::algorithm
116 } // namespace geos
117 
118 #endif // GEOS_ALGORITHM_INTERIORPOINTAREA_H
119 
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Computes a point in the interior of an areal geometry.
Definition: InteriorPointArea.h:63
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
Definition: LineString.h:70
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:56
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25