From ec0f29434e62c1f29ff48c0753ce62bde23be9c6 Mon Sep 17 00:00:00 2001 From: bdm-oslandia Date: Mon, 21 Jul 2025 15:45:33 +0200 Subject: [PATCH] fix JoinStyle3D --- python/PyQt6/core/auto_additions/qgis.py | 29 ++++---------------- python/PyQt6/core/auto_generated/qgis.sip.in | 4 +-- python/core/auto_additions/qgis.py | 29 ++++---------------- python/core/auto_generated/qgis.sip.in | 4 +-- src/core/geometry/qgssfcgalengine.cpp | 2 +- src/core/qgis.h | 12 ++++---- 6 files changed, 21 insertions(+), 59 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgis.py b/python/PyQt6/core/auto_additions/qgis.py index 04731534c4e..4bfe3fbc559 100644 --- a/python/PyQt6/core/auto_additions/qgis.py +++ b/python/PyQt6/core/auto_additions/qgis.py @@ -3893,36 +3893,17 @@ Qgis.JoinStyle.__doc__ = """Join styles for buffers. """ # -- Qgis.JoinStyle.baseClass = Qgis -QgsGeometry.JoinStyle3D = Qgis.JoinStyle3D # monkey patching scoped based enum -QgsGeometry.JoinStyle3DRound = Qgis.JoinStyle3D.Round -QgsGeometry.JoinStyle3D.JoinStyle3DRound = Qgis.JoinStyle3D.Round -QgsGeometry.JoinStyle3DRound.is_monkey_patched = True -QgsGeometry.JoinStyle3DRound.__doc__ = "Smooth, rounded buffer around the input geometry" -QgsGeometry.JoinStyle3DFlat = Qgis.JoinStyle3D.Flat -QgsGeometry.JoinStyle3D.JoinStyle3DFlat = Qgis.JoinStyle3D.Flat -QgsGeometry.JoinStyle3DFlat.is_monkey_patched = True -QgsGeometry.JoinStyle3DFlat.__doc__ = "Flat ends and constant width along the linestring" -QgsGeometry.JoinStyle3DCylSphere = Qgis.JoinStyle3D.CylSphere -QgsGeometry.JoinStyle3D.JoinStyle3DCylSphere = Qgis.JoinStyle3D.CylSphere -QgsGeometry.JoinStyle3DCylSphere.is_monkey_patched = True -QgsGeometry.JoinStyle3DCylSphere.__doc__ = "Cylinders along the linestring segments with spheres at the vertices" +Qgis.JoinStyle3D.Round.__doc__ = "Smooth, rounded buffer around the input geometry" +Qgis.JoinStyle3D.Flat.__doc__ = "Flat ends and constant width along the linestring" +Qgis.JoinStyle3D.CylindersAndSpheres.__doc__ = "Cylinders along the linestring segments with spheres at the vertices" Qgis.JoinStyle3D.__doc__ = """Join styles for 3D buffers. -.. versionadded:: 3.44 +.. versionadded:: 3.46 * ``Round``: Smooth, rounded buffer around the input geometry - - Available as ``QgsGeometry.JoinStyle3DRound`` in older QGIS releases. - * ``Flat``: Flat ends and constant width along the linestring - - Available as ``QgsGeometry.JoinStyle3DFlat`` in older QGIS releases. - -* ``CylSphere``: Cylinders along the linestring segments with spheres at the vertices - - Available as ``QgsGeometry.JoinStyle3DCylSphere`` in older QGIS releases. - +* ``CylindersAndSpheres``: Cylinders along the linestring segments with spheres at the vertices """ # -- diff --git a/python/PyQt6/core/auto_generated/qgis.sip.in b/python/PyQt6/core/auto_generated/qgis.sip.in index 4117337d455..a8e2767fe72 100644 --- a/python/PyQt6/core/auto_generated/qgis.sip.in +++ b/python/PyQt6/core/auto_generated/qgis.sip.in @@ -1234,10 +1234,10 @@ The development version }; enum class JoinStyle3D /BaseType=IntEnum/ - { + { Round, Flat, - CylSphere, + CylindersAndSpheres, }; enum class GeosCreationFlag /BaseType=IntFlag/ diff --git a/python/core/auto_additions/qgis.py b/python/core/auto_additions/qgis.py index a8aee3f5e2b..0c4d8357006 100644 --- a/python/core/auto_additions/qgis.py +++ b/python/core/auto_additions/qgis.py @@ -3854,36 +3854,17 @@ Qgis.JoinStyle.__doc__ = """Join styles for buffers. """ # -- Qgis.JoinStyle.baseClass = Qgis -QgsGeometry.JoinStyle3D = Qgis.JoinStyle3D # monkey patching scoped based enum -QgsGeometry.JoinStyle3DRound = Qgis.JoinStyle3D.Round -QgsGeometry.JoinStyle3D.JoinStyle3DRound = Qgis.JoinStyle3D.Round -QgsGeometry.JoinStyle3DRound.is_monkey_patched = True -QgsGeometry.JoinStyle3DRound.__doc__ = "Smooth, rounded buffer around the input geometry" -QgsGeometry.JoinStyle3DFlat = Qgis.JoinStyle3D.Flat -QgsGeometry.JoinStyle3D.JoinStyle3DFlat = Qgis.JoinStyle3D.Flat -QgsGeometry.JoinStyle3DFlat.is_monkey_patched = True -QgsGeometry.JoinStyle3DFlat.__doc__ = "Flat ends and constant width along the linestring" -QgsGeometry.JoinStyle3DCylSphere = Qgis.JoinStyle3D.CylSphere -QgsGeometry.JoinStyle3D.JoinStyle3DCylSphere = Qgis.JoinStyle3D.CylSphere -QgsGeometry.JoinStyle3DCylSphere.is_monkey_patched = True -QgsGeometry.JoinStyle3DCylSphere.__doc__ = "Cylinders along the linestring segments with spheres at the vertices" +Qgis.JoinStyle3D.Round.__doc__ = "Smooth, rounded buffer around the input geometry" +Qgis.JoinStyle3D.Flat.__doc__ = "Flat ends and constant width along the linestring" +Qgis.JoinStyle3D.CylindersAndSpheres.__doc__ = "Cylinders along the linestring segments with spheres at the vertices" Qgis.JoinStyle3D.__doc__ = """Join styles for 3D buffers. -.. versionadded:: 3.44 +.. versionadded:: 3.46 * ``Round``: Smooth, rounded buffer around the input geometry - - Available as ``QgsGeometry.JoinStyle3DRound`` in older QGIS releases. - * ``Flat``: Flat ends and constant width along the linestring - - Available as ``QgsGeometry.JoinStyle3DFlat`` in older QGIS releases. - -* ``CylSphere``: Cylinders along the linestring segments with spheres at the vertices - - Available as ``QgsGeometry.JoinStyle3DCylSphere`` in older QGIS releases. - +* ``CylindersAndSpheres``: Cylinders along the linestring segments with spheres at the vertices """ # -- diff --git a/python/core/auto_generated/qgis.sip.in b/python/core/auto_generated/qgis.sip.in index cc4f2b23fbd..20ccafcb065 100644 --- a/python/core/auto_generated/qgis.sip.in +++ b/python/core/auto_generated/qgis.sip.in @@ -1234,10 +1234,10 @@ The development version }; enum class JoinStyle3D - { + { Round, Flat, - CylSphere, + CylindersAndSpheres, }; enum class GeosCreationFlag diff --git a/src/core/geometry/qgssfcgalengine.cpp b/src/core/geometry/qgssfcgalengine.cpp index 6366d7668ed..7a34b030ee9 100644 --- a/src/core/geometry/qgssfcgalengine.cpp +++ b/src/core/geometry/qgssfcgalengine.cpp @@ -818,7 +818,7 @@ sfcgal::shared_geom QgsSfcgalEngine::buffer3D( const sfcgal::geometry *geom, dou case Qgis::JoinStyle3D::Round: buffer_type = sfcgal_buffer3d_type_t::SFCGAL_BUFFER3D_ROUND; break; - case Qgis::JoinStyle3D::CylSphere: + case Qgis::JoinStyle3D::CylindersAndSpheres: buffer_type = sfcgal_buffer3d_type_t::SFCGAL_BUFFER3D_CYLSPHERE; break; } diff --git a/src/core/qgis.h b/src/core/qgis.h index f3d59f3ebd3..a3429155476 100644 --- a/src/core/qgis.h +++ b/src/core/qgis.h @@ -2092,13 +2092,13 @@ class CORE_EXPORT Qgis /** * Join styles for 3D buffers. * - * \since QGIS 3.44 + * \since QGIS 3.46 */ - enum class JoinStyle3D SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsGeometry, JoinStyle3D ) : int - { - Round SIP_MONKEYPATCH_COMPAT_NAME( JoinStyle3DRound ) = 1, //!< Smooth, rounded buffer around the input geometry - Flat SIP_MONKEYPATCH_COMPAT_NAME( JoinStyle3DFlat ), //!< Flat ends and constant width along the linestring - CylSphere SIP_MONKEYPATCH_COMPAT_NAME( JoinStyle3DCylSphere ), //!< Cylinders along the linestring segments with spheres at the vertices + enum class JoinStyle3D : int + { + Round = 1, //!< Smooth, rounded buffer around the input geometry + Flat, //!< Flat ends and constant width along the linestring + CylindersAndSpheres, //!< Cylinders along the linestring segments with spheres at the vertices }; Q_ENUM( JoinStyle3D )