QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

[3D] Add support for data defined properties of points

Open ptitjano opened this issue 7 months ago • 10 comments

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:

  1. Entity1: (normal, radius1, length1)
  2. Entity2: (selected, radius1, length1)
  3. Entity3: (normal, radius1, lenght2)
  4. Entity4: (selected, radius1, lenght2)
  5. Entity5: (normal, radius2, lenght1)
  6. Entity6: (selected, radius2, lenght1)
  7. Entity5: (normal, radius2, lenght2)
  8. Entity6: (selected, radius2, lenght2) ...

If there is only one shape, the previous case still applies.

Example

Capture d’écran du 2024-06-28 16-05-33

Capture d’écran du 2024-06-28 16-06-06

ptitjano avatar Jun 28 '24 14:06 ptitjano