GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 0 / 1 / 1
Functions: -% 0 / 1 / 1
Branches: -% 0 / 1 / 1

src/gltf/GltfMetaData.hpp
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 #ifndef GLTF_GLTFMETADATA_HPP
7 #define GLTF_GLTFMETADATA_HPP
8
9 #include "GltfAPI.hpp"
10
11 #include "GltfModelObjectMetaData.hpp"
12 #include "GltfBoundingBox.hpp"
13
14 #include "../utilities/core/Logger.hpp"
15
16 namespace tinygltf {
17 class Value;
18 }
19
20 namespace openstudio {
21 namespace model {
22 class Model;
23 class PlanarSurfaceGroup;
24 class BuildingStory;
25
26 } // namespace model
27
28 namespace gltf {
29
30 /** GltfMetadata is an Interface between an OpenStudio Model and a glTF Scene's `extras` **/
31 class GLTF_API GltfMetaData
32 {
33 public:
34 GltfMetaData(); // default ctor
35
36 /** @name Interface with Model */
37 //@{
38 /** Interface with the Model **/
39 GltfMetaData(const model::Model& model);
40 //@}
41
42 /** @name Getters and Setters */
43 //@{
44
45 std::vector<GltfModelObjectMetaData> glTFModelObjectMetaDataVector() const;
46 void setGlTFModelObjectMetaDataVector(const std::vector<GltfModelObjectMetaData>& glTFModelObjectMetaDataVector);
47
48 GltfBoundingBox glTFBoundingBox() const;
49 void setGlTFBoundingBox(const GltfBoundingBox& glTFBoundingBox);
50
51 std::vector<std::string> buildingStoryNames() const;
52 void setBuildingStoryNames(const std::vector<std::string>& buildingStoryNames);
53 // Convenience function. TODO: keep?
54 void setBuildingStoryNames(const std::vector<model::BuildingStory>& buildingStories);
55
56 std::string generator() const;
57 void setGenerator(const std::string& generator);
58
59 std::string type() const;
60 void setType(const std::string& type);
61
62 std::string version() const;
63 void setVersion(const std::string& version);
64
65 double northAxis() const;
66 void setNorthAxis(double northAxis);
67 void setNorthAxis(const model::Model& model);
68
69 // Counting
70 // TODO: Remove setters
71 int thermalZoneCount() const;
72 void setThermalZoneCount(int thermalZoneCount);
73
74 int spaceCount() const;
75 void setSpaceCount(int spaceCount);
76
77 int spaceTypeCount() const;
78 void setSpaceTypeCount(int spaceTypeCount);
79
80 int constructionSetCount() const;
81 void setConstructionSetCount(int constructionSetCount);
82
83 int airLoopCount() const;
84 void setAirLoopCount(int airLoopCount);
85
86 int buildingStoryCount() const;
87 void setBuildingStoryCount(int buildingStoryCount);
88
89 //@}
90
91 protected:
92 /** @name Protected */
93 //@{
94 std::map<std::string, tinygltf::Value> toExtras() const;
95 GltfMetaData(const tinygltf::Value& metaDataObj);
96
97 //@}
98 friend class GltfForwardTranslator;
99
100 private:
101 − REGISTER_LOGGER("openstudio.gltf.GltfMetaData");
102
103 std::vector<GltfModelObjectMetaData> m_glTFModelObjectMetaDataVector;
104 GltfBoundingBox m_glTFBoundingBox;
105 std::vector<std::string> m_buildingStoryNames;
106 std::string m_generator;
107 std::string m_type;
108 std::string m_version;
109 double m_northAxis = 0.0;
110 int m_buildingStoryCount = 0; // TODO: this is pointless, we have m_buildingStoryNames.size()
111 int m_thermalZoneCount = 0;
112 int m_spaceCount = 0;
113 int m_spaceTypeCount = 0;
114 int m_constructionSetCount = 0;
115 int m_airLoopCount = 0;
116 int m_buildingUnitCount = 0;
117 };
118 } // namespace gltf
119 } // namespace openstudio
120
121 #endif //GLTF_GLTFMETADATA_HPP
122