Coverage Report

Created: 2024-07-03 06:16

/src/geos/include/geos/geom/Curve.h
Line
Count
Source (jump to first uncovered line)
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/Geometry.h>
18
19
namespace geos {
20
namespace geom {
21
22
class GEOS_DLL Curve : public Geometry {
23
24
public:
25
    using Geometry::apply_ro;
26
    using Geometry::apply_rw;
27
28
    void apply_ro(GeometryComponentFilter* filter) const override;
29
30
    void apply_ro(GeometryFilter* filter) const override;
31
32
    void apply_rw(GeometryComponentFilter* filter) override;
33
34
    void apply_rw(GeometryFilter* filter) override;
35
36
    /**
37
     * \brief
38
     * Returns Dimension::False for a closed Curve,
39
     * 0 otherwise (Curve boundary is a MultiPoint)
40
     */
41
    int
42
    getBoundaryDimension() const override
43
0
    {
44
0
        return isClosed() ? Dimension::False : 0;
45
0
    }
46
47
    /// Returns line dimension (1)
48
    Dimension::DimensionType getDimension() const override
49
1.15M
    {
50
1.15M
        return Dimension::L; // line
51
1.15M
    }
52
53
    /// Returns true if the first and last coordinate in the Curve are the same
54
    virtual bool isClosed() const = 0;
55
56
    /// Returns true if the curve is closed and simple
57
    bool isRing() const;
58
59
protected:
60
2.48M
    Curve(const GeometryFactory& factory) : Geometry(&factory) {}
61
62
};
63
64
}
65
}