mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 05:46:51 +00:00
Defensiveness #5683
This commit is contained in:
@@ -198,7 +198,11 @@ namespace IfcGeom {
|
|||||||
// @todo this shouldn't be necessary with properly immutable taxonomy items
|
// @todo this shouldn't be necessary with properly immutable taxonomy items
|
||||||
converter_->mapping()->use_caching() = false;
|
converter_->mapping()->use_caching() = false;
|
||||||
}
|
}
|
||||||
converter_->mapping()->get_representations(reps, filters_);
|
try {
|
||||||
|
converter_->mapping()->get_representations(reps, filters_);
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
Logger::Error(e);
|
||||||
|
}
|
||||||
time_points[1] = high_resolution_clock::now();
|
time_points[1] = high_resolution_clock::now();
|
||||||
|
|
||||||
for (auto& task : reps) {
|
for (auto& task : reps) {
|
||||||
|
|||||||
@@ -76,7 +76,13 @@ IfcSchema::IfcProduct::list::ptr mapping::products_represented_by(const IfcSchem
|
|||||||
IfcSchema::IfcMappedItem* item = *it;
|
IfcSchema::IfcMappedItem* item = *it;
|
||||||
if (item->StyledByItem()->size() != 0) continue;
|
if (item->StyledByItem()->size() != 0) continue;
|
||||||
|
|
||||||
taxonomy::matrix4::ptr target = taxonomy::cast<taxonomy::matrix4>(map(item->MappingTarget()));
|
taxonomy::matrix4::ptr target;
|
||||||
|
try {
|
||||||
|
target = taxonomy::cast<taxonomy::matrix4>(map(item->MappingTarget()));
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
Logger::Error(e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!target->is_identity()) {
|
if (!target->is_identity()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -361,8 +367,13 @@ IfcSchema::IfcRepresentation* mapping::representation_mapped_to(const IfcSchema:
|
|||||||
if (item->declaration().is(IfcSchema::IfcMappedItem::Class())) {
|
if (item->declaration().is(IfcSchema::IfcMappedItem::Class())) {
|
||||||
if (item->StyledByItem()->size() == 0) {
|
if (item->StyledByItem()->size() == 0) {
|
||||||
IfcSchema::IfcMappedItem* mapped_item = item->as<IfcSchema::IfcMappedItem>();
|
IfcSchema::IfcMappedItem* mapped_item = item->as<IfcSchema::IfcMappedItem>();
|
||||||
taxonomy::matrix4::ptr target = taxonomy::cast<taxonomy::matrix4>(map(mapped_item->MappingTarget()));
|
taxonomy::matrix4::ptr target;
|
||||||
if (target->is_identity()) {
|
try {
|
||||||
|
target = taxonomy::cast<taxonomy::matrix4>(map(mapped_item->MappingTarget()));
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
Logger::Error(e);
|
||||||
|
}
|
||||||
|
if (target && target->is_identity()) {
|
||||||
IfcSchema::IfcRepresentationMap* rmap = mapped_item->MappingSource();
|
IfcSchema::IfcRepresentationMap* rmap = mapped_item->MappingSource();
|
||||||
taxonomy::matrix4::ptr origin = taxonomy::cast<taxonomy::matrix4>(map(rmap->MappingOrigin()));
|
taxonomy::matrix4::ptr origin = taxonomy::cast<taxonomy::matrix4>(map(rmap->MappingOrigin()));
|
||||||
if (origin->is_identity()) {
|
if (origin->is_identity()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user