GEOS  3.13.0dev
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 #include <geos/geom/prep/PreparedPolygonPredicate.h>
23 
24 // Forward declarations
25 namespace geos {
26  namespace geom {
27  class Geometry;
28  namespace prep {
29  class PreparedPolygon;
30  }
31  }
32 }
33 
34 namespace geos {
35 namespace geom { // geos::geom
36 namespace prep { // geos::geom::prep
37 
38 class PreparedPolygon;
39 
40 class PreparedPolygonDistance : public PreparedPolygonPredicate {
41 public:
42 
43  static double distance(const PreparedPolygon& prep, const geom::Geometry* geom)
44  {
45  PreparedPolygonDistance op(prep);
46  return op.distance(geom);
47  }
48 
49  PreparedPolygonDistance(const PreparedPolygon& prep)
51  { }
52 
53  double distance(const geom::Geometry* g) const;
54 
55  bool isWithinDistance(const geom::Geometry* g, double d) const;
56 
57 protected:
58 
59  // Declare type as noncopyable
60  PreparedPolygonDistance(const PreparedPolygonDistance& other) = delete;
61  PreparedPolygonDistance& operator=(const PreparedPolygonDistance& rhs) = delete;
62 };
63 
64 } // namespace geos::geom::prep
65 } // namespace geos::geom
66 } // namespace geos
67 
PreparedPolygonPredicate(const PreparedPolygon *const p_prepPoly)
Creates an instance of this operation.
Definition: PreparedPolygonPredicate.h:128
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25