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

Method representation_mapped_to

src/ifcgeom/mapping/mapping.cpp:393–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393IfcSchema::IfcRepresentation* mapping::representation_mapped_to(const IfcSchema::IfcRepresentation* representation) {
394 IfcSchema::IfcRepresentation* representation_mapped_to = 0;
395 IfcSchema::IfcRepresentationItem::list::ptr items = representation->Items();
396 if (items->size() == 1) {
397 IfcSchema::IfcRepresentationItem* item = *items->begin();
398 if (item->declaration().is(IfcSchema::IfcMappedItem::Class())) {
399 if (item->StyledByItem()->size() == 0) {
400 IfcSchema::IfcMappedItem* mapped_item = item->as<IfcSchema::IfcMappedItem>();
401 taxonomy::matrix4::ptr target;
402 try {
403 target = taxonomy::cast<taxonomy::matrix4>(map(mapped_item->MappingTarget()));
404 } catch (const std::exception& e) {
405 Logger::Error(e);
406 }
407 if (target && target->is_identity()) {
408 IfcSchema::IfcRepresentationMap* rmap = mapped_item->MappingSource();
409 taxonomy::matrix4::ptr origin = taxonomy::cast<taxonomy::matrix4>(map(rmap->MappingOrigin()));
410 if (origin->is_identity()) {
411 representation_mapped_to = rmap->MappedRepresentation();
412 }
413 }
414 }
415 }
416 }
417 return representation_mapped_to;
418}
419
420namespace {
421 const IfcSchema::IfcRepresentationItem* find_item_carrying_style(const IfcSchema::IfcRepresentationItem* item) {

Callers

nothing calls this directly

Calls 5

isMethod · 0.80
is_identityMethod · 0.80
ErrorFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected