mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Adds caching of loop upgraded to pwf to loop class
This commit is contained in:
@@ -759,6 +759,7 @@ typedef item const* ptr;
|
|||||||
DECLARE_PTR(loop)
|
DECLARE_PTR(loop)
|
||||||
|
|
||||||
boost::optional<bool> external, closed;
|
boost::optional<bool> external, closed;
|
||||||
|
boost::optional<taxonomy::piecewise_function::ptr> pwf;
|
||||||
|
|
||||||
bool is_polyhedron() const {
|
bool is_polyhedron() const {
|
||||||
for (auto& e : children) {
|
for (auto& e : children) {
|
||||||
@@ -1130,6 +1131,9 @@ typedef item const* ptr;
|
|||||||
loop_to_piecewise_function_upgrade(taxonomy::ptr item) {
|
loop_to_piecewise_function_upgrade(taxonomy::ptr item) {
|
||||||
auto loop = taxonomy::dcast<taxonomy::loop>(item);
|
auto loop = taxonomy::dcast<taxonomy::loop>(item);
|
||||||
if (loop) {
|
if (loop) {
|
||||||
|
if (loop->pwf.is_initialized()) {
|
||||||
|
pwf_ = loop->pwf;
|
||||||
|
} else {
|
||||||
pwf_ = taxonomy::make<taxonomy::piecewise_function>();
|
pwf_ = taxonomy::make<taxonomy::piecewise_function>();
|
||||||
for (auto& edge : loop->children) {
|
for (auto& edge : loop->children) {
|
||||||
// the edge could be an arc or trimmed circle in the case of IfcIndexPolyCurve - support for this isn't implemented yet
|
// the edge could be an arc or trimmed circle in the case of IfcIndexPolyCurve - support for this isn't implemented yet
|
||||||
@@ -1150,6 +1154,8 @@ typedef item const* ptr;
|
|||||||
};
|
};
|
||||||
(*pwf_)->spans.emplace_back(l, fn);
|
(*pwf_)->spans.emplace_back(l, fn);
|
||||||
}
|
}
|
||||||
|
loop->pwf = pwf_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user