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

Method process_based_on_settings

src/ifcgeom/Iterator.cpp:403–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403IfcGeom::Element* IfcGeom::Iterator::process_based_on_settings(ifcopenshell::geometry::Settings settings, IfcGeom::BRepElement* elem, IfcGeom::TriangulationElement* previous)
404{
405 if (settings.get<ifcopenshell::geometry::settings::IteratorOutput>().get() == ifcopenshell::geometry::settings::SERIALIZED) {
406 try {
407 return new IfcGeom::SerializedElement(*elem);
408 } catch (...) {
409 Logger::Message(Logger::LOG_ERROR, "Getting a serialized element from model failed.");
410 return nullptr;
411 }
412 } else if (settings.get<ifcopenshell::geometry::settings::IteratorOutput>().get() == ifcopenshell::geometry::settings::TRIANGULATED) {
413 // the part before the hyphen is the representation id
414 auto gid2 = elem->geometry().id();
415 auto hyphen = gid2.find("-");
416 if (hyphen != std::string::npos) {
417 gid2 = gid2.substr(0, hyphen);
418 }
419
420 return decorate_with_cache_(GeometrySerializer::READ_TRIANGULATION, elem->guid(), gid2, [elem, previous]() {
421 try {
422 if (!previous) {
423 return new TriangulationElement(*elem);
424 } else {
425 return new TriangulationElement(*elem, previous->geometry_pointer());
426 }
427 } catch (...) {
428 Logger::Message(Logger::LOG_ERROR, "Getting a triangulation element from model failed.");
429 }
430 return (TriangulationElement*)nullptr;
431 });
432 } else {
433 return elem;
434 }
435}
436
437bool IfcGeom::Iterator::wait_for_element() {
438 while (true) {

Callers

nothing calls this directly

Calls 7

MessageClass · 0.85
decorate_with_cache_Function · 0.85
substrMethod · 0.80
getMethod · 0.45
idMethod · 0.45
findMethod · 0.45
guidMethod · 0.45

Tested by

no test coverage detected