GEOS 3.15.0dev
ArcString.h
1/**********************************************************************
2*
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2025 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/export.h>
18#include <geos/geom/CircularArc.h>
19#include <geos/noding/PathString.h>
20
21#include <vector>
22
23namespace geos::noding {
24
30class GEOS_DLL ArcString : public PathString {
31public:
32 explicit ArcString(std::vector<geom::CircularArc> arcs) : m_arcs(std::move(arcs)) {
33 }
34
35 ArcString(std::vector<geom::CircularArc> arcs, const std::shared_ptr<const geom::CoordinateSequence>& seq, void* context)
36 : m_arcs(std::move(arcs)),
37 m_seq(seq),
38 m_context(context)
39 {}
40
41 std::size_t getSize() const override {
42 return m_arcs.size();
43 }
44
45 double getLength() const override {
46 double tot = 0;
47 for (const auto &arc: m_arcs) {
48 tot += arc.getLength();
49 }
50 return tot;
51 }
52
53 const geom::CircularArc &getArc(std::size_t i) const {
54 return m_arcs[i];
55 }
56
57 auto begin() const {
58 return m_arcs.begin();
59 }
60
61 auto end() const {
62 return m_arcs.end();
63 }
64
65 const std::shared_ptr<const geom::CoordinateSequence>& getCoordinates() const override;
66
67protected:
68 std::vector<geom::CircularArc> m_arcs;
69 std::shared_ptr<const geom::CoordinateSequence> m_seq;
70 void* m_context;
71};
72
73}
Definition CircularArc.h:29
An interface for classes which represent a sequence of contiguous circular arcs, analogous to the Seg...
Definition ArcString.h:30
const std::shared_ptr< const geom::CoordinateSequence > & getCoordinates() const override
Return a pointer to the CoordinateSequence associated with this PathString.
Definition PathString.h:31
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42