GEOS 3.9.1
PreparedPolygonDistance.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 Sandro Santilli <strk@kbt.io>
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: ORIGINAL WORK
17 *
18 **********************************************************************/
19
20#ifndef GEOS_GEOM_PREP_PREPAREDPOLYGONDISTANCE_H
21#define GEOS_GEOM_PREP_PREPAREDPOLYGONDISTANCE_H
22
23// Forward declarations
24namespace geos {
25 namespace geom {
26 class Geometry;
27 namespace prep {
28 class PreparedPolygon;
29 }
30 }
31}
32
33namespace geos {
34namespace geom { // geos::geom
35namespace prep { // geos::geom::prep
36
37class PreparedPolygon;
38
39class PreparedPolygonDistance {
40public:
41
42 static double distance(const PreparedPolygon& prep, const geom::Geometry* geom)
43 {
44 PreparedPolygonDistance op(prep);
45 return op.distance(geom);
46 }
47
48 PreparedPolygonDistance(const PreparedPolygon& prep)
49 : prepPoly(prep)
50 { }
51
52 double distance(const geom::Geometry* g) const;
53
54protected:
55
56 const PreparedPolygon& prepPoly;
57
58 // Declare type as noncopyable
59 PreparedPolygonDistance(const PreparedPolygonDistance& other) = delete;
60 PreparedPolygonDistance& operator=(const PreparedPolygonDistance& rhs) = delete;
61};
62
63} // namespace geos::geom::prep
64} // namespace geos::geom
65} // namespace geos
66
67#endif // GEOS_GEOM_PREP_PREPAREDPOLYGONDISTANCE_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26