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