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

Function getObjectGLTFMaterialName

src/gltf/GltfUtils.cpp:209–233  ·  view source on GitHub ↗

Gets GLTF Material name on the basis of idd Object Type and Name param : iddObjectType param : name returns : name of GLTF Material Name

Source from the content-addressed store, hash-verified

207 // param : name
208 // returns : name of GLTF Material Name
209 std::string getObjectGLTFMaterialName(const std::string& iddObjectType, const std::string& name) {
210 std::string result;
211 if (istringEqual(iddObjectType, "OS:Construction")) {
212 result = "Construction_" + name;
213 } else if (istringEqual(iddObjectType, "OS:ThermalZone")) {
214 result = "ThermalZone_" + name;
215 } else if (istringEqual(iddObjectType, "OS:AirLoopHVAC")) {
216 result = "AirLoopHVAC_" + name;
217 } else if (istringEqual(iddObjectType, "OS:SpaceType")) {
218 result = "SpaceType_" + name;
219 } else if (istringEqual(iddObjectType, "OS:BuildingStory")) {
220 result = "BuildingStory_" + name;
221 } else if (istringEqual(iddObjectType, "OS:BuildingUnit")) {
222 result = "BuildingUnit_" + name;
223 } else if (istringEqual(iddObjectType, "OS:Construction:AirBoundary")) {
224 // TODO
225 // This shouldn't happen
226 // LOG_FREE(Error, "getObjectGLTFMaterialName", "Didn't expect it would be called for '" << iddObjectType << "' (name = '" << name << "')");
227 // result = "ConstructionAirBoundary_" + name;
228 result = "AirWall";
229 } else {
230 LOG_FREE(Error, "getObjectGLTFMaterialName", "Unknown iddObjectType '" << iddObjectType << "'");
231 }
232 return result;
233 }
234
235 // Gets GLTF Material Name on the basis of Model Object
236 // param : object

Callers 2

buildMaterialsMethod · 0.85
GltfUserDataMethod · 0.85

Calls 4

istringEqualFunction · 0.85
valueDescriptionMethod · 0.80
nameStringMethod · 0.80
iddObjectTypeMethod · 0.45

Tested by

no test coverage detected