InteriorPointArea.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2013 Sandro Santilli <strk@keybit.net>
00007  * Copyright (C) 2005-2006 Refractions Research Inc.
00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation. 
00013  * See the COPYING file for more information.
00014  *
00015  **********************************************************************
00016  *
00017  * Last port: algorithm/InteriorPointArea.java r728 (JTS-1.13+)
00018  *
00019  **********************************************************************/
00020 
00021 #ifndef GEOS_ALGORITHM_INTERIORPOINTAREA_H
00022 #define GEOS_ALGORITHM_INTERIORPOINTAREA_H
00023 
00024 #include <geos/export.h>
00025 #include <geos/geom/Coordinate.h>
00026 
00027 // Forward declarations
00028 namespace geos {
00029         namespace geom {
00030                 class Geometry;
00031                 class LineString;
00032                 class GeometryFactory;
00033                 class GeometryCollection;
00034         }
00035 }
00036 
00037 
00038 namespace geos {
00039 namespace algorithm { // geos::algorithm
00040 
00063 class GEOS_DLL InteriorPointArea {
00064 
00065 private:
00066 
00067         bool foundInterior;
00068 
00069         const geom::GeometryFactory *factory;
00070 
00071         geom::Coordinate interiorPoint;
00072 
00073         double maxWidth;
00074 
00075         void add(const geom::Geometry *geom);
00076 
00077         const geom::Geometry *widestGeometry(const geom::Geometry *geometry);
00078 
00079         const geom::Geometry *widestGeometry(const geom::GeometryCollection *gc);
00080 
00081         geom::LineString *horizontalBisector(const geom::Geometry *geometry);
00082 
00083 public:
00084 
00091         InteriorPointArea(const geom::Geometry *g);
00092 
00093         ~InteriorPointArea();
00094 
00100         bool getInteriorPoint(geom::Coordinate& ret) const;
00101 
00102 private:
00103 
00111         void addPolygon(const geom::Geometry *geometry);
00112 
00113 };
00114 
00115 } // namespace geos::algorithm
00116 } // namespace geos
00117 
00118 #endif // GEOS_ALGORITHM_INTERIORPOINTAREA_H
00119 

Generated on 15 May 2014 for GEOS by  doxygen 1.4.7