| 391 | } |
| 392 | |
| 393 | IfcSchema::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 | |
| 420 | namespace { |
| 421 | const IfcSchema::IfcRepresentationItem* find_item_carrying_style(const IfcSchema::IfcRepresentationItem* item) { |
nothing calls this directly
no test coverage detected