Last minute refactoring

This commit is contained in:
Thomas Krijnen
2026-08-08 07:42:45 +02:00
parent 8870ffb018
commit af58eaf79f
300 changed files with 5230 additions and 5150 deletions
+13 -13
View File
@@ -41,7 +41,7 @@ struct MaterialInfo {
float r = 0.75f, g = 0.75f, b = 0.78f, a = 1.0f;
};
static MaterialInfo materialFromStyle(const ifcopenshell::geometry::taxonomy::style::ptr& style) {
static MaterialInfo materialFromStyle(const ifcopenshell::geom::taxonomy::style::ptr& style) {
MaterialInfo material;
if (!style) return material;
const auto& color = style->get_color();
@@ -155,7 +155,7 @@ std::vector<ElementInfo> GeometryStreamer::drainElements() {
// the magnitude off the float-precision-sensitive vertex column.
static StreamedMesh buildStreamedMesh(uint32_t session_model_id,
uint32_t local_mesh_id,
const IfcGeom::TriangulationElement* elem,
const ifcopenshell::geom::triangulation_element* elem,
const Eigen::Vector3d& offset) {
StreamedMesh mesh;
mesh.session_model_id = session_model_id;
@@ -389,7 +389,7 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
return;
}
ifcopenshell::geometry::Settings settings;
ifcopenshell::geom::settings settings;
// Instancing path: geometry stays in local coords; the transform is
// applied on the GPU per instance.
settings.set("use-world-coords", false);
@@ -501,7 +501,7 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
bool is_gross) -> bool {
if (include_ids.empty()) return true;
ifcopenshell::geometry::Settings base_settings = settings;
ifcopenshell::geom::settings base_settings = settings;
if (is_gross) {
base_settings.set("disable-opening-subtractions", true);
}
@@ -509,21 +509,21 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
// Elements that haven't yet produced geometry from any context.
std::set<int> remaining = include_ids;
auto run_iterator = [&](ifcopenshell::geometry::Settings& iter_settings) -> bool {
auto run_iterator = [&](ifcopenshell::geom::settings& iter_settings) -> bool {
if (remaining.empty()) return true;
std::vector<ifcopenshell::geometry::filter_t> filters;
IfcGeom::instance_id_filter idf{
std::vector<ifcopenshell::geom::filter_t> filters;
ifcopenshell::geom::instance_id_filter idf{
/*include=*/true, /*traverse=*/false, remaining};
filters.push_back(idf);
std::unique_ptr<IfcGeom::Iterator> iterator;
std::unique_ptr<ifcopenshell::geom::iterator> iterator;
try {
const std::string geometry_library =
AppSettings::instance().geometryLibrary().toStdString();
auto kernel = ifcopenshell::geometry::kernels::construct(
auto kernel = ifcopenshell::geom::kernels::construct(
ifc_file_.get(), geometry_library, iter_settings);
iterator = std::make_unique<IfcGeom::Iterator>(
iterator = std::make_unique<ifcopenshell::geom::iterator>(
std::move(kernel), iter_settings, ifc_file_.get(),
filters, num_threads);
} catch (const std::exception& e) {
@@ -539,10 +539,10 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
do {
if (cancel_requested_.load()) break;
const IfcGeom::Element* elem = iterator->get();
const ifcopenshell::geom::element* elem = iterator->get();
if (!elem) continue;
const auto* tri_elem = dynamic_cast<const IfcGeom::TriangulationElement*>(elem);
const auto* tri_elem = dynamic_cast<const ifcopenshell::geom::triangulation_element*>(elem);
if (!tri_elem) continue;
const auto& geom = tri_elem->geometry();
@@ -678,7 +678,7 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
if (cancel_requested_.load()) break;
if (remaining.empty()) break;
ifcopenshell::geometry::Settings iter_settings = base_settings;
ifcopenshell::geom::settings iter_settings = base_settings;
iter_settings.set("context-ids",
std::set<int>{ prioritised_contexts[i] });