GCC Code Coverage Report


Directory: ./
File: libs/viz/scene3d/factory/new.cpp
Date: 2024-04-17 17:28:21
Exec Total Coverage
Lines: 6 8 75.0%
Branches: 3 8 37.5%

Line Branch Exec Source
1 /************************************************************************
2 *
3 * Copyright (C) 2014-2023 IRCAD France
4 * Copyright (C) 2014-2021 IHU Strasbourg
5 *
6 * This file is part of Sight.
7 *
8 * Sight is free software: you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * Sight is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with Sight. If not, see <https://www.gnu.org/licenses/>.
20 *
21 ***********************************************************************/
22
23 #include "viz/scene3d/factory/new.hpp"
24
25 #include "viz/scene3d/light_adaptor.hpp"
26 #include "viz/scene3d/text.hpp"
27 #include "viz/scene3d/window_interactor.hpp"
28
29 namespace sight::viz::scene3d
30 {
31
32 namespace factory
33 {
34
35 //------------------------------------------------------------------------------
36
37 46 viz::scene3d::window_interactor::sptr make(const viz::scene3d::registry::key_t& _classname)
38 {
39
1/2
✓ Branch 2 taken 46 times.
✗ Branch 3 not taken.
92 return viz::scene3d::registry::get()->create(_classname);
40 }
41
42 } // namespace factory
43
44 namespace offscreen_interactor_mgr_factory
45 {
46
47 //------------------------------------------------------------------------------
48
49 viz::scene3d::window_interactor::sptr make(
50 const viz::scene3d::registry::key_t& _classname,
51 std::pair<unsigned int, unsigned int> _dims
52 )
53 {
54 return viz::scene3d::registry::get_offscreen_mgr()->create(_classname, _dims);
55 }
56
57 } // namespace offscreen_interactor_mgr_factory
58
59 namespace light_factory
60 {
61
62 //------------------------------------------------------------------------------
63
64 68 viz::scene3d::light_adaptor::sptr make(const viz::scene3d::registry::key_t& _classname)
65 {
66
1/2
✓ Branch 2 taken 68 times.
✗ Branch 3 not taken.
136 return viz::scene3d::registry::get_light_registry()->create(_classname);
67 }
68
69 } // namespace light_factory
70
71 namespace text_factory
72 {
73
74 //------------------------------------------------------------------------------
75
76 57 viz::scene3d::text::sptr make(
77 const viz::scene3d::registry::key_t& _classname,
78 const sight::viz::scene3d::layer::sptr& _layer
79 )
80 {
81
1/2
✓ Branch 2 taken 57 times.
✗ Branch 3 not taken.
114 return viz::scene3d::registry::get_text_registry()->create(_classname, _layer);
82 }
83
84 } // namespace text_factory
85
86 } // namespace sight::viz::scene3d
87