| 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) 2006 Refractions Research Inc. |
|
7
|
|
|
|
|
|
|
* |
|
8
|
|
|
|
|
|
|
* This is free software; you can redistribute and/or modify it under |
|
9
|
|
|
|
|
|
|
* the terms of the GNU Lesser General Public Licence as published |
|
10
|
|
|
|
|
|
|
* by the Free Software Foundation. |
|
11
|
|
|
|
|
|
|
* See the COPYING file for more information. |
|
12
|
|
|
|
|
|
|
* |
|
13
|
|
|
|
|
|
|
* |
|
14
|
|
|
|
|
|
|
********************************************************************** |
|
15
|
|
|
|
|
|
|
* |
|
16
|
|
|
|
|
|
|
* Last port: geom/prep/PreparedGeometryFactory.java rev. 1.4 (JTS-1.10) |
|
17
|
|
|
|
|
|
|
* |
|
18
|
|
|
|
|
|
|
**********************************************************************/ |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#ifndef GEOS_GEOM_PREP_PREPAREDGEOMETRYFACTORY_H |
|
21
|
|
|
|
|
|
|
#define GEOS_GEOM_PREP_PREPAREDGEOMETRYFACTORY_H |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#include |
|
24
|
|
|
|
|
|
|
#include |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
namespace geos { |
|
27
|
|
|
|
|
|
|
namespace geom { |
|
28
|
|
|
|
|
|
|
namespace prep { |
|
29
|
|
|
|
|
|
|
class PreparedGeometry; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
namespace geos { |
|
36
|
|
|
|
|
|
|
namespace geom { // geos::geom |
|
37
|
|
|
|
|
|
|
namespace prep { // geos::geom::prep |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
/** |
|
41
|
|
|
|
|
|
|
* \brief |
|
42
|
|
|
|
|
|
|
* A factory for creating {@link PreparedGeometry}s. |
|
43
|
|
|
|
|
|
|
* |
|
44
|
|
|
|
|
|
|
* It chooses an appropriate implementation of PreparedGeometry |
|
45
|
|
|
|
|
|
|
* based on the geoemtric type of the input geometry. |
|
46
|
|
|
|
|
|
|
* In the future, the factory may accept hints that indicate |
|
47
|
|
|
|
|
|
|
* special optimizations which can be performed. |
|
48
|
|
|
|
|
|
|
* |
|
49
|
|
|
|
|
|
|
* @author Martin Davis |
|
50
|
|
|
|
|
|
|
* |
|
51
|
|
|
|
|
|
|
*/ |
|
52
|
|
|
|
|
|
|
class GEOS_DLL PreparedGeometryFactory |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
|
|
|
|
|
|
public: |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
/** |
|
57
|
|
|
|
|
|
|
* Creates a new {@link PreparedGeometry} appropriate for the argument {@link Geometry}. |
|
58
|
|
|
|
|
|
|
* |
|
59
|
|
|
|
|
|
|
* @param geom the geometry to prepare |
|
60
|
|
|
|
|
|
|
* @return the prepared geometry |
|
61
|
|
|
|
|
|
|
*/ |
|
62
|
2
|
|
|
|
|
|
static const PreparedGeometry * prepare(const geom::Geometry * geom) |
|
63
|
|
|
|
|
|
|
{ |
|
64
|
|
|
|
|
|
|
PreparedGeometryFactory pf; |
|
65
|
2
|
50
|
|
|
|
|
return pf.create(geom); |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
/** |
|
69
|
|
|
|
|
|
|
* Destroys {@link PreparedGeometry} allocated with the factory. |
|
70
|
|
|
|
|
|
|
* |
|
71
|
|
|
|
|
|
|
* @param geom to be deallocated |
|
72
|
|
|
|
|
|
|
*/ |
|
73
|
|
|
|
|
|
|
static void destroy(const PreparedGeometry* geom) |
|
74
|
|
|
|
|
|
|
{ |
|
75
|
|
|
|
|
|
|
delete geom; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
/** |
|
79
|
|
|
|
|
|
|
* Creates a new {@link PreparedGeometry} appropriate for the argument {@link Geometry}. |
|
80
|
|
|
|
|
|
|
* |
|
81
|
|
|
|
|
|
|
* @param geom the geometry to prepare |
|
82
|
|
|
|
|
|
|
* @return the prepared geometry |
|
83
|
|
|
|
|
|
|
*/ |
|
84
|
|
|
|
|
|
|
const PreparedGeometry* create(const geom::Geometry* geom) const; |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
}; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
} // namespace geos::geom::prep |
|
89
|
|
|
|
|
|
|
} // namespace geos::geom |
|
90
|
|
|
|
|
|
|
} // namespace geos |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
#endif // GEOS_GEOM_PREP_PREPAREDGEOMETRYFACTORY_H |