MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / GltfMetaData

Method GltfMetaData

src/gltf/GltfMetaData.cpp:42–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 GltfMetaData::GltfMetaData() = default;
41
42 GltfMetaData::GltfMetaData(const model::Model& model) {
43
44 // Generator
45 setGenerator("OpenStudio");
46 // type | ??
47 setType("Object");
48 // Version
49 setVersion(openStudioVersion());
50 // North Axis
51 setNorthAxis(model);
52
53 m_glTFBoundingBox = GltfBoundingBox(model.getModelObjects<model::PlanarSurfaceGroup>());
54
55 // Building Story Names
56 auto buildingStories = model.getConcreteModelObjects<model::BuildingStory>();
57 for (const auto& buildingStory : buildingStories) {
58 m_glTFModelObjectMetaDataVector.emplace_back(buildingStory);
59 m_buildingStoryNames.emplace_back(buildingStory.nameString());
60 ++m_buildingStoryCount;
61 // TODO: I am matching what the initial implementation was doing, I guess the idea is to have spaces follow the story they belong to
62 for (const auto& space : buildingStory.spaces()) {
63 m_glTFModelObjectMetaDataVector.emplace_back(space);
64 ++m_spaceCount;
65 }
66 }
67
68 for (const auto& buildingUnit : model.getConcreteModelObjects<model::BuildingUnit>()) {
69 m_glTFModelObjectMetaDataVector.emplace_back(buildingUnit);
70 ++m_buildingUnitCount;
71 }
72
73 for (const auto& thermalZone : model.getConcreteModelObjects<model::ThermalZone>()) {
74 m_glTFModelObjectMetaDataVector.emplace_back(thermalZone);
75 ++m_thermalZoneCount;
76 }
77
78 for (const auto& buildingUnit : model.getConcreteModelObjects<model::SpaceType>()) {
79 m_glTFModelObjectMetaDataVector.emplace_back(buildingUnit);
80 ++m_spaceTypeCount;
81 }
82
83 for (const auto& buildingUnit : model.getConcreteModelObjects<model::DefaultConstructionSet>()) {
84 m_glTFModelObjectMetaDataVector.emplace_back(buildingUnit);
85 ++m_constructionSetCount;
86 }
87
88 for (const auto& buildingUnit : model.getConcreteModelObjects<model::AirLoopHVAC>()) {
89 m_glTFModelObjectMetaDataVector.emplace_back(buildingUnit);
90 ++m_airLoopCount;
91 }
92 }
93
94 std::vector<GltfModelObjectMetaData> GltfMetaData::glTFModelObjectMetaDataVector() const {
95 return m_glTFModelObjectMetaDataVector;

Callers

nothing calls this directly

Calls 3

nameStringMethod · 0.80
spacesMethod · 0.45
iddObjectTypeMethod · 0.45

Tested by

no test coverage detected