GEOS 3.15.0beta1
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 hasDimension(Dimension::DimensionType d) const override
59 {
60 return d == Dimension::L;
61 }
62
65 bool isClosed() const;
66
67 bool isDimensionStrict(Dimension::DimensionType d) const override
68 {
69 return d == Dimension::L;
70 }
71
81 std::unique_ptr<MultiCurve> reverse() const
82 {
83 return std::unique_ptr<MultiCurve>(reverseImpl());
84 }
85
86protected:
87
105 MultiCurve(std::vector<std::unique_ptr<Curve>>&& newLines,
106 const GeometryFactory& newFactory);
107
108 MultiCurve(std::vector<std::unique_ptr<Geometry>>&& newLines,
109 const GeometryFactory& newFactory);
110
111 MultiCurve(const MultiCurve& mp)
112 : GeometryCollection(mp)
113 {}
114
115 MultiCurve* cloneImpl() const override
116 {
117 return new MultiCurve(*this);
118 }
119
120 MultiCurve* reverseImpl() const override;
121
122 MultiCurve* getCurvedImpl(const algorithm::LineToCurveParams&) const override { return cloneImpl(); }
123
124 MultiLineString* getLinearizedImpl(const algorithm::CurveToLineParams&) const override;
125
126 int
127 getSortIndex() const override
128 {
129 return SORTINDEX_MULTICURVE;
130 };
131
132};
133
134}
135}
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:51
Definition Angle.h:26
GeometryTypeId
Geometry types.
Definition Geometry.h:78
Basic namespace for all GEOS functionalities.
Definition geos.h:38