MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / read_surface_style

Method read_surface_style

src/serializers/HdfSerializer.cpp:237–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void HdfSerializer::read_surface_style(const surface_style_serialization& s,
238 ifcopenshell::geometry::taxonomy::style& gss,
239 IfcParse::IfcFile& f) {
240 if (strlen(s.name) || s.id) {
241 if (!std::isnan(s.diffuse[0])) {
242 gss.diffuse = ifcopenshell::geometry::taxonomy::colour(s.diffuse[0], s.diffuse[1], s.diffuse[2]);
243 }
244 if (!std::isnan(s.specular[0])) {
245 gss.specular = ifcopenshell::geometry::taxonomy::colour(s.specular[0], s.specular[1], s.specular[2]);
246 }
247 if (!std::isnan(s.transparency)) {
248 gss.transparency = s.transparency;
249 }
250 if (!std::isnan(s.specularity)) {
251 gss.specularity = s.specularity;
252 }
253 if (s.id != 0) {
254 gss.instance = f.instance_by_id(s.id)->as<IfcUtil::IfcBaseEntity>();
255 }
256 }
257
258}
259
260void HdfSerializer::remove(const std::string& guid) {
261 if (H5Lexists(file.getId(), guid.c_str(), H5P_DEFAULT)) {

Callers

nothing calls this directly

Calls 1

instance_by_idMethod · 0.45

Tested by

no test coverage detected