fix: general optimization, lazy cooking, transform caching, fix geometry copying

This commit is contained in:
parker
2025-08-02 23:02:14 +01:00
parent 92bfc8ff26
commit 48ad8909cc
12 changed files with 104 additions and 62 deletions

View File

@@ -19,16 +19,13 @@ enzo::nt::OpId enzo::nt::NetworkManager::addOperator(op::OpInfo opInfo)
maxOpId_++;
std::unique_ptr<GeometryOperator> newOp = std::make_unique<GeometryOperator>(maxOpId_, opInfo);
newOp->nodeDirtied.connect(
[this](nt::OpId opId, bool dirtyDescendents)
[this](nt::OpId opId, bool dirtyDependents)
{
IC();
if(dirtyDescendents)
if(dirtyDependents)
{
IC();
std::vector<OpId> dependentIds = getDependentsGraph(opId);
for(OpId dependentId : dependentIds)
{
IC();
// dirty node
enzo::nt::GeometryOperator& dependentOp = getGeoOperator(opId);
std::cout << "dirtying id: " << dependentId << "\n";
@@ -37,7 +34,6 @@ enzo::nt::OpId enzo::nt::NetworkManager::addOperator(op::OpInfo opInfo)
// cook display op
if(getDisplayOp().has_value() && getDisplayOp().value()==dependentId)
{
IC();
cookOp(dependentId);
updateDisplay(dependentOp.getOutputGeo(0));
}
@@ -46,7 +42,6 @@ enzo::nt::OpId enzo::nt::NetworkManager::addOperator(op::OpInfo opInfo)
});
gopStore_.emplace(maxOpId_, std::move(newOp));
std::cout << "adding operator " << maxOpId_ << "\n";
return maxOpId_;
}
@@ -96,8 +91,11 @@ void enzo::nt::NetworkManager::cookOp(enzo::nt::OpId opId)
for(enzo::nt::OpId dependencyOpId : dependencyGraph)
{
enzo::nt::GeometryOperator& op = getGeoOperator(dependencyOpId);
enzo::op::Context context(dependencyOpId, enzo::nt::nm());
op.cookOp(context);
if(op.isDirty())
{
enzo::op::Context context(dependencyOpId, enzo::nt::nm());
op.cookOp(context);
}
}
}