QGIS
QGIS copied to clipboard
[3D] Add support for data defined properties of points
Description
This PR introduces support for data defined properties (radius, length...). This needs some changes in QgsInstancedPoint3DSymbolHandler
. Inded, it uses OpenGL instancing in order to draw multiple times the same entity at different locations with the same shape. In practice, this means that only 2 Qt3D entities are
created:
- 1 for the points which are not selected
- 1 for the selected points Indeed, the selected points do not have the same color as the normal ones. If there isn't any selected point, only one entity is created.
When a point can have a data defined shapes, this logic needs to be updated. The idea is to group the points which have the same shape. This logic is handled by the PointData
class and the ==
operator. If two different have the same state (selected or normal) and the same shape, they are grouped together in the same PointData
instance and their respective positions are stored in positions
. With that logic, the following entities are created:
- Entity1: (normal, radius1, length1)
- Entity2: (selected, radius1, length1)
- Entity3: (normal, radius1, lenght2)
- Entity4: (selected, radius1, lenght2)
- Entity5: (normal, radius2, lenght1)
- Entity6: (selected, radius2, lenght1)
- Entity5: (normal, radius2, lenght2)
- Entity6: (selected, radius2, lenght2) ...
If there is only one shape, the previous case still applies.