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

findNeighbor function problem #11

Closed
yeseuleee opened this issue Mar 11, 2019 · 1 comment
Closed

findNeighbor function problem #11

yeseuleee opened this issue Mar 11, 2019 · 1 comment

Comments

@yeseuleee
Copy link

yeseuleee commented Mar 11, 2019

findNeighbor function don't check that root_ variable is valid.(the func have not check if(root_ == 0) condition)
But radiusNeighbor function check that root_ variable is valid.
So if root_ is not initialized situation, findNeighbor make program fault and radiusNeighbor doesn't make fault.
Then I think should be add "check root_ code" in findNeighbor.
The code is important in dynamic cloud situation.
Then user can well know error situation.

For example,

template <typename PointT, typename ContainerT>
template
int32_t Octree<PointT, ContainerT>::findNeighbor(const PointT& query, float minDistance) const
{
if(root_==0) return -999;//****return error code that user defined
float maxDistance = std::numeric_limits::infinity();
int32_t resultIndex = -1;
findNeighbor(root_, query, minDistance, maxDistance, resultIndex);

return resultIndex;
}

@jbehley
Copy link
Owner

jbehley commented Dec 17, 2019

Thanks for pointing this out. I added a check to the findNeighbor function. Now one has only to take care for return value -1.

Sorry for the delay. :/

This issue was closed.
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

No branches or pull requests

2 participants