Skip to content

GeoLib OctTree#714

Merged
bilke merged 3 commits intoufz:masterfrom
TomFischer:GeoLibOctTree
Jun 16, 2015
Merged

GeoLib OctTree#714
bilke merged 3 commits intoufz:masterfrom
TomFischer:GeoLibOctTree

Conversation

@TomFischer
Copy link
Copy Markdown
Member

This PR contains a rework of class OctTree, which will be used in another PR fixing some issues in GeoLib::GEOObject that is already in preparation (see branch GeoLibReworkMergingGeometries). Also in this PR a tests for OctTree are added.

Maybe the OctTree can also be useful for other things like mesh node search?

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 12, 2015

Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/270/

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 12, 2015

Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/200/

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 12, 2015

Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/272/

Comment thread GeoLib/OctTree-impl.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Without repeating the algorithm an AABB could be used here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I do not see how the AABB can help at this place. Here a special AABB is computed - a cube. The input points ll and ur needs not to describe a cube.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I missed the cube part. Thanks.

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 12, 2015

Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/202/

Comment thread GeoLib/OctTree-impl.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The return type could be a boost::optional if not too difficult to change.
The input could be a reference to a point.

@TomFischer
Copy link
Copy Markdown
Member Author

Summary before weekend:

  • The question for the signature of addPoint() is still open.
  • Other points are either answered or already changed.

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 12, 2015

Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/274/

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 12, 2015

Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/204/

Comment thread GeoLib/OctTree.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why static? should we share the same epsilon for all Octree objects?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. On the one hand I want only one epsilon (stored once) for one OctTree. On the other hand different OctTrees can and should have different epsilon. I am thinking of a good solution. Do you (or somebody else) have any suggestions how to solve this issue?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed from class variable to class member variable. I also changed the handling of the number of maximal points per OctTree node from a static variable to a template parameter. So it is possible to have for each OctTree it is own value.

@TomFischer
Copy link
Copy Markdown
Member Author

@endJunction wrote:

The return type could be a boost::optional if not too difficult to change.

The addPoint() method is returning a bit more information than would fit in a boost::optional. In case the point could not be inserted (return value false) the user also get the reason via the ret_pnt: If ret_pnt is a nullptr the point is outside of the OctTree cubic domain. If the ret_pnt is not equal to a nullptr the returned value is the pointer to a point within the eps-radius that was already inserted into the OctTree before.

@endJunction wrote:

The input could be a reference to a point.

If the OctTree stores references or objects instead of pointers in my opinion this would result in some performance issues. I expect that OctTree nodes are often split. As a consequence a recreation of POINT objects for the childs and destroying the POINT objects for the split node are necessary very often.

@endJunction Please let me know if the answers are okay for you.

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 15, 2015

Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/277/

@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 15, 2015

Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/207/

@endJunction
Copy link
Copy Markdown
Member

Thanks Tom for clarifying the open questions.
I would though insist on use proper English "children" for the plural of a child. ✅

@norihiro-w
Copy link
Copy Markdown
Collaborator

👍

@TomFischer
Copy link
Copy Markdown
Member Author

Rebased and added changelog entry. There are not any further source code changes.

Comment thread GeoLib/OctTree.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo: leaf

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.

5 participants