logic: Show inheritance edges between parents of active symbol and other visible symbols (issue #167)

* add inheritance edges between parents of active symbol and other visible symbols
* add dashed inheritance edges when symbols are no direct decendants
* inheritance edges are also respected in layouting, putting base/derived classes in the correct top/bottom spot now

bug id = 167
This commit is contained in:
Eberhard Graether
2017-07-16 18:40:59 +02:00
parent 9a36d48d1e
commit 9d0b86ad98
19 changed files with 261 additions and 17 deletions
@@ -103,17 +103,34 @@ void GraphController::handleMessage(MessageActivateTokens* message)
{
bundleNodes();
}
else if (message->isAggregation)
{
bool isInheritanceChain = true;
for (auto edge : m_dummyEdges)
{
if (!edge->data->isType(Edge::EDGE_INHERITANCE))
{
isInheritanceChain = false;
break;
}
}
if (isInheritanceChain)
{
for (auto node : m_dummyNodes)
{
node->bundleInfo.layoutVertical = true;
}
}
m_useBezierEdges = !isInheritanceChain;
}
layoutNesting();
layoutGraph(true);
assignBundleIds();
}
if (message->isAggregation)
{
m_useBezierEdges = true;
}
buildGraph(message, !isNamespace, true, isNamespace);
}
@@ -640,7 +657,8 @@ bool GraphController::setActive(const std::vector<Id>& activeTokenIds, bool show
DummyNode* from = getDummyGraphNodeById(edge->ownerId);
DummyNode* to = getDummyGraphNodeById(edge->targetId);
if (from && to && (showAllEdges || noActive || from->active || to->active || edge->active))
bool isInheritance = edge->data->isType(Edge::EDGE_INHERITANCE);
if (from && to && (showAllEdges || noActive || from->active || to->active || edge->active || isInheritance))
{
edge->visible = true;
from->connected = true;