mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 00:23:14 +00:00
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:
@@ -1496,7 +1496,8 @@ namespace ifcopenshell::geom {
|
||||
void add_file(ifcopenshell::geom::iterator& it) {
|
||||
if (it.initialize()) {
|
||||
do {
|
||||
add_element(dynamic_cast<ifcopenshell::geom::brep_element*>(it.get()));
|
||||
auto element = it.get();
|
||||
add_element(dynamic_cast<ifcopenshell::geom::brep_element*>(element.get()));
|
||||
} while (it.next());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@ namespace ifcopenshell {
|
||||
ifcopenshell::geom::iterator iterator(ifcopenshell::geom::kernels::construct(&file, "opencascade", settings_), settings_, &file, {}, 1);
|
||||
if (iterator.initialize()) {
|
||||
do {
|
||||
add_element(iterator.get());
|
||||
auto element = iterator.get();
|
||||
add_element(element.get());
|
||||
} while (iterator.next());
|
||||
}
|
||||
}
|
||||
@@ -139,7 +140,8 @@ namespace ifcopenshell {
|
||||
ifcopenshell::geom::iterator iterator(ifcopenshell::geom::kernels::construct(&file, "opencascade", settings_), settings_, &file, {}, 1);
|
||||
if (iterator.initialize()) {
|
||||
do {
|
||||
add_element(iterator.get());
|
||||
auto element = iterator.get();
|
||||
add_element(element.get());
|
||||
} while (iterator.next());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user