Skip to content
Snippets Groups Projects
Commit fe90a39c authored by Cyril Moineau's avatar Cyril Moineau Committed by Cyril Moineau
Browse files

GraphView::add, revert true -> false.

parent c916dde6
No related branches found
No related tags found
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!133Fix duplicate name issue when adding a GraphView to an other
...@@ -659,8 +659,9 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl ...@@ -659,8 +659,9 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl
for (auto node : nodesToAdd) { for (auto node : nodesToAdd) {
if (mNodeRegistry.find(node->name()) != mNodeRegistry.end()){ if (mNodeRegistry.find(node->name()) != mNodeRegistry.end()){
std::string newName = node->createUniqueName(node->name()); std::string newName = node->createUniqueName(node->name());
node->setName(newName);
fmt::print("Warning: node name \"{}\" is a duplicate, renaming to {}.\n", node->name(), newName); fmt::print("Warning: node name \"{}\" is a duplicate, renaming to {}.\n", node->name(), newName);
node->setName(newName);
} }
} }
// List the nodes to rank, initially all the nodes in the GraphView // List the nodes to rank, initially all the nodes in the GraphView
...@@ -760,7 +761,7 @@ bool Aidge::GraphView::add(std::pair<NodePtr, std::set<NodePtr>> nodes, bool inc ...@@ -760,7 +761,7 @@ bool Aidge::GraphView::add(std::pair<NodePtr, std::set<NodePtr>> nodes, bool inc
bool Aidge::GraphView::add(std::shared_ptr<GraphView> graph) { bool Aidge::GraphView::add(std::shared_ptr<GraphView> graph) {
// set the rootNode to the other graphView rootNode if no rootNode yet // set the rootNode to the other graphView rootNode if no rootNode yet
mRootNode = mRootNode ? mRootNode : graph->rootNode(); mRootNode = mRootNode ? mRootNode : graph->rootNode();
return add(graph->getNodes(), true); return add(graph->getNodes(), false);
} }
void Aidge::GraphView::addChild(std::shared_ptr<Node> toOtherNode, void Aidge::GraphView::addChild(std::shared_ptr<Node> toOtherNode,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment