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