1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
14 **********************************************************************
16 * Last port: algorithm/InteriorPointLine.java r317 (JTS-1.12)
18 **********************************************************************/
20 #ifndef GEOS_ALGORITHM_INTERIORPOINTLINE_H
21 #define GEOS_ALGORITHM_INTERIORPOINTLINE_H
23 #include <geos/export.h>
24 #include <geos/geom/Coordinate.h>
26 // Forward declarations
30 class CoordinateSequence
;
36 namespace algorithm
{ // geos::algorithm
39 * Computes a point in the interior of an linear geometry.
43 * - Find an interior vertex which is closest to
44 * the centroid of the linestring.
45 * - If there is no interior vertex, find the endpoint which is
46 * closest to the centroid.
48 class GEOS_DLL InteriorPointLine
{
51 InteriorPointLine(const geom::Geometry
*g
);
55 //Coordinate* getInteriorPoint() const;
57 bool getInteriorPoint(geom::Coordinate
& ret
) const;
63 geom::Coordinate centroid
;
67 geom::Coordinate interiorPoint
;
69 void addInterior(const geom::Geometry
*geom
);
71 void addInterior(const geom::CoordinateSequence
*pts
);
73 void addEndpoints(const geom::Geometry
*geom
);
75 void addEndpoints(const geom::CoordinateSequence
*pts
);
77 void add(const geom::Coordinate
& point
);
81 } // namespace geos::algorithm
84 #endif // GEOS_ALGORITHM_INTERIORPOINTLINE_H
86 /**********************************************************************
88 * Revision 1.1 2006/03/09 16:46:48 strk
89 * geos::geom namespace definition, first pass at headers split
91 **********************************************************************/