InteriorPointLine.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2005-2006 Refractions Research Inc.
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: algorithm/InteriorPointLine.java r317 (JTS-1.12)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_ALGORITHM_INTERIORPOINTLINE_H
00021 #define GEOS_ALGORITHM_INTERIORPOINTLINE_H
00022 
00023 #include <geos/export.h>
00024 #include <geos/geom/Coordinate.h>
00025 
00026 // Forward declarations
00027 namespace geos {
00028         namespace geom {
00029                 class Geometry;
00030                 class CoordinateSequence;
00031         }
00032 }
00033 
00034 
00035 namespace geos {
00036 namespace algorithm { // geos::algorithm
00037 
00048 class GEOS_DLL InteriorPointLine {
00049 public:
00050 
00051         InteriorPointLine(const geom::Geometry *g);
00052 
00053         ~InteriorPointLine();
00054 
00055         //Coordinate* getInteriorPoint() const;
00056 
00057         bool getInteriorPoint(geom::Coordinate& ret) const;
00058 
00059 private:
00060 
00061         bool hasInterior;
00062 
00063         geom::Coordinate centroid;
00064 
00065         double minDistance;
00066 
00067         geom::Coordinate interiorPoint;
00068 
00069         void addInterior(const geom::Geometry *geom);
00070 
00071         void addInterior(const geom::CoordinateSequence *pts);
00072         
00073         void addEndpoints(const geom::Geometry *geom);
00074 
00075         void addEndpoints(const geom::CoordinateSequence *pts);
00076 
00077         void add(const geom::Coordinate& point);
00078 
00079 };
00080 
00081 } // namespace geos::algorithm
00082 } // namespace geos
00083 
00084 #endif // GEOS_ALGORITHM_INTERIORPOINTLINE_H
00085 

Generated on 15 May 2014 for GEOS by  doxygen 1.4.7