Merge branch 'develop' into feature/cubiquity-version

Conflicts:
	library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.inl
This commit is contained in:
David Williams 2014-01-28 23:39:22 +01:00
commit 20576d7a6f
10 changed files with 36 additions and 73 deletions

View File

@ -199,9 +199,9 @@ namespace PolyVox
lodRecord.endIndex = m_meshCurrent->getNoOfIndices();
m_meshCurrent->m_vecLodRecords.push_back(lodRecord);
logTrace() << "Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds()
POLYVOX_LOG_TRACE("Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds()
<< "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels()
<< "x" << m_regSizeInVoxels.getDepthInVoxels() << ")";
<< "x" << m_regSizeInVoxels.getDepthInVoxels() << ")");
}
template<typename VolumeType, typename IsQuadNeeded>

View File

@ -130,8 +130,8 @@ namespace PolyVox
lodRecord.endIndex = m_meshCurrent->getNoOfIndices();
m_meshCurrent->m_vecLodRecords.push_back(lodRecord);
logTrace() << "Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds()
POLYVOX_LOG_TRACE("Cubic surface extraction took " << timer.elapsedTimeInMilliSeconds()
<< "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels()
<< "x" << m_regSizeInVoxels.getDepthInVoxels() << ")";
<< "x" << m_regSizeInVoxels.getDepthInVoxels() << ")");
}
}

View File

@ -62,10 +62,7 @@ namespace PolyVox
{
for(std::vector<std::string>::iterator iter = m_vecCreatedFiles.begin(); iter < m_vecCreatedFiles.end(); iter++)
{
if(!std::remove(iter->c_str()))
{
logWarning() << "Failed to delete '" << *iter << "' when destroying FilePager";
}
POLYVOX_LOG_WARNING_IF(!std::remove(iter->c_str()), "Failed to delete '" << *iter << "' when destroying FilePager");
}
m_vecCreatedFiles.clear();
@ -89,7 +86,7 @@ namespace PolyVox
FILE* pFile = fopen(filename.c_str(), "rb");
if(pFile)
{
logTrace() << "Paging in data for " << region;
POLYVOX_LOG_TRACE("Paging in data for " << region);
fseek(pFile, 0L, SEEK_END);
size_t fileSizeInBytes = ftell(pFile);
@ -109,7 +106,7 @@ namespace PolyVox
}
else
{
logTrace() << "No data found for " << region << " during paging in.";
POLYVOX_LOG_TRACE("No data found for " << region << " during paging in.");
}
}
@ -118,7 +115,7 @@ namespace PolyVox
POLYVOX_ASSERT(pBlockData, "Attempting to page out NULL block");
//POLYVOX_ASSERT(pBlockData->hasUncompressedData() == false, "Block should not have uncompressed data");
logTrace() << "Paging out data for " << region;
POLYVOX_LOG_TRACE("Paging out data for " << region);
std::stringstream ssFilename;
ssFilename << m_strFolderName << "/" << m_strRandomPrefix << "-"

View File

