Freakazo wrote:
In regards with the bounds checking for Large volume and maybe the other classes as well, how about having it be conditionally compiled based on a cmake setting or debug/release build?
Actually is
kind of how it works, in that the getVoxel() function (which does not perform bounds checking) does still have an assert() present. So Bounds checking actually is performed if asserts are enabled, but not otherwise, and it will never throw an exception regardless. You can see it here:
https://bitbucket.org/volumesoffun/poly ... elop#cl-82But you've got me thinking, maybe getVoxel() should instead take a parameter to control whether bounds checks are supressed. Untested code:
Code:
template <typename VoxelType>
VoxelType RawVolume<VoxelType>::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, bool suppressBoundsChecks = false) const
{
if(!suppressBoundsChecks)
{
//Do bounds checks and throw an exception
}
//Get on with the rest of the stuff.
}
In practice 'suppressBoundsChecks' should be a template parameter so that checking it is free, but I can't write the syntax for that off the top of my head. We could then also have another overload:
Code:
template <typename VoxelType>
VoxelType RawVolume<VoxelType>::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode wrapmode) const
Which includes a wrap mode, and hence never needs bounds checking anyway (but the wrapping has some small overhead). this would replace getVoxelWithWrapping() which is in develop at the moment.
Ok, I will play with this and see what I can come up with.
holocronweaver wrote:
I second the idea of an abstract Paging class that the user can implement. This will make using LargeVolume easier and cleaner. I think 'Paging' sounds better than 'Pager', especially since the latter is associated with the antiquated wireless messaging device.
Actually I think a classname should always be a noun, but something like PagingManager would be possible. I was actually wondering whether 'page' is the right word at all... maybe 'Streamer' or 'OverflowManager' or something. Hmmm... probably not. I'll think about it but maybe Pager is best after all.