-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Reverse octree's depth first iterator order #2332
Reverse octree's depth first iterator order #2332
Conversation
1a07fd5
to
dc5dfde
Compare
a3ce21f
to
678d2c8
Compare
678d2c8
to
ec6d4fa
Compare
ec6d4fa
to
46acd79
Compare
46acd79
to
35e72e0
Compare
b95b951
to
61d3490
Compare
61d3490
to
ed5b2d0
Compare
ed5b2d0
to
734f9f5
Compare
Could you briefly describe (here) how the order is changed? Are we fixing some implementation flaw or rather changing behavior to something that makes more sense? Could this break someones code? |
It seems like instead of starting from index 0 is starts from index 8. It's just starting the traversal from the end, horizontally speaking. @frozar what's the use for this? Was something broken? Edit: I think the tests hint the problem. The octree key values which are closely tied to the depth we're looking weird before and now seem to make more sense. |
ClarificationHi there, I think this PR change the behavior of the iterator in a way it makes more sense. I will try to explain it on the simple octree example I provided in a previous PR:
If we consist the previous The second order is the good one for me. Side effect of this changeUsually people don't care about the order in which the iterator provide octree nodes I think. If someone use an algorithm which is sensible to the order of the octree nodes he deals with, maybe this change will fix some Issue ^^. If really it's a big issue for somebody, maybe both iterator should be provide: in one order and its reverse. About implementationLast point about the implementation, as the Depth First Iterators use a stack internally, surpringly to get the octree nodes in the correct order, we have to push them in the reverse order, and it's fine. Also, why do I use a |
depth first iterator go in the intuitive order over an octree. Say is to say, from the lowest octree key to the highest octree key.
…et the intuitive order.
734f9f5
to
c38f4af
Compare
I hope everything is finally alright for this tiny PR. |
Warning: this PR is based onto #2204
Fix the order in which the octree is walked through by a 'depth_first'-like iterator.