Merge remote-tracking branch 'origin/v0.8.0' into ifcviewer-wgpu

This commit is contained in:
Thomas Krijnen
2026-07-09 13:21:39 +02:00
373 changed files with 22411 additions and 4242 deletions
+11 -10
View File
@@ -4,10 +4,11 @@
using namespace ifcopenshell::geometry;
ifcopenshell::geometry::Converter::Converter(std::unique_ptr<ifcopenshell::geometry::kernels::AbstractKernel>&& geometry_library, ifcopenshell::file* file, ifcopenshell::geometry::Settings& s)
ifcopenshell::geometry::Converter::Converter(std::unique_ptr<ifcopenshell::geometry::kernels::AbstractKernel>&& geometry_library, ifcopenshell::file* file, ifcopenshell::geometry::Settings& s, Logger& logger)
: kernel_(std::move(geometry_library))
, logger_(logger)
{
mapping_ = impl::mapping_implementations().construct(file, s);
mapping_ = impl::mapping_implementations().construct(file, s, logger_);
// Mapping reads unit information and applies to settings
settings_ = mapping_->settings();
}
@@ -17,7 +18,7 @@ ifcopenshell::geometry::Converter::~Converter() {
}
namespace {
void substitute_with_box_based_on_density(IfcGeom::ConversionResults& items, double& density) {
void substitute_with_box_based_on_density(Logger& logger, IfcGeom::ConversionResults& items, double& density) {
int nv = 0;
void* box = nullptr;
double volume = 0.;
@@ -29,7 +30,7 @@ namespace {
if (density > 1e5) {
items[0].Shape()->set_box(box);
items.erase(items.begin() + 1, items.end());
logger::notice("Substituted element with " + boost::lexical_cast<std::string>(density) + " vertices / m3 with a bounding box");
logger.Notice("GEO", 30, "Substituted element with " + boost::lexical_cast<std::string>(density) + " vertices / m3 with a bounding box");
}
}
}
@@ -140,7 +141,7 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
}
}
if (some_items_without_style) {
logger::warning("No material and surface styles for:", product);
logger_.Warning("GEO", 31, "No material and surface styles for:", product);
}
}
@@ -164,7 +165,7 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
parent_id = parent_object.id();
}
} catch (const std::exception& e) {
logger::error(e);
logger_.Error("GEO", 32, e);
}
const std::string name = product.get_value<std::string>("Name", "");
@@ -210,10 +211,10 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
kernel_->convert_openings(product, opening_items, shapes, *place, opened_shapes);
}
} catch (const std::exception& e) {
logger::message(logger::LOG_ERROR, std::string("error processing openings for: ") + e.what() + ":", product);
logger_.Message(Logger::LOG_ERROR, "GEO", 33, std::string("Error processing openings for: ") + e.what() + ":", product);
caught_error = true;
} catch (...) {
logger::message(logger::LOG_ERROR, "error processing openings for:", product);
logger_.Message(Logger::LOG_ERROR, "GEO", 34, "Error processing openings for:", product);
}
if (!(caught_error && opened_shapes.size() < shapes.size())) {
@@ -241,7 +242,7 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
std::swap(shapes, unified_shapes);
}
} catch (std::exception& e) {
logger::error(e);
logger_.Error("GEO", 35, e);
}
}
@@ -360,7 +361,7 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_process
parent_id = parent_object.id();
}
} catch (const std::exception& e) {
logger::error(e);
logger_.Error("GEO", 36, e);
}
const std::string guid = product.get_value<std::string>("GlobalId");