GEOS 3.15.0dev
CircularString.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/CircularArc.h>
18#include <geos/geom/SimpleCurve.h>
19
20namespace geos {
21namespace geom {
22
23class GEOS_DLL CircularString : public SimpleCurve {
24
25public:
26 using SimpleCurve::SimpleCurve;
27
28 friend class GeometryFactory;
29
30 ~CircularString() override;
31
32 std::unique_ptr<CircularString> clone() const;
33
34 const std::vector<CircularArc>& getArcs() const;
35
36 std::string getGeometryType() const override;
37
38 GeometryTypeId getGeometryTypeId() const override;
39
40 double getLength() const override;
41
42 bool hasCurvedComponents() const override
43 {
44 return true;
45 }
46
47 bool isCurved() const override {
48 return true;
49 }
50
51 std::unique_ptr<CircularString> reverse() const
52 {
53 return std::unique_ptr<CircularString>(reverseImpl());
54 }
55
56protected:
57
61 CircularString(std::unique_ptr<CoordinateSequence>&& pts,
62 const GeometryFactory& newFactory);
63
64 CircularString(const std::shared_ptr<const CoordinateSequence>& pts,
65 const GeometryFactory& newFactory);
66
67 CircularString* cloneImpl() const override
68 {
69 return new CircularString(*this);
70 }
71
72 void geometryChangedAction() override
73 {
74 envelope = computeEnvelopeInternal(false);
75 }
76
77 int
78 getSortIndex() const override
79 {
80 return SORTINDEX_LINESTRING;
81 };
82
83 CircularString* reverseImpl() const override;
84
85 void validateConstruction();
86
87private:
88 void createArcs() const;
89
90 mutable std::vector<CircularArc> arcs;
91
92};
93
94
95}
96}
GeometryTypeId
Geometry types.
Definition Geometry.h:73
Basic namespace for all GEOS functionalities.
Definition geos.h:38