line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/********************************************************************** |
2
|
|
|
|
|
|
|
* |
3
|
|
|
|
|
|
|
* GEOS - Geometry Engine Open Source |
4
|
|
|
|
|
|
|
* http://geos.osgeo.org |
5
|
|
|
|
|
|
|
* |
6
|
|
|
|
|
|
|
* Copyright (C) 2005-2006 Refractions Research Inc. |
7
|
|
|
|
|
|
|
* Copyright (C) 2001-2002 Vivid Solutions Inc. |
8
|
|
|
|
|
|
|
* |
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. |
13
|
|
|
|
|
|
|
* |
14
|
|
|
|
|
|
|
**********************************************************************/ |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#ifndef GEOS_ALGORITHM_INTERIORPOINTPOINT_H |
17
|
|
|
|
|
|
|
#define GEOS_ALGORITHM_INTERIORPOINTPOINT_H |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#include |
20
|
|
|
|
|
|
|
#include |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
// Forward declarations |
23
|
|
|
|
|
|
|
namespace geos { |
24
|
|
|
|
|
|
|
namespace geom { |
25
|
|
|
|
|
|
|
class Geometry; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
namespace geos { |
30
|
|
|
|
|
|
|
namespace algorithm { // geos::algorithm |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
/** |
33
|
|
|
|
|
|
|
* \class InteriorPointPoint geosAlgorithm.h geos/geosAlgorithm.h |
34
|
|
|
|
|
|
|
* \brief |
35
|
|
|
|
|
|
|
* Computes a point in the interior of an point geometry. |
36
|
|
|
|
|
|
|
* |
37
|
|
|
|
|
|
|
* Algorithm: |
38
|
|
|
|
|
|
|
* |
39
|
|
|
|
|
|
|
* Find a point which is closest to the centroid of the geometry. |
40
|
|
|
|
|
|
|
*/ |
41
|
|
|
|
|
|
|
class GEOS_DLL InteriorPointPoint { |
42
|
|
|
|
|
|
|
private: |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
bool hasInterior; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
geom::Coordinate centroid; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
double minDistance; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
geom::Coordinate interiorPoint; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
/** |
53
|
|
|
|
|
|
|
* Tests the point(s) defined by a Geometry for the best inside point. |
54
|
|
|
|
|
|
|
* If a Geometry is not of dimension 0 it is not tested. |
55
|
|
|
|
|
|
|
* @param geom the geometry to add |
56
|
|
|
|
|
|
|
*/ |
57
|
|
|
|
|
|
|
void add(const geom::Geometry *geom); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
void add(const geom::Coordinate *point); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
public: |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
InteriorPointPoint(const geom::Geometry *g); |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
|
~InteriorPointPoint() {} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
bool getInteriorPoint(geom::Coordinate& ret) const; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
}; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
} // namespace geos::algorithm |
72
|
|
|
|
|
|
|
} // namespace geos |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
#endif // GEOS_ALGORITHM_INTERIORPOINTPOINT_H |
76
|
|
|
|
|
|
|
|