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:
@@ -14,6 +14,7 @@ public:
|
||||
void clear();
|
||||
|
||||
void createConnection(Id edgeId, Id fromId, Id toId, bool sourceVisible, bool targetImplicit);
|
||||
void createInheritance(Id edgeId, Id fromId, Id toId);
|
||||
|
||||
Id getLastVisibleParentNodeId(Id nodeId) const;
|
||||
size_t getIndexOfLastVisibleParentNode(Id nodeId) const;
|
||||
@@ -29,6 +30,8 @@ public:
|
||||
|
||||
bool nodeHasChildren(Id nodeId) const;
|
||||
|
||||
std::vector<std::tuple<Id, Id, std::vector<Id>>> getInheritanceEdgesForNodeId(Id nodeId, const std::set<Id>& nodeIds) const;
|
||||
|
||||
private:
|
||||
class HierarchyNode
|
||||
{
|
||||
@@ -43,6 +46,8 @@ private:
|
||||
HierarchyNode* getParent() const;
|
||||
void setParent(HierarchyNode* parent);
|
||||
|
||||
void addBase(HierarchyNode* base, Id edgeId);
|
||||
|
||||
void addChild(HierarchyNode* child);
|
||||
|
||||
size_t getChildrenCount() const;
|
||||
@@ -57,11 +62,19 @@ private:
|
||||
bool isImplicit() const;
|
||||
void setIsImplicit(bool isImplicit);
|
||||
|
||||
void addInheritanceEdgesRecursive(
|
||||
Id startId, std::vector<Id> inheritanceEdgeIds,
|
||||
const std::set<Id>& nodeIds, std::vector<std::tuple<Id, Id, std::vector<Id>>>* inheritanceEdges);
|
||||
|
||||
private:
|
||||
const Id m_nodeId;
|
||||
Id m_edgeId;
|
||||
|
||||
HierarchyNode* m_parent;
|
||||
|
||||
std::vector<HierarchyNode*> m_bases;
|
||||
std::vector<Id> m_baseEdgeIds;
|
||||
|
||||
std::vector<HierarchyNode*> m_children;
|
||||
|
||||
bool m_isVisible;
|
||||
|
||||
Reference in New Issue
Block a user