fix JoinStyle3D

This commit is contained in:
bdm-oslandia 2025-07-21 15:45:33 +02:00 committed by Nyall Dawson
parent 65ba76b0e7
commit ec0f29434e
6 changed files with 21 additions and 59 deletions

View File

@ -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
"""
# --

View File

@ -1237,7 +1237,7 @@ The development version
{
Round,
Flat,
CylSphere,
CylindersAndSpheres,
};
enum class GeosCreationFlag /BaseType=IntFlag/

View File

@ -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
"""
# --

View File

@ -1237,7 +1237,7 @@ The development version
{
Round,
Flat,
CylSphere,
CylindersAndSpheres,
};
enum class GeosCreationFlag

View File

@ -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;
}

View File

@ -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
enum class 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
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 )