@ -159,7 +159,7 @@ namespace PolyVox
do \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getTraceStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getTraceStreamInstance()) << message << std::endl; \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -174,7 +174,7 @@ namespace PolyVox
if ((condition)) \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getTraceStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getTraceStreamInstance()) << message << std::endl; \
} \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -212,7 +212,7 @@ namespace PolyVox
do \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getDebugStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getDebugStreamInstance()) << message << std::endl; \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -227,7 +227,7 @@ namespace PolyVox
if ((condition)) \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getDebugStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getDebugStreamInstance()) << message << std::endl; \
} \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -265,7 +265,7 @@ namespace PolyVox
do \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getInfoStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getInfoStreamInstance()) << message << std::endl; \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -280,7 +280,7 @@ namespace PolyVox
if ((condition)) \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getInfoStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getInfoStreamInstance()) << message << std::endl; \
} \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -318,7 +318,7 @@ namespace PolyVox
do \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getWarningStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getWarningStreamInstance()) << message << std::endl; \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -333,7 +333,7 @@ namespace PolyVox
if ((condition)) \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getWarningStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getWarningStreamInstance()) << message << std::endl; \
} \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -371,7 +371,7 @@ namespace PolyVox
do \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getErrorStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getErrorStreamInstance()) << message << std::endl; \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -386,7 +386,7 @@ namespace PolyVox
if ((condition)) \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getErrorStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getErrorStreamInstance()) << message << std::endl; \
} \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -424,7 +424,7 @@ namespace PolyVox
do \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getFatalStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getFatalStreamInstance()) << message << std::endl; \
} while(0) \
POLYVOX_MSC_WARNING_POP
@ -439,7 +439,7 @@ namespace PolyVox
if ((condition)) \
{ \
/* Appending the 'std::endl' forces the stream to be flushed. */ \
*(PolyVox::Impl::getFatalStreamInstance()) << (message) << std::endl; \
*(PolyVox::Impl::getFatalStreamInstance()) << message << std::endl; \
} \
} while(0) \
POLYVOX_MSC_WARNING_POP

View File

@ -258,8 +258,8 @@ namespace PolyVox
m_uMaxNumberOfUncompressedBlocks = uMaxNumberOfUncompressedBlocks;
uint32_t uUncompressedBlockSizeInBytes = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType);
logDebug() << "The maximum number of uncompresed blocks has been set to " << m_uMaxNumberOfUncompressedBlocks
<< ", which is " << m_uMaxNumberOfUncompressedBlocks * uUncompressedBlockSizeInBytes << " bytes";
POLYVOX_LOG_DEBUG("The maximum number of uncompresed blocks has been set to " << m_uMaxNumberOfUncompressedBlocks
<< ", which is " << m_uMaxNumberOfUncompressedBlocks * uUncompressedBlockSizeInBytes << " bytes");
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -130,9 +130,9 @@ namespace PolyVox
lodRecord.endIndex = m_meshCurrent->getNoOfIndices();
m_meshCurrent->m_vecLodRecords.push_back(lodRecord);
logTrace() << "Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds()
POLYVOX_LOG_TRACE("Marching cubes surface extraction took " << timer.elapsedTimeInMilliSeconds()
<< "ms (Region size = " << m_regSizeInVoxels.getWidthInVoxels() << "x" << m_regSizeInVoxels.getHeightInVoxels()
<< "x" << m_regSizeInVoxels.getDepthInVoxels() << ")";
<< "x" << m_regSizeInVoxels.getDepthInVoxels() << ")");
}
template<typename VolumeType, typename Controller>

View File

@ -68,8 +68,8 @@ namespace PolyVox
uint32_t expectedCompressedSize = getExpectedCompressedSize(uSrcLength);
if(m_vecTempBuffer.size() != expectedCompressedSize)
{
logInfo() << "Resizing temp buffer to " << expectedCompressedSize << "bytes. "
<< "This should only happen the first time the MinizBlockCompressor is used";
POLYVOX_LOG_INFO("Resizing temp buffer to " << expectedCompressedSize << "bytes. "
<< "This should only happen the first time the MinizBlockCompressor is used");
m_vecTempBuffer.resize(expectedCompressedSize);
}
@ -90,8 +90,8 @@ namespace PolyVox
// It is possible for the compression to fail. A common cause for this would be if the destination
// buffer is not big enough. So now we try again using a buffer that is definitely big enough.
// Note that ideally we will choose our earlier buffer size so that this almost never happens.
logWarning() << "The compressor failed to compress the block, probabaly due to the buffer being too small.";
logWarning() << "The compression will be tried again with a larger buffer.";
POLYVOX_LOG_WARNING("The compressor failed to compress the block, probabaly due to the buffer being too small.");
POLYVOX_LOG_WARNING("The compression will be tried again with a larger buffer.");
std::vector<uint8_t> vecExtraBigBuffer;
vecExtraBigBuffer.resize(getMaxCompressedSize(uSrcLength));

