ui: graph showing neighbours

The graph view can now display the n1 neighbours of the active node, including connections between neighbours.
This commit is contained in:
Manuel Dobusch
2014-07-09 16:32:15 +02:00
parent 2009b7526a
commit d12fd3edf3
14 changed files with 338 additions and 64 deletions
+25 -1
View File
@@ -17,7 +17,7 @@ QtGraphEdge::QtGraphEdge(const std::weak_ptr<GraphNode>& owner, const std::weak_
}
else
{
LOG_WARNING("Either the owner or the target node could is null.");
LOG_WARNING("Either the owner or the target node is null.");
}
QPen blackPen(Qt::black);
@@ -57,3 +57,27 @@ void QtGraphEdge::targetMoved()
LOG_WARNING("Target node is null.");
}
}
void QtGraphEdge::removeEdgeFromScene()
{
std::shared_ptr<GraphNode> node = m_owner.lock();
if(node != NULL)
{
node->removeOutEdge(this);
}
else
{
LOG_WARNING("Target node is null.");
}
}
std::weak_ptr<GraphNode> QtGraphEdge::getOwner()
{
return m_owner;
}
std::weak_ptr<GraphNode> QtGraphEdge::getTarget()
{
return m_target;
}