Own iterator geometry results

Return independent geometry copies with unique ownership, preserve parent lifetimes, and teach the Python wrapper to own derived results. Keep serializer inputs non-owning and replace Collada's deferred object with copied triangulation elements.\n\nGenerated with the assistance of an AI coding tool.
This commit is contained in:
Thomas Krijnen
2026-08-08 15:18:51 +02:00
parent c30841aad6
commit 4e49b640a7
14 changed files with 134 additions and 134 deletions
+4 -4
View File
@@ -933,15 +933,15 @@ int main(int argc, char** argv) {
while (true) {
ifcopenshell::geom::element* geom_object = context_iterator->get();
auto geom_object = context_iterator->get();
if (is_tesselated)
{
serializer->write(static_cast<const ifcopenshell::geom::triangulation_element*>(geom_object));
serializer->write(static_cast<const ifcopenshell::geom::triangulation_element*>(geom_object.get()));
}
else
{
serializer->write(static_cast<const ifcopenshell::geom::brep_element*>(geom_object));
serializer->write(static_cast<const ifcopenshell::geom::brep_element*>(geom_object.get()));
}
if (!no_progress) {
@@ -1412,7 +1412,7 @@ void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool st
if (num_created) {
has_more = context_iterator.next();
}
ifcopenshell::geom::brep_element* geom_object = nullptr;
std::unique_ptr<ifcopenshell::geom::brep_element> geom_object;
if (has_more) {
geom_object = context_iterator.get_native();
}
@@ -111,7 +111,7 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
if (num_created) {
has_more = context_iterator.next();
}
ifcopenshell::geom::brep_element* geom_object = nullptr;
std::unique_ptr<ifcopenshell::geom::brep_element> geom_object;
if (has_more) {
geom_object = context_iterator.get_native();
}
+1 -1
View File
@@ -477,7 +477,7 @@ struct intersection_validator {
if (num_created) {
has_more = context_iterator.next();
}
ifcopenshell::geom::brep_element* geom_object = nullptr;
std::unique_ptr<ifcopenshell::geom::brep_element> geom_object;
if (has_more) {
geom_object = context_iterator.get_native();
}