-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
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.
0e7deea
to
d651e29
Compare
d651e29
to
4f121d6
Compare
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.
4f121d6
to
ead6e8c
Compare
// 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 ); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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
|
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. |
Description
This is split from #57593 and only contains the pointcloud part.