Skip to content

New API for traversal of geometry's vertices using iterator pattern#4513

Closed
wonder-sk wants to merge 2 commits intoqgis:masterfrom
wonder-sk:vertex-iterator
Closed

New API for traversal of geometry's vertices using iterator pattern#4513
wonder-sk wants to merge 2 commits intoqgis:masterfrom
wonder-sk:vertex-iterator

Conversation

@wonder-sk
Copy link
Member

Introducing:

  1. STL-style iterator: QgsAbstractGeometry::vertex_iterator
  2. Java-style iterator: QgsVertexIterator (built on top of STL-style)

The iterators are modeled after Qt's STL-style and Java-style iterators, the idea is to replace nextVertex() method and later introduce iterators for other bits (e.g. part_iterator, ring_iterator).

@nyalldawson
Copy link
Collaborator

Awesome! This will be very useful

Copy link
Member

Choose a reason for hiding this comment

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

Should there be an error message here?

Copy link
Member

Choose a reason for hiding this comment

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

Can these be prefixed with a mEmber prefix?

Copy link
Member

Choose a reason for hiding this comment

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

Would be great to have a short code snippet here or on the class QgsVertexIterator
Maybe just a copy of the python test.

@m-kuhn
Copy link
Member

m-kuhn commented May 7, 2017

Really nice stuff

wonder-sk added 2 commits May 30, 2017 19:32
Introducing:
1. STL-style iterator: QgsAbstractGeometry::vertex_iterator
2. Java-style iterator: QgsVertexIterator (built on top of STL-style)

The iterators are modeled after Qt's STL-style and Java-style iterators,
the idea is to replace nextVertex() method and later introduce iterators
for other bits (e.g. part_iterator, ring_iterator).
@m-kuhn
Copy link
Member

m-kuhn commented Jul 17, 2017

@wonder-sk are you planning to revive this? It will be very valuable to have this in place!

@wonder-sk
Copy link
Member Author

Yeah I will update it soon... the third dimension is keeping me busy nowadays...

@m-kuhn
Copy link
Member

m-kuhn commented Aug 13, 2017

I wish it would be possible to upvote PRs ;)

@nyalldawson
Copy link
Collaborator

cough please finish this cough

@wonder-sk
Copy link
Member Author

Superseded by #5365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments