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