GEOS 3.15.0dev
SimpleCurve.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005 2006 Refractions Research Inc.
8 * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
9 * Copyright (C) 2024 ISciences, LLC
10 *
11 * This is free software; you can redistribute and/or modify it under
12 * the terms of the GNU Lesser General Public Licence as published
13 * by the Free Software Foundation.
14 * See the COPYING file for more information.
15 *
16 **********************************************************************/
17
18#pragma once
19
20#include <geos/geom/Curve.h>
21#include <geos/geom/Geometry.h>
22
23namespace geos {
24namespace geom {
25
26class GEOS_DLL SimpleCurve : public Curve {
27public:
28
29 using Curve::apply_ro;
30 using Curve::apply_rw;
31
32 void apply_ro(CoordinateFilter* filter) const override;
33
34 void apply_ro(CoordinateSequenceFilter& filter) const override;
35
36 void apply_rw(CoordinateSequenceFilter& filter) override;
37
38 void apply_rw(const CoordinateFilter* filter) override;
39
40 bool equalsExact(const Geometry* other, double tolerance = 0)
41 const override;
42
43 bool equalsIdentical(const Geometry* other) const override;
44
50 std::unique_ptr<Geometry> getBoundary() const override;
51
52 const CoordinateXY* getCoordinate() const override;
53
55 uint8_t getCoordinateDimension() const override;
56
57 virtual const Coordinate& getCoordinateN(std::size_t n) const;
58
59 std::unique_ptr<CoordinateSequence> getCoordinates() const override;
60
62 const CoordinateSequence* getCoordinatesRO() const;
63
65 const std::shared_ptr<const CoordinateSequence>& getSharedCoordinates() const;
66
67 const SimpleCurve* getCurveN(std::size_t) const override;
68
73 std::unique_ptr<Point> getEndPoint() const override;
74
75 const Envelope* getEnvelopeInternal() const override
76 {
77 return &envelope;
78 }
79
80 std::size_t getNumCurves() const override;
81
82 std::size_t getNumPoints() const override;
83
84 std::unique_ptr<Point> getPointN(std::size_t n) const override;
85
90 std::unique_ptr<Point> getStartPoint() const override;
91
92 bool hasM() const override;
93
94 bool hasZ() const override;
95
96 bool isClosed() const override;
97
98 virtual bool isCoordinate(CoordinateXY& pt) const;
99
100 virtual bool isCurved() const = 0;
101
102 bool isEmpty() const override;
103
104 std::unique_ptr<SimpleCurve> reverse() const;
105
106protected:
107
108 SimpleCurve(const SimpleCurve& other);
109
110 SimpleCurve(const std::shared_ptr<const CoordinateSequence>& newCoords,
111 bool isLinear,
112 const GeometryFactory& factory);
113
114 SimpleCurve(std::unique_ptr<CoordinateSequence>&& newCoords,
115 bool isLinear,
116 const GeometryFactory& factory);
117
118 int compareToSameClass(const Geometry* ls) const override;
119
120 Envelope computeEnvelopeInternal(bool isLinear) const;
121
122 std::shared_ptr<const CoordinateSequence> points;
123 mutable Envelope envelope;
124};
125
126}
127}
Basic namespace for all GEOS functionalities.
Definition geos.h:38