data: Fixed aggregation edge creation and display
This commit is contained in:
@@ -339,7 +339,7 @@ void GraphController::setActiveAndVisibility(const std::vector<Id>& activeTokenI
|
||||
|
||||
for (DummyEdge& edge : m_dummyEdges)
|
||||
{
|
||||
if (!edge.data || edge.data->isType(Edge::EDGE_AGGREGATION))
|
||||
if (!edge.data)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -361,43 +361,9 @@ void GraphController::setActiveAndVisibility(const std::vector<Id>& activeTokenI
|
||||
}
|
||||
}
|
||||
|
||||
for (DummyEdge& edge : m_dummyEdges)
|
||||
{
|
||||
if (!edge.data || !edge.data->isType(Edge::EDGE_AGGREGATION))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
DummyNode* from = findTopLevelDummyNodeRecursive(m_dummyNodes, edge.ownerId);
|
||||
DummyNode* to = findTopLevelDummyNodeRecursive(m_dummyNodes, edge.targetId);
|
||||
|
||||
if (from && to && (from->active || to->active))
|
||||
{
|
||||
TokenComponentAggregation* component = edge.data->getComponent<TokenComponentAggregation>();
|
||||
std::set<Id> ids = component->getAggregationIds();
|
||||
for (Id id : ids)
|
||||
{
|
||||
for (DummyEdge& e : m_dummyEdges)
|
||||
{
|
||||
if (e.visible && e.data && e.data->getId() == id)
|
||||
{
|
||||
component->removeAggregationId(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (component->getAggregationCount() > 0)
|
||||
{
|
||||
edge.visible = true;
|
||||
from->aggregated = true;
|
||||
to->aggregated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (DummyNode& node : m_dummyNodes)
|
||||
{
|
||||
setNodeVisibilityRecursiveBottomUp(node, false);
|
||||
setNodeVisibilityRecursiveBottomUp(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +382,7 @@ void GraphController::setNodeActiveRecursive(DummyNode& node, const std::vector<
|
||||
}
|
||||
}
|
||||
|
||||
bool GraphController::setNodeVisibilityRecursiveBottomUp(DummyNode& node, bool aggregated) const
|
||||
bool GraphController::setNodeVisibilityRecursiveBottomUp(DummyNode& node) const
|
||||
{
|
||||
node.visible = false;
|
||||
node.childVisible = false;
|
||||
@@ -434,13 +400,13 @@ bool GraphController::setNodeVisibilityRecursiveBottomUp(DummyNode& node, bool a
|
||||
|
||||
for (DummyNode& subNode : node.subNodes)
|
||||
{
|
||||
if (setNodeVisibilityRecursiveBottomUp(subNode, aggregated | node.aggregated))
|
||||
if (setNodeVisibilityRecursiveBottomUp(subNode))
|
||||
{
|
||||
node.childVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (node.active || node.connected || node.childVisible || (!aggregated && node.aggregated))
|
||||
if (node.active || node.connected || node.childVisible)
|
||||
{
|
||||
setNodeVisibilityRecursiveTopDown(node, false);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
|
||||
void setActiveAndVisibility(const std::vector<Id>& activeTokenIds);
|
||||
void setNodeActiveRecursive(DummyNode& node, const std::vector<Id>& activeTokenIds) const;
|
||||
bool setNodeVisibilityRecursiveBottomUp(DummyNode& node, bool aggregated) const;
|
||||
bool setNodeVisibilityRecursiveBottomUp(DummyNode& node) const;
|
||||
void setNodeVisibilityRecursiveTopDown(DummyNode& node, bool parentExpanded) const;
|
||||
|
||||
void splitNamespaceNodes();
|
||||
|
||||
@@ -20,7 +20,6 @@ public:
|
||||
, data(nullptr)
|
||||
, active(false)
|
||||
, connected(false)
|
||||
, aggregated(false)
|
||||
, expanded(false)
|
||||
, hasNamespace(false)
|
||||
, accessType(TokenComponentAccess::ACCESS_NONE)
|
||||
@@ -117,7 +116,6 @@ public:
|
||||
const Node* data;
|
||||
bool active;
|
||||
bool connected;
|
||||
bool aggregated;
|
||||
bool expanded;
|
||||
bool hasNamespace;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user