Line |
Branch |
Exec |
Source |
1 |
|
|
/************************************************************************ |
2 |
|
|
* |
3 |
|
|
* Copyright (C) 2014-2023 IRCAD France |
4 |
|
|
* Copyright (C) 2014-2019 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/registry/detail.hpp" |
24 |
|
|
|
25 |
|
|
#include <core/lazy_instantiator.hpp> |
26 |
|
|
|
27 |
|
|
namespace sight::viz::scene3d::registry |
28 |
|
|
{ |
29 |
|
|
|
30 |
|
|
struct render_ogre_registry_instantiator_tag {}; |
31 |
|
|
|
32 |
|
59 |
SPTR(type) get() |
33 |
|
|
{ |
34 |
|
59 |
using instantiator_t = core::lazy_instantiator<type, render_ogre_registry_instantiator_tag>; |
35 |
|
59 |
return instantiator_t::get_instance(); |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
struct interactor_offscreen_mgr_registry_instantiator_tag {}; |
39 |
|
|
|
40 |
|
13 |
SPTR(offscreen_mgr_t) get_offscreen_mgr() |
41 |
|
|
{ |
42 |
|
13 |
using instantiator_t = core::lazy_instantiator<offscreen_mgr_t, |
43 |
|
|
interactor_offscreen_mgr_registry_instantiator_tag>; |
44 |
|
13 |
return instantiator_t::get_instance(); |
45 |
|
|
} |
46 |
|
|
|
47 |
|
|
struct interactor_registry_instantiator_tag {}; |
48 |
|
|
|
49 |
|
✗ |
SPTR(interactor_factory_t) get_interactor_registry() |
50 |
|
|
{ |
51 |
|
✗ |
using instantiator_t = core::lazy_instantiator<interactor_factory_t, interactor_registry_instantiator_tag>; |
52 |
|
✗ |
return instantiator_t::get_instance(); |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
struct camera_registry_instantiator_tag {}; |
56 |
|
|
|
57 |
|
✗ |
SPTR(camera_factory_t) get_camera_registry() |
58 |
|
|
{ |
59 |
|
✗ |
using instantiator_t = core::lazy_instantiator<camera_factory_t, camera_registry_instantiator_tag>; |
60 |
|
✗ |
return instantiator_t::get_instance(); |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
struct light_registry_instantiator_tag {}; |
64 |
|
|
|
65 |
|
81 |
SPTR(light_factory_t) get_light_registry() |
66 |
|
|
{ |
67 |
|
81 |
using instantiator_t = core::lazy_instantiator<light_factory_t, light_registry_instantiator_tag>; |
68 |
|
81 |
return instantiator_t::get_instance(); |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
struct text_registry_instantiator_tag {}; |
72 |
|
|
|
73 |
|
74 |
SPTR(text_factory_t) get_text_registry() |
74 |
|
|
{ |
75 |
|
74 |
using instantiator_t = core::lazy_instantiator<text_factory_t, text_registry_instantiator_tag>; |
76 |
|
74 |
return instantiator_t::get_instance(); |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
} // namespace sight::viz::scene3d::registry |
80 |
|
|
|