227 Commits

Author SHA1 Message Date
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
87f117f47b [sipify] Avoid leading and trailing newlines in enum value docstrings 2024-02-11 13:37:29 +10:00
uclaros
38db09fa39 deprecate Qgs3DMapScene::openScenes() hack
fix docstrings
2024-01-19 06:51:53 -08:00
uclaros
652b6a630d limit what's exposed to python 2024-01-19 06:51:53 -08:00
uclaros
d8996ae33b Add 3D map canvas handling methods to QgisInterface 2024-01-19 06:51:53 -08:00
uclaros
2f98809d2c cleanup 2024-01-19 06:51:53 -08:00
uclaros
75607c05f8 Qgs3DMapCanvas + Qgs3DWindow = <3 2024-01-19 06:51:53 -08:00
Nyall Dawson
da06bde051 Use double instead of float in high level class to avoid
user set values changing when saving/restoring material settings

Convert to float when creating low level, performance critical
objects only.
2024-01-16 13:20:47 +10:00
Nyall Dawson
0215bf01a3 Add API to control coefficients (strength) of ambient/diffuse/specular
contributions to phong shader
2024-01-16 13:20:47 +10:00
Julien Cabieces
3e27ac5985 [PyQt6] Build PyQt6 2024-01-16 12:18:11 +10:00
Nyall Dawson
9099fa4f3e Add a physically based metal rough material
Adds a new material choice for a physically based metal/roughness
material. Options are available for setting the material base color,
metalness and roughness.

Internally this uses a clone of Qt's QMetalRoughMaterial class. We
use a copy of the Qt class instead of relying on Qt's implementation
as longer-term improvements (such as data defined base color) will
require a re-implementation anyway. By using our own material we
will avoid having two different code paths for the data-defined/
non-data defined scenarios.
2024-01-11 11:43:01 +10:00
Nyall Dawson
f6addcd0ca Promote 3d point symbol shape to enum class 2023-12-25 17:54:44 +10:00
Nyall Dawson
7b41268c99 Ensure that default shape properties for 3d symbols are only
stored in a single place, and that we always use the default
value when its not overwise set

This has two benefits:
1. The user doesn't see confusing "0" values for radius/length etc,
which are silently treated as some other fixed value when rendering
2. The default values are correctly accounted for when calculating
the layer's AABB, otherwise we end up with a flat AABB by
default
2023-12-23 06:38:43 +10:00
Martin Dobias
fa49d149fe sip fixes 2023-12-18 12:07:17 +01:00
Julien Cabieces
e57a13639e fix useless new line 2023-12-13 05:36:44 +10:00
bdm-oslandia
3707510ede fix(Qgs3DMapScene): add const to const member functions 2023-12-12 07:38:31 +10:00
Jean Felder
1200cbbe58 qgspolygon3dsymbol: Rename height property to offset
This is similar to the changes already applied to QgsLine3DSymbol.

height() are setHeight() are kept for API compatibility reasons.
2023-11-09 05:22:05 +10:00
Jean Felder
630fec5cc8 qgsline3dsymbol: Rename height property to offset
The `height` property is in fact a vertical offset applied to the
line. Also, the `offset` phrase is already used by the terrain for
similar purposes.

height() are setHeight() are kept for API compatibility reasons.
2023-11-09 05:22:05 +10:00
Nyall Dawson
a1f9039f12 Fix invalid escape sequences in docstrings for enums with since
annotation
2023-10-24 06:44:46 +10:00
Martin Dobias
859a851e39 Allow GPU memory limit configuration + show a warning when limit got hit 2023-09-29 05:41:59 +10:00
Jean Felder
d8508b1132 qgs3dmapscene: Fix sip file
This fixes commit b9f770210c03201a5d81324ac3b1523f57bc2bd8.
2023-09-25 09:53:13 +10:00
Nyall Dawson
0a04a64413 QString fixup 2023-08-18 11:45:29 +10:00
Martin Dobias
e8a24b0f96 Fixed note + added convert to subclass code 2023-08-16 13:19:44 +10:00
Martin Dobias
9eb35537e7 Add Python bindings for tiled scene 3D renderer 2023-08-16 13:19:44 +10:00
bdm-oslandia
ecd7212e6c fix(3D): replace geometry renderer identification (main/selected) by property
3D geometry renderer identification in QgsChunkedEntity was made according to the object name and can be prone to error. Now we used a property (prop name is defined in a const) with values from enum.
2023-06-14 10:31:02 +02:00
Jean Felder
70debe9787 qgs3dmapcanvaswidget: Allow to draw the extent on the 2D map canvas
This adds a QgsRubberband in the 2D map canvas similar to the one used
to display the Frustum.

