Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:11:38

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2020 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/tools/output_test_stream.hpp>
0010 #include <boost/test/unit_test.hpp>
0011 
0012 #include "Acts/Visualization/ObjVisualization3D.hpp"
0013 
0014 #include <iostream>
0015 #include <string>
0016 #include <vector>
0017 
0018 #include "TrackingGeometryView3DBase.hpp"
0019 #include "Visualization3DTester.hpp"
0020 
0021 namespace Acts {
0022 namespace Test {
0023 
0024 BOOST_AUTO_TEST_SUITE(Visualization)
0025 
0026 /// This tests if the corresponding obj output is well formatted
0027 BOOST_AUTO_TEST_CASE(TrackingGeometryView3DObj) {
0028   ObjVisualization3D obj;
0029   // Standard test
0030   bool triangulate = false;
0031   auto objTest = TrackingGeometryView3DTest::run(obj, triangulate, "");
0032   auto objErrors = testObjString(objTest, triangulate);
0033   std::cout << "Surfaces Obj Test    : " << objTest.size()
0034             << " characters written with " << objErrors.size() << " errors."
0035             << std::endl;
0036   BOOST_CHECK(objErrors.empty());
0037   for (const auto& objerr : objErrors) {
0038     std::cout << objerr << std::endl;
0039   }
0040   // Triangular mesh test
0041   triangulate = true;
0042   auto objTest3M = TrackingGeometryView3DTest::run(obj, triangulate, "_3M");
0043   auto objErrors3M = testObjString(objTest3M, triangulate);
0044   std::cout << "Surfaces Obj Test 3M : " << objTest3M.size()
0045             << " characters written with " << objErrors3M.size() << " errors."
0046             << std::endl;
0047   BOOST_CHECK(objErrors3M.empty());
0048   for (const auto& objerr : objErrors3M) {
0049     std::cout << objerr << std::endl;
0050   }
0051 }
0052 
0053 /*
0054 /// This tests if the corresponding ply output is well formatted
0055 BOOST_AUTO_TEST_CASE(TrackingGeometryView3DPly) {
0056   PlyVisualization3D ply;
0057   // Standard test
0058   bool triangulate = false;
0059   auto plyTest = TrackingGeometryView3DTest::run(ply, triangulate, "");
0060   auto plyErrors = testPlyString(plyTest, triangulate);
0061   std::cout << "Surfaces Ply Test    : " << plyTest.size()
0062             << " characters written with " << plyErrors.size() << " errors."
0063             << std::endl;
0064   BOOST_CHECK_EQUAL(plyErrors.size(), 0);
0065   for (const auto& plyerr : plyErrors) {
0066     std::cout << plyerr << std::endl;
0067   }
0068   // Triangular mesh test
0069   triangulate = true;
0070   auto plyTest3M = TrackingGeometryView3DTest::run(ply, triangulate, "_3M");
0071   auto plyErrors3M = testPlyString(plyTest3M, triangulate);
0072   std::cout << "Surfaces Ply Test 3M : " << plyTest3M.size()
0073             << " characters written with " << plyErrors3M.size() << " errors."
0074             << std::endl;
0075   BOOST_CHECK_EQUAL(plyErrors3M.size(), 0);
0076   for (const auto& plyerr : plyErrors3M) {
0077     std::cout << plyerr << std::endl;
0078   }
0079 }
0080 */
0081 
0082 BOOST_AUTO_TEST_SUITE_END()
0083 
0084 }  // namespace Test
0085 }  // namespace Acts