GEOS 3.15.0beta1
LineToCurveConverter.h
1/**********************************************************************
2*
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2025-2026 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/util/CurveBuilder.h>
19
20#include <memory>
21
22namespace geos::algorithm {
23 class LineToCurveParams;
24}
25
26namespace geos::geom {
27 class CircularArc;
29 class Curve;
30 class GeometryFactory;
31 class LineString;
32 class SimpleCurve;
33}
34
35namespace geos::algorithm {
36
37class GEOS_DLL LineToCurveConverter {
38
39public:
40
44 static std::unique_ptr<geom::Curve> getCurved(const geom::LineString& ls, const LineToCurveParams& params);
45
46private:
47
48 explicit LineToCurveConverter(const geom::GeometryFactory& factory, bool outputZ, bool outputM);
49
50 std::unique_ptr<geom::Curve> compute(const geom::LineString& ls, const LineToCurveParams& params);
51
52 void addArc(const geom::CircularArc& arc, std::size_t stop);
53
54 void addLineCoords(const geom::CoordinateSequence& points, std::size_t from, std::size_t to);
55
56 /*
57
58 void finishArc();
59
60 void finishLine();
61
62 std::shared_ptr<geom::CoordinateSequence> lineCoords;
63 std::shared_ptr<geom::CoordinateSequence> arcCoords;
64 std::vector<std::unique_ptr<geom::SimpleCurve>> curves;
65 const geom::GeometryFactory& factory;
66 */
67 geom::util::CurveBuilder curveBuilder;
68
70 LineToCurveConverter(const LineToCurveConverter& other);
71 LineToCurveConverter& operator=(const LineToCurveConverter& rhs);
72};
73
74}
Definition CircularArc.h:34
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:72
Definition LineString.h:66
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
Definition Angle.h:26