View File

@ -45,7 +45,7 @@ namespace PolyVox
LARGE_INTEGER li;
if(!QueryPerformanceFrequency(&li))
{
logWarning() << "QueryPerformanceFrequency failed!";
POLYVOX_LOG_WARNING("QueryPerformanceFrequency failed!");
m_fPCFreq = 1.0f;
}

View File

@ -23,6 +23,7 @@ freely, subject to the following restrictions:
#include "PolyVoxCore/Region.h"
#include <algorithm>
#include <limits>
namespace PolyVox

View File

@ -37,6 +37,12 @@ MACRO(CREATE_TEST headerfile sourcefile executablename)
SET(LATEST_TEST ${CMAKE_CURRENT_BINARY_DIR}/${executablename})
ENDIF(WIN32)
SET_PROPERTY(TARGET ${executablename} PROPERTY FOLDER "Tests")
IF(${XML_TEST_OUTPUT})
ADD_TEST(${executablename} ${LATEST_TEST} -xunitxml)
ELSE()
ADD_TEST(${executablename} ${LATEST_TEST})
ENDIF()
ENDMACRO(CREATE_TEST)
INCLUDE_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/include ${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR})
@ -64,78 +70,37 @@ ENDIF()
# AmbientOcclusionGenerator tests
CREATE_TEST(TestAmbientOcclusionGenerator.h TestAmbientOcclusionGenerator.cpp TestAmbientOcclusionGenerator)
ADD_TEST(AmbientOcclusionGeneratorExecuteTest ${LATEST_TEST} testExecute)
# Array tests
CREATE_TEST(TestArray.h TestArray.cpp TestArray)
ADD_TEST(ArrayReadWriteTest ${LATEST_TEST} testReadWrite)
# AStarPathfinder tests
CREATE_TEST(TestAStarPathfinder.h TestAStarPathfinder.cpp TestAStarPathfinder)
ADD_TEST(AStarPathfinderExecuteTest ${LATEST_TEST} testExecute)
CREATE_TEST(TestCubicSurfaceExtractor.h TestCubicSurfaceExtractor.cpp TestCubicSurfaceExtractor)
ADD_TEST(CubicSurfaceExtractorExecuteTest ${LATEST_TEST} testExecute)
# Low pass filter tests
CREATE_TEST(TestLowPassFilter.h TestLowPassFilter.cpp TestLowPassFilter)
ADD_TEST(LowPassFilterExecuteTest ${LATEST_TEST} testExecute)
# Material tests
CREATE_TEST(testmaterial.h testmaterial.cpp testmaterial)
ADD_TEST(MaterialTestCompile ${LATEST_TEST} testCompile)
# Raycast tests
CREATE_TEST(TestRaycast.h TestRaycast.cpp TestRaycast)
ADD_TEST(RaycastExecuteTest ${LATEST_TEST} testExecute)
# Picking tests
CREATE_TEST(TestPicking.h TestPicking.cpp TestPicking)
ADD_TEST(PickingExecuteTest ${LATEST_TEST} testExecute)
# Region tests
CREATE_TEST(TestRegion.h TestRegion.cpp TestRegion)
ADD_TEST(RegionEqualityTest ${LATEST_TEST} testEquality)
CREATE_TEST(TestSurfaceExtractor.h TestSurfaceExtractor.cpp TestSurfaceExtractor)
ADD_TEST(SurfaceExtractorExecuteTest ${LATEST_TEST} testExecute)
#Vector tests
CREATE_TEST(testvector.h testvector.cpp testvector)
ADD_TEST(VectorLengthTest ${LATEST_TEST} testLength)
ADD_TEST(VectorDotProductTest ${LATEST_TEST} testDotProduct)
ADD_TEST(VectorEqualityTest ${LATEST_TEST} testEquality)
# Volume tests
CREATE_TEST(testvolume.h testvolume.cpp testvolume)
ADD_TEST(RawVolumeDirectAccessAllInternalForwards ${LATEST_TEST} testRawVolumeDirectAccessAllInternalForwards)
ADD_TEST(RawVolumeSamplersAllInternalForwards ${LATEST_TEST} testRawVolumeSamplersAllInternalForwards)
ADD_TEST(RawVolumeDirectAccessWithExternalForwards ${LATEST_TEST} testRawVolumeDirectAccessWithExternalForwards)
ADD_TEST(RawVolumeSamplersWithExternalForwards ${LATEST_TEST} testRawVolumeSamplersWithExternalForwards)
ADD_TEST(RawVolumeDirectAccessAllInternalBackwards ${LATEST_TEST} testRawVolumeDirectAccessAllInternalBackwards)
ADD_TEST(RawVolumeSamplersAllInternalBackwards ${LATEST_TEST} testRawVolumeSamplersAllInternalBackwards)
ADD_TEST(RawVolumeDirectAccessWithExternalBackwards ${LATEST_TEST} testRawVolumeDirectAccessWithExternalBackwards)
ADD_TEST(RawVolumeSamplersWithExternalBackwards ${LATEST_TEST} testRawVolumeSamplersWithExternalBackwards)
ADD_TEST(SimpleVolumeDirectAccessAllInternalForwards ${LATEST_TEST} testSimpleVolumeDirectAccessAllInternalForwards)
ADD_TEST(SimpleVolumeSamplersAllInternalForwards ${LATEST_TEST} testSimpleVolumeSamplersAllInternalForwards)
ADD_TEST(SimpleVolumeDirectAccessWithExternalForwards ${LATEST_TEST} testSimpleVolumeDirectAccessWithExternalForwards)
ADD_TEST(SimpleVolumeSamplersWithExternalForwards ${LATEST_TEST} testSimpleVolumeSamplersWithExternalForwards)
ADD_TEST(SimpleVolumeDirectAccessAllInternalBackwards ${LATEST_TEST} testSimpleVolumeDirectAccessAllInternalBackwards)
ADD_TEST(SimpleVolumeSamplersAllInternalBackwards ${LATEST_TEST} testSimpleVolumeSamplersAllInternalBackwards)
ADD_TEST(SimpleVolumeDirectAccessWithExternalBackwards ${LATEST_TEST} testSimpleVolumeDirectAccessWithExternalBackwards)
ADD_TEST(SimpleVolumeSamplersWithExternalBackwards ${LATEST_TEST} testSimpleVolumeSamplersWithExternalBackwards)
ADD_TEST(LargeVolumeDirectAccessAllInternalForwards ${LATEST_TEST} testLargeVolumeDirectAccessAllInternalForwards)
ADD_TEST(LargeVolumeSamplersAllInternalForwards ${LATEST_TEST} testLargeVolumeSamplersAllInternalForwards)
ADD_TEST(LargeVolumeDirectAccessWithExternalForwards ${LATEST_TEST} testLargeVolumeDirectAccessWithExternalForwards)
ADD_TEST(LargeVolumeSamplersWithExternalForwards ${LATEST_TEST} testLargeVolumeSamplersWithExternalForwards)
ADD_TEST(LargeVolumeDirectAccessAllInternalBackwards ${LATEST_TEST} testLargeVolumeDirectAccessAllInternalBackwards)
ADD_TEST(LargeVolumeSamplersAllInternalBackwards ${LATEST_TEST} testLargeVolumeSamplersAllInternalBackwards)
ADD_TEST(LargeVolumeDirectAccessWithExternalBackwards ${LATEST_TEST} testLargeVolumeDirectAccessWithExternalBackwards)
ADD_TEST(LargeVolumeSamplersWithExternalBackwards ${LATEST_TEST} testLargeVolumeSamplersWithExternalBackwards)
# Volume subclass tests
CREATE_TEST(TestVolumeSubclass.h TestVolumeSubclass.cpp TestVolumeSubclass)
ADD_TEST(VolumeSubclassExtractSurfaceTest ${LATEST_TEST} testExtractSurface)