EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceView3DTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SurfaceView3DTests.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #include <boost/test/tools/output_test_stream.hpp>
10 #include <boost/test/unit_test.hpp>
11 
15 
16 #include <fstream>
17 #include <iostream>
18 
19 #include "SurfaceView3DBase.hpp"
21 
22 namespace Acts {
23 namespace Test {
24 
25 BOOST_AUTO_TEST_SUITE(Visualization)
26 
27 
28 BOOST_AUTO_TEST_CASE(SurfaceView3DObj) {
30  // Standard test
31  bool triangulate = false;
32  auto objTest = SurfaceView3DTest::run(obj, triangulate, "");
33  auto objErrors = testObjString(objTest, triangulate);
34  std::cout << "Sufaces Obj Test : " << objTest.size()
35  << " characters written with " << objErrors.size() << " errors."
36  << std::endl;
37  BOOST_CHECK(objErrors.size() == 0);
38  for (auto objerr : objErrors) {
39  std::cout << objerr << std::endl;
40  }
41  // Triangular mesh test
42  triangulate = true;
43  auto objTest3M = SurfaceView3DTest::run(obj, triangulate, "_3M");
44  auto objErrors3M = testObjString(objTest3M, triangulate);
45  std::cout << "Sufaces Obj Test 3M : " << objTest3M.size()
46  << " characters written with " << objErrors3M.size() << " errors."
47  << std::endl;
48  BOOST_CHECK(objErrors3M.size() == 0);
49  for (auto objerr : objErrors3M) {
50  std::cout << objerr << std::endl;
51  }
52 }
53 
55 BOOST_AUTO_TEST_CASE(SurfaceView3DPly) {
57  // Standard test
58  bool triangulate = false;
59  auto plyTest = SurfaceView3DTest::run(ply, triangulate, "");
60  auto plyErrors = testPlyString(plyTest, triangulate);
61  std::cout << "Sufaces Ply Test : " << plyTest.size()
62  << " characters written with " << plyErrors.size() << " errors."
63  << std::endl;
64  BOOST_CHECK(plyErrors.size() == 0);
65  for (auto plyerr : plyErrors) {
66  std::cout << plyerr << std::endl;
67  }
68  // Triangular mesh test
69  triangulate = true;
70  auto plyTest3M = SurfaceView3DTest::run(ply, triangulate, "_3M");
71  auto plyErrors3M = testPlyString(plyTest3M, triangulate);
72  std::cout << "Sufaces Ply Test 3M : " << plyTest3M.size()
73  << " characters written with " << plyErrors3M.size() << " errors."
74  << std::endl;
75  BOOST_CHECK(plyErrors3M.size() == 0);
76  for (auto plyerr : plyErrors3M) {
77  std::cout << plyerr << std::endl;
78  }
79 }
80 
81 BOOST_AUTO_TEST_SUITE_END()
82 
83 } // namespace Test
84 } // namespace Acts