GEOS 3.15.0beta3
MultiCurve.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/Curve.h>
18#include <geos/geom/GeometryCollection.h>
19#include <geos/geom/MultiLineString.h>
20
21namespace geos {
22namespace geom {
23
24class GEOS_DLL MultiCurve : public GeometryCollection {
25 friend class GeometryFactory;
26
27public:
28 ~MultiCurve() override = default;
29
30 std::unique_ptr<MultiCurve> clone() const
31 {
32 return std::unique_ptr<MultiCurve>(cloneImpl());
33 };
34
36 std::unique_ptr<Geometry> getBoundary() const override;
37
43 int getBoundaryDimension() const override;
44
46 Dimension::DimensionType getDimension() const override;
47
48 const Curve* getGeometryN(std::size_t n) const override;
49
50 std::string getGeometryType() const override;
51
52 GeometryTypeId getGeometryTypeId() const override;
53
54 std::unique_ptr<MultiLineString> getLinearized(const algorithm::CurveToLineParams& params) const {
55 return std::unique_ptr<MultiLineString>(getLinearizedImpl(params));
56 }
57
58 bool hasCurvedTypes() const override {
59 return true;
60 }
61
62 bool hasDimension(Dimension::DimensionType d) const override
63 {
64 return d == Dimension::L;
65 }
66
69 bool isClosed() const;
70
71 bool isDimensionStrict(Dimension::DimensionType d) const override
72 {
73 return d == Dimension::L;
74 }
75
85 std::unique_ptr<MultiCurve> reverse() const
86 {
87 return std::unique_ptr<MultiCurve>(reverseImpl());
88 }
89
90protected:
91
109 MultiCurve(std::vector<std::unique_ptr<Curve>>&& newLines,
110 const GeometryFactory& newFactory);
111
112 MultiCurve(std::vector<std::unique_ptr<Geometry>>&& newLines,
113 const GeometryFactory& newFactory);
114
115 MultiCurve(const MultiCurve& mp)
116 : GeometryCollection(mp)
117 {}
118
119 MultiCurve* cloneImpl() const override
120 {
121 return new MultiCurve(*this);
122 }
123
124 MultiCurve* reverseImpl() const override;
125
126 MultiCurve* getCurvedImpl(const algorithm::LineToCurveParams&) const override { return cloneImpl(); }
127
128 MultiLineString* getLinearizedImpl(const algorithm::CurveToLineParams&) const override;
129
130 int
131 getSortIndex() const override
132 {
133 return SORTINDEX_MULTICURVE;
134 };
135
136};
137
138}
139}
GeometryTypeId
Geometry types.
Definition Geometry.h:78
Basic namespace for all GEOS functionalities.
Definition geos.h:38