Coverage Report

Created: 2026-09-01 06:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/geos/include/geos/geom/CircularString.h
Line
Count
Source
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/LineString.h>
19
#include <geos/geom/SimpleCurve.h>
20
21
namespace geos {
22
namespace geom {
23
24
class GEOS_DLL CircularString : public SimpleCurve {
25
26
public:
27
    using SimpleCurve::SimpleCurve;
28
29
    friend class GeometryFactory;
30
31
    ~CircularString() override;
32
33
    std::unique_ptr<CircularString> clone() const;
34
35
    const std::vector<CircularArc>& getArcs() const;
36
37
    std::string getGeometryType() const override;
38
39
    GeometryTypeId getGeometryTypeId() const override;
40
41
    double getLength() const override;
42
43
    bool hasCurvedComponents() const override
44
263k
    {
45
263k
        return true;
46
263k
    }
47
48
    bool hasCurvedTypes() const override
49
87.1k
    {
50
87.1k
        return true;
51
87.1k
    }
52
53
2.75k
    bool isCurved() const override {
54
2.75k
        return true;
55
2.75k
    }
56
57
    void normalize() override;
58
59
    std::unique_ptr<CircularString> reverse() const
60
0
    {
61
0
        return std::unique_ptr<CircularString>(reverseImpl());
62
0
    }
63
64
    std::unique_ptr<Curve> getCurved(const algorithm::LineToCurveParams&) const;
65
66
protected:
67
68
    /// \brief
69
    /// Constructs a CircularString taking ownership the
70
    /// given CoordinateSequence.
71
    CircularString(std::unique_ptr<CoordinateSequence>&& pts,
72
                   const GeometryFactory& newFactory);
73
74
    CircularString(const std::shared_ptr<const CoordinateSequence>& pts,
75
                   const GeometryFactory& newFactory);
76
77
    CircularString* cloneImpl() const override
78
45.8k
    {
79
45.8k
        return new CircularString(*this);
80
45.8k
    }
81
82
    void geometryChangedAction() override
83
0
    {
84
0
        envelope = computeEnvelopeInternal(false);
85
0
    }
86
87
0
    CircularString* getCurvedImpl(const algorithm::LineToCurveParams&) const override {
88
0
        return cloneImpl();
89
0
    }
90
91
    LineString* getLinearizedImpl(const algorithm::CurveToLineParams&) const override;
92
93
    int
94
    getSortIndex() const override
95
0
    {
96
0
        return SORTINDEX_CIRCULARSTRING;
97
0
    };
98
99
    CircularString* reverseImpl() const override;
100
101
    void validateConstruction();
102
103
private:
104
    void createArcs() const;
105
106
    void normalizeClosed();
107
108
    mutable std::vector<CircularArc> arcs;
109
110
};
111
112
113
}
114
}