GEOS 3.11.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#pragma once
21
22// Forward declarations
23namespace geos {
24 namespace geom {
25 class Geometry;
26 namespace prep {
27 class PreparedPolygon;
28 }
29 }
30}
31
32namespace geos {
33namespace geom { // geos::geom
34namespace prep { // geos::geom::prep
35
36class PreparedPolygon;
37
38class PreparedPolygonDistance {
39public:
40
41 static double distance(const PreparedPolygon& prep, const geom::Geometry* geom)
42 {
43 PreparedPolygonDistance op(prep);
44 return op.distance(geom);
45 }
46
47 PreparedPolygonDistance(const PreparedPolygon& prep)
48 : prepPoly(prep)
49 { }
50
51 double distance(const geom::Geometry* g) const;
52
53protected:
54
55 const PreparedPolygon& prepPoly;
56
57 // Declare type as noncopyable
58 PreparedPolygonDistance(const PreparedPolygonDistance& other) = delete;
59 PreparedPolygonDistance& operator=(const PreparedPolygonDistance& rhs) = delete;
60};
61
62} // namespace geos::geom::prep
63} // namespace geos::geom
64} // namespace geos
65
Basic namespace for all GEOS functionalities.
Definition: geos.h:39