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 void normalize() override;
52
53 std::unique_ptr<CircularString> reverse() const
54 {
55 return std::unique_ptr<CircularString>(reverseImpl());
56 }
57
58protected:
59
63 CircularString(std::unique_ptr<CoordinateSequence>&& pts,
64 const GeometryFactory& newFactory);
65
66 CircularString(const std::shared_ptr<const CoordinateSequence>& pts,
67 const GeometryFactory& newFactory);
68
69 CircularString* cloneImpl() const override
70 {
71 return new CircularString(*this);
72 }
73
74 void geometryChangedAction() override
75 {
76 envelope = computeEnvelopeInternal(false);
77 }
78
79 int
80 getSortIndex() const override
81 {
82 return SORTINDEX_CIRCULARSTRING;
83 };
84
85 CircularString* reverseImpl() const override;
86
87 void validateConstruction();
88
89private:
90 void createArcs() const;
91
92 void normalizeClosed();
93
94 mutable std::vector<CircularArc> arcs;
95
96};
97
98
99}
100}
GeometryTypeId
Geometry types.
Definition Geometry.h:73
Basic namespace for all GEOS functionalities.
Definition geos.h:38