GEOS 3.15.0dev
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 {
20namespace geom {
21
22class SimpleCurve;
23
24class GEOS_DLL Curve : public Geometry {
25
26public:
27 using Geometry::apply_ro;
28 using Geometry::apply_rw;
29
30 void apply_ro(GeometryComponentFilter* filter) const override;
31
32 void apply_ro(GeometryFilter* filter) const override;
33
34 void apply_rw(GeometryComponentFilter* filter) override;
35
36 void apply_rw(GeometryFilter* filter) override;
37
43 int
44 getBoundaryDimension() const override
45 {
46 return isClosed() ? Dimension::False : 0;
47 }
48
50 Dimension::DimensionType getDimension() const override
51 {
52 return Dimension::L; // line
53 }
54
58 virtual std::unique_ptr<Point> getEndPoint() const = 0;
59
63 virtual std::unique_ptr<Point> getPointN(std::size_t n) const = 0;
64
68 virtual std::unique_ptr<Point> getStartPoint() const = 0;
69
71 virtual bool isClosed() const = 0;
72
74 bool isRing() const;
75
76 virtual std::size_t getNumCurves() const = 0;
77
78 virtual const SimpleCurve* getCurveN(std::size_t) const = 0;
79
80 std::unique_ptr<Curve> reverse() const;
81
82protected:
83 Curve(const GeometryFactory& factory) : Geometry(&factory) {}
84
85};
86
87}
88}
Basic namespace for all GEOS functionalities.
Definition geos.h:38