Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D] Add support for a rotated 3d scene - pointcloud support #57618

Closed
wants to merge 8 commits into from

Conversation

ptitjano
Copy link
Contributor

Description

This is split from #57593 and only contains the pointcloud part.

@github-actions github-actions bot added this to the 3.38.0 milestone May 30, 2024
Copy link

github-actions bot commented May 30, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit ead6e8c)

src/core/pointcloud/qgspointcloudrequest.h Outdated Show resolved Hide resolved
src/core/pointcloud/qgslazdecoder.cpp Outdated Show resolved Hide resolved
ptitjano added 6 commits June 6, 2024 18:54
This change introduces a new parameter `mZRotation` which stores
the rotation of a 3d scene in degrees clockwise from North.
It is already possible to limit the extent of a 3d scene. However, the
3d scene is always aligned the true north. This change will make it
possible to define a Z rotation of the 3d scene extent.

There are now 4 stored parameters to fully describe the 3d scene
extent:
- QgsRectangle `mExtent`: axis aligned extent
- double `mZRotation`: Z rotation of the 3d scene
- QgsGeometry `mRotatedExtent`: the rotated `mExtent`
- QgsRectangle `mRotatedExtentBBox`: the bounding box of
  `mRotatedExtent`

If there is no rotation, `mExtent`, `mRotatedExtent` and
`mRotatedExtentBBox` are the same.

`Qgs3DMapSettings::rotatedExtent()` returns a geometry of the rotated
extent.
`Qgs3DMapSettings::extent()` now returns the bounding box of the
rotated extent.

This parameter is not used at the moment. The next commits will update
the loaders and widgets to take it into account.
This allows to avoid the need to construct a temporary QgsPoint.
@ptitjano ptitjano force-pushed the 3d-rotate-z-simple-pointcloud branch from 0e7deea to d651e29 Compare June 6, 2024 16:57
@ptitjano ptitjano force-pushed the 3d-rotate-z-simple-pointcloud branch from d651e29 to 4f121d6 Compare June 6, 2024 18:29
If the rotation is not 0, the filter Rect used to request is the
bounding box of the real extent. In that case, one need to ensure that
points are inside the 3d scene extent.
@ptitjano ptitjano force-pushed the 3d-rotate-z-simple-pointcloud branch from 4f121d6 to ead6e8c Compare June 6, 2024 18:35
// The request was made on the boundingbox of the real extent
// It is necessary to ensure that the features intersect
// with extentGeom if the scene rotation is not 0.
QgsGeos extentIntersectionGeos( nullptr );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better! If you look through the code, the typical pattern is to use a unique_ptr for QgsGeos objects to avoid an invalid construction like this.

@@ -810,6 +810,33 @@ bool QgsGeos::intersects( const QgsAbstractGeometry *geom, QString *errorMsg ) c
return relation( geom, RelationIntersects, errorMsg );
}

bool QgsGeos::intersects( double x, double y, QString *errorMsg ) const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're adding this method then we need to take care that it's optimised for use in all situations -- can you model it off the QgsGeos::contains method please?

This will all eventually get cleaned up when we can safely bump the minimum geos version, so I'm not concerned about the complexity.

@nyalldawson
Copy link
Collaborator

Thanks @ptitjano !

Can you pull the QgsGeos::intersects API addition out to a new PR, as that's safe to merge immediately. Then I suggest we move discussion back to #57593

Copy link

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jun 21, 2024
Copy link

While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist.

@github-actions github-actions bot closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants