src/gltf/GltfUserData.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "GltfUserData.hpp" | ||
| 7 | #include "GltfUtils.hpp" | ||
| 8 | |||
| 9 | #include "../model/Model.hpp" | ||
| 10 | |||
| 11 | #include "../model/PlanarSurface.hpp" | ||
| 12 | |||
| 13 | #include "../model/PlanarSurfaceGroup.hpp" | ||
| 14 | #include "../model/Surface.hpp" | ||
| 15 | #include "../model/Surface_Impl.hpp" | ||
| 16 | #include "../model/SubSurface.hpp" | ||
| 17 | #include "../model/SubSurface_Impl.hpp" | ||
| 18 | #include "../model/ShadingSurface.hpp" | ||
| 19 | #include "../model/ShadingSurface_Impl.hpp" | ||
| 20 | #include "../model/InteriorPartitionSurface.hpp" | ||
| 21 | #include "../model/InteriorPartitionSurface_Impl.hpp" | ||
| 22 | #include "../model/DefaultConstructionSet.hpp" | ||
| 23 | #include "../model/ShadingSurfaceGroup.hpp" | ||
| 24 | #include "../model/InteriorPartitionSurfaceGroup.hpp" | ||
| 25 | #include "../model/ConstructionBase.hpp" | ||
| 26 | #include "../model/ConstructionAirBoundary.hpp" | ||
| 27 | #include "../model/ConstructionAirBoundary_Impl.hpp" | ||
| 28 | #include "../model/Construction.hpp" | ||
| 29 | #include "../model/Space.hpp" | ||
| 30 | #include "../model/ThermalZone.hpp" | ||
| 31 | #include "../model/AirLoopHVAC.hpp" | ||
| 32 | #include "../model/SpaceType.hpp" | ||
| 33 | #include "../model/BuildingStory.hpp" | ||
| 34 | #include "../model/BuildingUnit.hpp" | ||
| 35 | |||
| 36 | #include "../utilities/core/UUID.hpp" | ||
| 37 | #include "../utilities/geometry/Transformation.hpp" | ||
| 38 | #include "../utilities/geometry/Geometry.hpp" | ||
| 39 | |||
| 40 | #include <tiny_gltf.h> | ||
| 41 | |||
| 42 | #include <string> | ||
| 43 | #include <map> | ||
| 44 | |||
| 45 | namespace openstudio { | ||
| 46 | namespace gltf { | ||
| 47 | |||
| 48 | ✗ | GltfUserData::GltfUserData() = default; | |
| 49 | |||
| 50 | 23036 | std::string GltfUserData::surfaceTypeMaterialName() const { | |
| 51 | { | ||
| 52 |
17/33✓ Branch 1 taken 23036 times.
✓ Branch 4 taken 20570 times.
✓ Branch 7 taken 20570 times.
✓ Branch 9 taken 20570 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 20570 times.
✓ Branch 15 taken 20570 times.
✓ Branch 17 taken 20570 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 20570 times.
✓ Branch 21 taken 2466 times.
✓ Branch 22 taken 20570 times.
✓ Branch 23 taken 2466 times.
✓ Branch 25 taken 20570 times.
✓ Branch 26 taken 2466 times.
✓ Branch 27 taken 23036 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 23036 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 2646 times.
✓ Branch 33 taken 20390 times.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
|
151388 | if (istringEqual(m_surfaceType, "FixedWindow") || istringEqual(m_surfaceType, "OperableWindow") || istringEqual(m_surfaceType, "GlassDoor") |
| 53 |
15/24✓ Branch 1 taken 20570 times.
✓ Branch 4 taken 20570 times.
✓ Branch 6 taken 20390 times.
✓ Branch 7 taken 180 times.
✓ Branch 9 taken 20390 times.
✓ Branch 12 taken 20390 times.
✓ Branch 14 taken 20390 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 20390 times.
✓ Branch 18 taken 2646 times.
✓ Branch 19 taken 20570 times.
✓ Branch 20 taken 2466 times.
✓ Branch 22 taken 20570 times.
✓ Branch 23 taken 2466 times.
✓ Branch 24 taken 20570 times.
✓ Branch 25 taken 2466 times.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
|
104956 | || istringEqual(m_surfaceType, "Skylight") || istringEqual(m_surfaceType, "TubularDaylightDome") |
| 54 |
12/17✓ Branch 1 taken 23036 times.
✓ Branch 3 taken 20570 times.
✓ Branch 4 taken 2466 times.
✓ Branch 6 taken 20390 times.
✓ Branch 9 taken 20390 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 20390 times.
✓ Branch 13 taken 20390 times.
✓ Branch 14 taken 2646 times.
✓ Branch 16 taken 20390 times.
✓ Branch 17 taken 2646 times.
✓ Branch 18 taken 20390 times.
✓ Branch 19 taken 2646 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
|
87032 | || istringEqual(m_surfaceType, "TubularDaylightDiffuser")) { |
| 55 |
1/1✓ Branch 1 taken 2646 times.
|
5292 | return "Window"; |
| 56 |
15/26✓ Branch 1 taken 20390 times.
✓ Branch 4 taken 20390 times.
✓ Branch 6 taken 20348 times.
✓ Branch 7 taken 42 times.
✓ Branch 9 taken 20348 times.
✓ Branch 12 taken 20348 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 20348 times.
✓ Branch 16 taken 20348 times.
✓ Branch 17 taken 42 times.
✓ Branch 19 taken 20348 times.
✓ Branch 20 taken 42 times.
✓ Branch 21 taken 20390 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 20390 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 42 times.
✓ Branch 27 taken 20348 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
|
101866 | } else if (istringEqual(m_surfaceType, "Door") || istringEqual(m_surfaceType, "OverheadDoor")) { |
| 57 |
1/1✓ Branch 1 taken 42 times.
|
84 | return "Door"; |
| 58 | } | ||
| 59 | 20348 | return m_surfaceType; | |
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | 11519 | std::string GltfUserData::boundaryMaterialName() const { | |
| 64 | 11519 | std::string result; | |
| 65 |
2/2✓ Branch 1 taken 29 times.
✓ Branch 2 taken 11490 times.
|
11519 | if (m_outsideBoundaryCondition.empty()) { |
| 66 | 29 | return result; | |
| 67 | } | ||
| 68 | |||
| 69 |
4/4✓ Branch 1 taken 11490 times.
✓ Branch 4 taken 11490 times.
✓ Branch 7 taken 5253 times.
✓ Branch 8 taken 6237 times.
|
22980 | if (istringEqual(m_outsideBoundaryCondition, "Outdoors")) { |
| 70 |
11/26✓ Branch 1 taken 5253 times.
✓ Branch 4 taken 5253 times.
✓ Branch 6 taken 5253 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 5253 times.
✓ Branch 12 taken 5253 times.
✓ Branch 14 taken 5253 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 5253 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 5253 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 5253 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 5253 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 5253 times.
✗ 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 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
|
26265 | if (istringEqual(m_sunExposure, "SunExposed") && istringEqual(m_windExposure, "WindExposed")) { |
| 71 |
1/1✓ Branch 1 taken 5253 times.
|
5253 | result = "Boundary_Outdoors_SunWind"; |
| 72 | ✗ | } else if (istringEqual(m_sunExposure, "SunExposed")) { | |
| 73 | ✗ | result = "Boundary_Outdoors_Sun"; | |
| 74 | ✗ | } else if (istringEqual(m_windExposure, "WindExposed")) { | |
| 75 | ✗ | result = "Boundary_Outdoors_Wind"; | |
| 76 | } else { | ||
| 77 | ✗ | result = "Boundary_Outdoors"; | |
| 78 | } | ||
| 79 | } else { | ||
| 80 |
1/1✓ Branch 1 taken 6237 times.
|
6237 | result = "Boundary_" + m_outsideBoundaryCondition; |
| 81 | } | ||
| 82 | 11490 | return result; | |
| 83 | ✗ | } | |
| 84 | |||
| 85 | 11518 | GltfUserData::GltfUserData(const model::PlanarSurface& planarSurface) { | |
| 86 |
1/1✓ Branch 1 taken 11518 times.
|
11518 | std::string name = planarSurface.nameString(); |
| 87 | |||
| 88 |
2/2✓ Branch 1 taken 11518 times.
✓ Branch 4 taken 11518 times.
|
11518 | m_handle = openstudio::removeBraces(planarSurface.handle()); |
| 89 |
1/1✓ Branch 1 taken 11518 times.
|
11518 | m_name = planarSurface.nameString(); |
| 90 | |||
| 91 |
3/3✓ Branch 1 taken 11518 times.
✓ Branch 3 taken 10148 times.
✓ Branch 4 taken 1370 times.
|
23036 | if (auto surface = planarSurface.optionalCast<model::Surface>()) { |
| 92 |
2/2✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
|
10148 | m_surfaceName = surface->nameString(); |
| 93 |
3/3✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
✓ Branch 7 taken 10148 times.
|
10148 | m_surfaceHandle = openstudio::removeBraces(surface->handle()); |
| 94 |
2/2✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
|
10148 | m_surfaceType = surface->surfaceType(); |
| 95 |
2/2✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
|
10148 | m_sunExposure = surface->sunExposure(); |
| 96 |
2/2✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
|
10148 | m_windExposure = surface->windExposure(); |
| 97 |
2/2✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
|
10148 | m_outsideBoundaryCondition = surface->outsideBoundaryCondition(); |
| 98 | |||
| 99 |
2/2✓ Branch 1 taken 10148 times.
✓ Branch 4 taken 10148 times.
|
10148 | boost::optional<model::Surface> adjacentSurface = surface->adjacentSurface(); |
| 100 |
2/2✓ Branch 0 taken 4466 times.
✓ Branch 1 taken 5682 times.
|
10148 | if (adjacentSurface) { |
| 101 |
2/2✓ Branch 1 taken 4466 times.
✓ Branch 4 taken 4466 times.
|
4466 | m_outsideBoundaryConditionObjectName = adjacentSurface->nameString(); |
| 102 |
3/3✓ Branch 1 taken 4466 times.
✓ Branch 4 taken 4466 times.
✓ Branch 7 taken 4466 times.
|
4466 | m_outsideBoundaryConditionObjectHandle = openstudio::removeBraces(adjacentSurface->handle()); |
| 103 | } | ||
| 104 |
3/3✓ Branch 2 taken 1370 times.
✓ Branch 4 taken 20 times.
✓ Branch 5 taken 1350 times.
|
12888 | } else if (auto shadingSurface = planarSurface.optionalCast<model::ShadingSurface>()) { |
| 105 | |||
| 106 |
3/3✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
✓ Branch 7 taken 20 times.
|
20 | m_shadingHandle = openstudio::removeBraces(shadingSurface->handle()); |
| 107 |
2/2✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
|
20 | m_shadingName = shadingSurface->nameString(); |
| 108 | |||
| 109 |
1/1✓ Branch 1 taken 20 times.
|
20 | std::string shadingSurfaceType = "Building"; |
| 110 |
3/4✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
✓ Branch 7 taken 20 times.
✗ Branch 8 not taken.
|
40 | if (shadingSurface->shadingSurfaceGroup()) { |
| 111 |
4/4✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
✓ Branch 7 taken 20 times.
✓ Branch 10 taken 20 times.
|
20 | shadingSurfaceType = shadingSurface->shadingSurfaceGroup()->shadingSurfaceType(); |
| 112 | } | ||
| 113 |
1/1✓ Branch 1 taken 20 times.
|
20 | std::string surfaceType = shadingSurfaceType + "Shading"; |
| 114 |
1/1✓ Branch 1 taken 20 times.
|
20 | m_surfaceType = surfaceType; |
| 115 |
1/1✓ Branch 1 taken 20 times.
|
20 | m_sunExposure = "SunExposed"; |
| 116 |
1/1✓ Branch 1 taken 20 times.
|
20 | m_windExposure = "WindExposed"; |
| 117 | // m_outsideBoundaryCondition.clear(); | ||
| 118 | // m_outsideBoundaryConditionObjectName.clear(); | ||
| 119 | // m_outsideBoundaryConditionObjectHandle.clear(); | ||
| 120 |
3/3✓ Branch 3 taken 1350 times.
✓ Branch 5 taken 6 times.
✓ Branch 6 taken 1344 times.
|
2720 | } else if (auto interiorPartitionSurface = planarSurface.optionalCast<model::InteriorPartitionSurface>()) { |
| 121 |
1/1✓ Branch 1 taken 6 times.
|
6 | m_surfaceType = "InteriorPartitionSurface"; |
| 122 |
1/1✓ Branch 1 taken 6 times.
|
6 | m_sunExposure = "NoSun"; |
| 123 |
1/1✓ Branch 1 taken 6 times.
|
6 | m_windExposure = "NoWind"; |
| 124 | // m_outsideBoundaryCondition.clear(); | ||
| 125 | // m_outsideBoundaryConditionObjectName.clear(); | ||
| 126 | // m_outsideBoundaryConditionObjectHandle.clear(); | ||
| 127 | } | ||
| 128 | |||
| 129 |
2/3✓ Branch 1 taken 1344 times.
✓ Branch 3 taken 1344 times.
✗ Branch 4 not taken.
|
2688 | else if (auto subSurface = planarSurface.optionalCast<model::SubSurface>()) { |
| 130 |
3/3✓ Branch 1 taken 1344 times.
✓ Branch 4 taken 1344 times.
✓ Branch 7 taken 1344 times.
|
1344 | m_subSurfaceHandle = openstudio::removeBraces(subSurface->handle()); |
| 131 |
2/2✓ Branch 1 taken 1344 times.
✓ Branch 4 taken 1344 times.
|
1344 | m_subSurfaceName = subSurface->nameString(); |
| 132 |
2/2✓ Branch 1 taken 1344 times.
✓ Branch 4 taken 1344 times.
|
1344 | m_surfaceType = subSurface->subSurfaceType(); |
| 133 | |||
| 134 |
2/2✓ Branch 1 taken 1344 times.
✓ Branch 4 taken 1344 times.
|
1344 | boost::optional<model::Surface> parentSurface = subSurface->surface(); |
| 135 |
2/2✓ Branch 0 taken 1341 times.
✓ Branch 1 taken 3 times.
|
1344 | if (parentSurface) { |
| 136 |
2/2✓ Branch 1 taken 1341 times.
✓ Branch 4 taken 1341 times.
|
1341 | m_outsideBoundaryCondition = parentSurface->outsideBoundaryCondition(); |
| 137 |
2/2✓ Branch 1 taken 1341 times.
✓ Branch 4 taken 1341 times.
|
1341 | m_sunExposure = parentSurface->sunExposure(); |
| 138 |
2/2✓ Branch 1 taken 1341 times.
✓ Branch 4 taken 1341 times.
|
1341 | m_windExposure = parentSurface->windExposure(); |
| 139 |
2/2✓ Branch 1 taken 1341 times.
✓ Branch 4 taken 1341 times.
|
1341 | m_surfaceName = parentSurface->nameString(); |
| 140 |
3/3✓ Branch 1 taken 1341 times.
✓ Branch 4 taken 1341 times.
✓ Branch 7 taken 1341 times.
|
1341 | m_surfaceHandle = openstudio::removeBraces(parentSurface->handle()); |
| 141 | } | ||
| 142 | |||
| 143 |
2/2✓ Branch 1 taken 1344 times.
✓ Branch 4 taken 1344 times.
|
1344 | boost::optional<model::SubSurface> adjacentSubSurface = subSurface->adjacentSubSurface(); |
| 144 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1328 times.
|
1344 | if (adjacentSubSurface) { |
| 145 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | m_outsideBoundaryConditionObjectName = adjacentSubSurface->nameString(); |
| 146 |
3/3✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
|
16 | m_outsideBoundaryConditionObjectHandle = openstudio::removeBraces(adjacentSubSurface->handle()); |
| 147 | } | ||
| 148 | 16926 | } | |
| 149 | |||
| 150 |
3/3✓ Branch 1 taken 11518 times.
✓ Branch 3 taken 10379 times.
✓ Branch 4 taken 1139 times.
|
23036 | if (boost::optional<model::ConstructionBase> construction = planarSurface.construction()) { |
| 151 | |||
| 152 |
3/3✓ Branch 1 taken 10379 times.
✓ Branch 4 taken 10379 times.
✓ Branch 7 taken 10379 times.
|
10379 | m_constructionSetHandle = openstudio::removeBraces(construction->handle()); |
| 153 |
2/2✓ Branch 1 taken 10379 times.
✓ Branch 4 taken 10379 times.
|
10379 | m_constructionName = construction->nameString(); |
| 154 | // If this is a ConstructionAirBoundary, then set to the standard material "AirWall" | ||
| 155 |
4/4✓ Branch 1 taken 10379 times.
✓ Branch 4 taken 10379 times.
✓ Branch 7 taken 50 times.
✓ Branch 8 taken 10329 times.
|
20758 | if (construction->optionalCast<model::ConstructionAirBoundary>()) { |
| 156 |
1/1✓ Branch 1 taken 50 times.
|
50 | m_constructionMaterialName = "AirWall"; |
| 157 |
4/5✓ Branch 1 taken 10329 times.
✓ Branch 4 taken 10329 times.
✓ Branch 7 taken 10329 times.
✓ Branch 10 taken 10329 times.
✗ Branch 11 not taken.
|
10329 | } else if (construction->iddObjectType() == model::Construction::iddObjectType()) { |
| 158 |
3/3✓ Branch 1 taken 10329 times.
✓ Branch 4 taken 10329 times.
✓ Branch 7 taken 10329 times.
|
10329 | m_constructionMaterialName = "Construction_" + construction->nameString(); |
| 159 | } else { | ||
| 160 | ✗ | OS_ASSERT(false); // Shouldn't happen | |
| 161 | ✗ | m_constructionMaterialName = getObjectGLTFMaterialName(construction.get()); | |
| 162 | } | ||
| 163 | 11518 | } | |
| 164 | |||
| 165 |
3/3✓ Branch 1 taken 11518 times.
✓ Branch 3 taken 11420 times.
✓ Branch 4 taken 98 times.
|
23036 | if (auto space = planarSurface.space()) { |
| 166 |
3/3✓ Branch 1 taken 11420 times.
✓ Branch 4 taken 11420 times.
✓ Branch 7 taken 11420 times.
|
11420 | m_spaceHandle = openstudio::removeBraces(space->handle()); |
| 167 |
2/2✓ Branch 1 taken 11420 times.
✓ Branch 4 taken 11420 times.
|
11420 | m_spaceName = space->nameString(); |
| 168 |
4/4✓ Branch 1 taken 11420 times.
✓ Branch 4 taken 11420 times.
✓ Branch 6 taken 7156 times.
✓ Branch 7 taken 4264 times.
|
22840 | if (auto thermalZone = space->thermalZone()) { |
| 169 |
3/3✓ Branch 1 taken 7156 times.
✓ Branch 4 taken 7156 times.
✓ Branch 7 taken 7156 times.
|
7156 | m_thermalZoneHandle = openstudio::removeBraces(thermalZone->handle()); |
| 170 |
2/2✓ Branch 1 taken 7156 times.
✓ Branch 4 taken 7156 times.
|
7156 | m_thermalZoneName = thermalZone->nameString(); |
| 171 |
3/3✓ Branch 1 taken 7156 times.
✓ Branch 4 taken 7156 times.
✓ Branch 7 taken 7156 times.
|
7156 | m_thermalZoneMaterialName = "ThermalZone_" + thermalZone->nameString(); |
| 172 |
2/2✓ Branch 1 taken 7156 times.
✓ Branch 4 taken 7156 times.
|
7156 | std::vector<model::AirLoopHVAC> airLoopHVACs = thermalZone->airLoopHVACs(); |
| 173 |
4/4✓ Branch 1 taken 7156 times.
✓ Branch 4 taken 7156 times.
✓ Branch 10 taken 168 times.
✓ Branch 11 taken 7156 times.
|
7324 | for (const auto& airLoopHVAC : thermalZone->airLoopHVACs()) { |
| 174 |
3/3✓ Branch 1 taken 168 times.
✓ Branch 4 taken 168 times.
✓ Branch 7 taken 168 times.
|
168 | m_airLoopHVACHandles.emplace_back(openstudio::removeBraces(airLoopHVAC.handle())); |
| 175 | |||
| 176 |
2/2✓ Branch 1 taken 168 times.
✓ Branch 4 taken 168 times.
|
168 | m_airLoopHVACNames.emplace_back(airLoopHVAC.nameString()); |
| 177 | |||
| 178 |
2/2✓ Branch 1 taken 168 times.
✓ Branch 4 taken 168 times.
|
168 | m_airLoopHVACMaterialNames.emplace_back(getObjectGLTFMaterialName(airLoopHVAC)); |
| 179 | 7156 | } | |
| 180 | 18576 | } | |
| 181 | |||
| 182 |
4/4✓ Branch 1 taken 11420 times.
✓ Branch 4 taken 11420 times.
✓ Branch 6 taken 10219 times.
✓ Branch 7 taken 1201 times.
|
22840 | if (auto spaceType = space->spaceType()) { |
| 183 |
3/3✓ Branch 1 taken 10219 times.
✓ Branch 4 taken 10219 times.
✓ Branch 7 taken 10219 times.
|
10219 | m_spaceTypeHandle = openstudio::removeBraces(spaceType->handle()); |
| 184 |
2/2✓ Branch 1 taken 10219 times.
✓ Branch 4 taken 10219 times.
|
10219 | m_spaceTypeName = spaceType->nameString(); |
| 185 |
2/2✓ Branch 1 taken 10219 times.
✓ Branch 4 taken 10219 times.
|
10219 | m_spaceTypeMaterialName = getObjectGLTFMaterialName(spaceType.get()); |
| 186 | 11420 | } | |
| 187 | |||
| 188 |
4/4✓ Branch 1 taken 11420 times.
✓ Branch 4 taken 11420 times.
✓ Branch 6 taken 6617 times.
✓ Branch 7 taken 4803 times.
|
22840 | if (auto buildingStory = space->buildingStory()) { |
| 189 |
3/3✓ Branch 1 taken 6617 times.
✓ Branch 4 taken 6617 times.
✓ Branch 7 taken 6617 times.
|
6617 | m_buildingStoryHandle = openstudio::removeBraces(buildingStory->handle()); |
| 190 |
2/2✓ Branch 1 taken 6617 times.
✓ Branch 4 taken 6617 times.
|
6617 | m_buildingStoryName = buildingStory->nameString(); |
| 191 |
2/2✓ Branch 1 taken 6617 times.
✓ Branch 4 taken 6617 times.
|
6617 | m_buildingStoryMaterialName = getObjectGLTFMaterialName(buildingStory.get()); |
| 192 | 11420 | } | |
| 193 | |||
| 194 |
3/4✓ Branch 1 taken 11420 times.
✓ Branch 4 taken 11420 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 11420 times.
|
22840 | if (auto buildingUnit = space->buildingUnit()) { |
| 195 | ✗ | m_buildingUnitHandle = openstudio::removeBraces(buildingUnit->handle()); | |
| 196 | ✗ | m_buildingUnitName = buildingUnit->nameString(); | |
| 197 | ✗ | m_buildingUnitMaterialName = getObjectGLTFMaterialName(buildingUnit.get()); | |
| 198 | 11420 | } | |
| 199 | 11518 | } | |
| 200 | |||
| 201 | // check if the adjacent surface is truly adjacent | ||
| 202 | 11518 | m_coincidentWithOutsideObject = false; | |
| 203 | |||
| 204 |
2/2✓ Branch 1 taken 4482 times.
✓ Branch 2 taken 7036 times.
|
11518 | if (!m_outsideBoundaryConditionObjectHandle.empty()) { |
| 205 | |||
| 206 |
1/1✓ Branch 1 taken 4482 times.
|
4482 | Transformation buildingTransformation; |
| 207 |
3/3✓ Branch 1 taken 4482 times.
✓ Branch 3 taken 4457 times.
✓ Branch 4 taken 25 times.
|
8964 | if (boost::optional<model::PlanarSurfaceGroup> planarSurfaceGroup_ = planarSurface.planarSurfaceGroup()) { |
| 208 |
2/2✓ Branch 1 taken 4457 times.
✓ Branch 4 taken 4457 times.
|
4457 | buildingTransformation = planarSurfaceGroup_->buildingTransformation(); |
| 209 | 4482 | } | |
| 210 | // get the vertices | ||
| 211 |
1/1✓ Branch 1 taken 4482 times.
|
4482 | Point3dVector vertices = planarSurface.vertices(); |
| 212 | |||
| 213 |
1/1✓ Branch 1 taken 4482 times.
|
4482 | auto adjacentHandle = toUUID(m_outsideBoundaryConditionObjectHandle); |
| 214 |
2/2✓ Branch 1 taken 4482 times.
✓ Branch 4 taken 4482 times.
|
4482 | auto adjacentPlanarSurface = planarSurface.model().getModelObject<model::PlanarSurface>(adjacentHandle); |
| 215 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4482 times.
✗ Branch 4 not taken.
|
4482 | OS_ASSERT(adjacentPlanarSurface); |
| 216 | |||
| 217 |
1/1✓ Branch 1 taken 4482 times.
|
4482 | Transformation otherBuildingTransformation; |
| 218 |
4/4✓ Branch 1 taken 4482 times.
✓ Branch 4 taken 4482 times.
✓ Branch 7 taken 4457 times.
✓ Branch 8 taken 25 times.
|
8964 | if (adjacentPlanarSurface->planarSurfaceGroup()) { |
| 219 |
4/4✓ Branch 1 taken 4457 times.
✓ Branch 4 taken 4457 times.
✓ Branch 7 taken 4457 times.
✓ Branch 10 taken 4457 times.
|
4457 | otherBuildingTransformation = adjacentPlanarSurface->planarSurfaceGroup()->buildingTransformation(); |
| 220 | } | ||
| 221 | |||
| 222 |
3/3✓ Branch 1 taken 4482 times.
✓ Branch 4 taken 4482 times.
✓ Branch 7 taken 4482 times.
|
4482 | Point3dVector otherVertices = otherBuildingTransformation * adjacentPlanarSurface->vertices(); |
| 223 |
3/3✓ Branch 1 taken 4482 times.
✓ Branch 4 taken 4482 times.
✓ Branch 7 taken 4482 times.
|
4482 | m_coincidentWithOutsideObject = circularEqual(buildingTransformation * vertices, reverse(otherVertices)); |
| 224 | 4482 | } | |
| 225 | 11518 | } | |
| 226 | |||
| 227 | ✗ | std::string GltfUserData::handle() const { | |
| 228 | ✗ | return m_handle; | |
| 229 | } | ||
| 230 | ✗ | void GltfUserData::setHandle(const std::string& handle) { | |
| 231 | ✗ | m_handle = handle; | |
| 232 | ✗ | } | |
| 233 | |||
| 234 | 7 | std::string GltfUserData::name() const { | |
| 235 | 7 | return m_name; | |
| 236 | } | ||
| 237 | ✗ | void GltfUserData::setName(const std::string& name) { | |
| 238 | ✗ | m_name = name; | |
| 239 | ✗ | } | |
| 240 | |||
| 241 | 1 | std::string GltfUserData::surfaceType() const { | |
| 242 | 1 | return m_surfaceType; | |
| 243 | } | ||
| 244 | ✗ | void GltfUserData::setSurfaceType(const std::string& surfaceType) { | |
| 245 | ✗ | m_surfaceType = surfaceType; | |
| 246 | ✗ | } | |
| 247 | |||
| 248 | ✗ | std::string GltfUserData::constructionName() const { | |
| 249 | ✗ | return m_constructionName; | |
| 250 | } | ||
| 251 | ✗ | void GltfUserData::setConstructionName(const std::string& constructionName) { | |
| 252 | ✗ | m_constructionName = constructionName; | |
| 253 | ✗ | } | |
| 254 | |||
| 255 | ✗ | std::string GltfUserData::constructionHandle() const { | |
| 256 | ✗ | return m_constructionHandle; | |
| 257 | } | ||
| 258 | ✗ | void GltfUserData::setConstructionHandle(const std::string& constructionHandle) { | |
| 259 | ✗ | m_constructionHandle = constructionHandle; | |
| 260 | ✗ | } | |
| 261 | |||
| 262 | 1 | std::string GltfUserData::constructionMaterialName() const { | |
| 263 | 1 | return m_constructionMaterialName; | |
| 264 | } | ||
| 265 | ✗ | void GltfUserData::setConstructionMaterialName(const std::string& constructionMaterialName) { | |
| 266 | ✗ | m_constructionMaterialName = constructionMaterialName; | |
| 267 | ✗ | } | |
| 268 | |||
| 269 | ✗ | std::string GltfUserData::surfaceName() const { | |
| 270 | ✗ | return m_surfaceName; | |
| 271 | } | ||
| 272 | ✗ | void GltfUserData::setSurfaceName(const std::string& surfaceName) { | |
| 273 | ✗ | m_surfaceName = surfaceName; | |
| 274 | ✗ | } | |
| 275 | |||
| 276 | ✗ | std::string GltfUserData::surfaceHandle() const { | |
| 277 | ✗ | return m_surfaceHandle; | |
| 278 | } | ||
| 279 | ✗ | void GltfUserData::setSurfaceHandle(const std::string& surfaceHandle) { | |
| 280 | ✗ | m_surfaceHandle = surfaceHandle; | |
| 281 | ✗ | } | |
| 282 | |||
| 283 | ✗ | std::string GltfUserData::subSurfaceName() const { | |
| 284 | ✗ | return m_subSurfaceName; | |
| 285 | } | ||
| 286 | ✗ | void GltfUserData::setSubSurfaceName(const std::string& subSurfaceName) { | |
| 287 | ✗ | m_subSurfaceName = subSurfaceName; | |
| 288 | ✗ | } | |
| 289 | |||
| 290 | ✗ | std::string GltfUserData::subSurfaceHandle() const { | |
| 291 | ✗ | return m_subSurfaceHandle; | |
| 292 | } | ||
| 293 | ✗ | void GltfUserData::setSubSurfaceHandle(const std::string& subSurfaceHandle) { | |
| 294 | ✗ | m_subSurfaceHandle = subSurfaceHandle; | |
| 295 | ✗ | } | |
| 296 | |||
| 297 | ✗ | std::string GltfUserData::spaceName() const { | |
| 298 | ✗ | return m_spaceName; | |
| 299 | } | ||
| 300 | ✗ | void GltfUserData::setSpaceName(const std::string& spaceName) { | |
| 301 | ✗ | m_spaceName = spaceName; | |
| 302 | ✗ | } | |
| 303 | |||
| 304 | ✗ | std::string GltfUserData::spaceHandle() const { | |
| 305 | ✗ | return m_spaceHandle; | |
| 306 | } | ||
| 307 | ✗ | void GltfUserData::setSpaceHandle(const std::string& spaceHandle) { | |
| 308 | ✗ | m_spaceHandle = spaceHandle; | |
| 309 | ✗ | } | |
| 310 | |||
| 311 | ✗ | std::string GltfUserData::shadingName() const { | |
| 312 | ✗ | return m_shadingName; | |
| 313 | } | ||
| 314 | ✗ | void GltfUserData::setShadingName(const std::string& shadingName) { | |
| 315 | ✗ | m_shadingName = shadingName; | |
| 316 | ✗ | } | |
| 317 | |||
| 318 | ✗ | std::string GltfUserData::shadingHandle() const { | |
| 319 | ✗ | return m_shadingHandle; | |
| 320 | } | ||
| 321 | ✗ | void GltfUserData::setShadingHandle(const std::string& shadingHandle) { | |
| 322 | ✗ | m_shadingHandle = shadingHandle; | |
| 323 | ✗ | } | |
| 324 | |||
| 325 | 1 | std::string GltfUserData::thermalZoneName() const { | |
| 326 | 1 | return m_thermalZoneName; | |
| 327 | } | ||
| 328 | ✗ | void GltfUserData::setThermalZoneName(const std::string& thermalZoneName) { | |
| 329 | ✗ | m_thermalZoneName = thermalZoneName; | |
| 330 | ✗ | } | |
| 331 | |||
| 332 | ✗ | std::string GltfUserData::thermalZoneHandle() const { | |
| 333 | ✗ | return m_thermalZoneHandle; | |
| 334 | } | ||
| 335 | ✗ | void GltfUserData::setThermalZoneHandle(const std::string& thermalZoneHandle) { | |
| 336 | ✗ | m_thermalZoneHandle = thermalZoneHandle; | |
| 337 | ✗ | } | |
| 338 | |||
| 339 | ✗ | std::string GltfUserData::thermalZoneMaterialName() const { | |
| 340 | ✗ | return m_thermalZoneMaterialName; | |
| 341 | } | ||
| 342 | ✗ | void GltfUserData::setThermalZoneMaterialName(const std::string& thermalZoneMaterialName) { | |
| 343 | ✗ | m_thermalZoneMaterialName = thermalZoneMaterialName; | |
| 344 | ✗ | } | |
| 345 | |||
| 346 | ✗ | std::string GltfUserData::spaceTypeName() const { | |
| 347 | ✗ | return m_spaceTypeName; | |
| 348 | } | ||
| 349 | ✗ | void GltfUserData::setSpaceTypeName(const std::string& spaceTypeName) { | |
| 350 | ✗ | m_spaceTypeName = spaceTypeName; | |
| 351 | ✗ | } | |
| 352 | |||
| 353 | ✗ | std::string GltfUserData::spaceTypeHandle() const { | |
| 354 | ✗ | return m_spaceTypeHandle; | |
| 355 | } | ||
| 356 | ✗ | void GltfUserData::setSpaceTypeHandle(const std::string& spaceTypeHandle) { | |
| 357 | ✗ | m_spaceTypeHandle = spaceTypeHandle; | |
| 358 | ✗ | } | |
| 359 | |||
| 360 | ✗ | std::string GltfUserData::spaceTypeMaterialName() const { | |
| 361 | ✗ | return m_spaceTypeMaterialName; | |
| 362 | } | ||
| 363 | ✗ | void GltfUserData::setSpaceTypeMaterialName(const std::string& spaceTypeMaterialName) { | |
| 364 | ✗ | m_spaceTypeMaterialName = spaceTypeMaterialName; | |
| 365 | ✗ | } | |
| 366 | |||
| 367 | ✗ | std::string GltfUserData::buildingStoryName() const { | |
| 368 | ✗ | return m_buildingStoryName; | |
| 369 | } | ||
| 370 | ✗ | void GltfUserData::setBuildingStoryName(const std::string& buildingStoryName) { | |
| 371 | ✗ | m_buildingStoryName = buildingStoryName; | |
| 372 | ✗ | } | |
| 373 | |||
| 374 | ✗ | std::string GltfUserData::buildingStoryHandle() const { | |
| 375 | ✗ | return m_buildingStoryHandle; | |
| 376 | } | ||
| 377 | ✗ | void GltfUserData::setBuildingStoryHandle(const std::string& buildingStoryHandle) { | |
| 378 | ✗ | m_buildingStoryHandle = buildingStoryHandle; | |
| 379 | ✗ | } | |
| 380 | |||
| 381 | ✗ | std::string GltfUserData::buildingStoryMaterialName() const { | |
| 382 | ✗ | return m_buildingStoryMaterialName; | |
| 383 | } | ||
| 384 | ✗ | void GltfUserData::setBuildingStoryMaterialName(const std::string& buildingStoryMaterialName) { | |
| 385 | ✗ | m_buildingStoryMaterialName = buildingStoryMaterialName; | |
| 386 | ✗ | } | |
| 387 | |||
| 388 | ✗ | std::string GltfUserData::buildingUnitName() const { | |
| 389 | ✗ | return m_buildingUnitName; | |
| 390 | } | ||
| 391 | ✗ | void GltfUserData::setBuildingUnitName(const std::string& buildingUnitName) { | |
| 392 | ✗ | m_buildingUnitName = buildingUnitName; | |
| 393 | ✗ | } | |
| 394 | |||
| 395 | ✗ | std::string GltfUserData::buildingUnitHandle() const { | |
| 396 | ✗ | return m_buildingUnitHandle; | |
| 397 | } | ||
| 398 | ✗ | void GltfUserData::setBuildingUnitHandle(const std::string& buildingUnitHandle) { | |
| 399 | ✗ | m_buildingUnitHandle = buildingUnitHandle; | |
| 400 | ✗ | } | |
| 401 | |||
| 402 | ✗ | std::string GltfUserData::buildingUnitMaterialName() const { | |
| 403 | ✗ | return m_buildingUnitMaterialName; | |
| 404 | } | ||
| 405 | ✗ | void GltfUserData::setBuildingUnitMaterialName(const std::string& buildingUnitMaterialName) { | |
| 406 | ✗ | m_buildingUnitMaterialName = buildingUnitMaterialName; | |
| 407 | ✗ | } | |
| 408 | |||
| 409 | ✗ | std::string GltfUserData::constructionSetName() const { | |
| 410 | ✗ | return m_constructionSetName; | |
| 411 | } | ||
| 412 | ✗ | void GltfUserData::setConstructionSetName(const std::string& constructionSetName) { | |
| 413 | ✗ | m_constructionSetName = constructionSetName; | |
| 414 | ✗ | } | |
| 415 | |||
| 416 | ✗ | std::string GltfUserData::constructionSetHandle() const { | |
| 417 | ✗ | return m_constructionSetHandle; | |
| 418 | } | ||
| 419 | ✗ | void GltfUserData::setConstructionSetHandle(const std::string& constructionSetHandle) { | |
| 420 | ✗ | m_constructionSetHandle = constructionSetHandle; | |
| 421 | ✗ | } | |
| 422 | |||
| 423 | ✗ | std::string GltfUserData::constructionSetMaterialName() const { | |
| 424 | ✗ | return m_constructionSetMaterialName; | |
| 425 | } | ||
| 426 | ✗ | void GltfUserData::setConstructionSetMaterialName(const std::string& constructionSetMaterialName) { | |
| 427 | ✗ | m_constructionSetMaterialName = constructionSetMaterialName; | |
| 428 | ✗ | } | |
| 429 | |||
| 430 | 1 | std::string GltfUserData::outsideBoundaryCondition() const { | |
| 431 | 1 | return m_outsideBoundaryCondition; | |
| 432 | } | ||
| 433 | ✗ | void GltfUserData::setOutsideBoundaryCondition(const std::string& outsideBoundaryCondition) { | |
| 434 | ✗ | m_outsideBoundaryCondition = outsideBoundaryCondition; | |
| 435 | ✗ | } | |
| 436 | |||
| 437 | ✗ | std::string GltfUserData::outsideBoundaryConditionObjectName() const { | |
| 438 | ✗ | return m_outsideBoundaryConditionObjectName; | |
| 439 | } | ||
| 440 | ✗ | void GltfUserData::setOutsideBoundaryConditionObjectName(const std::string& outsideBoundaryConditionObjectName) { | |
| 441 | ✗ | m_outsideBoundaryConditionObjectName = outsideBoundaryConditionObjectName; | |
| 442 | ✗ | } | |
| 443 | |||
| 444 | ✗ | std::string GltfUserData::outsideBoundaryConditionObjectHandle() const { | |
| 445 | ✗ | return m_outsideBoundaryConditionObjectHandle; | |
| 446 | } | ||
| 447 | ✗ | void GltfUserData::setOutsideBoundaryConditionObjectHandle(const std::string& outsideBoundaryConditionObjectHandle) { | |
| 448 | ✗ | m_outsideBoundaryConditionObjectHandle = outsideBoundaryConditionObjectHandle; | |
| 449 | ✗ | } | |
| 450 | |||
| 451 | ✗ | bool GltfUserData::coincidentWithOutsideObject() const { | |
| 452 | ✗ | return m_coincidentWithOutsideObject; | |
| 453 | } | ||
| 454 | ✗ | void GltfUserData::setCoincidentWithOutsideObject(bool coincidentWithOutsideObject) { | |
| 455 | ✗ | m_coincidentWithOutsideObject = coincidentWithOutsideObject; | |
| 456 | ✗ | } | |
| 457 | |||
| 458 | 1 | std::string GltfUserData::sunExposure() const { | |
| 459 | 1 | return m_sunExposure; | |
| 460 | } | ||
| 461 | ✗ | void GltfUserData::setSunExposure(const std::string& sunExposure) { | |
| 462 | ✗ | m_sunExposure = sunExposure; | |
| 463 | ✗ | } | |
| 464 | |||
| 465 | 1 | std::string GltfUserData::windExposure() const { | |
| 466 | 1 | return m_windExposure; | |
| 467 | } | ||
| 468 | ✗ | void GltfUserData::setWindExposure(const std::string& windExposure) { | |
| 469 | ✗ | m_windExposure = windExposure; | |
| 470 | ✗ | } | |
| 471 | |||
| 472 | 1 | double GltfUserData::illuminanceSetpoint() const { | |
| 473 | 1 | return m_illuminanceSetpoint; | |
| 474 | } | ||
| 475 | ✗ | void GltfUserData::setIlluminanceSetpoint(double illuminanceSetpoint) { | |
| 476 | ✗ | m_illuminanceSetpoint = illuminanceSetpoint; | |
| 477 | ✗ | } | |
| 478 | |||
| 479 | ✗ | bool GltfUserData::airWall() const { | |
| 480 | ✗ | return m_airWall; | |
| 481 | } | ||
| 482 | ✗ | void GltfUserData::setAirWall(bool airWall) { | |
| 483 | ✗ | m_airWall = airWall; | |
| 484 | ✗ | } | |
| 485 | |||
| 486 | ✗ | std::vector<std::string> GltfUserData::airLoopHVACNames() const { | |
| 487 | ✗ | return m_airLoopHVACNames; | |
| 488 | } | ||
| 489 | |||
| 490 | ✗ | void GltfUserData::setAirLoopHVACNames(const std::vector<std::string>& airLoopHVACNames) { | |
| 491 | ✗ | m_airLoopHVACNames = airLoopHVACNames; | |
| 492 | ✗ | } | |
| 493 | |||
| 494 | ✗ | void GltfUserData::addAirLoopHVACName(std::string airLoopHVACName) { | |
| 495 | ✗ | m_airLoopHVACNames.emplace_back(std::move(airLoopHVACName)); | |
| 496 | ✗ | } | |
| 497 | |||
| 498 | ✗ | std::vector<std::string> GltfUserData::airLoopHVACHandles() const { | |
| 499 | ✗ | return m_airLoopHVACHandles; | |
| 500 | } | ||
| 501 | |||
| 502 | ✗ | void GltfUserData::setAirLoopHVACHandles(const std::vector<std::string>& airLoopHVACHandles) { | |
| 503 | ✗ | m_airLoopHVACHandles = airLoopHVACHandles; | |
| 504 | ✗ | } | |
| 505 | |||
| 506 | ✗ | void GltfUserData::addAirLoopHVACHandle(std::string airLoopHVACHandle) { | |
| 507 | ✗ | m_airLoopHVACHandles.emplace_back(std::move(airLoopHVACHandle)); | |
| 508 | ✗ | } | |
| 509 | |||
| 510 | ✗ | std::vector<std::string> GltfUserData::airLoopHVACMaterialNames() const { | |
| 511 | ✗ | return m_airLoopHVACMaterialNames; | |
| 512 | } | ||
| 513 | |||
| 514 | ✗ | void GltfUserData::setAirLoopHVACMaterialNames(const std::vector<std::string>& airLoopHVACMaterialNames) { | |
| 515 | ✗ | m_airLoopHVACMaterialNames = airLoopHVACMaterialNames; | |
| 516 | ✗ | } | |
| 517 | |||
| 518 | ✗ | void GltfUserData::addAirLoopHVACMaterialName(std::string airLoopHVACMaterialName) { | |
| 519 | ✗ | m_airLoopHVACMaterialNames.emplace_back(std::move(airLoopHVACMaterialName)); | |
| 520 | ✗ | } | |
| 521 | |||
| 522 | 11518 | std::map<std::string, tinygltf::Value> GltfUserData::toExtras() const { | |
| 523 | // TODO: probably make the airloopHVAC stuff a single object with multiple properties | ||
| 524 | // But in any case, we want Arrays not a useless map<std::string(int), std::string> | ||
| 525 | |||
| 526 | 11518 | std::map<std::string, tinygltf::Value> airLoopHVACNamesObject; | |
| 527 | 11518 | std::map<std::string, tinygltf::Value> airLoopHVACHandlesObject; | |
| 528 | 11518 | std::map<std::string, tinygltf::Value> airLoopHVACMaterialNamesObject; | |
| 529 |
2/2✓ Branch 1 taken 168 times.
✓ Branch 2 taken 11518 times.
|
11686 | for (size_t i = 0; i < m_airLoopHVACNames.size(); ++i) { |
| 530 |
3/3✓ Branch 2 taken 168 times.
✓ Branch 5 taken 168 times.
✓ Branch 9 taken 168 times.
|
168 | airLoopHVACNamesObject.emplace(std::make_pair(std::to_string(i), tinygltf::Value(m_airLoopHVACNames[i]))); |
| 531 |
3/3✓ Branch 2 taken 168 times.
✓ Branch 5 taken 168 times.
✓ Branch 9 taken 168 times.
|
168 | airLoopHVACHandlesObject.emplace(std::make_pair(std::to_string(i), tinygltf::Value(m_airLoopHVACHandles[i]))); |
| 532 |
3/3✓ Branch 2 taken 168 times.
✓ Branch 5 taken 168 times.
✓ Branch 9 taken 168 times.
|
168 | airLoopHVACMaterialNamesObject.emplace(std::make_pair(std::to_string(i), tinygltf::Value(m_airLoopHVACMaterialNames[i]))); |
| 533 | } | ||
| 534 | |||
| 535 | return { | ||
| 536 | ✗ | {"handle", tinygltf::Value(m_handle)}, | |
| 537 | 11518 | {"name", tinygltf::Value(m_name)}, | |
| 538 | 11518 | {"surfaceType", tinygltf::Value(m_surfaceType)}, | |
| 539 | 23036 | {"surfaceTypeMaterialName", tinygltf::Value(this->surfaceTypeMaterialName())}, | |
| 540 | 11518 | {"constructionName", tinygltf::Value(m_constructionName)}, | |
| 541 | 11518 | {"constructionHandle", tinygltf::Value(m_constructionHandle)}, | |
| 542 | 11518 | {"constructionMaterialName", tinygltf::Value(m_constructionMaterialName)}, | |
| 543 | 11518 | {"surfaceName", tinygltf::Value(m_surfaceName)}, | |
| 544 | 11518 | {"surfaceHandle", tinygltf::Value(m_surfaceHandle)}, | |
| 545 | 11518 | {"subSurfaceName", tinygltf::Value(m_subSurfaceName)}, | |
| 546 | 11518 | {"subSurfaceHandle", tinygltf::Value(m_subSurfaceHandle)}, | |
| 547 | 11518 | {"spaceName", tinygltf::Value(m_spaceName)}, | |
| 548 | 11518 | {"spaceHandle", tinygltf::Value(m_spaceHandle)}, | |
| 549 | 11518 | {"shadingName", tinygltf::Value(m_shadingName)}, | |
| 550 | 11518 | {"shadingHandle", tinygltf::Value(m_shadingHandle)}, | |
| 551 | 11518 | {"thermalZoneName", tinygltf::Value(m_thermalZoneName)}, | |
| 552 | 11518 | {"thermalZoneHandle", tinygltf::Value(m_thermalZoneHandle)}, | |
| 553 | 11518 | {"thermalZoneMaterialName", tinygltf::Value(m_thermalZoneMaterialName)}, | |
| 554 | 11518 | {"spaceTypeName", tinygltf::Value(m_spaceTypeName)}, | |
| 555 | 11518 | {"spaceTypeHandle", tinygltf::Value(m_spaceTypeHandle)}, | |
| 556 | 11518 | {"spaceTypeMaterialName", tinygltf::Value(m_spaceTypeMaterialName)}, | |
| 557 | 11518 | {"buildingStoryName", tinygltf::Value(m_buildingStoryName)}, | |
| 558 | 11518 | {"buildingStoryHandle", tinygltf::Value(m_buildingStoryHandle)}, | |
| 559 | 11518 | {"buildingStoryMaterialName", tinygltf::Value(m_buildingStoryMaterialName)}, | |
| 560 | 11518 | {"buildingUnitName", tinygltf::Value(m_buildingUnitName)}, | |
| 561 | 11518 | {"buildingUnitHandle", tinygltf::Value(m_buildingUnitHandle)}, | |
| 562 | 11518 | {"buildingUnitMaterialName", tinygltf::Value(m_buildingUnitMaterialName)}, | |
| 563 | 11518 | {"constructionSetName", tinygltf::Value(m_constructionSetName)}, | |
| 564 | 11518 | {"constructionSetHandle", tinygltf::Value(m_constructionSetHandle)}, | |
| 565 | 11518 | {"constructionSetMaterialName", tinygltf::Value(m_constructionSetMaterialName)}, | |
| 566 | 11518 | {"outsideBoundaryCondition", tinygltf::Value(m_outsideBoundaryCondition)}, | |
| 567 | 11518 | {"outsideBoundaryConditionObjectName", tinygltf::Value(m_outsideBoundaryConditionObjectName)}, | |
| 568 | 11518 | {"outsideBoundaryConditionObjectHandle", tinygltf::Value(m_outsideBoundaryConditionObjectHandle)}, | |
| 569 | 23036 | {"boundaryMaterialName", tinygltf::Value(this->boundaryMaterialName())}, | |
| 570 | 11518 | {"coincidentWithOutsideObject", tinygltf::Value(m_coincidentWithOutsideObject)}, | |
| 571 | 11518 | {"sunExposure", tinygltf::Value(m_sunExposure)}, | |
| 572 | 11518 | {"windExposure", tinygltf::Value(m_windExposure)}, | |
| 573 | 11518 | {"illuminanceSetpoint", tinygltf::Value(m_illuminanceSetpoint)}, | |
| 574 | 11518 | {"airWall", tinygltf::Value(m_airWall)}, | |
| 575 | 11518 | {"airLoopHVACNames", tinygltf::Value(airLoopHVACNamesObject)}, | |
| 576 | 11518 | {"airLoopHVACHandles", tinygltf::Value(airLoopHVACHandlesObject)}, | |
| 577 | 11518 | {"airLoopHVACMaterialNames", tinygltf::Value(airLoopHVACMaterialNamesObject)}, | |
| 578 |
3/5✓ Branch 1 taken 11518 times.
✓ Branch 3 taken 483756 times.
✓ Branch 4 taken 11518 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
518310 | }; |
| 579 | 46072 | } | |
| 580 | |||
| 581 | 30 | GltfUserData::GltfUserData(const tinygltf::Value& userDataObj) { | |
| 582 | |||
| 583 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("handle")) { |
| 584 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("handle"); |
| 585 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 586 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_handle = val.Get<std::string>(); |
| 587 | } else { | ||
| 588 | ✗ | LOG(Warn, "userDataObj has the key 'handle' but it is not a std::string"); | |
| 589 | } | ||
| 590 | 30 | } else { | |
| 591 | ✗ | LOG(Debug, "userDataObj is missing the key 'handle'"); | |
| 592 | } | ||
| 593 | |||
| 594 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("name")) { |
| 595 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("name"); |
| 596 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 597 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_name = val.Get<std::string>(); |
| 598 | } else { | ||
| 599 | ✗ | LOG(Warn, "userDataObj has the key 'name' but it is not a std::string"); | |
| 600 | } | ||
| 601 | 30 | } else { | |
| 602 | ✗ | LOG(Debug, "userDataObj is missing the key 'name'"); | |
| 603 | } | ||
| 604 | |||
| 605 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("surfaceType")) { |
| 606 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("surfaceType"); |
| 607 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 608 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_surfaceType = val.Get<std::string>(); |
| 609 | } else { | ||
| 610 | ✗ | LOG(Warn, "userDataObj has the key 'surfaceType' but it is not a std::string"); | |
| 611 | } | ||
| 612 | 30 | } else { | |
| 613 | ✗ | LOG(Debug, "userDataObj is missing the key 'surfaceType'"); | |
| 614 | } | ||
| 615 | |||
| 616 | // if (userDataObj.Has("surfaceTypeMaterialName")) { | ||
| 617 | // auto val = userDataObj.Get("surfaceTypeMaterialName"); | ||
| 618 | // if (val.IsString()) { | ||
| 619 | // m_surfaceTypeMaterialName = val.Get<std::string>(); | ||
| 620 | // } else { | ||
| 621 | // LOG(Warn, "userDataObj has the key 'surfaceTypeMaterialName' but it is not a std::string"); | ||
| 622 | // } | ||
| 623 | // } else { | ||
| 624 | // LOG(Debug, "userDataObj is missing the key 'surfaceTypeMaterialName'"); | ||
| 625 | // } | ||
| 626 | |||
| 627 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("constructionName")) { |
| 628 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("constructionName"); |
| 629 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 630 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_constructionName = val.Get<std::string>(); |
| 631 | } else { | ||
| 632 | ✗ | LOG(Warn, "userDataObj has the key 'constructionName' but it is not a std::string"); | |
| 633 | } | ||
| 634 | 30 | } else { | |
| 635 | ✗ | LOG(Debug, "userDataObj is missing the key 'constructionName'"); | |
| 636 | } | ||
| 637 | |||
| 638 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("constructionHandle")) { |
| 639 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("constructionHandle"); |
| 640 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 641 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_constructionHandle = val.Get<std::string>(); |
| 642 | } else { | ||
| 643 | ✗ | LOG(Warn, "userDataObj has the key 'constructionHandle' but it is not a std::string"); | |
| 644 | } | ||
| 645 | 30 | } else { | |
| 646 | ✗ | LOG(Debug, "userDataObj is missing the key 'constructionHandle'"); | |
| 647 | } | ||
| 648 | |||
| 649 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("constructionMaterialName")) { |
| 650 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("constructionMaterialName"); |
| 651 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 652 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_constructionMaterialName = val.Get<std::string>(); |
| 653 | } else { | ||
| 654 | ✗ | LOG(Warn, "userDataObj has the key 'constructionMaterialName' but it is not a std::string"); | |
| 655 | } | ||
| 656 | 30 | } else { | |
| 657 | ✗ | LOG(Debug, "userDataObj is missing the key 'constructionMaterialName'"); | |
| 658 | } | ||
| 659 | |||
| 660 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("surfaceName")) { |
| 661 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("surfaceName"); |
| 662 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 663 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_surfaceName = val.Get<std::string>(); |
| 664 | } else { | ||
| 665 | ✗ | LOG(Warn, "userDataObj has the key 'surfaceName' but it is not a std::string"); | |
| 666 | } | ||
| 667 | 30 | } else { | |
| 668 | ✗ | LOG(Debug, "userDataObj is missing the key 'surfaceName'"); | |
| 669 | } | ||
| 670 | |||
| 671 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("surfaceHandle")) { |
| 672 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("surfaceHandle"); |
| 673 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 674 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_surfaceHandle = val.Get<std::string>(); |
| 675 | } else { | ||
| 676 | ✗ | LOG(Warn, "userDataObj has the key 'surfaceHandle' but it is not a std::string"); | |
| 677 | } | ||
| 678 | 30 | } else { | |
| 679 | ✗ | LOG(Debug, "userDataObj is missing the key 'surfaceHandle'"); | |
| 680 | } | ||
| 681 | |||
| 682 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("subSurfaceName")) { |
| 683 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("subSurfaceName"); |
| 684 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 685 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_subSurfaceName = val.Get<std::string>(); |
| 686 | } else { | ||
| 687 | ✗ | LOG(Warn, "userDataObj has the key 'subSurfaceName' but it is not a std::string"); | |
| 688 | } | ||
| 689 | 30 | } else { | |
| 690 | ✗ | LOG(Debug, "userDataObj is missing the key 'subSurfaceName'"); | |
| 691 | } | ||
| 692 | |||
| 693 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("subSurfaceHandle")) { |
| 694 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("subSurfaceHandle"); |
| 695 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 696 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_subSurfaceHandle = val.Get<std::string>(); |
| 697 | } else { | ||
| 698 | ✗ | LOG(Warn, "userDataObj has the key 'subSurfaceHandle' but it is not a std::string"); | |
| 699 | } | ||
| 700 | 30 | } else { | |
| 701 | ✗ | LOG(Debug, "userDataObj is missing the key 'subSurfaceHandle'"); | |
| 702 | } | ||
| 703 | |||
| 704 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("spaceName")) { |
| 705 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("spaceName"); |
| 706 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 707 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_spaceName = val.Get<std::string>(); |
| 708 | } else { | ||
| 709 | ✗ | LOG(Warn, "userDataObj has the key 'spaceName' but it is not a std::string"); | |
| 710 | } | ||
| 711 | 30 | } else { | |
| 712 | ✗ | LOG(Debug, "userDataObj is missing the key 'spaceName'"); | |
| 713 | } | ||
| 714 | |||
| 715 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("spaceHandle")) { |
| 716 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("spaceHandle"); |
| 717 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 718 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_spaceHandle = val.Get<std::string>(); |
| 719 | } else { | ||
| 720 | ✗ | LOG(Warn, "userDataObj has the key 'spaceHandle' but it is not a std::string"); | |
| 721 | } | ||
| 722 | 30 | } else { | |
| 723 | ✗ | LOG(Debug, "userDataObj is missing the key 'spaceHandle'"); | |
| 724 | } | ||
| 725 | |||
| 726 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("shadingName")) { |
| 727 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("shadingName"); |
| 728 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 729 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_shadingName = val.Get<std::string>(); |
| 730 | } else { | ||
| 731 | ✗ | LOG(Warn, "userDataObj has the key 'shadingName' but it is not a std::string"); | |
| 732 | } | ||
| 733 | 30 | } else { | |
| 734 | ✗ | LOG(Debug, "userDataObj is missing the key 'shadingName'"); | |
| 735 | } | ||
| 736 | |||
| 737 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("shadingHandle")) { |
| 738 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("shadingHandle"); |
| 739 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 740 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_shadingHandle = val.Get<std::string>(); |
| 741 | } else { | ||
| 742 | ✗ | LOG(Warn, "userDataObj has the key 'shadingHandle' but it is not a std::string"); | |
| 743 | } | ||
| 744 | 30 | } else { | |
| 745 | ✗ | LOG(Debug, "userDataObj is missing the key 'shadingHandle'"); | |
| 746 | } | ||
| 747 | |||
| 748 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("thermalZoneName")) { |
| 749 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("thermalZoneName"); |
| 750 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 751 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_thermalZoneName = val.Get<std::string>(); |
| 752 | } else { | ||
| 753 | ✗ | LOG(Warn, "userDataObj has the key 'thermalZoneName' but it is not a std::string"); | |
| 754 | } | ||
| 755 | 30 | } else { | |
| 756 | ✗ | LOG(Debug, "userDataObj is missing the key 'thermalZoneName'"); | |
| 757 | } | ||
| 758 | |||
| 759 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("thermalZoneHandle")) { |
| 760 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("thermalZoneHandle"); |
| 761 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 762 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_thermalZoneHandle = val.Get<std::string>(); |
| 763 | } else { | ||
| 764 | ✗ | LOG(Warn, "userDataObj has the key 'thermalZoneHandle' but it is not a std::string"); | |
| 765 | } | ||
| 766 | 30 | } else { | |
| 767 | ✗ | LOG(Debug, "userDataObj is missing the key 'thermalZoneHandle'"); | |
| 768 | } | ||
| 769 | |||
| 770 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("thermalZoneMaterialName")) { |
| 771 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("thermalZoneMaterialName"); |
| 772 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 773 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_thermalZoneMaterialName = val.Get<std::string>(); |
| 774 | } else { | ||
| 775 | ✗ | LOG(Warn, "userDataObj has the key 'thermalZoneMaterialName' but it is not a std::string"); | |
| 776 | } | ||
| 777 | 30 | } else { | |
| 778 | ✗ | LOG(Debug, "userDataObj is missing the key 'thermalZoneMaterialName'"); | |
| 779 | } | ||
| 780 | |||
| 781 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("spaceTypeName")) { |
| 782 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("spaceTypeName"); |
| 783 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 784 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_spaceTypeName = val.Get<std::string>(); |
| 785 | } else { | ||
| 786 | ✗ | LOG(Warn, "userDataObj has the key 'spaceTypeName' but it is not a std::string"); | |
| 787 | } | ||
| 788 | 30 | } else { | |
| 789 | ✗ | LOG(Debug, "userDataObj is missing the key 'spaceTypeName'"); | |
| 790 | } | ||
| 791 | |||
| 792 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("spaceTypeHandle")) { |
| 793 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("spaceTypeHandle"); |
| 794 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 795 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_spaceTypeHandle = val.Get<std::string>(); |
| 796 | } else { | ||
| 797 | ✗ | LOG(Warn, "userDataObj has the key 'spaceTypeHandle' but it is not a std::string"); | |
| 798 | } | ||
| 799 | 30 | } else { | |
| 800 | ✗ | LOG(Debug, "userDataObj is missing the key 'spaceTypeHandle'"); | |
| 801 | } | ||
| 802 | |||
| 803 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("spaceTypeMaterialName")) { |
| 804 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("spaceTypeMaterialName"); |
| 805 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 806 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_spaceTypeMaterialName = val.Get<std::string>(); |
| 807 | } else { | ||
| 808 | ✗ | LOG(Warn, "userDataObj has the key 'spaceTypeMaterialName' but it is not a std::string"); | |
| 809 | } | ||
| 810 | 30 | } else { | |
| 811 | ✗ | LOG(Debug, "userDataObj is missing the key 'spaceTypeMaterialName'"); | |
| 812 | } | ||
| 813 | |||
| 814 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("buildingStoryName")) { |
| 815 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("buildingStoryName"); |
| 816 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 817 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_buildingStoryName = val.Get<std::string>(); |
| 818 | } else { | ||
| 819 | ✗ | LOG(Warn, "userDataObj has the key 'buildingStoryName' but it is not a std::string"); | |
| 820 | } | ||
| 821 | 30 | } else { | |
| 822 | ✗ | LOG(Debug, "userDataObj is missing the key 'buildingStoryName'"); | |
| 823 | } | ||
| 824 | |||
| 825 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("buildingStoryHandle")) { |
| 826 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("buildingStoryHandle"); |
| 827 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 828 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_buildingStoryHandle = val.Get<std::string>(); |
| 829 | } else { | ||
| 830 | ✗ | LOG(Warn, "userDataObj has the key 'buildingStoryHandle' but it is not a std::string"); | |
| 831 | } | ||
| 832 | 30 | } else { | |
| 833 | ✗ | LOG(Debug, "userDataObj is missing the key 'buildingStoryHandle'"); | |
| 834 | } | ||
| 835 | |||
| 836 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("buildingStoryMaterialName")) { |
| 837 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("buildingStoryMaterialName"); |
| 838 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 839 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_buildingStoryMaterialName = val.Get<std::string>(); |
| 840 | } else { | ||
| 841 | ✗ | LOG(Warn, "userDataObj has the key 'buildingStoryMaterialName' but it is not a std::string"); | |
| 842 | } | ||
| 843 | 30 | } else { | |
| 844 | ✗ | LOG(Debug, "userDataObj is missing the key 'buildingStoryMaterialName'"); | |
| 845 | } | ||
| 846 | |||
| 847 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("buildingUnitName")) { |
| 848 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("buildingUnitName"); |
| 849 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 850 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_buildingUnitName = val.Get<std::string>(); |
| 851 | } else { | ||
| 852 | ✗ | LOG(Warn, "userDataObj has the key 'buildingUnitName' but it is not a std::string"); | |
| 853 | } | ||
| 854 | 30 | } else { | |
| 855 | ✗ | LOG(Debug, "userDataObj is missing the key 'buildingUnitName'"); | |
| 856 | } | ||
| 857 | |||
| 858 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("buildingUnitHandle")) { |
| 859 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("buildingUnitHandle"); |
| 860 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 861 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_buildingUnitHandle = val.Get<std::string>(); |
| 862 | } else { | ||
| 863 | ✗ | LOG(Warn, "userDataObj has the key 'buildingUnitHandle' but it is not a std::string"); | |
| 864 | } | ||
| 865 | 30 | } else { | |
| 866 | ✗ | LOG(Debug, "userDataObj is missing the key 'buildingUnitHandle'"); | |
| 867 | } | ||
| 868 | |||
| 869 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("buildingUnitMaterialName")) { |
| 870 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("buildingUnitMaterialName"); |
| 871 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 872 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_buildingUnitMaterialName = val.Get<std::string>(); |
| 873 | } else { | ||
| 874 | ✗ | LOG(Warn, "userDataObj has the key 'buildingUnitMaterialName' but it is not a std::string"); | |
| 875 | } | ||
| 876 | 30 | } else { | |
| 877 | ✗ | LOG(Debug, "userDataObj is missing the key 'buildingUnitMaterialName'"); | |
| 878 | } | ||
| 879 | |||
| 880 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("constructionSetName")) { |
| 881 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("constructionSetName"); |
| 882 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 883 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_constructionSetName = val.Get<std::string>(); |
| 884 | } else { | ||
| 885 | ✗ | LOG(Warn, "userDataObj has the key 'constructionSetName' but it is not a std::string"); | |
| 886 | } | ||
| 887 | 30 | } else { | |
| 888 | ✗ | LOG(Debug, "userDataObj is missing the key 'constructionSetName'"); | |
| 889 | } | ||
| 890 | |||
| 891 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("constructionSetHandle")) { |
| 892 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("constructionSetHandle"); |
| 893 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 894 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_constructionSetHandle = val.Get<std::string>(); |
| 895 | } else { | ||
| 896 | ✗ | LOG(Warn, "userDataObj has the key 'constructionSetHandle' but it is not a std::string"); | |
| 897 | } | ||
| 898 | 30 | } else { | |
| 899 | ✗ | LOG(Debug, "userDataObj is missing the key 'constructionSetHandle'"); | |
| 900 | } | ||
| 901 | |||
| 902 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("constructionSetMaterialName")) { |
| 903 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("constructionSetMaterialName"); |
| 904 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 905 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_constructionSetMaterialName = val.Get<std::string>(); |
| 906 | } else { | ||
| 907 | ✗ | LOG(Warn, "userDataObj has the key 'constructionSetMaterialName' but it is not a std::string"); | |
| 908 | } | ||
| 909 | 30 | } else { | |
| 910 | ✗ | LOG(Debug, "userDataObj is missing the key 'constructionSetMaterialName'"); | |
| 911 | } | ||
| 912 | |||
| 913 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("outsideBoundaryCondition")) { |
| 914 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("outsideBoundaryCondition"); |
| 915 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 916 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_outsideBoundaryCondition = val.Get<std::string>(); |
| 917 | } else { | ||
| 918 | ✗ | LOG(Warn, "userDataObj has the key 'outsideBoundaryCondition' but it is not a std::string"); | |
| 919 | } | ||
| 920 | 30 | } else { | |
| 921 | ✗ | LOG(Debug, "userDataObj is missing the key 'outsideBoundaryCondition'"); | |
| 922 | } | ||
| 923 | |||
| 924 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("outsideBoundaryConditionObjectName")) { |
| 925 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("outsideBoundaryConditionObjectName"); |
| 926 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 927 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_outsideBoundaryConditionObjectName = val.Get<std::string>(); |
| 928 | } else { | ||
| 929 | ✗ | LOG(Warn, "userDataObj has the key 'outsideBoundaryConditionObjectName' but it is not a std::string"); | |
| 930 | } | ||
| 931 | 30 | } else { | |
| 932 | ✗ | LOG(Debug, "userDataObj is missing the key 'outsideBoundaryConditionObjectName'"); | |
| 933 | } | ||
| 934 | |||
| 935 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("outsideBoundaryConditionObjectHandle")) { |
| 936 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("outsideBoundaryConditionObjectHandle"); |
| 937 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 938 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_outsideBoundaryConditionObjectHandle = val.Get<std::string>(); |
| 939 | } else { | ||
| 940 | ✗ | LOG(Warn, "userDataObj has the key 'outsideBoundaryConditionObjectHandle' but it is not a std::string"); | |
| 941 | } | ||
| 942 | 30 | } else { | |
| 943 | ✗ | LOG(Debug, "userDataObj is missing the key 'outsideBoundaryConditionObjectHandle'"); | |
| 944 | } | ||
| 945 | |||
| 946 | // if (userDataObj.Has("boundaryMaterialName")) { | ||
| 947 | // auto val = userDataObj.Get("boundaryMaterialName"); | ||
| 948 | // if (val.IsString()) { | ||
| 949 | // m_boundaryMaterialName = val.Get<std::string>(); | ||
| 950 | // } else { | ||
| 951 | // LOG(Warn, "userDataObj has the key 'boundaryMaterialName' but it is not a std::string"); | ||
| 952 | // } | ||
| 953 | // } else { | ||
| 954 | // LOG(Debug, "userDataObj is missing the key 'boundaryMaterialName'"); | ||
| 955 | // } | ||
| 956 | // | ||
| 957 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("coincidentWithOutsideObject")) { |
| 958 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("coincidentWithOutsideObject"); |
| 959 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsBool()) { |
| 960 | 30 | m_coincidentWithOutsideObject = val.Get<bool>(); | |
| 961 | } else { | ||
| 962 | ✗ | LOG(Warn, "userDataObj has the key 'coincidentWithOutsideObject' but it is not a bool"); | |
| 963 | } | ||
| 964 | 30 | } else { | |
| 965 | ✗ | LOG(Debug, "userDataObj is missing the key 'coincidentWithOutsideObject'"); | |
| 966 | } | ||
| 967 | |||
| 968 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("sunExposure")) { |
| 969 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("sunExposure"); |
| 970 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 971 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_sunExposure = val.Get<std::string>(); |
| 972 | } else { | ||
| 973 | ✗ | LOG(Warn, "userDataObj has the key 'sunExposure' but it is not a std::string"); | |
| 974 | } | ||
| 975 | 30 | } else { | |
| 976 | ✗ | LOG(Debug, "userDataObj is missing the key 'sunExposure'"); | |
| 977 | } | ||
| 978 | |||
| 979 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("windExposure")) { |
| 980 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("windExposure"); |
| 981 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsString()) { |
| 982 |
1/1✓ Branch 2 taken 30 times.
|
30 | m_windExposure = val.Get<std::string>(); |
| 983 | } else { | ||
| 984 | ✗ | LOG(Warn, "userDataObj has the key 'windExposure' but it is not a std::string"); | |
| 985 | } | ||
| 986 | 30 | } else { | |
| 987 | ✗ | LOG(Debug, "userDataObj is missing the key 'windExposure'"); | |
| 988 | } | ||
| 989 | |||
| 990 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("illuminanceSetpoint")) { |
| 991 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("illuminanceSetpoint"); |
| 992 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsReal()) { |
| 993 | 30 | m_illuminanceSetpoint = val.Get<double>(); | |
| 994 | } else { | ||
| 995 | ✗ | LOG(Warn, "userDataObj has the key 'illuminanceSetpoint' but it is not a double"); | |
| 996 | } | ||
| 997 | 30 | } else { | |
| 998 | ✗ | LOG(Debug, "userDataObj is missing the key 'illuminanceSetpoint'"); | |
| 999 | } | ||
| 1000 | |||
| 1001 |
3/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
60 | if (userDataObj.Has("airWall")) { |
| 1002 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | auto val = userDataObj.Get("airWall"); |
| 1003 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | if (val.IsBool()) { |
| 1004 | 30 | m_airWall = val.Get<bool>(); | |
| 1005 | } else { | ||
| 1006 | ✗ | LOG(Warn, "userDataObj has the key 'airWall' but it is not a bool"); | |
| 1007 | } | ||
| 1008 | 30 | } else { | |
| 1009 | ✗ | LOG(Debug, "userDataObj is missing the key 'airWall'"); | |
| 1010 | } | ||
| 1011 | |||
| 1012 |
4/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 28 times.
✓ Branch 8 taken 2 times.
|
60 | if (userDataObj.Has("airLoopHVACNames")) { |
| 1013 |
3/3✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
✓ Branch 7 taken 28 times.
|
28 | auto val = userDataObj.Get("airLoopHVACNames"); |
| 1014 |
1/2✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
|
28 | if (val.IsObject()) { |
| 1015 | 28 | std::vector<std::string> names; | |
| 1016 |
2/2✓ Branch 6 taken 28 times.
✓ Branch 7 taken 28 times.
|
56 | for (const auto& vv : val.Get<std::map<std::string, tinygltf::Value>>()) { |
| 1017 |
1/2✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
|
28 | if (vv.second.IsString()) { |
| 1018 |
1/1✓ Branch 2 taken 28 times.
|
28 | m_airLoopHVACNames.emplace_back(vv.second.Get<std::string>()); |
| 1019 | } else { | ||
| 1020 | ✗ | LOG(Warn, "userDataObj has the key 'airLoopHVACNames', it is an Object, but at least one of the subobjects is not a std::string"); | |
| 1021 | } | ||
| 1022 | } | ||
| 1023 | 28 | } else { | |
| 1024 | ✗ | LOG(Warn, "userDataObj has the key 'airLoopHVACNames' but it is not an Object"); | |
| 1025 | } | ||
| 1026 | 28 | } else { | |
| 1027 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
|
2 | LOG(Debug, "userDataObj is missing the key 'airLoopHVACNames'"); |
| 1028 | } | ||
| 1029 | |||
| 1030 |
4/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 28 times.
✓ Branch 8 taken 2 times.
|
60 | if (userDataObj.Has("airLoopHVACHandles")) { |
| 1031 |
3/3✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
✓ Branch 7 taken 28 times.
|
28 | auto val = userDataObj.Get("airLoopHVACHandles"); |
| 1032 |
1/2✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
|
28 | if (val.IsObject()) { |
| 1033 | 28 | std::vector<std::string> names; | |
| 1034 |
2/2✓ Branch 6 taken 28 times.
✓ Branch 7 taken 28 times.
|
56 | for (const auto& vv : val.Get<std::map<std::string, tinygltf::Value>>()) { |
| 1035 |
1/2✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
|
28 | if (vv.second.IsString()) { |
| 1036 |
1/1✓ Branch 2 taken 28 times.
|
28 | m_airLoopHVACHandles.emplace_back(vv.second.Get<std::string>()); |
| 1037 | } else { | ||
| 1038 | ✗ | LOG(Warn, "userDataObj has the key 'airLoopHVACHandles', it is an Object, but at least one of the subobjects is not a std::string"); | |
| 1039 | } | ||
| 1040 | } | ||
| 1041 | 28 | } else { | |
| 1042 | ✗ | LOG(Warn, "userDataObj has the key 'airLoopHVACHandles' but it is not an Object"); | |
| 1043 | } | ||
| 1044 | 28 | } else { | |
| 1045 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
|
2 | LOG(Debug, "userDataObj is missing the key 'airLoopHVACHandles'"); |
| 1046 | } | ||
| 1047 | |||
| 1048 |
4/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 28 times.
✓ Branch 8 taken 2 times.
|
60 | if (userDataObj.Has("airLoopHVACMaterialNames")) { |
| 1049 |
3/3✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
✓ Branch 7 taken 28 times.
|
28 | auto val = userDataObj.Get("airLoopHVACMaterialNames"); |
| 1050 |
1/2✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
|
28 | if (val.IsObject()) { |
| 1051 | 28 | std::vector<std::string> names; | |
| 1052 |
2/2✓ Branch 6 taken 28 times.
✓ Branch 7 taken 28 times.
|
56 | for (const auto& vv : val.Get<std::map<std::string, tinygltf::Value>>()) { |
| 1053 |
1/2✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
|
28 | if (vv.second.IsString()) { |
| 1054 |
1/1✓ Branch 2 taken 28 times.
|
28 | m_airLoopHVACMaterialNames.emplace_back(vv.second.Get<std::string>()); |
| 1055 | } else { | ||
| 1056 | ✗ | LOG(Warn, "userDataObj has the key 'airLoopHVACMaterialNames', it is an Object, but at least one of the subobjects is not a std::string"); | |
| 1057 | } | ||
| 1058 | } | ||
| 1059 | 28 | } else { | |
| 1060 | ✗ | LOG(Warn, "userDataObj has the key 'airLoopHVACMaterialNames' but it is not an Object"); | |
| 1061 | } | ||
| 1062 | 28 | } else { | |
| 1063 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
|
2 | LOG(Debug, "userDataObj is missing the key 'airLoopHVACMaterialNames'"); |
| 1064 | } | ||
| 1065 | 30 | } | |
| 1066 | |||
| 1067 | } // namespace gltf | ||
| 1068 | } // namespace openstudio | ||
| 1069 |