GEOS 3.14.0dev
PreparedLineStringDistance.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
22namespace geos {
23namespace geom { // geos::geom
24
25class Geometry;
26
27namespace prep { // geos::geom::prep
28
29class PreparedLineString;
30
31class PreparedLineStringDistance {
32public:
33
34 static double distance(const PreparedLineString& prep, const geom::Geometry* geom)
35 {
36 PreparedLineStringDistance op(prep);
37 return op.distance(geom);
38 }
39
40 PreparedLineStringDistance(const PreparedLineString& prep)
41 : prepLine(prep)
42 { }
43
44 double distance(const geom::Geometry* g) const;
45
46 bool isWithinDistance(const geom::Geometry* g, double d) const;
47
48protected:
49
50 const PreparedLineString& prepLine;
51
52 // Declare type as noncopyable
53 PreparedLineStringDistance(const PreparedLineStringDistance& other) = delete;
54 PreparedLineStringDistance& operator=(const PreparedLineStringDistance& rhs) = delete;
55};
56
57} // namespace geos::geom::prep
58} // namespace geos::geom
59} // namespace geos
60
Basic namespace for all GEOS functionalities.
Definition geos.h:39