64 Commits

Author SHA1 Message Date
qgis-bot
94411b5fcd auto sipify 🍺 2024-10-17 08:34:52 +00:00
Jean Felder
e38ac6c7b9 qgs3dmapscene: Add support to setup clipping
This adds two functions to setup clip planes on a 3d scene:
- enableClipping() to enable opengl clipping
- disableClipping() to disable opengl clipping

The `enableClipping()` function achieves 3 things:
- it stores the clipping plane equations
- it adds clip planes to the framegraph
- it enables the clipping on the material of the existing entities

`disableClipping()` does the opposite things.

The clip planes equations need to be stored to handle the dynamic
addition of new entities. Indeed, when a new entity is added, clipping
needs to be enabled on its material if necessary. This is achieved
in `finalizeNewEntity` which is called on all new entities.
However, this is not true for the terrain entity. That's why,
`mTerrain` now listens to the `newEntityCreated` signal to call
`handleClippingOnEntity()`.
2024-10-17 10:31:40 +02:00
qgis-bot
8f4da32b6b auto sipify 🍺 2024-10-02 22:13:35 +00:00
Martin Dobias
b02813e657 Add API to temporarily disable updates in 3D map scene
This is useful for debugging 3D views, to pause scene updates and
inspect some parts of the scene in detail.
2024-10-03 08:09:04 +10:00
qgis-bot
774399c3ea auto sipify 🍺 2024-09-12 07:21:24 +00:00
Alessandro Pasotti
987c38eda6
[auth][api] QgsAuthConfigurationStorage classes and tests (#57992)
Implementation of QEP 
Authentication System: allow Database storage for authentication DB
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/248
2024-09-12 09:18:15 +02:00
Nyall Dawson
f21722a0f1 [sipify] Minor cleanup to auto additions
Condense injections into a single block instead of multiple
separate blocks
2024-09-09 16:56:29 +10:00
Nyall Dawson
cfd251e7f7 Capture signal arguments 2024-09-08 16:06:22 +10:00
qgis-bot
d46973d9c1 auto sipify 🍺 2024-09-03 20:35:11 +00:00
Nyall Dawson
534ca73c59 Fix missing see also trailing notes in PyQGIS documentation 2024-09-04 06:32:03 +10:00
Nyall Dawson
0f1daa11f3 Fix formatting of some \see links 2024-09-04 06:32:03 +10:00
Julien Cabieces
94863b435e
Merge pull request #58534 from nyalldawson/fix_3d_import
Fix PyQGIS 3D module patching
2024-09-02 11:21:11 +02:00
Nyall Dawson
ef0289f3ec Fix formatting of Python ..deprecated annotations in docstrings
Fixes https://github.com/qgis/pyqgis-api-docs-builder/issues/174
2024-09-02 11:42:12 +10:00
Nyall Dawson
765cbb32db Standardise some deprecated annotations 2024-09-02 11:42:12 +10:00
Nyall Dawson
2af54ad057 Fix malformed python docstrings when enum value has \since annotation 2024-09-01 02:29:17 +10:00
Nyall Dawson
da317dd8de
Fix PyQGIS 3D module patching
The module patching for _3d was not working at all, because
the same logic which works for other modules with a private _module
copy clashed with the approach of exposing the public 3d module
as qgis._3d

Work around this by renaming the private internal module as _3d_p,
so that the monkey patching logic from sip is correctly run
when the module is loaded.

Fixes broken API in 3d module for renamed enums, and fixes the
broken PyQGIS doc for the 3d module
2024-08-30 11:57:42 +10:00
qgis-bot
9a3809de82 auto sipify 🍺 2024-08-28 02:41:19 +00:00
Nyall Dawson
e161d0bd60 Enforce thread safety for Qgs3DMapSettings 2024-08-28 12:38:16 +10:00
Nyall Dawson
9391a62664 Refactor so Qgs3DMapSettings is a member of Qgs3DSceneEntity 2024-08-28 12:38:16 +10:00
Nyall Dawson
1f94f9bc4e Rework to use Qgs3DRenderContext instead 2024-08-28 12:38:16 +10:00
Nyall Dawson
5e33ee4a57 Add some thread safety to Qgs3DMapSettings usage
Create a small, cheap to copy (non-qobject) class
Qgs3DMapSettingsSnapshot which is designed to store
just cheap properties of Qgs3DMapSettings. Then use this
object wherever possible to avoid accessing the (non-thread
safe) Qgs3DMapSettings object for retrieval of simple
map properties (eg crs, extent, ...)

Refs https://github.com/qgis/QGIS-Enhancement-Proposals/issues/301
2024-08-28 12:38:16 +10:00
qgis-bot
a37fec4fc9 auto sipify 🍺 2024-08-28 02:01:25 +00:00
Nyall Dawson
bc52832b47 Lazily hack around markdown title underline not being long enough
Causes a bunch of warnings when building the PyQGIS docs
2024-08-28 11:58:21 +10:00
Nyall Dawson
6a936472d4 Remove incorrect 'not available in python' note 2024-08-28 11:58:21 +10:00
Jean Felder
8dab246707
[3D] Use QGIS material for the terrain (#58134)
* terrain: Use PhongMaterialSettings material for the non texture case

There is no functional change. With this change, the terrain uses a
material defined by QGIS instead of a default Qt3D. This will make it
easier to customize the shader in the future.

* qgsphongmaterialsettings: Fix setShininess signature

`mShininess` is a double.

* qgsphongtexturedmaterialsettings: Use a double to store shininess

This is already waht QgsPhongTexturedMaterialSettings does. The reason
for this change is to avoid the user-set values changing for them when
saving/restoring projects.

* qgsphongtexturedmaterialsettings: Use a double to store opacity

This is already waht QgsPhongTexturedMaterialSettings does. The reason
for this change is to avoid the user-set values changing for them when
saving/restoring projects.

* qgsphongtexturedmaterialsettings: Do proper opacity cast in toMaterial

* qgsphongtexturedmaterialsettings: Factor out material creation

This introduces a new class `QgsPhongTexturedMaterial` which is
similar to Qt3D `QDiffuseSpecularMaterial`.
`QgsPhongTexturedMaterial::toMaterial()` now calls
`QgsPhongTexturedMaterial` to create the material. This has no
functional change.

This will make it possible to directly use `QgsPhongTexturedMaterial`
for the terrain in the next commit. Indeed, the texture case needs to
use a `QTexture2D` which cannot be stored in a settings class. This
issue is avoided by directly creating the material instead of using
`QgsPhongTexturedMaterial::toMaterial()`.

* qgsterraintileloader: Fix typo

* terrain: Use QgsPhongTexturedMaterial for shading texture

There is no functional change. With this change, the terrain uses a
material defined by QGIS instead of a default Qt3D. This will make it
easier to customize the shader in the future.

* 3d/material: Introduce QgsTextureMaterial

This is the same material as the qt3d one:
`Qt3DExtras::QTextureMaterial`. It will also be used in the following
commit by the terrain.

* terrain: Use QgsTextureMaterial for non shading texture

There is no functional change. With this change, the terrain uses a
material defined by QGIS instead of a default Qt3D. This will make it
easier to customize the shader in the future.
2024-08-19 23:01:06 +02:00
qgis-bot
6222445858 auto sipify 🍺 2024-08-19 09:19:05 +00:00
Nyall Dawson
bc331f6a98 Add documentation for QgsPoint3DSymbol properties
Fixes https://github.com/qgis/pyqgis-api-docs-builder/issues/140
2024-08-19 11:16:01 +02:00
Nyall Dawson
3f481b568e Record header subfolders as __group__ attribute in PyQGIS classes
This will allow us to logically create subgroups for PyQGIS modules
in the API reference guide
2024-08-17 20:13:12 +10:00
Nyall Dawson
1f27fc627a [pyqgis] Wrap unambiguously static methods in staticmethod
sip doesn't use the standard Python staticmethod type for defining
static methods, which means that standard means of testing
for a static method (like `isinstance(..., staticmethod)`) fail
with any PyQGIS static methods.

This causes issues with lint tools, which incorrectly flag
calls to QGIS static methods as missing self arguments. It also
breaks detection of static methods in the sphinx PyQGIS docs,
so all static methods are shown as non-static.

Work around this in sipify, by wrapping unambiguously static
methods in staticmethod wrappers.
2024-08-14 22:08:41 +10:00
Nyall Dawson
dc68f03f88 Be tolerant against optional sip modules 2024-08-14 13:05:46 +10:00
Nyall Dawson
ed19d996b2 Collect attribute docstrings for PyQGIS documentation 2024-08-14 13:05:46 +10:00
Nyall Dawson
774ad87251 Remove orphaned sip files
These headers are marked SIP_NO_FILE, these files are not
referenced anywhere
2024-08-13 20:28:55 +10:00
Nyall Dawson
3a578d6712 Header update 2024-08-13 20:28:55 +10:00
Nyall Dawson
e7b26478e2 Valid fixes 2024-08-13 20:28:55 +10:00
qgis-bot
3aed037ce2 auto sipify 🍺 2024-07-25 08:00:08 +00:00
Nyall Dawson
c2c75f3b19
More no-value dox removal 2024-07-25 09:04:22 +10:00
qgis-bot
15fe04a289 auto sipify 🍺 2024-07-24 18:05:14 +00:00
Nyall Dawson
6f652d251b Drop no-value copy constructor dox 2024-07-25 04:02:55 +10:00
qgis-bot
612afa779a auto sipify 🍺 2024-07-22 16:10:48 +00:00
Nyall Dawson
28943f9c1b Remove a bunch of useless default constructor doxygen 2024-07-23 02:08:28 +10:00
Denis Rouzaud
6e9933145a
Adds a file to hold a map from class/method to headerfile (#58054)
* create map file for class / header files for PyQGIS API docs

* create map files

* install file

* add line numbers

* also add methods

* wait to sort

* more methods

* fix CMakeLists install

* fix sorting

* fix spell check

* remove map files for Qt6

* Revert "remove map files for Qt6"

This reverts commit 972f483410f556d1735a2070943b8ad9e2522c5e.

* do not test class_map files + auto sipify_all on branches

* fix warning
2024-07-16 11:40:25 +02:00
Jean Felder
2682a2ee2d qgs3dmapsettings: Fix extent methods documention
The 3D scene's CRS is not necessarily the same as the project's
CRS. For example, it can be "EPSG:3857" if the project's CRS is
geographic.

The stored extent in the settings is always the 3D scene's extent.

See:
b0d1a4f8b1
2024-05-30 05:28:33 +10:00
Jean Felder
13109d7577 qgs3dmapscene: Fix python bindings availability note
Qgs3DMapScene is now available in Python bindings.

See: 176807bc35
2024-05-04 06:31:11 +10:00
Even Rouault
15ea5c46bc
Header files: remove all mentions of '\since QGIS 3.0' 2024-02-18 20:57:23 +01:00
Nyall Dawson
0096246afe Sipify 2024-02-13 20:51:03 +10:00
Nyall Dawson
814e6db3b4 Don't map non-list of QVariantMaps to QMap<QString,QVariant>
The original workaround was only supposed to apply to QList/
QVector of QVariantMaps. By replacing them all in sip we
break mapping of signals defined in c++ which are emitted
by Python code.

Fixes exceptions after running processing algorithms in Qt6
builds.
2024-02-12 12:16:14 +10:00
Nyall Dawson
87f117f47b [sipify] Avoid leading and trailing newlines in enum value docstrings 2024-02-11 13:37:29 +10:00
Nyall Dawson
078fd4f2ea Make IntFlag enum type opt-in, rather than opt-out
And make sipify handle this nicely. This means that all our non-flag
style enums correctly map across to IntFlag python enums on Qt 6,
fixing issues with negative enum values for these and providing
a better match for the original c++ enum.
2024-01-31 17:16:18 +10:00
Nyall Dawson
4654ad3db5 Sipify 2024-01-23 08:32:38 +01:00
uclaros
38db09fa39 deprecate Qgs3DMapScene::openScenes() hack
fix docstrings
2024-01-19 06:51:53 -08:00