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

Virtual octreedatanode #97

Closed
wants to merge 3 commits into from
Closed

Virtual octreedatanode #97

wants to merge 3 commits into from

Conversation

lorenzoriano
Copy link

Subclassing OcTreeNode is still problematic, since no method is virtual and the class is not polymorphic. The main problem is with static_cast in OcTreeNode::createChild, where any information about a subclass is lost. Effectively creating a subclass is still not very easy, as a number of methods need to be rewritten (including the copy constructor) but these changes allow for polymorphism, thus easier extension of the node.

This pull request should solve issue #93 and potentially #95

Merry Christmas! 😄 🎄

@ahornung ahornung mentioned this pull request Dec 25, 2015
@ahornung
Copy link
Member

Hi Lorenzo!

Indeed, polymorphism would make many things easier. However, the cost would be one pointer for each node object for the vtable, as mentioned in our OctoMap paper (Hornung et al. 2013). This is a significant increase particularly for the leaf nodes and usually not needed because the single nodes of one tree class can't change during runtime.

That's why the implementation explicitly does not use virtual inheritance for the nodes. I created a new issue (#98) to track improvements to the current situation, although I don't have a clear idea yet how they can look like. Maybe there are some implementation tricks that could help, otherwise it'll be with a better documentation.

@ahornung ahornung closed this Dec 25, 2015
@ahornung
Copy link
Member

...and Merry Christmas as well, thanks! 🎄 🎅

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.

2 participants