GCC Code Coverage Report


ernie/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
45 / 45
100.0%
Branches:
108 / 220
49.1%
Functions:
4 / 4
100.0%

scene/schema/registry.cpp
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2 /// @file registry.cpp
3 /// @brief Every registered schema, by family, bases before the types deriving from them.
4 #include "ernie/scene/schema/camera.h"
5 #include "ernie/scene/schema/collection.h"
6 #include "ernie/scene/schema/geom.h"
7 #include "ernie/scene/schema/instancer.h"
8 #include "ernie/scene/schema/lux.h"
9 #include "ernie/scene/schema/mesh.h"
10 #include "ernie/scene/schema/planet.h"
11 #include "ernie/scene/schema/render.h"
12 #include "ernie/scene/schema/shade.h"
13 #include "ernie/scene/schema/vol.h"
14
15 namespace ernie {
16
17
9/18
✓ Branch 0 taken 146 times.
✓ Branch 1 taken 12 times.
✓ Branch 3 taken 146 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 146 times.
✗ Branch 7 not taken.
✓ Branch 10 taken 146 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 146 times.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 146 times.
✓ Branch 20 taken 584 times.
✓ Branch 21 taken 146 times.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
1326 ERNIE_DEFINE_SCHEMA(CollectionAPI, MultipleApply, kInheritExtent, ERNIE_COLLECTION_API_ATTRIBUTES)
18
19 663 std::span<const SchemaFamily> SchemaFamilies() {
20 663 static const std::vector<SchemaFamily> kFamilies{
21 {"geometry",
22 "Geometry",
23 "UsdGeom",
24 "https://openusd.org/release/api/usd_geom_page_front.html",
25
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&Imageable::Definition(), &Xformable::Definition(), &Boundable::Definition(),
26 438 &Gprim::Definition(), &Xform::Definition(), &Scope::Definition(),
27 438 &GeomModelAPI::Definition(), &GeomSubset::Definition(), &Cube::Definition(),
28 438 &Sphere::Definition(), &Cylinder::Definition(), &Cone::Definition(),
29 438 &Capsule::Definition(), &Plane::Definition(), &PointBased::Definition(),
30 438 &Mesh::Definition(), &Points::Definition(), &Curves::Definition(),
31 438 &BasisCurves::Definition(), &NurbsCurves::Definition(), &HermiteCurves::Definition(),
32 146 &PointInstancer::Definition()},
33 {}},
34 {"volumes",
35 "Volumes",
36 "UsdVol",
37 "https://openusd.org/release/api/usd_vol_page_front.html",
38
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&Volume::Definition(), &FieldBase::Definition(), &FieldAsset::Definition(),
39 146 &OpenVDBAsset::Definition()},
40
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&NanoVDBField::Definition(), &DenseField::Definition()}},
41 {"cameras",
42 "Cameras and lenses",
43 "UsdGeom",
44 "https://openusd.org/release/api/class_usd_geom_camera.html",
45
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&Camera::Definition()},
46
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&ErnieLensAPI::Definition(), &ErniePolarizerAPI::Definition(),
47 146 &ErnieSensorAPI::Definition()}},
48 {"lights",
49 "Lights",
50 "UsdLux",
51 "https://openusd.org/release/api/usd_lux_page_front.html",
52
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&LightAPI::Definition(), &BoundableLightBase::Definition(),
53 292 &NonboundableLightBase::Definition(), &DistantLight::Definition(),
54 438 &DiskLight::Definition(), &RectLight::Definition(), &SphereLight::Definition(),
55 438 &CylinderLight::Definition(), &DomeLight::Definition(), &PortalLight::Definition(),
56 438 &MeshLightAPI::Definition(), &VolumeLightAPI::Definition(), &ShapingAPI::Definition(),
57 146 &ShadowAPI::Definition()},
58
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&PhotometricAreaLightAPI::Definition(), &PhotometricDistantLightAPI::Definition(),
59 292 &PhotometricDomeLightAPI::Definition(), &PhysicalLightIlluminantAPI::Definition(),
60 146 &LaserLight::Definition()}},
61 {"materials",
62 "Materials",
63 "UsdShade",
64 "https://openusd.org/release/api/usd_shade_page_front.html",
65
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&MaterialBindingAPI::Definition(), &NodeGraph::Definition(), &Material::Definition(),
66 146 &Shader::Definition()},
67 {}},
68 {"render",
69 "Render settings",
70 "UsdRender",
71 "https://openusd.org/release/api/usd_render_page_front.html",
72
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&RenderSettingsBase::Definition(), &RenderSettings::Definition(),
73 438 &RenderProduct::Definition(), &RenderVar::Definition(), &RenderPass::Definition()},
74 {}},
75 {"planetary",
76 "Planetary",
77 "",
78 "",
79 {},
80
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&Terrain::Definition(), &Atmosphere::Definition(), &StarField::Definition(),
81 146 &GroundPlane::Definition()}},
82 {"collections",
83 "Collections",
84 "Usd",
85 "https://openusd.org/release/api/class_usd_collection_a_p_i.html",
86
1/2
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
146 {&CollectionAPI::Definition()},
87 {}},
88
6/10
✓ Branch 0 taken 146 times.
✓ Branch 1 taken 517 times.
✓ Branch 3 taken 146 times.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 146 times.
✓ Branch 10 taken 1168 times.
✓ Branch 11 taken 146 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
1977 };
89 663 return kFamilies;
90
73/156
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 146 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 146 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 146 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 146 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 146 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 146 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 146 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 146 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 146 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 146 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 146 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 146 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 146 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 146 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 146 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 146 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 146 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 146 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 146 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 146 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 146 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 146 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 146 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 146 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 146 times.
✗ Branch 77 not taken.
✓ Branch 79 taken 146 times.
✗ Branch 80 not taken.
✓ Branch 82 taken 146 times.
✗ Branch 83 not taken.
✓ Branch 85 taken 146 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 146 times.
✗ Branch 89 not taken.
✓ Branch 91 taken 146 times.
✗ Branch 92 not taken.
✓ Branch 94 taken 146 times.
✗ Branch 95 not taken.
✓ Branch 97 taken 146 times.
✗ Branch 98 not taken.
✓ Branch 100 taken 146 times.
✗ Branch 101 not taken.
✓ Branch 103 taken 146 times.
✗ Branch 104 not taken.
✓ Branch 106 taken 146 times.
✗ Branch 107 not taken.
✓ Branch 109 taken 146 times.
✗ Branch 110 not taken.
✓ Branch 112 taken 146 times.
✗ Branch 113 not taken.
✓ Branch 115 taken 146 times.
✗ Branch 116 not taken.
✓ Branch 118 taken 146 times.
✗ Branch 119 not taken.
✓ Branch 121 taken 146 times.
✗ Branch 122 not taken.
✓ Branch 124 taken 146 times.
✗ Branch 125 not taken.
✓ Branch 127 taken 146 times.
✗ Branch 128 not taken.
✓ Branch 130 taken 146 times.
✗ Branch 131 not taken.
✓ Branch 133 taken 146 times.
✗ Branch 134 not taken.
✓ Branch 136 taken 146 times.
✗ Branch 137 not taken.
✓ Branch 139 taken 146 times.
✗ Branch 140 not taken.
✓ Branch 142 taken 146 times.
✗ Branch 143 not taken.
✓ Branch 145 taken 146 times.
✗ Branch 146 not taken.
✓ Branch 148 taken 146 times.
✗ Branch 149 not taken.
✓ Branch 151 taken 146 times.
✗ Branch 152 not taken.
✓ Branch 154 taken 146 times.
✗ Branch 155 not taken.
✓ Branch 157 taken 146 times.
✗ Branch 158 not taken.
✓ Branch 160 taken 146 times.
✗ Branch 161 not taken.
✓ Branch 163 taken 146 times.
✗ Branch 164 not taken.
✓ Branch 166 taken 146 times.
✗ Branch 167 not taken.
✓ Branch 169 taken 146 times.
✗ Branch 170 not taken.
✓ Branch 172 taken 146 times.
✗ Branch 173 not taken.
✓ Branch 175 taken 146 times.
✗ Branch 176 not taken.
✓ Branch 178 taken 146 times.
✗ Branch 179 not taken.
✓ Branch 181 taken 146 times.
✗ Branch 182 not taken.
✓ Branch 184 taken 146 times.
✗ Branch 185 not taken.
✓ Branch 187 taken 146 times.
✗ Branch 188 not taken.
✓ Branch 190 taken 146 times.
✗ Branch 191 not taken.
✓ Branch 193 taken 146 times.
✗ Branch 194 not taken.
✓ Branch 196 taken 146 times.
✗ Branch 197 not taken.
✓ Branch 199 taken 146 times.
✗ Branch 200 not taken.
✓ Branch 202 taken 146 times.
✗ Branch 203 not taken.
✓ Branch 205 taken 146 times.
✗ Branch 206 not taken.
✓ Branch 208 taken 146 times.
✗ Branch 209 not taken.
✓ Branch 211 taken 146 times.
✗ Branch 212 not taken.
✓ Branch 214 taken 146 times.
✗ Branch 215 not taken.
✓ Branch 217 taken 146 times.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✗ Branch 220 not taken.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✗ Branch 225 not taken.
✗ Branch 226 not taken.
✗ Branch 228 not taken.
✗ Branch 229 not taken.
✗ Branch 231 not taken.
✗ Branch 232 not taken.
730 }
91
92 3470 std::span<const SchemaDef* const> Schemas() {
93 146 static const std::vector<const SchemaDef*> kSchemas = [] {
94 146 std::vector<const SchemaDef*> schemas;
95
3/4
✓ Branch 1 taken 146 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1168 times.
✓ Branch 4 taken 146 times.
1314 for (const SchemaFamily& family : SchemaFamilies()) {
96
1/2
✓ Branch 1 taken 1168 times.
✗ Branch 2 not taken.
1168 schemas.insert(schemas.end(), family.usd.begin(), family.usd.end());
97
1/2
✓ Branch 1 taken 1168 times.
✗ Branch 2 not taken.
1168 schemas.insert(schemas.end(), family.ernie.begin(), family.ernie.end());
98 }
99 146 return schemas;
100
4/6
✓ Branch 0 taken 146 times.
✓ Branch 1 taken 3324 times.
✓ Branch 3 taken 146 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 146 times.
✗ Branch 7 not taken.
3470 }();
101 3470 return kSchemas;
102 }
103
104 } // namespace ernie
105