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