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 Qgis.JoinStyle.baseClass = Qgis
QgsGeometry.JoinStyle3D = Qgis.JoinStyle3D
# monkey patching scoped based enum # monkey patching scoped based enum
QgsGeometry.JoinStyle3DRound = Qgis.JoinStyle3D.Round Qgis.JoinStyle3D.Round.__doc__ = "Smooth, rounded buffer around the input geometry"
QgsGeometry.JoinStyle3D.JoinStyle3DRound = Qgis.JoinStyle3D.Round Qgis.JoinStyle3D.Flat.__doc__ = "Flat ends and constant width along the linestring"
QgsGeometry.JoinStyle3DRound.is_monkey_patched = True Qgis.JoinStyle3D.CylindersAndSpheres.__doc__ = "Cylinders along the linestring segments with spheres at the vertices"
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.__doc__ = """Join styles for 3D buffers. Qgis.JoinStyle3D.__doc__ = """Join styles for 3D buffers.
.. versionadded:: 3.44 .. versionadded:: 3.46
* ``Round``: Smooth, rounded buffer around the input geometry * ``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 * ``Flat``: Flat ends and constant width along the linestring
* ``CylindersAndSpheres``: Cylinders along the linestring segments with spheres at the vertices
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.
""" """
# -- # --

View File

@ -1234,10 +1234,10 @@ The development version
}; };
enum class JoinStyle3D /BaseType=IntEnum/ enum class JoinStyle3D /BaseType=IntEnum/
{ {
Round, Round,
Flat, Flat,
CylSphere, CylindersAndSpheres,
}; };
enum class GeosCreationFlag /BaseType=IntFlag/ enum class GeosCreationFlag /BaseType=IntFlag/

View File

@ -3854,36 +3854,17 @@ Qgis.JoinStyle.__doc__ = """Join styles for buffers.
""" """
# -- # --
Qgis.JoinStyle.baseClass = Qgis Qgis.JoinStyle.baseClass = Qgis
QgsGeometry.JoinStyle3D = Qgis.JoinStyle3D
# monkey patching scoped based enum # monkey patching scoped based enum
QgsGeometry.JoinStyle3DRound = Qgis.JoinStyle3D.Round Qgis.JoinStyle3D.Round.__doc__ = "Smooth, rounded buffer around the input geometry"
QgsGeometry.JoinStyle3D.JoinStyle3DRound = Qgis.JoinStyle3D.Round Qgis.JoinStyle3D.Flat.__doc__ = "Flat ends and constant width along the linestring"
QgsGeometry.JoinStyle3DRound.is_monkey_patched = True Qgis.JoinStyle3D.CylindersAndSpheres.__doc__ = "Cylinders along the linestring segments with spheres at the vertices"
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.__doc__ = """Join styles for 3D buffers. Qgis.JoinStyle3D.__doc__ = """Join styles for 3D buffers.
.. versionadded:: 3.44 .. versionadded:: 3.46
* ``Round``: Smooth, rounded buffer around the input geometry * ``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 * ``Flat``: Flat ends and constant width along the linestring
* ``CylindersAndSpheres``: Cylinders along the linestring segments with spheres at the vertices
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.
""" """
# -- # --

View File

@ -1234,10 +1234,10 @@ The development version
}; };
enum class JoinStyle3D enum class JoinStyle3D
{ {
Round, Round,
Flat, Flat,
CylSphere, CylindersAndSpheres,
}; };
enum class GeosCreationFlag enum class GeosCreationFlag

View File

@ -818,7 +818,7 @@ sfcgal::shared_geom QgsSfcgalEngine::buffer3D( const sfcgal::geometry *geom, dou
case Qgis::JoinStyle3D::Round: case Qgis::JoinStyle3D::Round:
buffer_type = sfcgal_buffer3d_type_t::SFCGAL_BUFFER3D_ROUND; buffer_type = sfcgal_buffer3d_type_t::SFCGAL_BUFFER3D_ROUND;
break; break;
case Qgis::JoinStyle3D::CylSphere: case Qgis::JoinStyle3D::CylindersAndSpheres:
buffer_type = sfcgal_buffer3d_type_t::SFCGAL_BUFFER3D_CYLSPHERE; buffer_type = sfcgal_buffer3d_type_t::SFCGAL_BUFFER3D_CYLSPHERE;
break; break;
} }

View File

@ -2092,13 +2092,13 @@ class CORE_EXPORT Qgis
/** /**
* Join styles for 3D buffers. * 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 Round = 1, //!< Smooth, rounded buffer around the input geometry
Flat SIP_MONKEYPATCH_COMPAT_NAME( JoinStyle3DFlat ), //!< Flat ends and constant width along the linestring Flat, //!< Flat ends and constant width along the linestring
CylSphere SIP_MONKEYPATCH_COMPAT_NAME( JoinStyle3DCylSphere ), //!< Cylinders along the linestring segments with spheres at the vertices CylindersAndSpheres, //!< Cylinders along the linestring segments with spheres at the vertices
}; };
Q_ENUM( JoinStyle3D ) Q_ENUM( JoinStyle3D )