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
+17
View File
@@ -4,6 +4,7 @@
#include "data/graph/Node.h"
#include "data/graph/token_component/TokenComponentAggregation.h"
#include "data/graph/token_component/TokenComponentInheritanceChain.h"
#include "utility/logging/logging.h"
#include "utility/utilityString.h"
@@ -134,6 +135,22 @@ void Edge::addComponentAggregation(std::shared_ptr<TokenComponentAggregation> co
}
}
void Edge::addComponentInheritanceChain(std::shared_ptr<TokenComponentInheritanceChain> component)
{
if (getComponent<TokenComponentInheritanceChain>())
{
LOG_ERROR("TokenComponentInheritanceChain has been set before!");
}
else if (m_type != EDGE_INHERITANCE)
{
LOG_ERROR("TokenComponentInheritanceChain can't be set on edge of type: " + getReadableTypeString());
}
else
{
addComponent(component);
}
}
std::string Edge::getUnderscoredTypeString(EdgeType type)
{
return utility::replace(utility::replace(getReadableTypeString(type), "-", "_"), " ", "_");