GEOS  3.13.1
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 
20 namespace geos {
21 namespace geom {
22 
23 class GEOS_DLL MultiCurve : public GeometryCollection {
24  friend class GeometryFactory;
25 
26 public:
27  ~MultiCurve() override = default;
28 
29  std::unique_ptr<MultiCurve> clone() const
30  {
31  return std::unique_ptr<MultiCurve>(cloneImpl());
32  };
33 
35  std::unique_ptr<Geometry> getBoundary() const override;
36 
42  int getBoundaryDimension() const override;
43 
45  Dimension::DimensionType getDimension() const override;
46 
47  const Curve* getGeometryN(std::size_t n) const override;
48 
49  std::string getGeometryType() const override;
50 
51  GeometryTypeId getGeometryTypeId() const override;
52 
53  bool hasDimension(Dimension::DimensionType d) const override
54  {
55  return d == Dimension::L;
56  }
57 
60  bool isClosed() const;
61 
62  bool isDimensionStrict(Dimension::DimensionType d) const override
63  {
64  return d == Dimension::L;
65  }
66 
76  std::unique_ptr<MultiCurve> reverse() const
77  {
78  return std::unique_ptr<MultiCurve>(reverseImpl());
79  }
80 
81 protected:
82 
100  MultiCurve(std::vector<std::unique_ptr<Curve>>&& newLines,
101  const GeometryFactory& newFactory);
102 
103  MultiCurve(std::vector<std::unique_ptr<Geometry>>&& newLines,
104  const GeometryFactory& newFactory);
105 
106  MultiCurve(const MultiCurve& mp)
107  : GeometryCollection(mp)
108  {}
109 
110  MultiCurve* cloneImpl() const override
111  {
112  return new MultiCurve(*this);
113  }
114 
115  MultiCurve* reverseImpl() const override;
116 
117  int
118  getSortIndex() const override
119  {
120  return SORTINDEX_MULTICURVE;
121  };
122 
123 };
124 
125 }
126 }
DimensionType
Definition: Dimension.h:29
@ L
Dimension value of a curve (1).
Definition: Dimension.h:43
GeometryTypeId
Geometry types.
Definition: Geometry.h:74
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25