-
Notifications
You must be signed in to change notification settings - Fork 239
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
GeoLib OctTree #714
GeoLib OctTree #714
Conversation
Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/270/ |
Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/200/ |
cf9e1a2
to
1e66f6b
Compare
Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/272/ |
OctTree<POINT>::_max_items_per_node = max_items_per_node; | ||
OctTree<POINT>::_eps = eps; | ||
// compute an axis aligned cube around the points ll and ur | ||
const double dx(ur[0] - ll[0]); |
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.
Without repeating the algorithm an AABB could be used here.
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.
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.
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.
I missed the cube part. Thanks.
Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/202/ |
} | ||
|
||
template <typename POINT> | ||
bool OctTree<POINT>::addPoint(POINT * pnt, POINT *& ret_pnt) |
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.
The return type could be a boost::optional if not too difficult to change.
The input could be a reference to a point.
1e66f6b
to
4b2564a
Compare
Summary before weekend:
|
Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/274/ |
Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/204/ |
return true; | ||
} | ||
private: | ||
static double _eps; |
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.
why static? should we share the same epsilon for all Octree objects?
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.
Good point. On the one hand I want only one epsilon (stored once) for one OctTree
. On the other hand different OctTree
s 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?
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.
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.
@endJunction wrote:
The @endJunction wrote:
If the @endJunction Please let me know if the answers are okay for you. |
4b2564a
to
b3c733e
Compare
Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/277/ |
Jenkins: OGS-6/Win-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Win-PRs/207/ |
b3c733e
to
427d9a2
Compare
Thanks Tom for clarifying the open questions. |
427d9a2
to
0b968ab
Compare
👍 |
0b968ab
to
d2a423b
Compare
Rebased and added changelog entry. There are not any further source code changes. |
/// Adding a new item to an already "filled" OctTree node results in a | ||
/// split of the OctTree node. The smaller this number is the more leafes | ||
/// the OctTree will have, i.e. it needs more memory and more time to walk | ||
/// through the OctTree, but the search inside a leafe is fast. In |
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.
Typo: leaf
✅
d2a423b
to
16ccf26
Compare
OpenGeoSys development has been moved to GitLab. |
This PR contains a rework of class
OctTree
, which will be used in another PR fixing some issues inGeoLib::GEOObject
that is already in preparation (see branch GeoLibReworkMergingGeometries). Also in this PR a tests forOctTree
are added.Maybe the
OctTree
can also be useful for other things like mesh node search?