GCC Code Coverage Report


Directory: ./
File: openvdb/openvdb/Types.h
Date: 2022-07-25 17:40:05
Exec Total Coverage
Lines: 30 30 100.0%
Functions: 4 20 20.0%
Branches: 533 1759 30.3%

Line Branch Exec Source
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
4 #ifndef OPENVDB_TYPES_HAS_BEEN_INCLUDED
5 #define OPENVDB_TYPES_HAS_BEEN_INCLUDED
6
7 #include "version.h"
8 #include "Platform.h"
9 #include "TypeList.h" // backwards compat
10
11 #ifdef OPENVDB_USE_IMATH_HALF
12 #ifdef OPENVDB_IMATH_VERSION
13 #include <Imath/half.h>
14 #else
15 #include <OpenEXR/half.h>
16 #endif
17 namespace openvdb {
18 OPENVDB_USE_VERSION_NAMESPACE
19 namespace OPENVDB_VERSION_NAME {
20 namespace math {
21 using half = half;
22 }}}
23 #else
24 #include <openvdb/math/Half.h>
25 namespace openvdb {
26 OPENVDB_USE_VERSION_NAMESPACE
27 namespace OPENVDB_VERSION_NAME {
28 namespace math {
29 using half = internal::half;
30 }}}
31 #endif
32
33 #include <openvdb/math/Math.h>
34 #include <openvdb/math/BBox.h>
35 #include <openvdb/math/Quat.h>
36 #include <openvdb/math/Vec2.h>
37 #include <openvdb/math/Vec3.h>
38 #include <openvdb/math/Vec4.h>
39 #include <openvdb/math/Mat3.h>
40 #include <openvdb/math/Mat4.h>
41 #include <openvdb/math/Coord.h>
42 #include <cstdint>
43 #include <memory>
44 #include <type_traits>
45
46
47 namespace openvdb {
48 OPENVDB_USE_VERSION_NAMESPACE
49 namespace OPENVDB_VERSION_NAME {
50
51 // One-dimensional scalar types
52 using Index32 = uint32_t;
53 using Index64 = uint64_t;
54 using Index = Index32;
55 using Int16 = int16_t;
56 using Int32 = int32_t;
57 using Int64 = int64_t;
58 using Int = Int32;
59 using Byte = unsigned char;
60 using Real = double;
61
62 // Two-dimensional vector types
63 using Vec2R = math::Vec2<Real>;
64 using Vec2I = math::Vec2<Index32>;
65 using Vec2f = math::Vec2<float>;
66 using Vec2H = math::Vec2<math::half>;
67 using math::Vec2i;
68 using math::Vec2s;
69 using math::Vec2d;
70
71 // Three-dimensional vector types
72 using Vec3R = math::Vec3<Real>;
73 using Vec3I = math::Vec3<Index32>;
74 using Vec3f = math::Vec3<float>;
75 using Vec3H = math::Vec3<math::half>;
76 using Vec3U8 = math::Vec3<uint8_t>;
77 using Vec3U16 = math::Vec3<uint16_t>;
78 using math::Vec3i;
79 using math::Vec3s;
80 using math::Vec3d;
81
82 using math::Coord;
83 using math::CoordBBox;
84 using BBoxd = math::BBox<Vec3d>;
85
86 // Four-dimensional vector types
87 using Vec4R = math::Vec4<Real>;
88 using Vec4I = math::Vec4<Index32>;
89 using Vec4f = math::Vec4<float>;
90 using Vec4H = math::Vec4<math::half>;
91 using math::Vec4i;
92 using math::Vec4s;
93 using math::Vec4d;
94
95 // Three-dimensional matrix types
96 using Mat3R = math::Mat3<Real>;
97 using math::Mat3s;
98 using math::Mat3d;
99
100 // Four-dimensional matrix types
101 using Mat4R = math::Mat4<Real>;
102 using math::Mat4s;
103 using math::Mat4d;
104
105 // Quaternions
106 using QuatR = math::Quat<Real>;
107 using math::Quats;
108 using math::Quatd;
109
110 // Dummy type for a voxel with a binary mask value, e.g. the active state
111 class ValueMask {};
112
113 // Use STL shared pointers from OpenVDB 4 on.
114 template<typename T> using SharedPtr = std::shared_ptr<T>;
115 template<typename T> using WeakPtr = std::weak_ptr<T>;
116
117 /// @brief Return a new shared pointer that points to the same object
118 /// as the given pointer but with possibly different <TT>const</TT>-ness.
119 /// @par Example:
120 /// @code
121 /// FloatGrid::ConstPtr grid = ...;
122 /// FloatGrid::Ptr nonConstGrid = ConstPtrCast<FloatGrid>(grid);
123 /// FloatGrid::ConstPtr constGrid = ConstPtrCast<const FloatGrid>(nonConstGrid);
124 /// @endcode
125 template<typename T, typename U> inline SharedPtr<T>
126 56078 ConstPtrCast(const SharedPtr<U>& ptr) { return std::const_pointer_cast<T, U>(ptr); }
127
128 /// @brief Return a new shared pointer that is either null or points to
129 /// the same object as the given pointer after a @c dynamic_cast.
130 /// @par Example:
131 /// @code
132 /// GridBase::ConstPtr grid = ...;
133 /// FloatGrid::ConstPtr floatGrid = DynamicPtrCast<const FloatGrid>(grid);
134 /// @endcode
135 template<typename T, typename U> inline SharedPtr<T>
136 27 DynamicPtrCast(const SharedPtr<U>& ptr) { return std::dynamic_pointer_cast<T, U>(ptr); }
137
138 /// @brief Return a new shared pointer that points to the same object
139 /// as the given pointer after a @c static_cast.
140 /// @par Example:
141 /// @code
142 /// FloatGrid::Ptr floatGrid = ...;
143 /// GridBase::Ptr grid = StaticPtrCast<GridBase>(floatGrid);
144 /// @endcode
145 template<typename T, typename U> inline SharedPtr<T>
146 1515739 StaticPtrCast(const SharedPtr<U>& ptr) { return std::static_pointer_cast<T, U>(ptr); }
147
148
149 ////////////////////////////////////////
150
151
152 /// @brief Integer wrapper, required to distinguish PointIndexGrid and
153 /// PointDataGrid from Int32Grid and Int64Grid
154 /// @note @c Kind is a dummy parameter used to create distinct types.
155 template<typename IntType_, Index Kind>
156 struct PointIndex
157 {
158 static_assert(std::is_integral<IntType_>::value, "PointIndex requires an integer value type");
159
160 using IntType = IntType_;
161
162
39/83
✓ Branch 1 taken 22227456 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 586 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1025 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 4097 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 4096 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 19 taken 4613 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 4821 times.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 4098 times.
✓ Branch 26 taken 1838592 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 7170 times.
✓ Branch 29 taken 114688 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 1792 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 4864 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 4609 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 4097 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 4097 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 256 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 4097 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 4096 times.
✗ Branch 53 not taken.
✗ Branch 55 not taken.
✓ Branch 56 taken 1 times.
✗ Branch 57 not taken.
✓ Branch 58 taken 4096 times.
✓ Branch 59 taken 1 times.
✗ Branch 60 not taken.
✓ Branch 61 taken 19968 times.
✓ Branch 62 taken 1 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 512 times.
✓ Branch 65 taken 1 times.
✗ Branch 66 not taken.
✓ Branch 67 taken 4096 times.
✓ Branch 68 taken 1 times.
✗ Branch 69 not taken.
✓ Branch 70 taken 4096 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 4096 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 4096 times.
✗ Branch 77 not taken.
✓ Branch 79 taken 4096 times.
✗ Branch 80 not taken.
✓ Branch 82 taken 4096 times.
✗ Branch 83 not taken.
✓ Branch 85 taken 4096 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 4096 times.
✗ Branch 89 not taken.
✓ Branch 91 taken 4096 times.
✗ Branch 92 not taken.
✓ Branch 94 taken 6144 times.
✗ Branch 95 not taken.
✓ Branch 97 taken 1 times.
✗ Branch 98 not taken.
✓ Branch 100 taken 1 times.
✗ Branch 101 not taken.
94249687 PointIndex(IntType i = IntType(0)): mIndex(i) {}
163
164 /// Explicit type conversion constructor
165
48/173
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 25 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 76 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✓ Branch 16 taken 16 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 3 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✓ Branch 37 taken 25 times.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✓ Branch 40 taken 76 times.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✓ Branch 45 taken 14 times.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✓ Branch 48 taken 16 times.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✓ Branch 51 taken 16 times.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✓ Branch 54 taken 16 times.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✓ Branch 60 taken 24 times.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✓ Branch 63 taken 25 times.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✓ Branch 69 taken 24 times.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✓ Branch 72 taken 78 times.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✓ Branch 85 taken 3 times.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✓ Branch 91 taken 3 times.
✗ Branch 92 not taken.
✓ Branch 94 taken 730 times.
✓ Branch 95 taken 1 times.
✗ Branch 96 not taken.
✓ Branch 97 taken 4 times.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 4 times.
✓ Branch 104 taken 1 times.
✗ Branch 105 not taken.
✓ Branch 106 taken 1 times.
✓ Branch 107 taken 1 times.
✗ Branch 108 not taken.
✓ Branch 109 taken 8 times.
✓ Branch 110 taken 1 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 6 times.
✓ Branch 113 taken 1 times.
✗ Branch 114 not taken.
✓ Branch 115 taken 15 times.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✓ Branch 118 taken 1654104 times.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
✓ Branch 121 taken 32 times.
✓ Branch 122 taken 1 times.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✓ Branch 125 taken 17 times.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✓ Branch 134 taken 1 times.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✓ Branch 137 taken 1 times.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✓ Branch 157 taken 4 times.
✗ Branch 158 not taken.
✓ Branch 160 taken 4 times.
✗ Branch 161 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 175 not taken.
✗ Branch 176 not taken.
✗ Branch 178 not taken.
✗ Branch 179 not taken.
✗ Branch 181 not taken.
✗ Branch 182 not taken.
✓ Branch 184 taken 3837100 times.
✗ Branch 185 not taken.
✗ Branch 189 not taken.
✗ Branch 190 not taken.
✓ Branch 193 taken 52 times.
✗ Branch 194 not taken.
5572229 template<typename T> explicit PointIndex(T i): mIndex(static_cast<IntType>(i)) {}
166
167
135/288
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 16 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 16 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 16 times.
✓ Branch 16 taken 4 times.
✓ Branch 17 taken 3851 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 40 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 8211 times.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 26 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 72 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✓ Branch 37 taken 65532 times.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✓ Branch 41 taken 2 times.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✓ Branch 52 taken 2 times.
✓ Branch 53 taken 16 times.
✓ Branch 54 taken 2 times.
✗ Branch 55 not taken.
✓ Branch 56 taken 2 times.
✓ Branch 57 taken 98417 times.
✓ Branch 58 taken 6 times.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✓ Branch 61 taken 29 times.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✓ Branch 64 taken 40000 times.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✓ Branch 69 taken 14 times.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✓ Branch 87 taken 819150 times.
✓ Branch 88 taken 20 times.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✓ Branch 91 taken 40109 times.
✓ Branch 92 taken 91 times.
✗ Branch 93 not taken.
✓ Branch 94 taken 1514 times.
✓ Branch 95 taken 1433 times.
✗ Branch 96 not taken.
✓ Branch 97 taken 10184 times.
✓ Branch 98 taken 305498 times.
✓ Branch 99 taken 13842 times.
✓ Branch 100 taken 18646 times.
✗ Branch 101 not taken.
✓ Branch 102 taken 1032 times.
✓ Branch 103 taken 31608 times.
✓ Branch 104 taken 297 times.
✓ Branch 105 taken 59306 times.
✓ Branch 106 taken 128137 times.
✓ Branch 107 taken 639300 times.
✓ Branch 108 taken 172811 times.
✓ Branch 109 taken 38824 times.
✗ Branch 110 not taken.
✓ Branch 111 taken 60027 times.
✗ Branch 112 not taken.
✓ Branch 113 taken 27 times.
✓ Branch 114 taken 60000 times.
✓ Branch 115 taken 27 times.
✗ Branch 116 not taken.
✓ Branch 117 taken 3647 times.
✗ Branch 118 not taken.
✓ Branch 119 taken 27 times.
✓ Branch 120 taken 20559 times.
✓ Branch 121 taken 27 times.
✗ Branch 122 not taken.
✓ Branch 123 taken 505130 times.
✓ Branch 124 taken 505206 times.
✓ Branch 125 taken 27 times.
✓ Branch 126 taken 1399 times.
✓ Branch 127 taken 168 times.
✗ Branch 128 not taken.
✓ Branch 129 taken 7 times.
✗ Branch 130 not taken.
✓ Branch 131 taken 7 times.
✓ Branch 132 taken 1 times.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✓ Branch 135 taken 511 times.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✗ Branch 156 not taken.
✗ Branch 157 not taken.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✓ Branch 168 taken 1 times.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✗ Branch 171 not taken.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 174 not taken.
✗ Branch 175 not taken.
✗ Branch 176 not taken.
✗ Branch 177 not taken.
✓ Branch 178 taken 1 times.
✓ Branch 179 taken 2656 times.
✓ Branch 180 taken 14610 times.
✓ Branch 181 taken 22669 times.
✓ Branch 182 taken 1430 times.
✓ Branch 183 taken 38 times.
✓ Branch 184 taken 8466 times.
✓ Branch 185 taken 1566 times.
✗ Branch 186 not taken.
✓ Branch 187 taken 68 times.
✓ Branch 188 taken 3682 times.
✓ Branch 189 taken 12 times.
✓ Branch 190 taken 220130 times.
✓ Branch 191 taken 447 times.
✓ Branch 192 taken 64 times.
✓ Branch 193 taken 11 times.
✓ Branch 194 taken 90005 times.
✗ Branch 195 not taken.
✓ Branch 196 taken 2822 times.
✗ Branch 197 not taken.
✓ Branch 198 taken 372519 times.
✓ Branch 199 taken 731 times.
✓ Branch 200 taken 56 times.
✓ Branch 201 taken 9 times.
✓ Branch 202 taken 121 times.
✓ Branch 203 taken 1 times.
✓ Branch 204 taken 1 times.
✓ Branch 205 taken 506 times.
✓ Branch 206 taken 63462 times.
✓ Branch 207 taken 1390136 times.
✓ Branch 208 taken 57 times.
✓ Branch 209 taken 8 times.
✗ Branch 210 not taken.
✓ Branch 211 taken 32 times.
✗ Branch 212 not taken.
✗ Branch 213 not taken.
✓ Branch 214 taken 127872 times.
✓ Branch 215 taken 137 times.
✓ Branch 216 taken 56 times.
✓ Branch 217 taken 8 times.
✓ Branch 218 taken 31755 times.
✓ Branch 219 taken 196 times.
✓ Branch 220 taken 4088 times.
✗ Branch 221 not taken.
✓ Branch 222 taken 174342 times.
✓ Branch 223 taken 8349 times.
✓ Branch 224 taken 59 times.
✓ Branch 225 taken 12 times.
✓ Branch 226 taken 12264 times.
✓ Branch 227 taken 463 times.
✓ Branch 228 taken 76 times.
✓ Branch 229 taken 3 times.
✓ Branch 230 taken 447980 times.
✓ Branch 231 taken 757 times.
✓ Branch 232 taken 56 times.
✓ Branch 233 taken 9 times.
✓ Branch 234 taken 139776 times.
✓ Branch 235 taken 192 times.
✓ Branch 236 taken 1 times.
✗ Branch 237 not taken.
✓ Branch 238 taken 220615 times.
✓ Branch 239 taken 440 times.
✓ Branch 240 taken 56 times.
✓ Branch 241 taken 8 times.
✓ Branch 242 taken 98112 times.
✓ Branch 243 taken 192 times.
✗ Branch 244 not taken.
✓ Branch 245 taken 1 times.
✓ Branch 246 taken 794081 times.
✓ Branch 247 taken 3744 times.
✓ Branch 248 taken 2338 times.
✓ Branch 249 taken 2 times.
✗ Branch 250 not taken.
✓ Branch 251 taken 4 times.
✓ Branch 252 taken 3 times.
✓ Branch 253 taken 1 times.
✗ Branch 254 not taken.
✓ Branch 255 taken 3 times.
✓ Branch 256 taken 3 times.
✗ Branch 257 not taken.
✗ Branch 258 not taken.
✓ Branch 259 taken 3 times.
✓ Branch 260 taken 3 times.
✗ Branch 261 not taken.
✗ Branch 262 not taken.
✗ Branch 263 not taken.
✗ Branch 264 not taken.
✗ Branch 265 not taken.
✗ Branch 266 not taken.
✗ Branch 267 not taken.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✗ Branch 275 not taken.
✗ Branch 276 not taken.
✗ Branch 277 not taken.
✓ Branch 278 taken 23 times.
✗ Branch 279 not taken.
✓ Branch 282 taken 1 times.
✓ Branch 283 taken 38799 times.
✓ Branch 286 taken 927432 times.
✓ Branch 287 taken 79775 times.
✓ Branch 288 taken 232 times.
✓ Branch 289 taken 2875 times.
✗ Branch 291 not taken.
✗ Branch 292 not taken.
99126785 operator IntType() const { return mIndex; }
168
169 /// Needed to support the <tt>(zeroVal<PointIndex>() + val)</tt> idiom.
170 template<typename T>
171 1272310 PointIndex operator+(T x) { return PointIndex(mIndex + IntType(x)); }
172
173 private:
174 IntType mIndex;
175 };
176
177
178 using PointIndex32 = PointIndex<Index32, 0>;
179 using PointIndex64 = PointIndex<Index64, 0>;
180
181 using PointDataIndex32 = PointIndex<Index32, 1>;
182 using PointDataIndex64 = PointIndex<Index64, 1>;
183
184
185 ////////////////////////////////////////
186
187
188 /// @brief Helper metafunction used to determine if the first template
189 /// parameter is a specialization of the class template given in the second
190 /// template parameter
191 template <typename T, template <typename...> class Template>
192 struct IsSpecializationOf: public std::false_type {};
193
194 template <typename... Args, template <typename...> class Template>
195 struct IsSpecializationOf<Template<Args...>, Template>: public std::true_type {};
196
197
198 ////////////////////////////////////////
199
200
201 template<typename T, bool = IsSpecializationOf<T, math::Vec2>::value ||
202 IsSpecializationOf<T, math::Vec3>::value ||
203 IsSpecializationOf<T, math::Vec4>::value>
204 struct VecTraits
205 {
206 static const bool IsVec = true;
207 static const int Size = T::size;
208 using ElementType = typename T::ValueType;
209 };
210
211 template<typename T>
212 struct VecTraits<T, false>
213 {
214 static const bool IsVec = false;
215 static const int Size = 1;
216 using ElementType = T;
217 };
218
219 template<typename T, bool = IsSpecializationOf<T, math::Quat>::value>
220 struct QuatTraits
221 {
222 static const bool IsQuat = true;
223 static const int Size = T::size;
224 using ElementType = typename T::ValueType;
225 };
226
227 template<typename T>
228 struct QuatTraits<T, false>
229 {
230 static const bool IsQuat = false;
231 static const int Size = 1;
232 using ElementType = T;
233 };
234
235 template<typename T, bool = IsSpecializationOf<T, math::Mat3>::value ||
236 IsSpecializationOf<T, math::Mat4>::value>
237 struct MatTraits
238 {
239 static const bool IsMat = true;
240 static const int Size = T::size;
241 using ElementType = typename T::ValueType;
242 };
243
244 template<typename T>
245 struct MatTraits<T, false>
246 {
247 static const bool IsMat = false;
248 static const int Size = 1;
249 using ElementType = T;
250 };
251
252 template<typename T, bool = VecTraits<T>::IsVec ||
253 QuatTraits<T>::IsQuat ||
254 MatTraits<T>::IsMat>
255 struct ValueTraits
256 {
257 static const bool IsVec = VecTraits<T>::IsVec;
258 static const bool IsQuat = QuatTraits<T>::IsQuat;
259 static const bool IsMat = MatTraits<T>::IsMat;
260 static const bool IsScalar = false;
261 static const int Size = T::size;
262 static const int Elements = IsMat ? Size*Size : Size;
263 using ElementType = typename T::ValueType;
264 };
265
266 template<typename T>
267 struct ValueTraits<T, false>
268 {
269 static const bool IsVec = false;
270 static const bool IsQuat = false;
271 static const bool IsMat = false;
272 static const bool IsScalar = true;
273 static const int Size = 1;
274 static const int Elements = 1;
275 using ElementType = T;
276 };
277
278
279 /// @brief Conversion classes for changing the underlying type of VDB types
280 /// @{
281 template<typename T, typename SubT> struct ConvertElementType { using Type = SubT; };
282 template<typename T, typename SubT> struct ConvertElementType<math::Vec2<T>, SubT> { using Type = math::Vec2<SubT>; };
283 template<typename T, typename SubT> struct ConvertElementType<math::Vec3<T>, SubT> { using Type = math::Vec3<SubT>; };
284 template<typename T, typename SubT> struct ConvertElementType<math::Vec4<T>, SubT> { using Type = math::Vec4<SubT>; };
285 template<typename T, typename SubT> struct ConvertElementType<math::Quat<T>, SubT> { using Type = math::Quat<SubT>; };
286 template<typename T, typename SubT> struct ConvertElementType<math::Mat3<T>, SubT> { using Type = math::Mat3<SubT>; };
287 template<typename T, typename SubT> struct ConvertElementType<math::Mat4<T>, SubT> { using Type = math::Mat4<SubT>; };
288 /// @}
289
290 namespace types_internal
291 {
292 template <size_t Bits, bool Signed> struct int_t;
293 template <> struct int_t<8ul, true> { using type = int8_t; };
294 template <> struct int_t<16ul, true> { using type = int16_t; };
295 template <> struct int_t<32ul, true> { using type = int32_t; };
296 template <> struct int_t<64ul, true> { using type = int64_t; };
297 template <> struct int_t<8ul, false> { using type = uint8_t; };
298 template <> struct int_t<16ul, false> { using type = uint16_t; };
299 template <> struct int_t<32ul, false> { using type = uint32_t; };
300 template <> struct int_t<64ul, false> { using type = uint64_t; };
301
302 template <size_t Bits> struct flt_t;
303 template <> struct flt_t<16ul> { using type = math::half; };
304 template <> struct flt_t<32ul> { using type = float; };
305 template <> struct flt_t<64ul> { using type = double; };
306 }
307
308 /// @brief Promotion classes which provide an interface for elevating and
309 /// demoting a scalar or VDB type to a higher or lower precision. Integer
310 /// types preserve their sign. Types promotion are only valid between
311 /// 8 to 64 bits (long doubles are not supported).
312 /// @{
313 template<typename T>
314 struct PromoteType
315 {
316 private:
317 template <size_t bits>
318 using TypeT = typename std::conditional<std::is_integral<T>::value,
319 types_internal::int_t<bits, std::is_signed<T>::value>,
320 types_internal::flt_t<std::max(size_t(16), bits)>>::type;
321 public:
322 static_assert(sizeof(T) <= 8ul, "Unsupported source type for promotion");
323
324 #define OPENVDB_TARGET_BITS(SHIFT, PROMOTE) \
325 std::max(size_t(8), \
326 std::min(size_t(64), (PROMOTE ? size_t(8)*(sizeof(T)<<SHIFT) : \
327 size_t(8)*(sizeof(T)>>SHIFT))))
328 template <size_t Shift = ~0UL> using Promote = typename TypeT<OPENVDB_TARGET_BITS(Shift, true)>::type;
329 template <size_t Shift = ~0UL> using Demote = typename TypeT<OPENVDB_TARGET_BITS(Shift, false)>::type;
330 #undef OPENVDB_TARGET_BITS
331
332 using Highest = typename TypeT<64ul>::type;
333 using Lowest = typename TypeT<8ul>::type;
334 using Next = Promote<1>;
335 using Previous = Demote<1>;
336 };
337
338 template <typename T, template <typename> class ContainerT>
339 struct PromoteContainerType
340 {
341 template <size_t Shift = ~0UL> using Promote = ContainerT<typename PromoteType<T>::template Promote<Shift>>;
342 template <size_t Shift = ~0UL> using Demote = ContainerT<typename PromoteType<T>::template Demote<Shift>>;
343 using Highest = ContainerT<typename PromoteType<T>::Highest>;
344 using Lowest = ContainerT<typename PromoteType<T>::Lowest>;
345 using Next = ContainerT<typename PromoteType<T>::Next>;
346 using Previous = ContainerT<typename PromoteType<T>::Previous>;
347 };
348
349 template<typename T> struct PromoteType<math::Vec2<T>> : public PromoteContainerType<T, math::Vec2> {};
350 template<typename T> struct PromoteType<math::Vec3<T>> : public PromoteContainerType<T, math::Vec3> {};
351 template<typename T> struct PromoteType<math::Vec4<T>> : public PromoteContainerType<T, math::Vec4> {};
352 template<typename T> struct PromoteType<math::Quat<T>> : public PromoteContainerType<T, math::Quat> {};
353 template<typename T> struct PromoteType<math::Mat3<T>> : public PromoteContainerType<T, math::Mat3> {};
354 template<typename T> struct PromoteType<math::Mat4<T>> : public PromoteContainerType<T, math::Mat4> {};
355 /// @}
356
357
358 ////////////////////////////////////////
359
360
361 /// @brief CanConvertType<FromType, ToType>::value is @c true if a value
362 /// of type @a ToType can be constructed from a value of type @a FromType.
363 template<typename FromType, typename ToType>
364 struct CanConvertType { enum { value = std::is_constructible<ToType, FromType>::value }; };
365
366 // Specializations for vector types, which can be constructed from values
367 // of their own ValueTypes (or values that can be converted to their ValueTypes),
368 // but only explicitly
369 template<typename T> struct CanConvertType<T, math::Vec2<T> > { enum { value = true }; };
370 template<typename T> struct CanConvertType<T, math::Vec3<T> > { enum { value = true }; };
371 template<typename T> struct CanConvertType<T, math::Vec4<T> > { enum { value = true }; };
372 template<typename T> struct CanConvertType<math::Vec2<T>, math::Vec2<T> > { enum {value = true}; };
373 template<typename T> struct CanConvertType<math::Vec3<T>, math::Vec3<T> > { enum {value = true}; };
374 template<typename T> struct CanConvertType<math::Vec4<T>, math::Vec4<T> > { enum {value = true}; };
375 template<typename T0, typename T1>
376 struct CanConvertType<T0, math::Vec2<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
377 template<typename T0, typename T1>
378 struct CanConvertType<T0, math::Vec3<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
379 template<typename T0, typename T1>
380 struct CanConvertType<T0, math::Vec4<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
381 template<> struct CanConvertType<PointIndex32, PointDataIndex32> { enum {value = true}; };
382 template<> struct CanConvertType<PointDataIndex32, PointIndex32> { enum {value = true}; };
383 template<typename T>
384 struct CanConvertType<T, ValueMask> { enum {value = CanConvertType<T, bool>::value}; };
385 template<typename T>
386 struct CanConvertType<ValueMask, T> { enum {value = CanConvertType<bool, T>::value}; };
387
388
389 ////////////////////////////////////////
390
391
392 /// @brief CopyConstness<T1, T2>::Type is either <tt>const T2</tt>
393 /// or @c T2 with no @c const qualifier, depending on whether @c T1 is @c const.
394 /// @details For example,
395 /// - CopyConstness<int, int>::Type is @c int
396 /// - CopyConstness<int, const int>::Type is @c int
397 /// - CopyConstness<const int, int>::Type is <tt>const int</tt>
398 /// - CopyConstness<const int, const int>::Type is <tt>const int</tt>
399 template<typename FromType, typename ToType> struct CopyConstness {
400 using Type = typename std::remove_const<ToType>::type;
401 };
402
403 /// @cond OPENVDB_DOCS_INTERNAL
404 template<typename FromType, typename ToType> struct CopyConstness<const FromType, ToType> {
405 using Type = const ToType;
406 };
407 /// @endcond
408
409
410 ////////////////////////////////////////
411
412
413 // Add new items to the *end* of this list, and update NUM_GRID_CLASSES.
414 enum GridClass {
415 GRID_UNKNOWN = 0,
416 GRID_LEVEL_SET,
417 GRID_FOG_VOLUME,
418 GRID_STAGGERED
419 };
420 enum { NUM_GRID_CLASSES = GRID_STAGGERED + 1 };
421
422 static const Real LEVEL_SET_HALF_WIDTH = 3;
423
424 /// The type of a vector determines how transforms are applied to it:
425 /// <dl>
426 /// <dt><b>Invariant</b>
427 /// <dd>Does not transform (e.g., tuple, uvw, color)
428 ///
429 /// <dt><b>Covariant</b>
430 /// <dd>Apply inverse-transpose transformation: @e w = 0, ignores translation
431 /// (e.g., gradient/normal)
432 ///
433 /// <dt><b>Covariant Normalize</b>
434 /// <dd>Apply inverse-transpose transformation: @e w = 0, ignores translation,
435 /// vectors are renormalized (e.g., unit normal)
436 ///
437 /// <dt><b>Contravariant Relative</b>
438 /// <dd>Apply "regular" transformation: @e w = 0, ignores translation
439 /// (e.g., displacement, velocity, acceleration)
440 ///
441 /// <dt><b>Contravariant Absolute</b>
442 /// <dd>Apply "regular" transformation: @e w = 1, vector translates (e.g., position)
443 /// </dl>
444 enum VecType {
445 VEC_INVARIANT = 0,
446 VEC_COVARIANT,
447 VEC_COVARIANT_NORMALIZE,
448 VEC_CONTRAVARIANT_RELATIVE,
449 VEC_CONTRAVARIANT_ABSOLUTE
450 };
451 enum { NUM_VEC_TYPES = VEC_CONTRAVARIANT_ABSOLUTE + 1 };
452
453
454 /// Specify how grids should be merged during certain (typically multithreaded) operations.
455 /// <dl>
456 /// <dt><b>MERGE_ACTIVE_STATES</b>
457 /// <dd>The output grid is active wherever any of the input grids is active.
458 ///
459 /// <dt><b>MERGE_NODES</b>
460 /// <dd>The output grid's tree has a node wherever any of the input grids' trees
461 /// has a node, regardless of any active states.
462 ///
463 /// <dt><b>MERGE_ACTIVE_STATES_AND_NODES</b>
464 /// <dd>The output grid is active wherever any of the input grids is active,
465 /// and its tree has a node wherever any of the input grids' trees has a node.
466 /// </dl>
467 enum MergePolicy {
468 MERGE_ACTIVE_STATES = 0,
469 MERGE_NODES,
470 MERGE_ACTIVE_STATES_AND_NODES
471 };
472
473
474 ////////////////////////////////////////
475
476
477
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
6 template<typename T> const char* typeNameAsString() { return typeid(T).name(); }
478 template<> inline const char* typeNameAsString<bool>() { return "bool"; }
479 template<> inline const char* typeNameAsString<ValueMask>() { return "mask"; }
480 template<> inline const char* typeNameAsString<math::half>() { return "half"; }
481 template<> inline const char* typeNameAsString<float>() { return "float"; }
482 template<> inline const char* typeNameAsString<double>() { return "double"; }
483 template<> inline const char* typeNameAsString<int8_t>() { return "int8"; }
484 template<> inline const char* typeNameAsString<uint8_t>() { return "uint8"; }
485 template<> inline const char* typeNameAsString<int16_t>() { return "int16"; }
486 template<> inline const char* typeNameAsString<uint16_t>() { return "uint16"; }
487 template<> inline const char* typeNameAsString<int32_t>() { return "int32"; }
488 template<> inline const char* typeNameAsString<uint32_t>() { return "uint32"; }
489 template<> inline const char* typeNameAsString<int64_t>() { return "int64"; }
490 template<> inline const char* typeNameAsString<Vec2i>() { return "vec2i"; }
491 template<> inline const char* typeNameAsString<Vec2s>() { return "vec2s"; }
492 template<> inline const char* typeNameAsString<Vec2d>() { return "vec2d"; }
493 template<> inline const char* typeNameAsString<Vec3U8>() { return "vec3u8"; }
494 template<> inline const char* typeNameAsString<Vec3U16>() { return "vec3u16"; }
495 template<> inline const char* typeNameAsString<Vec3i>() { return "vec3i"; }
496 template<> inline const char* typeNameAsString<Vec3f>() { return "vec3s"; }
497 template<> inline const char* typeNameAsString<Vec3d>() { return "vec3d"; }
498 template<> inline const char* typeNameAsString<Vec4i>() { return "vec4i"; }
499 template<> inline const char* typeNameAsString<Vec4f>() { return "vec4s"; }
500 template<> inline const char* typeNameAsString<Vec4d>() { return "vec4d"; }
501 template<> inline const char* typeNameAsString<std::string>() { return "string"; }
502 template<> inline const char* typeNameAsString<Mat3s>() { return "mat3s"; }
503 template<> inline const char* typeNameAsString<Mat3d>() { return "mat3d"; }
504 template<> inline const char* typeNameAsString<Mat4s>() { return "mat4s"; }
505 template<> inline const char* typeNameAsString<Mat4d>() { return "mat4d"; }
506 template<> inline const char* typeNameAsString<math::Quats>() { return "quats"; }
507 template<> inline const char* typeNameAsString<math::Quatd>() { return "quatd"; }
508 template<> inline const char* typeNameAsString<PointIndex32>() { return "ptidx32"; }
509 template<> inline const char* typeNameAsString<PointIndex64>() { return "ptidx64"; }
510 template<> inline const char* typeNameAsString<PointDataIndex32>() { return "ptdataidx32"; }
511 template<> inline const char* typeNameAsString<PointDataIndex64>() { return "ptdataidx64"; }
512
513
514 ////////////////////////////////////////
515
516
517 /// @brief This struct collects both input and output arguments to "grid combiner" functors
518 /// used with the tree::TypedGrid::combineExtended() and combine2Extended() methods.
519 /// AValueType and BValueType are the value types of the two grids being combined.
520 ///
521 /// @see openvdb/tree/Tree.h for usage information.
522 ///
523 /// Setter methods return references to this object, to facilitate the following usage:
524 /// @code
525 /// CombineArgs<float> args;
526 /// myCombineOp(args.setARef(aVal).setBRef(bVal).setAIsActive(true).setBIsActive(false));
527 /// @endcode
528 template<typename AValueType, typename BValueType = AValueType>
529 class CombineArgs
530 {
531 public:
532 using AValueT = AValueType;
533 using BValueT = BValueType;
534
535 870 CombineArgs()
536 : mAValPtr(nullptr)
537 , mBValPtr(nullptr)
538 , mResultValPtr(&mResultVal)
539 , mAIsActive(false)
540 , mBIsActive(false)
541
12/21
✓ Branch 0 taken 370 times.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 303 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 2 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 2 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 14 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 13 times.
✗ Branch 26 not taken.
870 , mResultIsActive(false)
542 {
543 }
544
545 /// Use this constructor when the result value is stored externally.
546 300017 CombineArgs(const AValueType& a, const BValueType& b, AValueType& result,
547 bool aOn = false, bool bOn = false)
548 : mAValPtr(&a)
549 , mBValPtr(&b)
550 , mResultValPtr(&result)
551 , mAIsActive(aOn)
552 300017 , mBIsActive(bOn)
553 {
554 this->updateResultActive();
555 }
556
557 /// Use this constructor when the result value should be stored in this struct.
558 CombineArgs(const AValueType& a, const BValueType& b, bool aOn = false, bool bOn = false)
559 : mAValPtr(&a)
560 , mBValPtr(&b)
561 , mResultValPtr(&mResultVal)
562 , mAIsActive(aOn)
563 , mBIsActive(bOn)
564 {
565 this->updateResultActive();
566 }
567
568 /// Get the A input value.
569
4/4
✓ Branch 0 taken 74743 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 74743 times.
✓ Branch 3 taken 7 times.
1813784 const AValueType& a() const { return *mAValPtr; }
570 /// Get the B input value.
571
11/48
✓ Branch 0 taken 71564 times.
✓ Branch 1 taken 572868 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 37375 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 37375 times.
✓ Branch 16 taken 74743 times.
✓ Branch 17 taken 7 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 37375 times.
✓ Branch 27 taken 37375 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✓ Branch 52 taken 37375 times.
✓ Branch 53 taken 37375 times.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 1 times.
1096005 const BValueType& b() const { return *mBValPtr; }
572 //@{
573 /// Get the output value.
574 const AValueType& result() const { return *mResultValPtr; }
575
19/126
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 19805 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 12276 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 163835 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 98301 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✓ Branch 37 taken 4095 times.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✓ Branch 43 taken 4076 times.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✓ Branch 50 taken 8190 times.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✓ Branch 60 taken 1 times.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✓ Branch 67 taken 1 times.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✓ Branch 74 taken 1 times.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✓ Branch 81 taken 1 times.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✓ Branch 85 taken 36862 times.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✓ Branch 91 taken 81907 times.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✓ Branch 97 taken 53235 times.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 103 not taken.
✓ Branch 104 taken 65534 times.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✓ Branch 111 taken 32767 times.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✓ Branch 117 taken 393204 times.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 425971 times.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
1547552 AValueType& result() { return *mResultValPtr; }
576 //@}
577
578 /// Set the output value.
579 1701666 CombineArgs& setResult(const AValueType& val) { *mResultValPtr = val; return *this; }
580
581 /// Redirect the A value to a new external source.
582
0/26
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
2000625 CombineArgs& setARef(const AValueType& a) { mAValPtr = &a; return *this; }
583 /// Redirect the B value to a new external source.
584
10/54
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✓ Branch 56 taken 1 times.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✓ Branch 61 taken 2 times.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✓ Branch 68 taken 1 times.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✓ Branch 73 taken 12 times.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✓ Branch 78 taken 13 times.
✗ Branch 79 not taken.
1535273 CombineArgs& setBRef(const BValueType& b) { mBValPtr = &b; return *this; }
585 /// Redirect the result value to a new external destination.
586
2/4
✓ Branch 15 taken 10 times.
✓ Branch 16 taken 1014 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
369152 CombineArgs& setResultRef(AValueType& val) { mResultValPtr = &val; return *this; }
587
588 /// @return true if the A value is active
589
4/4
✓ Branch 0 taken 74743 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 74743 times.
✓ Branch 3 taken 7 times.
450541 bool aIsActive() const { return mAIsActive; }
590 /// @return true if the B value is active
591
4/4
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 74740 times.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 74740 times.
450527 bool bIsActive() const { return mBIsActive; }
592 /// @return true if the output value is active
593
48/164
✓ Branch 0 taken 3033 times.
✓ Branch 1 taken 3623 times.
✓ Branch 2 taken 70148 times.
✓ Branch 3 taken 119292 times.
✓ Branch 4 taken 62309 times.
✓ Branch 5 taken 92827 times.
✓ Branch 6 taken 6 times.
✓ Branch 7 taken 20314 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 12276 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 3 times.
✓ Branch 13 taken 164344 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 98301 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 3 times.
✓ Branch 19 taken 509 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 4095 times.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✓ Branch 31 taken 4095 times.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 5 times.
✓ Branch 37 taken 4602 times.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✓ Branch 42 taken 4662 times.
✓ Branch 43 taken 9673 times.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✓ Branch 48 taken 10 times.
✓ Branch 49 taken 1014 times.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✓ Branch 54 taken 10 times.
✓ Branch 55 taken 1014 times.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 32767 times.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✓ Branch 65 taken 32767 times.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✓ Branch 71 taken 32767 times.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✓ Branch 77 taken 32767 times.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✓ Branch 82 taken 3 times.
✓ Branch 83 taken 509 times.
✗ Branch 84 not taken.
✓ Branch 85 taken 4095 times.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✓ Branch 88 taken 60 times.
✓ Branch 89 taken 6084 times.
✗ Branch 90 not taken.
✓ Branch 91 taken 4076 times.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✓ Branch 94 taken 65 times.
✓ Branch 95 taken 6591 times.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✓ Branch 101 taken 8190 times.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 8190 times.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✓ Branch 117 taken 4095 times.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 49140 times.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✓ Branch 129 taken 53235 times.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✓ Branch 133 taken 32767 times.
✗ Branch 134 not taken.
✓ Branch 135 taken 65534 times.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✓ Branch 139 taken 32767 times.
✗ Branch 140 not taken.
✓ Branch 141 taken 65534 times.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✓ Branch 147 taken 32767 times.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✓ Branch 153 taken 393204 times.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✗ Branch 156 not taken.
✗ Branch 157 not taken.
✗ Branch 158 not taken.
✓ Branch 159 taken 425971 times.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
2000113 bool resultIsActive() const { return mResultIsActive; }
594
595 /// Set the active state of the A value.
596 1024 CombineArgs& setAIsActive(bool b) { mAIsActive = b; updateResultActive(); return *this; }
597 /// Set the active state of the B value.
598 1656722 CombineArgs& setBIsActive(bool b) { mBIsActive = b; updateResultActive(); return *this; }
599 /// Set the active state of the output value.
600
0/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
300529 CombineArgs& setResultIsActive(bool b) { mResultIsActive = b; return *this; }
601
602 protected:
603 /// By default, the result value is active if either of the input values is active,
604 /// but this behavior can be overridden by calling setResultIsActive().
605
194/726
✓ Branch 0 taken 5548 times.
✓ Branch 1 taken 1620 times.
✓ Branch 2 taken 3966 times.
✓ Branch 3 taken 1634 times.
✓ Branch 4 taken 358 times.
✓ Branch 5 taken 5190 times.
✓ Branch 6 taken 1568 times.
✓ Branch 7 taken 3571 times.
✓ Branch 8 taken 1517 times.
✓ Branch 10 taken 370 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 119292 times.
✓ Branch 13 taken 70148 times.
✓ Branch 14 taken 119292 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 303 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 92827 times.
✓ Branch 20 taken 62309 times.
✓ Branch 21 taken 92827 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 20315 times.
✓ Branch 25 taken 5 times.
✓ Branch 26 taken 20312 times.
✓ Branch 27 taken 3 times.
✓ Branch 29 taken 20315 times.
✓ Branch 30 taken 5 times.
✓ Branch 31 taken 20314 times.
✓ Branch 32 taken 1 times.
✓ Branch 34 taken 12276 times.
✗ Branch 35 not taken.
✓ Branch 36 taken 12276 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 12276 times.
✗ Branch 39 not taken.
✓ Branch 41 taken 300017 times.
✗ Branch 42 not taken.
✓ Branch 43 taken 229869 times.
✓ Branch 44 taken 70148 times.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✓ Branch 48 taken 510 times.
✓ Branch 49 taken 2 times.
✓ Branch 50 taken 509 times.
✓ Branch 51 taken 1 times.
✓ Branch 52 taken 163835 times.
✓ Branch 53 taken 510 times.
✓ Branch 54 taken 163837 times.
✓ Branch 55 taken 509 times.
✓ Branch 56 taken 1 times.
✓ Branch 57 taken 163835 times.
✗ Branch 58 not taken.
✓ Branch 59 taken 163835 times.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✓ Branch 62 taken 98301 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 98301 times.
✗ Branch 65 not taken.
✓ Branch 66 taken 98301 times.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✓ Branch 72 taken 510 times.
✓ Branch 73 taken 2 times.
✓ Branch 74 taken 509 times.
✓ Branch 75 taken 1 times.
✗ Branch 76 not taken.
✓ Branch 77 taken 510 times.
✓ Branch 78 taken 2 times.
✓ Branch 79 taken 509 times.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✓ Branch 96 taken 4095 times.
✗ Branch 97 not taken.
✓ Branch 98 taken 4095 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 4095 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 4095 times.
✗ Branch 104 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 4095 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 4095 times.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✓ Branch 128 taken 4095 times.
✗ Branch 129 not taken.
✓ Branch 130 taken 4095 times.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✓ Branch 144 taken 507 times.
✓ Branch 145 taken 5 times.
✓ Branch 146 taken 505 times.
✓ Branch 147 taken 2 times.
✗ Branch 148 not taken.
✓ Branch 149 taken 507 times.
✓ Branch 150 taken 4100 times.
✓ Branch 151 taken 507 times.
✓ Branch 152 taken 4095 times.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
✓ Branch 155 taken 4095 times.
✗ Branch 156 not taken.
✓ Branch 157 taken 4095 times.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✓ Branch 168 taken 5578 times.
✓ Branch 169 taken 4662 times.
✓ Branch 170 taken 5285 times.
✓ Branch 171 taken 293 times.
✗ Branch 172 not taken.
✓ Branch 173 taken 5578 times.
✓ Branch 174 taken 4662 times.
✓ Branch 175 taken 5578 times.
✗ Branch 176 not taken.
✓ Branch 177 taken 4095 times.
✗ Branch 178 not taken.
✓ Branch 179 taken 4095 times.
✗ Branch 180 not taken.
✗ Branch 181 not taken.
✓ Branch 182 taken 4095 times.
✗ Branch 183 not taken.
✓ Branch 184 taken 4095 times.
✗ Branch 185 not taken.
✗ Branch 186 not taken.
✗ Branch 187 not taken.
✗ Branch 188 not taken.
✗ Branch 189 not taken.
✗ Branch 190 not taken.
✗ Branch 191 not taken.
✗ Branch 192 not taken.
✗ Branch 193 not taken.
✗ Branch 194 not taken.
✗ Branch 195 not taken.
✗ Branch 196 not taken.
✗ Branch 197 not taken.
✗ Branch 198 not taken.
✗ Branch 199 not taken.
✗ Branch 200 not taken.
✗ Branch 201 not taken.
✗ Branch 202 not taken.
✗ Branch 203 not taken.
✓ Branch 204 taken 1017 times.
✓ Branch 205 taken 7 times.
✓ Branch 206 taken 1011 times.
✓ Branch 207 taken 6 times.
✓ Branch 209 taken 1017 times.
✓ Branch 210 taken 7 times.
✓ Branch 211 taken 1014 times.
✓ Branch 212 taken 3 times.
✗ Branch 213 not taken.
✗ Branch 214 not taken.
✗ Branch 215 not taken.
✗ Branch 216 not taken.
✗ Branch 217 not taken.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✗ Branch 220 not taken.
✗ Branch 221 not taken.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✗ Branch 224 not taken.
✗ Branch 225 not taken.
✗ Branch 226 not taken.
✓ Branch 228 taken 1017 times.
✓ Branch 229 taken 7 times.
✓ Branch 230 taken 1011 times.
✓ Branch 231 taken 6 times.
✗ Branch 232 not taken.
✓ Branch 233 taken 1017 times.
✓ Branch 234 taken 7 times.
✓ Branch 235 taken 1014 times.
✓ Branch 236 taken 3 times.
✗ Branch 237 not taken.
✗ Branch 238 not taken.
✗ Branch 239 not taken.
✗ Branch 240 not taken.
✗ Branch 241 not taken.
✗ Branch 242 not taken.
✗ Branch 243 not taken.
✗ Branch 244 not taken.
✗ Branch 245 not taken.
✗ Branch 246 not taken.
✗ Branch 247 not taken.
✗ Branch 248 not taken.
✗ Branch 249 not taken.
✗ Branch 250 not taken.
✗ Branch 251 not taken.
✗ Branch 252 not taken.
✗ Branch 253 not taken.
✗ Branch 254 not taken.
✗ Branch 255 not taken.
✓ Branch 256 taken 32767 times.
✗ Branch 257 not taken.
✓ Branch 258 taken 32767 times.
✗ Branch 259 not taken.
✓ Branch 261 taken 32767 times.
✗ Branch 262 not taken.
✓ Branch 263 taken 32767 times.
✗ Branch 264 not taken.
✗ Branch 265 not taken.
✗ Branch 266 not taken.
✗ Branch 267 not taken.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✗ Branch 275 not taken.
✗ Branch 276 not taken.
✗ Branch 277 not taken.
✗ Branch 278 not taken.
✗ Branch 279 not taken.
✗ Branch 280 not taken.
✗ Branch 281 not taken.
✗ Branch 282 not taken.
✓ Branch 283 taken 32767 times.
✗ Branch 284 not taken.
✓ Branch 285 taken 32767 times.
✗ Branch 286 not taken.
✗ Branch 287 not taken.
✓ Branch 288 taken 32767 times.
✗ Branch 289 not taken.
✓ Branch 290 taken 32767 times.
✗ Branch 291 not taken.
✗ Branch 292 not taken.
✗ Branch 293 not taken.
✗ Branch 294 not taken.
✗ Branch 295 not taken.
✗ Branch 296 not taken.
✗ Branch 297 not taken.
✗ Branch 298 not taken.
✗ Branch 299 not taken.
✗ Branch 300 not taken.
✗ Branch 301 not taken.
✗ Branch 302 not taken.
✗ Branch 303 not taken.
✗ Branch 304 not taken.
✗ Branch 305 not taken.
✗ Branch 306 not taken.
✗ Branch 307 not taken.
✗ Branch 308 not taken.
✗ Branch 309 not taken.
✓ Branch 310 taken 32767 times.
✗ Branch 311 not taken.
✓ Branch 312 taken 32767 times.
✗ Branch 313 not taken.
✗ Branch 314 not taken.
✓ Branch 315 taken 32767 times.
✗ Branch 316 not taken.
✓ Branch 317 taken 32767 times.
✗ Branch 318 not taken.
✗ Branch 319 not taken.
✗ Branch 320 not taken.
✗ Branch 321 not taken.
✗ Branch 322 not taken.
✗ Branch 323 not taken.
✗ Branch 324 not taken.
✗ Branch 325 not taken.
✗ Branch 327 not taken.
✗ Branch 328 not taken.
✗ Branch 329 not taken.
✗ Branch 330 not taken.
✗ Branch 332 not taken.
✗ Branch 333 not taken.
✗ Branch 334 not taken.
✗ Branch 335 not taken.
✗ Branch 336 not taken.
✓ Branch 337 taken 32767 times.
✗ Branch 338 not taken.
✓ Branch 339 taken 32767 times.
✗ Branch 340 not taken.
✗ Branch 341 not taken.
✓ Branch 342 taken 32767 times.
✗ Branch 343 not taken.
✓ Branch 344 taken 32767 times.
✗ Branch 345 not taken.
✗ Branch 346 not taken.
✗ Branch 347 not taken.
✓ Branch 348 taken 4095 times.
✗ Branch 349 not taken.
✓ Branch 350 taken 4095 times.
✗ Branch 351 not taken.
✗ Branch 352 not taken.
✓ Branch 353 taken 4095 times.
✗ Branch 354 not taken.
✓ Branch 355 taken 4095 times.
✗ Branch 356 not taken.
✗ Branch 357 not taken.
✗ Branch 358 not taken.
✗ Branch 359 not taken.
✗ Branch 360 not taken.
✗ Branch 361 not taken.
✗ Branch 362 not taken.
✗ Branch 363 not taken.
✓ Branch 364 taken 509 times.
✓ Branch 365 taken 3 times.
✓ Branch 366 taken 508 times.
✓ Branch 367 taken 1 times.
✗ Branch 368 not taken.
✓ Branch 369 taken 509 times.
✓ Branch 370 taken 3 times.
✓ Branch 371 taken 509 times.
✗ Branch 372 not taken.
✓ Branch 374 taken 4076 times.
✗ Branch 375 not taken.
✓ Branch 376 taken 4076 times.
✗ Branch 377 not taken.
✗ Branch 378 not taken.
✓ Branch 379 taken 4076 times.
✗ Branch 380 not taken.
✓ Branch 381 taken 4076 times.
✗ Branch 382 not taken.
✗ Branch 383 not taken.
✗ Branch 384 not taken.
✗ Branch 385 not taken.
✗ Branch 386 not taken.
✗ Branch 387 not taken.
✓ Branch 388 taken 6102 times.
✓ Branch 389 taken 42 times.
✓ Branch 390 taken 6066 times.
✓ Branch 391 taken 36 times.
✗ Branch 392 not taken.
✓ Branch 393 taken 6102 times.
✓ Branch 394 taken 42 times.
✓ Branch 395 taken 6084 times.
✓ Branch 396 taken 18 times.
✗ Branch 397 not taken.
✗ Branch 398 not taken.
✗ Branch 399 not taken.
✗ Branch 400 not taken.
✗ Branch 401 not taken.
✗ Branch 402 not taken.
✗ Branch 403 not taken.
✗ Branch 405 not taken.
✗ Branch 406 not taken.
✗ Branch 407 not taken.
✗ Branch 408 not taken.
✗ Branch 409 not taken.
✗ Branch 410 not taken.
✗ Branch 411 not taken.
✓ Branch 412 taken 6609 times.
✓ Branch 413 taken 47 times.
✓ Branch 414 taken 6571 times.
✓ Branch 415 taken 38 times.
✓ Branch 417 taken 6609 times.
✓ Branch 418 taken 47 times.
✓ Branch 419 taken 6591 times.
✓ Branch 420 taken 18 times.
✗ Branch 421 not taken.
✗ Branch 422 not taken.
✗ Branch 423 not taken.
✗ Branch 424 not taken.
✗ Branch 425 not taken.
✗ Branch 426 not taken.
✗ Branch 427 not taken.
✗ Branch 429 not taken.
✗ Branch 430 not taken.
✗ Branch 431 not taken.
✗ Branch 432 not taken.
✗ Branch 433 not taken.
✗ Branch 434 not taken.
✗ Branch 435 not taken.
✓ Branch 436 taken 8190 times.
✗ Branch 437 not taken.
✓ Branch 438 taken 8190 times.
✗ Branch 439 not taken.
✓ Branch 441 taken 8190 times.
✗ Branch 442 not taken.
✓ Branch 443 taken 8190 times.
✗ Branch 444 not taken.
✗ Branch 445 not taken.
✗ Branch 446 not taken.
✗ Branch 447 not taken.
✗ Branch 448 not taken.
✗ Branch 449 not taken.
✗ Branch 450 not taken.
✗ Branch 451 not taken.
✗ Branch 453 not taken.
✗ Branch 454 not taken.
✗ Branch 455 not taken.
✗ Branch 456 not taken.
✗ Branch 457 not taken.
✗ Branch 458 not taken.
✗ Branch 459 not taken.
✗ Branch 460 not taken.
✗ Branch 461 not taken.
✓ Branch 462 taken 8190 times.
✗ Branch 463 not taken.
✓ Branch 464 taken 8190 times.
✗ Branch 465 not taken.
✗ Branch 466 not taken.
✓ Branch 467 taken 8190 times.
✗ Branch 468 not taken.
✓ Branch 469 taken 8190 times.
✗ Branch 470 not taken.
✗ Branch 471 not taken.
✓ Branch 472 taken 8190 times.
✗ Branch 473 not taken.
✗ Branch 474 not taken.
✗ Branch 475 not taken.
✗ Branch 476 not taken.
✗ Branch 477 not taken.
✗ Branch 478 not taken.
✗ Branch 479 not taken.
✗ Branch 480 not taken.
✗ Branch 481 not taken.
✗ Branch 482 not taken.
✗ Branch 483 not taken.
✗ Branch 484 not taken.
✗ Branch 485 not taken.
✗ Branch 486 not taken.
✗ Branch 487 not taken.
✗ Branch 488 not taken.
✗ Branch 489 not taken.
✗ Branch 490 not taken.
✗ Branch 491 not taken.
✗ Branch 492 not taken.
✗ Branch 493 not taken.
✗ Branch 494 not taken.
✗ Branch 495 not taken.
✗ Branch 496 not taken.
✗ Branch 497 not taken.
✗ Branch 498 not taken.
✗ Branch 499 not taken.
✗ Branch 500 not taken.
✗ Branch 501 not taken.
✗ Branch 502 not taken.
✗ Branch 503 not taken.
✗ Branch 504 not taken.
✗ Branch 505 not taken.
✗ Branch 506 not taken.
✗ Branch 507 not taken.
✗ Branch 508 not taken.
✗ Branch 509 not taken.
✗ Branch 510 not taken.
✗ Branch 511 not taken.
✗ Branch 512 not taken.
✗ Branch 513 not taken.
✗ Branch 514 not taken.
✗ Branch 515 not taken.
✗ Branch 516 not taken.
✗ Branch 517 not taken.
✗ Branch 518 not taken.
✗ Branch 519 not taken.
✗ Branch 520 not taken.
✗ Branch 521 not taken.
✗ Branch 522 not taken.
✗ Branch 523 not taken.
✗ Branch 524 not taken.
✗ Branch 525 not taken.
✗ Branch 526 not taken.
✗ Branch 527 not taken.
✗ Branch 528 not taken.
✗ Branch 529 not taken.
✗ Branch 530 not taken.
✗ Branch 531 not taken.
✗ Branch 532 not taken.
✗ Branch 533 not taken.
✗ Branch 534 not taken.
✓ Branch 535 taken 4095 times.
✗ Branch 536 not taken.
✓ Branch 537 taken 4095 times.
✗ Branch 538 not taken.
✗ Branch 539 not taken.
✓ Branch 540 taken 4095 times.
✗ Branch 541 not taken.
✓ Branch 542 taken 4095 times.
✗ Branch 543 not taken.
✓ Branch 544 taken 32767 times.
✗ Branch 545 not taken.
✓ Branch 546 taken 32767 times.
✗ Branch 547 not taken.
✗ Branch 548 not taken.
✓ Branch 549 taken 32767 times.
✗ Branch 550 not taken.
✓ Branch 551 taken 32767 times.
✗ Branch 552 not taken.
✗ Branch 553 not taken.
✗ Branch 554 not taken.
✗ Branch 555 not taken.
✗ Branch 556 not taken.
✗ Branch 557 not taken.
✗ Branch 558 not taken.
✗ Branch 559 not taken.
✓ Branch 561 taken 49140 times.
✗ Branch 562 not taken.
✓ Branch 563 taken 49140 times.
✗ Branch 564 not taken.
✗ Branch 565 not taken.
✓ Branch 566 taken 49140 times.
✗ Branch 567 not taken.
✓ Branch 568 taken 81907 times.
✗ Branch 569 not taken.
✓ Branch 570 taken 32767 times.
✗ Branch 571 not taken.
✗ Branch 572 not taken.
✓ Branch 573 taken 32767 times.
✗ Branch 574 not taken.
✓ Branch 575 taken 32767 times.
✗ Branch 576 not taken.
✗ Branch 578 not taken.
✗ Branch 579 not taken.
✗ Branch 580 not taken.
✗ Branch 581 not taken.
✗ Branch 582 not taken.
✗ Branch 583 not taken.
✗ Branch 584 not taken.
✗ Branch 585 not taken.
✗ Branch 586 not taken.
✓ Branch 587 taken 53235 times.
✗ Branch 588 not taken.
✓ Branch 589 taken 53235 times.
✗ Branch 590 not taken.
✓ Branch 592 taken 53235 times.
✗ Branch 593 not taken.
✓ Branch 594 taken 53235 times.
✗ Branch 595 not taken.
✗ Branch 597 not taken.
✗ Branch 598 not taken.
✗ Branch 599 not taken.
✗ Branch 600 not taken.
✗ Branch 601 not taken.
✗ Branch 602 not taken.
✗ Branch 603 not taken.
✗ Branch 604 not taken.
✗ Branch 605 not taken.
✗ Branch 606 not taken.
✗ Branch 607 not taken.
✗ Branch 608 not taken.
✗ Branch 609 not taken.
✗ Branch 610 not taken.
✗ Branch 611 not taken.
✗ Branch 612 not taken.
✓ Branch 613 taken 65534 times.
✗ Branch 614 not taken.
✓ Branch 615 taken 65534 times.
✗ Branch 616 not taken.
✗ Branch 617 not taken.
✓ Branch 618 taken 65534 times.
✗ Branch 619 not taken.
✓ Branch 620 taken 65534 times.
✗ Branch 621 not taken.
✗ Branch 622 not taken.
✗ Branch 623 not taken.
✗ Branch 624 not taken.
✗ Branch 625 not taken.
✗ Branch 626 not taken.
✗ Branch 627 not taken.
✗ Branch 628 not taken.
✗ Branch 629 not taken.
✗ Branch 630 not taken.
✗ Branch 631 not taken.
✗ Branch 632 not taken.
✗ Branch 633 not taken.
✗ Branch 634 not taken.
✗ Branch 635 not taken.
✗ Branch 636 not taken.
✓ Branch 637 taken 65534 times.
✗ Branch 638 not taken.
✓ Branch 639 taken 65534 times.
✗ Branch 640 not taken.
✗ Branch 641 not taken.
✓ Branch 642 taken 65534 times.
✗ Branch 643 not taken.
✓ Branch 644 taken 65534 times.
✗ Branch 645 not taken.
✗ Branch 646 not taken.
✓ Branch 647 taken 65534 times.
✗ Branch 648 not taken.
✗ Branch 649 not taken.
✗ Branch 650 not taken.
✗ Branch 651 not taken.
✗ Branch 652 not taken.
✗ Branch 653 not taken.
✗ Branch 654 not taken.
✗ Branch 655 not taken.
✗ Branch 656 not taken.
✗ Branch 657 not taken.
✗ Branch 658 not taken.
✗ Branch 659 not taken.
✗ Branch 660 not taken.
✗ Branch 661 not taken.
✗ Branch 662 not taken.
✗ Branch 663 not taken.
✗ Branch 664 not taken.
✗ Branch 665 not taken.
✓ Branch 666 taken 32767 times.
✗ Branch 667 not taken.
✓ Branch 668 taken 32767 times.
✗ Branch 669 not taken.
✓ Branch 671 taken 32767 times.
✗ Branch 672 not taken.
✓ Branch 673 taken 32767 times.
✗ Branch 674 not taken.
✗ Branch 676 not taken.
✗ Branch 677 not taken.
✗ Branch 678 not taken.
✗ Branch 679 not taken.
✗ Branch 680 not taken.
✗ Branch 681 not taken.
✗ Branch 683 not taken.
✗ Branch 684 not taken.
✗ Branch 685 not taken.
✗ Branch 686 not taken.
✗ Branch 687 not taken.
✗ Branch 688 not taken.
✓ Branch 690 taken 393204 times.
✗ Branch 691 not taken.
✓ Branch 692 taken 393204 times.
✗ Branch 693 not taken.
✓ Branch 695 taken 393204 times.
✗ Branch 696 not taken.
✓ Branch 697 taken 393204 times.
✗ Branch 698 not taken.
✗ Branch 700 not taken.
✗ Branch 701 not taken.
✗ Branch 702 not taken.
✗ Branch 703 not taken.
✗ Branch 704 not taken.
✗ Branch 705 not taken.
✗ Branch 707 not taken.
✗ Branch 708 not taken.
✗ Branch 709 not taken.
✗ Branch 710 not taken.
✗ Branch 711 not taken.
✗ Branch 712 not taken.
✓ Branch 714 taken 425971 times.
✗ Branch 715 not taken.
✓ Branch 716 taken 425971 times.
✗ Branch 717 not taken.
✓ Branch 719 taken 425971 times.
✗ Branch 720 not taken.
✓ Branch 721 taken 425971 times.
✗ Branch 722 not taken.
✗ Branch 724 not taken.
✗ Branch 725 not taken.
✗ Branch 726 not taken.
✗ Branch 727 not taken.
✗ Branch 728 not taken.
✗ Branch 729 not taken.
✗ Branch 731 not taken.
✗ Branch 732 not taken.
✗ Branch 733 not taken.
✗ Branch 734 not taken.
✗ Branch 735 not taken.
✗ Branch 736 not taken.
✗ Branch 738 not taken.
✗ Branch 739 not taken.
✗ Branch 740 not taken.
✗ Branch 741 not taken.
✗ Branch 743 not taken.
✗ Branch 744 not taken.
✗ Branch 745 not taken.
✗ Branch 746 not taken.
✗ Branch 748 not taken.
✗ Branch 749 not taken.
✗ Branch 750 not taken.
✗ Branch 751 not taken.
✗ Branch 753 not taken.
✗ Branch 754 not taken.
✗ Branch 755 not taken.
✗ Branch 756 not taken.
✗ Branch 757 not taken.
✗ Branch 758 not taken.
✗ Branch 760 not taken.
✗ Branch 761 not taken.
✗ Branch 762 not taken.
✗ Branch 763 not taken.
✗ Branch 764 not taken.
✗ Branch 765 not taken.
✗ Branch 767 not taken.
✗ Branch 768 not taken.
5722283 void updateResultActive() { mResultIsActive = mAIsActive || mBIsActive; }
606
607 const AValueType* mAValPtr; // pointer to input value from A grid
608 const BValueType* mBValPtr; // pointer to input value from B grid
609 AValueType mResultVal; // computed output value (unused if stored externally)
610 AValueType* mResultValPtr; // pointer to either mResultVal or an external value
611 bool mAIsActive, mBIsActive; // active states of A and B values
612 bool mResultIsActive; // computed active state (default: A active || B active)
613 };
614
615
616 /// This struct adapts a "grid combiner" functor to swap the A and B grid values
617 /// (e.g., so that if the original functor computes a + 2 * b, the adapted functor
618 /// will compute b + 2 * a).
619 template<typename ValueType, typename CombineOp>
620 struct SwappedCombineOp
621 {
622
1/24
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
361 SwappedCombineOp(CombineOp& _op): op(_op) {}
623
624
1/2
✓ Branch 0 taken 300017 times.
✗ Branch 1 not taken.
300017 void operator()(CombineArgs<ValueType>& args)
625 {
626 CombineArgs<ValueType> swappedArgs(args.b(), args.a(), args.result(),
627 args.bIsActive(), args.aIsActive());
628 300017 op(swappedArgs);
629 args.setResultIsActive(swappedArgs.resultIsActive());
630 300017 }
631
632 CombineOp& op;
633 };
634
635
636 ////////////////////////////////////////
637
638
639 /// @brief Tag dispatch class that distinguishes shallow copy constructors
640 /// from deep copy constructors
641 class ShallowCopy {};
642 /// @brief Tag dispatch class that distinguishes topology copy constructors
643 /// from deep copy constructors
644 class TopologyCopy {};
645 /// @brief Tag dispatch class that distinguishes constructors that deep copy
646 class DeepCopy {};
647 /// @brief Tag dispatch class that distinguishes constructors that steal
648 class Steal {};
649 /// @brief Tag dispatch class that distinguishes constructors during file input
650 class PartialCreate {};
651
652 } // namespace OPENVDB_VERSION_NAME
653 } // namespace openvdb
654
655
656 #endif // OPENVDB_TYPES_HAS_BEEN_INCLUDED
657