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