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

Transfer first z or m value to point #43060

Merged
merged 17 commits into from
Jun 9, 2021

Conversation

lbartoletti
Copy link
Member

@lbartoletti lbartoletti commented May 3, 2021

Description

This PR is the continuation of the #42812 (comment). It adds a method for adding the Z and the M from a QgsPointSequence. It is equivalent to using the transferFirstZValueToPoint and transferFirstMValueToPoint methods but avoid looping twice.

It is used in the QgsCircle, QgsEllipse, QgsTriangle classes. Three other dedicated PR will complete and add tests on these classes using this method.

Sponsored by: Métropole Européenne de Lille @Jean-Roc

@github-actions github-actions bot added this to the 3.20.0 milestone May 3, 2021
Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

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

Looks good!

If you wanted to make it super-flexible you could make the new method accept an iterator begin/end argument instead of QgsPointSequence, so that we could potentially call it on other point structures (such as the QgsGeometry vertex iterator) without the added expense of translating those to QgsPointSequence.

Probably not a big factor here, but something to keep in mind for future api additions which are designed to work with larger number of input points.

src/core/geometry/qgsgeometryutils.cpp Outdated Show resolved Hide resolved
src/core/geometry/qgsgeometryutils.cpp Outdated Show resolved Hide resolved
src/core/geometry/qgsgeometryutils.cpp Outdated Show resolved Hide resolved
@lbartoletti
Copy link
Member Author

Gentle ping @nyalldawson 😊

@pblottiere
Copy link
Member

Using a generic iterator was indeed a good idea! Code looks good to me.

@pblottiere pblottiere added the API API improvement only, no visible user interface changes label Jun 8, 2021
@pblottiere
Copy link
Member

Hi @lbartoletti,

While not strictly being a new feature, this PR is not really a bugfix either. Can we target this for 3.22? And sorry for not having merged sooner...

Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

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

Looks fantastic to me. I think this is safe to merge for 3.20

@nyalldawson nyalldawson merged commit 85345ee into qgis:master Jun 9, 2021
@pblottiere
Copy link
Member

I think this is safe to merge for 3.20

Nice 🎉!

@lbartoletti
Copy link
Member Author

Thanks @nyalldawson @pblottiere 🙏

rouault pushed a commit that referenced this pull request Aug 23, 2021
Follow up #42812, #42986 and #43060

Co-authored-by: Antoine Facchini <antoine.facchini@oslandia.com>
Koyaani added a commit to Koyaani/QGIS that referenced this pull request Sep 2, 2021
Follow up qgis#42812, qgis#42986 and qgis#43060

Co-authored-by: Antoine Facchini <antoine.facchini@oslandia.com>
@lbartoletti lbartoletti deleted the transferFirstZOrMValueToPoint branch September 3, 2021 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API improvement only, no visible user interface changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants