Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:03

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