GEOS 3.15.0beta1
Curve.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2024 ISciences, LLC
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#pragma once
16
17#include <geos/geom/Geometry.h>
18
19namespace geos::geom {
20 class LineString;
21}
22
23namespace geos {
24namespace geom {
25
26class SimpleCurve;
27
28class GEOS_DLL Curve : public Geometry {
29
30public:
31 using Geometry::apply_ro;
32 using Geometry::apply_rw;
33
34 void apply_ro(GeometryComponentFilter* filter) const override;
35
36 void apply_ro(GeometryFilter* filter) const override;
37
38 void apply_rw(GeometryComponentFilter* filter) override;
39
40 void apply_rw(GeometryFilter* filter) override;
41
47 int
48 getBoundaryDimension() const override
49 {
50 return isClosed() ? Dimension::False : 0;
51 }
52
54 Dimension::DimensionType getDimension() const override
55 {
56 return Dimension::L; // line
57 }
58
59 virtual const CoordinateXY& getEndCoordinate() const = 0;
60
64 virtual std::unique_ptr<Point> getEndPoint() const = 0;
65
69 virtual std::unique_ptr<Point> getPointN(std::size_t n) const = 0;
70
71 virtual const CoordinateXY& getStartCoordinate() const = 0;
72
76 virtual std::unique_ptr<Point> getStartPoint() const = 0;
77
78 std::unique_ptr<LineString> getLinearized(const algorithm::CurveToLineParams&) const;
79
80 std::unique_ptr<Curve> getCurved(const algorithm::LineToCurveParams&) const;
81
83 virtual bool isClosed() const = 0;
84
86 bool isRing() const;
87
88 virtual std::size_t getNumCurves() const = 0;
89
90 virtual const SimpleCurve* getCurveN(std::size_t) const = 0;
91
92 std::unique_ptr<Curve> clone() const;
93
94 std::unique_ptr<Curve> reverse() const;
95
96protected:
97 Curve(const GeometryFactory& factory) : Geometry(&factory) {}
98
99 Curve* getCurvedImpl(const algorithm::LineToCurveParams&) const override = 0;
100};
101
102}
103}
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:201
Definition LineString.h:66
Definition Angle.h:26
Basic namespace for all GEOS functionalities.
Definition geos.h:38