diff --git a/doc/Changelog.md b/doc/Changelog.md index 7f0c5be9..9e102284 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -3,6 +3,8 @@ Changelog {#Changelog} # Release 0.4 (git master) {#Release040} +* [#86](https://github.com/BlueBrain/Livre/pull/86): + Removed obsolete limitation to open only regular power-of-two volumes * [#84](https://github.com/BlueBrain/Livre/pull/84): Cache statistics are printed when showing statistics (press 's' key) * [#84](https://github.com/BlueBrain/Livre/pull/84): diff --git a/livre/core/Data/VolumeDataSourcePlugin.cpp b/livre/core/Data/VolumeDataSourcePlugin.cpp index e38c1f38..facc5594 100644 --- a/livre/core/Data/VolumeDataSourcePlugin.cpp +++ b/livre/core/Data/VolumeDataSourcePlugin.cpp @@ -70,37 +70,9 @@ void VolumeDataSourcePlugin::internalNodeToLODNode( boxCoordMax - _volumeInfo.worldSize * 0.5f )); } -bool isPowerOfTwo( const uint32_t x ) -{ - return ( x != 0 ) && ( ( x & ( x - 1 ) ) == 0 ); -} - -bool checkCompatibility( const Vector3ui& volumeDim, - const Vector3ui& blockSize ) -{ - if( volumeDim.x() % blockSize.x() ) - return false; - if( volumeDim.y() % blockSize.y() ) - return false; - if( volumeDim.z() % blockSize.z() ) - return false; - - if( !isPowerOfTwo( volumeDim.x() / blockSize.x() ) ) - return false; - if( !isPowerOfTwo( volumeDim.y() / blockSize.y() ) ) - return false; - if( !isPowerOfTwo( volumeDim.z() / blockSize.z() ) ) - return false; - - return true; -} - bool fillRegularVolumeInfo( VolumeInformation& info ) { const Vector3ui& blockSize = info.maximumBlockSize - info.overlap * 2; - if( !checkCompatibility( info.voxels, blockSize )) - return false; - const float maxDim = float( info.voxels.find_max( )); info.maximumBlockSize = blockSize + info.overlap * 2; @@ -127,6 +99,4 @@ bool fillRegularVolumeInfo( VolumeInformation& info ) return true; } - - }