From c8ba433b88589ef628a9526d43639ddbd7d2a7fe Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 5 Oct 2012 16:53:08 +0200 Subject: [PATCH] Replaced temporary use of MyClassname. --- .../PolyVoxCore/AmbientOcclusionCalculator.inl | 4 ++-- library/PolyVoxCore/include/PolyVoxCore/Raycast.h | 10 +++++----- library/PolyVoxCore/include/PolyVoxCore/Raycast.inl | 8 ++++---- tests/TestRaycast.cpp | 12 ++++++------ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl index f7d40a9c..b5b814fd 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl @@ -90,9 +90,9 @@ namespace PolyVox v3dRayDirection *= fRayLength; AmbientOcclusionCalculatorRaycastCallback ambientOcclusionCalculatorRaycastCallback(isVoxelTransparentCallback); - MyRaycastResult result = raycastWithDirection(volInput, v3dRayStart, v3dRayDirection, ambientOcclusionCalculatorRaycastCallback); + RaycastResult result = raycastWithDirection(volInput, v3dRayStart, v3dRayDirection, ambientOcclusionCalculatorRaycastCallback); - if(result == MyRaycastResults::Completed) + if(result == RaycastResults::Completed) { ++uVisibleDirections; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h b/library/PolyVoxCore/include/PolyVoxCore/Raycast.h index 1e95f60b..56aa6c96 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.h @@ -28,15 +28,15 @@ freely, subject to the following restrictions: namespace PolyVox { - namespace MyRaycastResults + namespace RaycastResults { - enum MyRaycastResult + enum RaycastResult { Completed, Interupted }; } - typedef MyRaycastResults::MyRaycastResult MyRaycastResult; + typedef RaycastResults::RaycastResult RaycastResult; /// OUT OF DATE SINCE UNCLASSING //////////////////////////////////////////////////////////////////////////////// @@ -87,10 +87,10 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template - MyRaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback); + RaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback); template - MyRaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback); + RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback); } #include "PolyVoxCore/Raycast.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl index 6ad915bc..b0d61170 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl @@ -53,7 +53,7 @@ namespace PolyVox // // This error was reported by Joey Hammer (PixelActive). template - MyRaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback) + RaycastResult raycastWithEndpoints(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dEnd, Callback& callback) { VolumeType::Sampler sampler(volData); @@ -96,7 +96,7 @@ namespace PolyVox { if(!callback(sampler)) { - return MyRaycastResults::Interupted; + return RaycastResults::Interupted; } if(tx <= ty && tx <= tz) @@ -126,11 +126,11 @@ namespace PolyVox } } - return MyRaycastResults::Completed; + return RaycastResults::Completed; } template - MyRaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback) + RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback) { Vector3DFloat v3dEnd = v3dStart + v3dDirectionAndLength; return raycastWithEndpoints(volData, v3dStart, v3dEnd, callback); diff --git a/tests/TestRaycast.cpp b/tests/TestRaycast.cpp index de658fee..80e74b61 100644 --- a/tests/TestRaycast.cpp +++ b/tests/TestRaycast.cpp @@ -38,10 +38,10 @@ using namespace PolyVox; // ray has hit a solid voxel). Because the instance of this class is passed to the raycast() function // by reference we can also use it to encapsulate some state. We're testing this by counting the total // number of voxels touched. -class MyFunctor +class RaycastTestFunctor { public: - MyFunctor() + RaycastTestFunctor() :m_uTotalVoxelsTouched(0) { } @@ -85,7 +85,7 @@ void TestRaycast::testExecute() // For demonstration purposes we are using the same function object for all raycasts. // Therefore, the state it maintains (total voxels touched) is accumulated over all raycsts. - MyFunctor myFunctor; + RaycastTestFunctor raycastTestFunctor; // We could have counted the total number of hits in the same way as the total number of voxels // touched, but for demonstration and testing purposes we are making use of the raycast return value @@ -95,9 +95,9 @@ void TestRaycast::testExecute() // Cast a large number of random rays for(int ct = 0; ct < 1000000; ct++) { - MyRaycastResult result = raycastWithDirection(&volData, start, randomUnitVectors[ct % 1024] * 1000.0f, myFunctor); + RaycastResult result = raycastWithDirection(&volData, start, randomUnitVectors[ct % 1024] * 1000.0f, raycastTestFunctor); - if(result == MyRaycastResults::Interupted) + if(result == RaycastResults::Interupted) { hits++; } @@ -107,7 +107,7 @@ void TestRaycast::testExecute() QCOMPARE(hits, 687494); // Check the total number of voxels touched - QCOMPARE(myFunctor.m_uTotalVoxelsTouched, static_cast(486219343)); + QCOMPARE(raycastTestFunctor.m_uTotalVoxelsTouched, static_cast(486219343)); } QTEST_MAIN(TestRaycast)