GCC Code Coverage Report


./
File: modules/ui/__/viz/cross_type_action.hpp
Date: 2025-01-21 16:21:04
Lines:
2/2
100.0%
Functions:
2/6
33.3%
Branches:
5/11
45.5%

Line Branch Exec Source
1 /************************************************************************
2 *
3 * Copyright (C) 2009-2024 IRCAD France
4 * Copyright (C) 2012-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 #pragma once
24
25 #include <ui/__/action.hpp>
26
27 #include <map>
28 #include <string>
29
30 namespace sight::module::ui::viz
31 {
32
33 /**
34 * @brief This action allows change the cross type
35 */
36 class cross_type_action : public sight::ui::action
37 {
38 public:
39
40
4/9
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
6 SIGHT_DECLARE_SERVICE(cross_type_action, sight::ui::action);
41
42 /// Constructor. Do nothing.
43 cross_type_action() noexcept;
44
45 /// Destructor. Do nothing.
46
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
12 ~cross_type_action() noexcept override = default;
47
48 protected:
49
50 /// Starts action
51 void starting() override;
52
53 /// Stops action
54 void stopping() override;
55
56 /// Notifies message to change cross type
57 void updating() override;
58
59 /**
60 * @brief Configure action.
61 * @code{.xml}
62 <service type="ui::action" impl="::uiData::cross_type_action" auto_connect="false">
63 <crossType>hide</crossType>
64 </service>
65 @endcode
66 * - \b crossType : must be full, half or hide
67 */
68 void configuring() override;
69
70 void info(std::ostream& _sstream) override;
71
72 private:
73
74 static std::map<std::string, float> s_scale_conversion;
75 std::string m_cross_type;
76
77 using cross_type_modified_signal_t = core::com::signal<void (double)>;
78 cross_type_modified_signal_t::sptr m_sig_cross_type_modified; ///< Signal emitted when cross type is modified
79 };
80
81 } // namespace sight::module::ui::viz
82