diff --git a/tests/pe/Raytracing.cpp b/tests/pe/Raytracing.cpp index ada6fc67534d8a1626c278abfa22dba693830341..c12dda18c93124014f7e5f9e5891bcaf4d99eb89 100644 --- a/tests/pe/Raytracing.cpp +++ b/tests/pe/Raytracing.cpp @@ -233,7 +233,7 @@ ShadingParameters customBodyToShadingParams(const BodyID body) { } } -void RaytracerTest(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRACE_HASHGRIDS, const std::string& outputFolder = ".") { +void RaytracerTest(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRACE_HASHGRIDS) { WALBERLA_LOG_INFO("Raytracer"); shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>(); shared_ptr<BlockForest> forest = createBlockForest(AABB(0,0,0,10,10,10), Vector3<uint_t>(1,1,1), Vector3<bool>(false, false, false)); @@ -287,7 +287,6 @@ void RaytracerTest(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRAC //raytracer.setTBufferOutputDirectory("tbuffer"); //raytracer.setTBufferOutputEnabled(true); - raytracer.setImageOutputDirectory(outputFolder); raytracer.setImageOutputEnabled(true); //raytracer.setLocalImageOutputEnabled(true); @@ -336,7 +335,7 @@ ShadingParameters customSpheresBodyToShadingParams(const BodyID body) { } } -void RaytracerSpheresTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRACE_HASHGRIDS, const std::string& outputFolder = ".") { +void RaytracerSpheresTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRACE_HASHGRIDS) { WALBERLA_LOG_INFO("Raytracer Spheres Scene"); shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>(); shared_ptr<BlockForest> forest = createBlockForest(AABB(0,0,0,10,10,10), Vector3<uint_t>(1,1,1), Vector3<bool>(false, false, false)); @@ -373,7 +372,6 @@ void RaytracerSpheresTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytra } } - raytracer.setImageOutputDirectory(outputFolder); raytracer.setImageOutputEnabled(true); raytracer.setRaytracingAlgorithm(raytracingAlgorithm); @@ -389,7 +387,7 @@ ShadingParameters customHashGridsBodyToShadingParams(const BodyID body) { } -void HashGridsTest(Raytracer::Algorithm raytracingAlgorithm, const std::string& outputFolder, +void HashGridsTest(Raytracer::Algorithm raytracingAlgorithm, size_t boxes, size_t capsules, size_t spheres, size_t numberOfViews = 1, real_t boxLenMin = real_t(0.1), real_t boxLenMax = real_t(0.2), bool boxRotation = false, real_t capRadiusMin = real_t(0.1), real_t capRadiusMax = real_t(0.2), real_t capLenMin = real_t(0.1), real_t capLenMax = real_t(0.3), @@ -539,7 +537,6 @@ void HashGridsTest(Raytracer::Algorithm raytracingAlgorithm, const std::string& Color(real_t(0.2),real_t(0.2),real_t(0.2)), real_t(2), customHashGridsBodyToShadingParams); - raytracer.setImageOutputDirectory(outputFolder); raytracer.setImageOutputEnabled(true); raytracer.setFilenameTimestepWidth(12); WALBERLA_LOG_INFO("output #" << i << " to: " << (boxes*100000000 + capsules*10000 + spheres) << " in " << raytracer.getImageOutputDirectory()); @@ -561,7 +558,7 @@ ShadingParameters customArtifactsBodyToShadingParams(const BodyID body) { return defaultShadingParams(body); } -void raytraceArtifactsForest(Raytracer::Algorithm raytracingAlgorithm, const std::string& outputFolder, +void raytraceArtifactsForest(Raytracer::Algorithm raytracingAlgorithm, const shared_ptr<BlockStorage> forest, const BlockDataID storageID, const shared_ptr<BodyStorage> globalBodyStorage, const BlockDataID ccdID, @@ -584,7 +581,6 @@ void raytraceArtifactsForest(Raytracer::Algorithm raytracingAlgorithm, const std Color(real_t(0.2),real_t(0.2),real_t(0.2)), real_t(2), customArtifactsBodyToShadingParams); - raytracer.setImageOutputDirectory(outputFolder); raytracer.setImageOutputEnabled(true); raytracer.setFilenameTimestepWidth(timestepWidth); raytracer.setRaytracingAlgorithm(raytracingAlgorithm); @@ -597,7 +593,7 @@ void raytraceArtifactsForest(Raytracer::Algorithm raytracingAlgorithm, const std } } -void HashGridsArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, const std::string& outputFolder, +void HashGridsArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, size_t boxes, real_t boxLenMin = real_t(0.1), real_t boxLenMax = real_t(0.2)) { WALBERLA_LOG_INFO_ON_ROOT("HashGrids Artifacts Test - In negative Z direction"); @@ -632,13 +628,13 @@ void HashGridsArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, const std: WALBERLA_CHECK(box_ != NULL); } - raytraceArtifactsForest(raytracingAlgorithm, outputFolder, + raytraceArtifactsForest(raytracingAlgorithm, forest, storageID, globalBodyStorage, ccdID, Vec3(2, 2, 7), Vec3(2, 2, 4), Vec3(0,1,0), boxes, 3); } -void HashGridsFromNegativeArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, const std::string& outputFolder, +void HashGridsFromNegativeArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, size_t boxes, real_t boxLenMin = real_t(0.1), real_t boxLenMax = real_t(0.2)) { WALBERLA_LOG_INFO_ON_ROOT("HashGrids Artifacts Test - In positive Z direction"); @@ -677,13 +673,13 @@ void HashGridsFromNegativeArtifactsTest(Raytracer::Algorithm raytracingAlgorithm WALBERLA_CHECK(box_ != NULL); } - raytraceArtifactsForest(raytracingAlgorithm, outputFolder, + raytraceArtifactsForest(raytracingAlgorithm, forest, storageID, globalBodyStorage, ccdID, Vec3(2, 2, -3), Vec3(2, 2, 0), Vec3(0,1,0), boxes, 4); } -void HashGridsFromNegativeXArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, const std::string& outputFolder, +void HashGridsFromNegativeXArtifactsTest(Raytracer::Algorithm raytracingAlgorithm, size_t boxes, real_t boxLenMin = real_t(0.1), real_t boxLenMax = real_t(0.2)) { WALBERLA_LOG_INFO_ON_ROOT("HashGrids Artifacts Test - In positive X direction"); WALBERLA_LOG_INFO_ON_ROOT(" Generating " << boxes << " boxes"); @@ -720,7 +716,7 @@ void HashGridsFromNegativeXArtifactsTest(Raytracer::Algorithm raytracingAlgorith WALBERLA_CHECK(box_ != NULL); } - raytraceArtifactsForest(raytracingAlgorithm, outputFolder, + raytraceArtifactsForest(raytracingAlgorithm, forest, storageID, globalBodyStorage, ccdID, Vec3(-3, 2, 2), Vec3(0, 2, 2), Vec3(0,0,1), boxes, 6); @@ -731,7 +727,7 @@ Vec3 minCornerToGpos(const Vec3& minCorner, real_t lengths) { return minCorner + Vec3(lengths/2, lengths/2, lengths/2); } -void HashGridsTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRACE_HASHGRIDS, const std::string& outputFolder = ".") { +void HashGridsTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRACE_HASHGRIDS) { WALBERLA_LOG_INFO_ON_ROOT("HashGrids Test Scene"); shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>(); @@ -825,7 +821,6 @@ void HashGridsTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RA Color(real_t(0.2),real_t(0.2),real_t(0.2)), real_t(2)); - raytracer.setImageOutputDirectory(outputFolder); raytracer.setRaytracingAlgorithm(raytracingAlgorithm); raytracer.setImageOutputEnabled(true); raytracer.setFilenameTimestepWidth(1); @@ -857,19 +852,21 @@ int main( int argc, char** argv ) const Raytracer::Algorithm algorithm = Raytracer::RAYTRACE_COMPARE_BOTH_STRICTLY; - RaytracerTest(algorithm, outputFolder); - //RaytracerSpheresTestScene(algorithm, outputFolder); - HashGridsTestScene(algorithm, outputFolder); - HashGridsTest(algorithm, outputFolder, 50, 30, 130, 10); - HashGridsTest(algorithm, outputFolder, + RaytracerTest(algorithm); + //RaytracerSpheresTestScene(algorithm); + HashGridsTestScene(algorithm); + HashGridsTest(algorithm, + 50, 30, 130, + 10); + HashGridsTest(algorithm, 60, 60, 3, 1, real_t(0.1), real_t(0.3), true, real_t(0.1), real_t(0.2), real_t(0.1), real_t(0.2), real_t(0.5), real_t(0.6)); - HashGridsArtifactsTest(algorithm, outputFolder, 750, real_t(0.2), real_t(0.3)); - HashGridsFromNegativeArtifactsTest(algorithm, outputFolder, 750, real_t(0.2), real_t(0.3)); - HashGridsFromNegativeXArtifactsTest(algorithm, outputFolder, 750, real_t(0.2), real_t(0.3)); + HashGridsArtifactsTest(algorithm, 750, real_t(0.2), real_t(0.3)); + HashGridsFromNegativeArtifactsTest(algorithm, 750, real_t(0.2), real_t(0.3)); + HashGridsFromNegativeXArtifactsTest(algorithm, 750, real_t(0.2), real_t(0.3)); return EXIT_SUCCESS; }