Skip to content

Commit

Permalink
Remove submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
cneben committed Nov 17, 2023
1 parent 5664ca2 commit 8bf029d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "samples/advanced/QuickQanava"]
path = samples/advanced/QuickQanava
url = [email protected]:cneben/QuickQanava.git
1 change: 0 additions & 1 deletion samples/advanced/QuickQanava
Submodule QuickQanava deleted from 0264f6
4 changes: 2 additions & 2 deletions src/qanGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2021,8 +2021,8 @@ std::vector<const qan::Node*> Graph::collectAncestors(const qan::Node& node) c
{
// ALGORITHM:
// 0. Collect node neighbour.
// 1. Collect ancestors of neighbours.
// 2. Remove original neighbour from ancestors.
// 1. Collect ancestors of neighbors.
// 2. Remove original neighbors from ancestors.

const auto collectAncestorsDfs_rec = [](const qan::Node* visited,
std::vector<const qan::Node*>& parents,
Expand Down
4 changes: 2 additions & 2 deletions src/qanGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const qan::Graph* Group::getGraph() const noexcept { return qan::Node::get_gra

std::unordered_set<qan::Edge*> Group::collectAdjacentEdges() const
{
std::unordered_set<qan::Edge*> edges = collectAdjacentEdges0();
std::unordered_set<qan::Edge*> edges = qan::Node::collectAdjacentEdges();
if (is_group()) {
for (const auto groupNode: qAsConst(group_nodes())) {
if (groupNode != nullptr) {
Expand All @@ -72,7 +72,7 @@ std::unordered_set<qan::Edge*> Group::collectAdjacentEdges() const
} else {
auto qanNode = qobject_cast<qan::Node*>(groupNode);
if (qanNode != nullptr) {
auto nodeEdges = qanNode->collectAdjacentEdges0();
auto nodeEdges = qanNode->collectAdjacentEdges();
edges.insert(nodeEdges.begin(), nodeEdges.end());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/qanGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Group : public qan::Node
/*! \brief Collect this group adjacent edges (ie adjacent edges of group and group nodes).
*
*/
std::unordered_set<qan::Edge*> collectAdjacentEdges() const;
virtual std::unordered_set<qan::Edge*> collectAdjacentEdges() const override;

public:
friend class qan::GroupItem;
Expand Down
2 changes: 1 addition & 1 deletion src/qanNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ QAbstractItemModel* Node::qmlGetOutEdges() const
return super_t::get_out_edges().model();
}

std::unordered_set<qan::Edge*> Node::collectAdjacentEdges0() const
std::unordered_set<qan::Edge*> Node::collectAdjacentEdges() const
{
std::unordered_set<qan::Edge*> edges;
for (const auto in_edge: qAsConst(get_in_edges())) {
Expand Down
2 changes: 1 addition & 1 deletion src/qanNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Node : public gtpo::node<QObject,

public:
//! Get this node level 0 adjacent edges (ie sum of node in edges and out edges).
std::unordered_set<qan::Edge*> collectAdjacentEdges0() const;
virtual std::unordered_set<qan::Edge*> collectAdjacentEdges() const;
//@}
//-------------------------------------------------------------------------

Expand Down
9 changes: 7 additions & 2 deletions src/qanNodeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,15 @@ void NodeItem::collapseAncestors(bool collapsed)
// 1.
const auto ancestors = graph->collectAncestors(*node);

qWarning() << "-- ANCESTORS: ";
for (const auto ancestor: ancestors)
qWarning() << ancestor->getLabel();
qWarning() << "------------";

// 2.
std::unordered_set<qan::Edge*> ancestorsEdges;
for (const auto ancestor: ancestors) {
const auto edges = ancestor->collectAdjacentEdges0();
const auto edges = ancestor->collectAdjacentEdges();
std::copy(edges.begin(), edges.end(), std::inserter(ancestorsEdges, ancestorsEdges.end()));
}

Expand Down Expand Up @@ -198,7 +203,7 @@ void NodeItem::collapseChilds(bool collapsed)
// 2.
std::unordered_set<qan::Edge*> childsEdges;
for (const auto child: childs) {
const auto edges = child->collectAdjacentEdges0();
const auto edges = child->collectAdjacentEdges();
std::copy(edges.begin(), edges.end(),
std::inserter(childsEdges, childsEdges.end()));
}
Expand Down

0 comments on commit 8bf029d

Please sign in to comment.