The option can be enabled in the General section of the 3D
configuration widget.
2023-03-24 07:09:55 +10:00
Jean Felder
2ba0ca9122 qgs3dmapsettings: remove the unused renderers logic
This is never used. The set or update renderer logic is handled in
Qgs3DMapScene by listening to the `onLayersChanged` and
`onLayerRenderer3DChanged` signals (see the previous commit).
2023-03-22 15:39:46 +01:00
Stefanos Natsis
b371267fbe
Improved 3d measure tool (#52208)
* cleanup 3d measure tool class from pickers

* update qgs3dmapscene and identify tool

* remove pickers from chunked entity and terrain entity

* add QgsRay3d::intersects( QgsBox3d );

* demterrain and tesselated polygon geometry intersection checks

* Add vertex markers to 3d rubber bands
Add moveLastPoint() support for 3d rubber bands

* Forward keyEvents to 3d map tools

* proof of concept, needs refactoring

* move intersection logic to ChunkedEntities

* move ray casting logic to Qgs3DUtils

* cleanup map tools

* rename intersectEntity to rayIntersection, further cleanup

* cleanup

* move RayCastContext param
fix last rubberband marker
use singleResult for pointclouds
cleanup

* replace autos

* fix FID fetching logic
fix rule based rendering hits
fix selected feature hits

* fix clearing identify results, startDrag tolerance

* use doubles when dealing with map coordinates
return world coords in point cloud RayHits

* dosctrings and method rename

* use raycastingtools::ray3d

* move RayHit and Context to raycastingutils

* sip skip new methods

* fix build

* remove unused

* added docstring

* fix forward declarations

* fix qt6 build

* Use anti-aliasing for better looking billboards

* Slightly improve styling of 3D rubber band

* Make it possible to have 3D rubber band always on top

Also adds some docs to the frame graph implementation

* Do not leave the final rubber band segment when measuring is done

* address review comments

* spelling typo

* make cppcheck happy

* address benoit and loic review comments

* remove previous bool QgsTerrainEntity::rayIntersection() implementation

* add consts, update test mask

---------

Co-authored-by: Martin Dobias <wonder.sk@gmail.com>
2023-03-21 22:01:45 +01:00
Mathieu Pellerin
22a46d9988 Oh clang 2023-02-27 11:32:38 +10:00
Mathieu Pellerin
16c087f4ab [3d] Expose the 3D map settings for a given scene to python API 2023-02-27 11:32:38 +10:00
Mathieu Pellerin
f188a00df5 [3d] Expose QgsCameraController's rotateCamera() function to API 2023-02-27 11:32:38 +10:00
Mathieu Pellerin
27e2e324ca [3d] Add a walkView() function to QgsCameraController 2023-02-27 11:32:38 +10:00
Nyall Dawson
2aa484ca23 Move QgsCameraController enums to Qgis, promote to enum class 2023-02-23 13:53:34 +10:00
Nyall Dawson
176807bc35 Provide a basic way to access open 3d scenes via PyQGIS
Qgs3DMapScene.openScenes() will now return a map of
open Qgs3DMapScene objects (by name) visible in the app. Various
basic properties of the scene are exposed, including
the camera controller, allowing access to navigate 3d
scenes via python
2023-02-23 13:53:34 +10:00
Nyall Dawson
046883fa9c Promote QgsWkbTypes enums to enum class, move to Qgis 2023-02-22 12:39:21 +10:00
uclaros
1f9276d59d code layout tests 2023-01-23 14:38:10 +10:00
uclaros
bd4c595cac Add widget to set 3d scene's 2d extent 2023-01-23 14:38:10 +10:00
uclaros
f2067aba1e Limit 3d scenes' 2d extent 2023-01-23 14:38:10 +10:00
Jean Felder
5d14d84bde
symbols: rename material to material settings (#50977)
* qgspoint3dsymbol: Rename mMaterial attribute to mMaterialSettings

mMaterial is not a material but an attribute to handle material
settings. Renaming it makes it easier to understand its usage.

* qgspoint3dsymbol: Rename materialSettings getter and setter

See previous commit.

* qgsline3dsymbol: Rename mMaterial attribute to mMaterialSettings

mMaterial is not a material but an attribute to handle material
settings. Renaming it makes it easier to understand its usage.

* qgsline3dsymbol: Rename materialSettings getter and setter

See previous commit.

* qgspolygon3dsymbol: Rename mMaterial attribute to mMaterialSettings

mMaterial is not a material but an attribute to handle material
settings. Renaming it makes it easier to understand its usage.

* qgspolygon3dsymbol: Rename materialSettings getter and setter

See previous commit.

* qgsmesh3dsymbol: Rename mMaterial attribute to mMaterialSettings

mMaterial is not a material but an attribute to handle material
settings. Renaming it makes it easier to understand its usage.

* qgsmesh3dsymbol: Rename materialSettings getter and setter

See previous commit.

* qgsgoochmaterialsettings: fix indentation
2022-11-30 16:45:32 +01:00