feat: trigger node update when new input is connected

This commit is contained in:
parker
2025-07-30 00:43:44 +01:00
parent d6a205f777
commit 1c57b7a9e6
2 changed files with 5 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
#include <algorithm> #include <algorithm>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include "icecream.hpp"
enzo::nt::OpId enzo::nt::NetworkManager::addOperator(op::OpInfo opInfo) enzo::nt::OpId enzo::nt::NetworkManager::addOperator(op::OpInfo opInfo)
{ {

View File

@@ -152,6 +152,8 @@ void Network::socketClicked(SocketGraphic* socket, QMouseEvent *event)
// the output node is the node the data flows to // the output node is the node the data flows to
auto outputNodeSocket = startSocket_->getIO()==enzo::nt::SocketIOType::Input ? startSocket_ : socket; auto outputNodeSocket = startSocket_->getIO()==enzo::nt::SocketIOType::Input ? startSocket_ : socket;
nt::GeometryOperator& geoOp = enzo::nt::nm().getGeoOperator(outputNodeSocket->getOpId());
std::cout << "CONNECTING opid: " << inputNodeSocket->getOpId() << " -> " << outputNodeSocket->getOpId() << "\n"; std::cout << "CONNECTING opid: " << inputNodeSocket->getOpId() << " -> " << outputNodeSocket->getOpId() << "\n";
@@ -163,6 +165,8 @@ void Network::socketClicked(SocketGraphic* socket, QMouseEvent *event)
newEdge->setPos(outputNodeSocket->scenePos(), inputNodeSocket->scenePos()); newEdge->setPos(outputNodeSocket->scenePos(), inputNodeSocket->scenePos());
scene_->addItem(newEdge); scene_->addItem(newEdge);
destroyFloatingEdge(); destroyFloatingEdge();
geoOp.dirtyNode();
} }
} }