mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
Merge remote-tracking branch 'origin/v0.8.0' into ifcviewer-wgpu
This commit is contained in:
@@ -51,6 +51,19 @@ void ifcopenshell::geometry::impl::MappingFactoryImplementation::bind(const std:
|
||||
mapping_registry_instance().bind(schema_name, fn, plugin::module(mapping_plugin_metadata(schema_name)));
|
||||
}
|
||||
|
||||
ifcopenshell::geometry::abstract_mapping* ifcopenshell::geometry::impl::MappingFactoryImplementation::construct(ifcopenshell::file* file, Settings& s) {
|
||||
return mapping_registry_instance().construct(file, s);
|
||||
ifcopenshell::geometry::abstract_mapping* ifcopenshell::geometry::impl::MappingFactoryImplementation::construct(ifcopenshell::file* file, Settings& s, Logger& logger) {
|
||||
const std::string schema_name_lower = boost::to_lower_copy(file->schema()->name());
|
||||
std::map<std::string, ifcopenshell::geometry::impl::mapping_fn>::const_iterator it;
|
||||
it = this->find(schema_name_lower);
|
||||
if (it == end()) {
|
||||
throw IfcParse::IfcException("No geometry mapping registered for " + schema_name_lower);
|
||||
}
|
||||
auto new_mapping = it->second(file, s, logger);
|
||||
try {
|
||||
new_mapping->initialize_settings();
|
||||
} catch (const std::exception& e) {
|
||||
logger.Error("GEO", 400, e);
|
||||
logger.Error("GEO", 401, "Unable to initialize conversion settings");
|
||||
}
|
||||
return new_mapping;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user