src: Rename aggregation edge to bundled edges (#1051)

The term aggregation is misleading. Bundled edges is a better definition for this type of edge.

closes #962
This commit is contained in:
Eberhard Gräther
2020-06-29 19:41:12 +02:00
committed by GitHub
parent 7008d2abdd
commit 3950da7999
33 changed files with 208 additions and 210 deletions
+1 -1
View File
@@ -234,7 +234,7 @@
<include></include>
<macro_use></macro_use>
<aggregation></aggregation>
<bundled_edges></bundled_edges>
</edge>
</graph>
+1 -1
View File
@@ -499,7 +499,7 @@
<macro_use>#4E82F6</macro_use>
<annotation_use>#4E82F6</annotation_use>
<aggregation>#666666</aggregation>
<bundled_edges>#666666</bundled_edges>
</edge>
</graph>
+1 -1
View File
@@ -467,7 +467,7 @@
<macro_use>#719660</macro_use>
<annotation_use>#719660</annotation_use>
<aggregation>#CCC</aggregation>
<bundled_edges>#CCC</bundled_edges>
</edge>
</graph>
+1 -1
View File
@@ -470,7 +470,7 @@
<macro_use>#247368</macro_use>
<annotation_use>#247368</annotation_use>
<aggregation>#4D4D4D</aggregation>
<bundled_edges>#4D4D4D</bundled_edges>
</edge>
</graph>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

+3 -3
View File
@@ -354,7 +354,7 @@
<ul>
<li><strong>Nodes:</strong> All named symbols in your source code will be displayed as different <a href="#Nodes">nodes</a>, such as <var>functions</var>, <var>classes</var> or <var>files</var>. Nodes with members (like <var>classes</var>) can be expanded to show all their contents, the number at the expansion arrow shows how many members are hidden. Clicking a node will activate it and update all the views to the new selection. Dragging a node can be used to change its position.</li>
<li><strong>Edges:</strong> The relationships between the symbols are displayed as different <a href="#Edges">edges</a>, such as <var>type use</var>, <var>function call</var> or <var>file include</var>. Sometimes edges get bundled together and are displayed as an <var>aggregation</var> edge that shows a number of how many edges it contains. Clicking an edge will highlight its source location in the code view.</li>
<li><strong>Edges:</strong> The relationships between the symbols are displayed as different <a href="#Edges">edges</a>, such as <var>type use</var>, <var>function call</var> or <var>file include</var>. Sometimes edges get bundled together and are displayed as <var>bundled edges</var> that show a number of how many edges are contained. Clicking an edge will highlight its source location in the code view.</li>
</ul>
<div class="row">
@@ -1565,13 +1565,13 @@
<tr> <th scope="row">Method Override</th> <td><img src="img/edge_override.png" style="height:240px;"></td> </tr>
<tr> <th scope="row">Template Specialization & Template Argument Use</th> <td><img src="img/edge_template_param.png" style="height:100px;"></td> </tr>
<tr> <th scope="row">Template Member Specialization</th> <td><img src="img/edge_template_member_specialization.png" style="height:160px;"></td> </tr>
<tr> <th scope="row">Aggregation: <span style="font-weight:normal">Bundles multiple edges between the child nodes of the 2 nodes. The thickness gives an impression of how many edges are bundled. Hover the edge to get the number of bundled edges.</span></th> <td><img src="img/edge_aggregation.png" style="height:50px;"></td> </tr>
<tr> <th scope="row">Bundled Edges: <span style="font-weight:normal">Bundles multiple edges between the child nodes of the 2 nodes. The thickness gives an impression of how many edges are bundled. Hover the edge to get the number of bundled edges.</span></th> <td><img src="img/edge_bundled_edges.png" style="height:50px;"></td> </tr>
</tbody>
</table>
<strong>Interactions:</strong>
<ul>
<li>Click an edge to see its location in the <a href="#CodeView">Code View</a>.</li>
<li>Click an aggregation edge to activate all its corresponding edges.</li>
<li>Click a bundled edges to activate all its corresponding edges.</li>
<li>Hover an edge to see a tooltip that displays the edges type.</li>
</ul>
+2 -2
View File
@@ -147,8 +147,8 @@ add_files(
data/graph/token_component/TokenComponentAbstraction.h
data/graph/token_component/TokenComponentAccess.cpp
data/graph/token_component/TokenComponentAccess.h
data/graph/token_component/TokenComponentAggregation.cpp
data/graph/token_component/TokenComponentAggregation.h
data/graph/token_component/TokenComponentBundledEdges.cpp
data/graph/token_component/TokenComponentBundledEdges.h
data/graph/token_component/TokenComponentConst.cpp
data/graph/token_component/TokenComponentConst.h
data/graph/token_component/TokenComponentFilePath.cpp
@@ -24,12 +24,12 @@ void ActivationController::clear() {}
void ActivationController::handleMessage(MessageActivateEdge* message)
{
if (message->isAggregation())
if (message->isBundledEdges())
{
MessageActivateTokens m(message);
m.tokenIds = message->aggregationIds;
m.tokenIds = message->bundledEdgesIds;
m.setKeepContent(false);
m.isAggregation = true;
m.isBundledEdges = true;
m.dispatchImmediately();
}
else
@@ -209,10 +209,10 @@ void BookmarkController::activateBookmark(const std::shared_ptr<Bookmark> bookma
else
{
MessageActivateEdge activateEdge(
0, Edge::EdgeType::EDGE_AGGREGATION, sourceName, targetName);
for (const Id aggregatedEdgeId: edgeBookmark->getEdgeIds())
0, Edge::EdgeType::EDGE_BUNDLED_EDGES, sourceName, targetName);
for (const Id bundledEdgeId: edgeBookmark->getEdgeIds())
{
activateEdge.aggregationIds.push_back(aggregatedEdgeId);
activateEdge.bundledEdgesIds.push_back(bundledEdgeId);
}
activateEdge.dispatch();
}
@@ -318,7 +318,7 @@ void BookmarkController::handleMessage(MessageActivateTokens* message)
Id tabId = message->getSchedulerId();
m_activeEdgeIds[tabId].clear();
if (message->isEdge || message->isAggregation)
if (message->isEdge || message->isBundledEdges)
{
m_activeEdgeIds[tabId] = message->tokenIds;
@@ -199,7 +199,7 @@ void CodeController::handleMessage(MessageActivateTokens* message)
params.clearSnippets = true;
Id declarationId = 0; // 0 means that no token is found.
if (!message->isAggregation)
if (!message->isBundledEdges)
{
std::vector<Id> activeTokenIds;
for (Id tokenId: params.activeTokenIds)
@@ -98,7 +98,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
if (message->isEdge || message->keepContent())
{
m_activeEdgeIds = message->tokenIds;
if (message->isAggregation) // only on redo
if (message->isBundledEdges) // only on redo
{
m_activeEdgeIds.clear();
}
@@ -119,7 +119,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
getView()->activateEdge(edgeId);
return;
}
else if (message->isAggregation)
else if (message->isBundledEdges)
{
m_activeNodeIds.clear();
m_activeEdgeIds = message->tokenIds;
@@ -166,7 +166,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
{
bundleNodes();
}
else if (message->isAggregation)
else if (message->isBundledEdges)
{
bool isInheritanceChain = true;
for (const auto& edge: m_dummyEdges)
@@ -489,22 +489,22 @@ void GraphController::handleMessage(MessageGraphNodeExpand* message)
{
std::shared_ptr<DummyEdge> edge = m_dummyEdges[i];
if (edge && edge->data && edge->data->isType(Edge::EDGE_AGGREGATION) &&
if (edge && edge->data && edge->data->isType(Edge::EDGE_BUNDLED_EDGES) &&
(edge->targetId == dummyNode->tokenId || edge->ownerId == dummyNode->tokenId))
{
std::vector<Id> aggregationIds = utility::toVector<Id>(
edge->data->getComponent<TokenComponentAggregation>()->getAggregationIds());
std::vector<Id> bundledEdgesIds = utility::toVector<Id>(
edge->data->getComponent<TokenComponentBundledEdges>()->getBundledEdgesIds());
if (m_graph->getEdgeById(aggregationIds[0]) != nullptr)
if (m_graph->getEdgeById(bundledEdgesIds[0]) != nullptr)
{
break;
}
std::shared_ptr<Graph> aggregationGraph =
std::shared_ptr<Graph> bundledEdgesGraph =
m_storageAccess->getGraphForActiveTokenIds(
aggregationIds, std::vector<Id>());
bundledEdgesIds, std::vector<Id>());
aggregationGraph->forEachEdge([this](Edge* e) {
bundledEdgesGraph->forEachEdge([this](Edge* e) {
if (!e->isType(Edge::EDGE_MEMBER))
{
m_dummyEdges.push_back(std::make_shared<DummyEdge>(
@@ -1085,25 +1085,25 @@ void GraphController::bundleNodes()
bundleInfo->isReferencing = false;
}
if (e->isType(Edge::EDGE_AGGREGATION))
if (e->isType(Edge::EDGE_BUNDLED_EDGES))
{
TokenComponentAggregation::Direction dir =
e->getComponent<TokenComponentAggregation>()->getDirection();
TokenComponentBundledEdges::Direction dir =
e->getComponent<TokenComponentBundledEdges>()->getDirection();
if (dir == TokenComponentAggregation::DIRECTION_NONE)
if (dir == TokenComponentBundledEdges::DIRECTION_NONE)
{
bundleInfo->isReferenced = true;
bundleInfo->isReferencing = true;
}
else if (
(dir == TokenComponentAggregation::DIRECTION_FORWARD && e->getFrom() == n) ||
(dir == TokenComponentAggregation::DIRECTION_BACKWARD && e->getTo() == n))
(dir == TokenComponentBundledEdges::DIRECTION_FORWARD && e->getFrom() == n) ||
(dir == TokenComponentBundledEdges::DIRECTION_BACKWARD && e->getTo() == n))
{
bundleInfo->isReferencing = true;
}
else if (
(dir == TokenComponentAggregation::DIRECTION_FORWARD && e->getTo() == n) ||
(dir == TokenComponentAggregation::DIRECTION_BACKWARD && e->getFrom() == n))
(dir == TokenComponentBundledEdges::DIRECTION_FORWARD && e->getTo() == n) ||
(dir == TokenComponentBundledEdges::DIRECTION_BACKWARD && e->getFrom() == n))
{
bundleInfo->isReferenced = true;
}
@@ -2041,7 +2041,7 @@ Vec4i GraphController::layoutNestingRecursive(DummyNode* node, int relayoutAcces
break;
case GroupLayout::BUCKET:
if (node->hasActiveSubNode() || !m_activeNodeIds.size() /* aggregations */)
if (node->hasActiveSubNode() || !m_activeNodeIds.size() /* bundled edges */)
{
BucketLayouter grid(viewSize);
grid.createBuckets(node->subNodes, m_dummyEdges);
@@ -2446,25 +2446,25 @@ void GraphController::createLegendGraph()
addEdge(Edge::EDGE_INHERITANCE, derived, main);
{
Edge* edge = addEdge(Edge::EDGE_AGGREGATION, user, main);
std::shared_ptr<TokenComponentAggregation> aggregationComp =
std::make_shared<TokenComponentAggregation>();
Edge* edge = addEdge(Edge::EDGE_BUNDLED_EDGES, user, main);
std::shared_ptr<TokenComponentBundledEdges> bundledEdgesComp =
std::make_shared<TokenComponentBundledEdges>();
for (size_t i = 0; i < 10; i++)
{
aggregationComp->addAggregationId(++id, true);
bundledEdgesComp->addBundledEdgesId(++id, true);
}
edge->addComponent(aggregationComp);
edge->addComponent(bundledEdgesComp);
}
{
Edge* edge = addEdge(Edge::EDGE_AGGREGATION, main, usee);
std::shared_ptr<TokenComponentAggregation> aggregationComp =
std::make_shared<TokenComponentAggregation>();
Edge* edge = addEdge(Edge::EDGE_BUNDLED_EDGES, main, usee);
std::shared_ptr<TokenComponentBundledEdges> bundledEdgesComp =
std::make_shared<TokenComponentBundledEdges>();
for (size_t i = 0; i < 10; i++)
{
aggregationComp->addAggregationId(++id, true);
bundledEdgesComp->addBundledEdgesId(++id, true);
}
edge->addComponent(aggregationComp);
edge->addComponent(bundledEdgesComp);
}
Node* publicMethod = addNode(NODE_METHOD, L"public method", Vec2i());
@@ -2622,17 +2622,17 @@ void GraphController::createLegendGraph()
}
{
addText(L"aggregation", 0, Vec2i(x, y + dy * ++i));
addText(L"bundled edges", 0, Vec2i(x, y + dy * ++i));
Node* typeA = addNode(NODE_TYPE, L"Type A", Vec2i(x, y + dy * ++i));
Node* typeB = addNode(NODE_TYPE, L"Type B", Vec2i(x + dx, y + dy * i));
Edge* edge = addEdge(Edge::EDGE_AGGREGATION, typeA, typeB);
std::shared_ptr<TokenComponentAggregation> aggregationComp =
std::make_shared<TokenComponentAggregation>();
Edge* edge = addEdge(Edge::EDGE_BUNDLED_EDGES, typeA, typeB);
std::shared_ptr<TokenComponentBundledEdges> bundledEdgesComp =
std::make_shared<TokenComponentBundledEdges>();
for (size_t i = 0; i < 10; i++)
{
aggregationComp->addAggregationId(++id, true);
bundledEdgesComp->addBundledEdgesId(++id, true);
}
edge->addComponent(aggregationComp);
edge->addComponent(bundledEdgesComp);
}
{
@@ -349,7 +349,7 @@ void UndoRedoController::handleMessage(MessageIndexingFinished* message)
MessageActivateTokens* msg = dynamic_cast<MessageActivateTokens*>(command.message.get());
if (msg)
{
if (msg->isAggregation)
if (msg->isBundledEdges)
{
continue;
}
@@ -498,7 +498,7 @@ void UndoRedoController::replayCommand(std::list<Command>::iterator it)
{
MessageActivateTokens* msg = dynamic_cast<MessageActivateTokens*>(m.get());
if (!msg->isEdge && !msg->isAggregation)
if (!msg->isEdge && !msg->isBundledEdges)
{
std::vector<SearchMatch> matches = msg->getSearchMatches();
msg->searchMatches.clear();
@@ -310,9 +310,9 @@ void BucketLayouter::createBuckets(
}
}
else if (
edge->getDirection() == TokenComponentAggregation::DIRECTION_BACKWARD ||
edge->getDirection() == TokenComponentBundledEdges::DIRECTION_BACKWARD ||
// put nodes with bidirectional edges on the left
(edge->getDirection() == TokenComponentAggregation::DIRECTION_NONE &&
(edge->getDirection() == TokenComponentBundledEdges::DIRECTION_NONE &&
!target->bundleInfo.isReferencing && !target->bundleInfo.isReferenced))
{
std::swap(owner, target);
+14 -14
View File
@@ -5,7 +5,7 @@
#include "types.h"
#include "Edge.h"
#include "TokenComponentAggregation.h"
#include "TokenComponentBundledEdges.h"
class Edge;
@@ -21,7 +21,7 @@ struct DummyEdge
, active(false)
, layoutHorizontal(true)
, weight(0)
, direction(TokenComponentAggregation::DIRECTION_INVALID)
, direction(TokenComponentBundledEdges::DIRECTION_INVALID)
{
}
@@ -34,7 +34,7 @@ struct DummyEdge
, active(false)
, layoutHorizontal(true)
, weight(0)
, direction(TokenComponentAggregation::DIRECTION_INVALID)
, direction(TokenComponentBundledEdges::DIRECTION_INVALID)
{
}
@@ -44,43 +44,43 @@ struct DummyEdge
{
return weight;
}
else if (data->isType(Edge::EDGE_AGGREGATION))
else if (data->isType(Edge::EDGE_BUNDLED_EDGES))
{
return data->getComponent<TokenComponentAggregation>()->getAggregationCount();
return data->getComponent<TokenComponentBundledEdges>()->getBundledEdgesCount();
}
return 1;
}
void updateDirection(TokenComponentAggregation::Direction dir, bool invert)
void updateDirection(TokenComponentBundledEdges::Direction dir, bool invert)
{
if (invert)
{
dir = TokenComponentAggregation::opposite(dir);
dir = TokenComponentBundledEdges::opposite(dir);
}
if (direction == TokenComponentAggregation::DIRECTION_INVALID)
if (direction == TokenComponentBundledEdges::DIRECTION_INVALID)
{
direction = dir;
}
else if (direction != dir)
{
direction = TokenComponentAggregation::DIRECTION_NONE;
direction = TokenComponentBundledEdges::DIRECTION_NONE;
}
}
TokenComponentAggregation::Direction getDirection() const
TokenComponentBundledEdges::Direction getDirection() const
{
if (!data)
{
return direction;
}
else if (data->isType(Edge::EDGE_AGGREGATION))
else if (data->isType(Edge::EDGE_BUNDLED_EDGES))
{
return data->getComponent<TokenComponentAggregation>()->getDirection();
return data->getComponent<TokenComponentBundledEdges>()->getDirection();
}
return TokenComponentAggregation::DIRECTION_FORWARD;
return TokenComponentBundledEdges::DIRECTION_FORWARD;
}
Id ownerId;
@@ -98,7 +98,7 @@ struct DummyEdge
// BundleEdge
int weight;
TokenComponentAggregation::Direction direction;
TokenComponentBundledEdges::Direction direction;
};
#endif // DUMMY_EDGE_H
+1 -1
View File
@@ -671,7 +671,7 @@ GraphViewStyle::EdgeStyle GraphViewStyle::getStyleForEdgeType(
switch (type)
{
case Edge::EDGE_AGGREGATION:
case Edge::EDGE_BUNDLED_EDGES:
style.width = 3;
style.arrowLength = 7;
style.arrowWidth = 10;
+8 -8
View File
@@ -3,7 +3,7 @@
#include <sstream>
#include "Node.h"
#include "TokenComponentAggregation.h"
#include "TokenComponentBundledEdges.h"
#include "logging.h"
#include "utilityString.h"
@@ -36,8 +36,8 @@ Edge::EdgeType Edge::intToType(int value)
return EDGE_INCLUDE;
case EDGE_IMPORT:
return EDGE_IMPORT;
case EDGE_AGGREGATION:
return EDGE_AGGREGATION;
case EDGE_BUNDLED_EDGES:
return EDGE_BUNDLED_EDGES;
case EDGE_MACRO_USAGE:
return EDGE_MACRO_USAGE;
case EDGE_ANNOTATION_USAGE:
@@ -139,8 +139,8 @@ std::wstring Edge::getReadableTypeString(EdgeType type)
return L"include";
case EDGE_IMPORT:
return L"import";
case EDGE_AGGREGATION:
return L"aggregation";
case EDGE_BUNDLED_EDGES:
return L"bundled edges";
case EDGE_MACRO_USAGE:
return L"macro use";
case EDGE_ANNOTATION_USAGE:
@@ -175,10 +175,10 @@ std::wstring Edge::getAsString() const
str << L"[" << getId() << L"] " << getReadableTypeString();
str << L": \"" << m_from->getName() << L"\" -> \"" + m_to->getName() << L"\"";
TokenComponentAggregation* aggregation = getComponent<TokenComponentAggregation>();
if (aggregation)
TokenComponentBundledEdges* bundledEdges = getComponent<TokenComponentBundledEdges>();
if (bundledEdges)
{
str << L" " << aggregation->getAggregationCount();
str << L" " << bundledEdges->getBundledEdgesCount();
}
return str.str();
+1 -1
View File
@@ -25,7 +25,7 @@ public:
EDGE_TEMPLATE_SPECIALIZATION = 1 << 7,
EDGE_INCLUDE = 1 << 8,
EDGE_IMPORT = 1 << 9,
EDGE_AGGREGATION = 1 << 10,
EDGE_BUNDLED_EDGES = 1 << 10,
EDGE_MACRO_USAGE = 1 << 11,
EDGE_ANNOTATION_USAGE = 1 << 12,
@@ -1,42 +0,0 @@
#ifndef TOKEN_COMPONENT_AGGREGATION_H
#define TOKEN_COMPONENT_AGGREGATION_H
#include <map>
#include <set>
#include "types.h"
#include "TokenComponent.h"
class TokenComponentAggregation: public TokenComponent
{
public:
enum Direction
{
DIRECTION_NONE,
DIRECTION_FORWARD,
DIRECTION_BACKWARD,
DIRECTION_INVALID
};
static Direction opposite(Direction direction);
TokenComponentAggregation();
virtual ~TokenComponentAggregation();
virtual std::shared_ptr<TokenComponent> copy() const;
int getAggregationCount() const;
std::set<Id> getAggregationIds() const;
void addAggregationId(Id id, bool forward);
void removeAggregationId(Id id);
Direction getDirection();
private:
std::map<Id, Direction> m_ids;
Direction m_direction;
};
#endif // TOKEN_COMPONENT_AGGREGATION_H
@@ -1,6 +1,6 @@
#include "TokenComponentAggregation.h"
#include "TokenComponentBundledEdges.h"
TokenComponentAggregation::Direction TokenComponentAggregation::opposite(Direction direction)
TokenComponentBundledEdges::Direction TokenComponentBundledEdges::opposite(Direction direction)
{
if (direction == DIRECTION_FORWARD)
{
@@ -14,21 +14,21 @@ TokenComponentAggregation::Direction TokenComponentAggregation::opposite(Directi
return direction;
}
TokenComponentAggregation::TokenComponentAggregation(): m_direction(DIRECTION_INVALID) {}
TokenComponentBundledEdges::TokenComponentBundledEdges(): m_direction(DIRECTION_INVALID) {}
TokenComponentAggregation::~TokenComponentAggregation() {}
TokenComponentBundledEdges::~TokenComponentBundledEdges() {}
std::shared_ptr<TokenComponent> TokenComponentAggregation::copy() const
std::shared_ptr<TokenComponent> TokenComponentBundledEdges::copy() const
{
return std::make_shared<TokenComponentAggregation>(*this);
return std::make_shared<TokenComponentBundledEdges>(*this);
}
int TokenComponentAggregation::getAggregationCount() const
int TokenComponentBundledEdges::getBundledEdgesCount() const
{
return static_cast<int>(m_ids.size());
}
std::set<Id> TokenComponentAggregation::getAggregationIds() const
std::set<Id> TokenComponentBundledEdges::getBundledEdgesIds() const
{
std::set<Id> ids;
@@ -40,21 +40,21 @@ std::set<Id> TokenComponentAggregation::getAggregationIds() const
return ids;
}
void TokenComponentAggregation::addAggregationId(Id id, bool forward)
void TokenComponentBundledEdges::addBundledEdgesId(Id id, bool forward)
{
m_ids.emplace(id, forward ? DIRECTION_FORWARD : DIRECTION_BACKWARD);
m_direction = DIRECTION_INVALID;
}
void TokenComponentAggregation::removeAggregationId(Id id)
void TokenComponentBundledEdges::removeBundledEdgesId(Id id)
{
m_ids.erase(id);
m_direction = DIRECTION_INVALID;
}
TokenComponentAggregation::Direction TokenComponentAggregation::getDirection()
TokenComponentBundledEdges::Direction TokenComponentBundledEdges::getDirection()
{
if (m_direction != DIRECTION_INVALID)
{
@@ -0,0 +1,42 @@
#ifndef TOKEN_COMPONENT_BUNDLED_EDGES_H
#define TOKEN_COMPONENT_BUNDLED_EDGES_H
#include <map>
#include <set>
#include "types.h"
#include "TokenComponent.h"
class TokenComponentBundledEdges: public TokenComponent
{
public:
enum Direction
{
DIRECTION_NONE,
DIRECTION_FORWARD,
DIRECTION_BACKWARD,
DIRECTION_INVALID
};
static Direction opposite(Direction direction);
TokenComponentBundledEdges();
virtual ~TokenComponentBundledEdges();
virtual std::shared_ptr<TokenComponent> copy() const;
int getBundledEdgesCount() const;
std::set<Id> getBundledEdgesIds() const;
void addBundledEdgesId(Id id, bool forward);
void removeBundledEdgesId(Id id);
Direction getDirection();
private:
std::map<Id, Direction> m_ids;
Direction m_direction;
};
#endif // TOKEN_COMPONENT_BUNDLED_EDGES_H
+25 -25
View File
@@ -19,7 +19,7 @@
#include "TextCodec.h"
#include "TimeStamp.h"
#include "TokenComponentAccess.h"
#include "TokenComponentAggregation.h"
#include "TokenComponentBundledEdges.h"
#include "TokenComponentFilePath.h"
#include "TokenComponentInheritanceChain.h"
#include "TokenComponentIsAmbiguous.h"
@@ -1102,8 +1102,8 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
std::vector<Id> nodeIds;
std::vector<Id> edgeIds;
bool addAggregations = false;
std::vector<StorageEdge> edgesToAggregate;
bool addBundledEdges = false;
std::vector<StorageEdge> edgesToBundle;
bool addFileContents = false;
@@ -1150,7 +1150,7 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
(m_hierarchyCache.getLastVisibleParentNodeId(edge.targetNodeId) !=
m_hierarchyCache.getLastVisibleParentNodeId(edge.sourceNodeId)))
{
edgesToAggregate.push_back(edge);
edgesToBundle.push_back(edge);
}
else
{
@@ -1164,7 +1164,7 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
}
else
{
addAggregations = true;
addBundledEdges = true;
}
}
}
@@ -1221,9 +1221,9 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
addNodesWithParentsAndEdgesToGraph(nodeIds, edgeIds, graph, true);
}
if (addAggregations)
if (addBundledEdges)
{
addAggregationEdgesToGraph(tokenIds[0], edgesToAggregate, graph);
addBundledEdgesToGraph(tokenIds[0], edgesToBundle, graph);
}
else if (addFileContents)
{
@@ -2968,8 +2968,8 @@ void PersistentStorage::addNodesWithParentsAndEdgesToGraph(
addEdgesToGraph(utility::toVector(allEdgeIds), graph);
}
void PersistentStorage::addAggregationEdgesToGraph(
Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const
void PersistentStorage::addBundledEdgesToGraph(
Id nodeId, const std::vector<StorageEdge>& edgesToBundle, Graph* graph) const
{
TRACE();
@@ -2979,19 +2979,19 @@ void PersistentStorage::addAggregationEdgesToGraph(
bool forward;
};
// build aggregation edges:
// build bundled edges:
// get all children of the active node
std::set<Id> childNodeIdsSet, edgeIdsSet;
m_hierarchyCache.addAllChildIdsForNodeId(nodeId, &childNodeIdsSet, &edgeIdsSet);
const std::vector<Id> childNodeIds = utility::toVector(childNodeIdsSet);
if (childNodeIds.size() == 0 && edgesToAggregate.size() == 0)
if (childNodeIds.size() == 0 && edgesToBundle.size() == 0)
{
return;
}
// get all edges of the children
std::map<Id, std::vector<EdgeInfo>> connectedNodeIds;
for (const StorageEdge& edge: edgesToAggregate)
for (const StorageEdge& edge: edgesToBundle)
{
bool isSource = nodeId == edge.sourceNodeId;
EdgeInfo edgeInfo;
@@ -3038,38 +3038,38 @@ void PersistentStorage::addAggregationEdgesToGraph(
std::vector<Id> nodeIdsToAdd;
for (const std::pair<Id, std::vector<EdgeInfo>>& p: connectedParentNodeIds)
{
const Id aggregationTargetNodeId = p.first;
if (!graph->getNodeById(aggregationTargetNodeId))
const Id bundledEdgesTargetNodeId = p.first;
if (!graph->getNodeById(bundledEdgesTargetNodeId))
{
nodeIdsToAdd.push_back(aggregationTargetNodeId);
nodeIdsToAdd.push_back(bundledEdgesTargetNodeId);
}
}
addNodesWithParentsAndEdgesToGraph(nodeIdsToAdd, std::vector<Id>(), graph, true);
// create aggregation edges between parents and active node
// create bundled edges between parents and active node
Node* sourceNode = graph->getNodeById(nodeId);
for (const std::pair<Id, std::vector<EdgeInfo>>& p: connectedParentNodeIds)
{
const Id aggregationTargetNodeId = p.first;
const Id bundledEdgesTargetNodeId = p.first;
Node* targetNode = graph->getNodeById(aggregationTargetNodeId);
Node* targetNode = graph->getNodeById(bundledEdgesTargetNodeId);
if (!targetNode)
{
LOG_ERROR("Aggregation target node not present.");
LOG_ERROR("Bundled edges target node not present.");
}
std::shared_ptr<TokenComponentAggregation> componentAggregation =
std::make_shared<TokenComponentAggregation>();
std::shared_ptr<TokenComponentBundledEdges> componentBundledEdges =
std::make_shared<TokenComponentBundledEdges>();
for (const EdgeInfo& edgeInfo: p.second)
{
componentAggregation->addAggregationId(edgeInfo.edgeId, edgeInfo.forward);
componentBundledEdges->addBundledEdgesId(edgeInfo.edgeId, edgeInfo.forward);
}
// Set first bit to 1 to avoid collisions
const Id aggregationId = ~(~Id(0) >> 1) + *componentAggregation->getAggregationIds().begin();
const Id bundledEdgesId = ~(~Id(0) >> 1) + *componentBundledEdges->getBundledEdgesIds().begin();
Edge* edge = graph->createEdge(aggregationId, Edge::EDGE_AGGREGATION, sourceNode, targetNode);
edge->addComponent(componentAggregation);
Edge* edge = graph->createEdge(bundledEdgesId, Edge::EDGE_BUNDLED_EDGES, sourceNode, targetNode);
edge->addComponent(componentBundledEdges);
}
}
+2 -2
View File
@@ -246,8 +246,8 @@ private:
inline void addFileNodeToGraph(const StorageNode& storageNode, Graph* const graph) const;
void addNodeToGraph(
const StorageNode& newNode, const NodeType& type, Graph* graph, bool addChildCount) const;
void addAggregationEdgesToGraph(
Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const;
void addBundledEdgesToGraph(
Id nodeId, const std::vector<StorageEdge>& edgesToBundle, Graph* graph) const;
void addFileContentsToGraph(Id fileId, Graph* graph) const;
void addComponentAccessToGraph(Graph* graph) const;
void addComponentIsAmbiguousToGraph(Graph* graph) const;
@@ -18,7 +18,7 @@ public:
}
MessageActivateTokens(const MessageBase* other)
: isEdge(false), isAggregation(false), isFromSearch(false)
: isEdge(false), isBundledEdges(false), isFromSearch(false)
{
setIsParallel(true);
setKeepContent(other->keepContent());
@@ -43,10 +43,10 @@ public:
std::vector<SearchMatch> getSearchMatches() const override
{
if (isAggregation)
if (isBundledEdges)
{
SearchMatch match;
match.name = match.text = L"aggregation"; // TODO: show aggregation source and target
match.name = match.text = L"bundled edges"; // TODO: show bundled edges source and target
match.searchType = SearchMatch::SEARCH_TOKEN;
match.nodeType = NodeType(NODE_TYPE);
return {match};
@@ -59,7 +59,7 @@ public:
std::vector<SearchMatch> searchMatches;
bool isEdge;
bool isAggregation;
bool isBundledEdges;
bool isFromSearch;
};
@@ -22,7 +22,7 @@ public:
, sourceNameHierarchy(sourceNameHierarchy)
, targetNameHierarchy(targetNameHierarchy)
{
if (!isAggregation())
if (!isBundledEdges())
{
setKeepContent(true);
}
@@ -35,9 +35,9 @@ public:
return "MessageActivateEdge";
}
bool isAggregation() const
bool isBundledEdges() const
{
return type == Edge::EDGE_AGGREGATION;
return type == Edge::EDGE_BUNDLED_EDGES;
}
std::wstring getFullName() const
@@ -58,7 +58,7 @@ public:
const NameHierarchy sourceNameHierarchy;
const NameHierarchy targetNameHierarchy;
std::vector<Id> aggregationIds;
std::vector<Id> bundledEdgesIds;
};
#endif // MESSAGE_ACTIVATE_EDGE_H
@@ -406,7 +406,7 @@ QtGraphEdge* GraphFocusHandler::findNextEdge(QPointF pos, Direction direction, Q
qreal distXMult = vertical ? 2.0 : 1.0;
qreal distYMult = vertical ? 1.0 : 2.0;
// only use one dimension for distance calculation in aggregation graphs to not miss
// only use one dimension for distance calculation in bundled edges graphs to not miss
// certain edges
if (edge->isBezierEdge() && m_client->getGraphNodes().size() == 2)
{
+18 -19
View File
@@ -19,7 +19,6 @@
#include "QtLineItemAngled.h"
#include "QtLineItemBezier.h"
#include "QtLineItemStraight.h"
#include "TokenComponentAggregation.h"
#include "TokenComponentInheritanceChain.h"
#include "TokenComponentIsAmbiguous.h"
#include "utility.h"
@@ -51,7 +50,7 @@ QtGraphEdge::QtGraphEdge(
bool isActive,
bool isInteractive,
bool horizontal,
TokenComponentAggregation::Direction direction)
TokenComponentBundledEdges::Direction direction)
: m_focusHandler(focusHandler)
, m_data(data)
, m_owner(owner)
@@ -64,7 +63,7 @@ QtGraphEdge::QtGraphEdge(
{
this->setCursor(Qt::PointingHandCursor);
if (m_direction == TokenComponentAggregation::DIRECTION_BACKWARD)
if (m_direction == TokenComponentBundledEdges::DIRECTION_BACKWARD)
{
QtGraphNode* temp = m_owner;
m_owner = m_target;
@@ -104,7 +103,7 @@ void QtGraphEdge::updateLine()
const QtGraphNode* owner = m_owner;
const QtGraphNode* target = m_target;
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_AGGREGATION);
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_BUNDLED_EDGES);
GraphViewStyle::EdgeStyle style = GraphViewStyle::getStyleForEdgeType(
type, m_isActive | m_isCoFocused, m_isFocused, m_isTrailEdge, isAmbiguous());
@@ -171,7 +170,7 @@ void QtGraphEdge::updateLine()
ownerParentRect = rect;
}
bool showArrow = m_direction != TokenComponentAggregation::DIRECTION_NONE;
bool showArrow = m_direction != TokenComponentBundledEdges::DIRECTION_NONE;
QtLineItemBezier* bezier = new QtLineItemBezier(this);
m_child = bezier;
@@ -260,7 +259,7 @@ void QtGraphEdge::updateLine()
child->setEarlyBend(true);
}
}
else if (type != Edge::EDGE_AGGREGATION || owner != ownerNonGroupParent || target != targetNonGroupParent)
else if (type != Edge::EDGE_BUNDLED_EDGES || owner != ownerNonGroupParent || target != targetNonGroupParent)
{
route = QtLineItemBase::ROUTE_HORIZONTAL;
}
@@ -268,9 +267,9 @@ void QtGraphEdge::updateLine()
child->setRoute(route);
bool showArrow = true;
if (type == Edge::EDGE_AGGREGATION)
if (type == Edge::EDGE_BUNDLED_EDGES)
{
showArrow = m_direction != TokenComponentAggregation::DIRECTION_NONE;
showArrow = m_direction != TokenComponentBundledEdges::DIRECTION_NONE;
}
if (getData())
@@ -332,7 +331,7 @@ void QtGraphEdge::onClick()
if (isExpandable())
{
QtGraphNode* node =
(m_direction == TokenComponentAggregation::DIRECTION_BACKWARD ? m_owner : m_target);
(m_direction == TokenComponentBundledEdges::DIRECTION_BACKWARD ? m_owner : m_target);
if (m_owner->isGroupNode())
{
node = m_owner;
@@ -360,18 +359,18 @@ void QtGraphEdge::onClick()
MessageActivateEdge msg(
getData()->getId(),
componentInheritance ? Edge::EDGE_AGGREGATION : getData()->getType(),
componentInheritance ? Edge::EDGE_BUNDLED_EDGES : getData()->getType(),
getData()->getFrom()->getNameHierarchy(),
getData()->getTo()->getNameHierarchy());
if (getData()->getType() == Edge::EDGE_AGGREGATION)
if (getData()->getType() == Edge::EDGE_BUNDLED_EDGES)
{
msg.aggregationIds = utility::toVector<Id>(
getData()->getComponent<TokenComponentAggregation>()->getAggregationIds());
msg.bundledEdgesIds = utility::toVector<Id>(
getData()->getComponent<TokenComponentBundledEdges>()->getBundledEdgesIds());
}
else if (componentInheritance)
{
msg.aggregationIds = componentInheritance->inheritanceEdgeIds;
msg.bundledEdgesIds = componentInheritance->inheritanceEdgeIds;
}
msg.dispatch();
@@ -397,7 +396,7 @@ void QtGraphEdge::coFocusIn()
if (s_focusedEdge == this)
{
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_AGGREGATION);
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_BUNDLED_EDGES);
TooltipInfo info;
info.title = Edge::getReadableTypeString(type);
@@ -407,13 +406,13 @@ void QtGraphEdge::coFocusIn()
info.title = L"ambiguous " + info.title;
}
if (type == Edge::EDGE_AGGREGATION &&
m_direction == TokenComponentAggregation::DIRECTION_NONE)
if (type == Edge::EDGE_BUNDLED_EDGES &&
m_direction == TokenComponentBundledEdges::DIRECTION_NONE)
{
info.title = L"bidirectional " + info.title;
}
if (type == Edge::EDGE_AGGREGATION)
if (type == Edge::EDGE_BUNDLED_EDGES)
{
info.count = static_cast<int>(m_weight);
info.countText = "edge";
@@ -526,7 +525,7 @@ void QtGraphEdge::hoverLeaveEvent(QGraphicsSceneHoverEvent* event)
s_focusedEdge = nullptr;
}
void QtGraphEdge::setDirection(TokenComponentAggregation::Direction direction)
void QtGraphEdge::setDirection(TokenComponentBundledEdges::Direction direction)
{
if (m_direction != direction)
{
+4 -5
View File
@@ -5,11 +5,10 @@
#include <QGraphicsItem>
#include "TokenComponentBundledEdges.h"
#include "Vector2.h"
#include "Vector4.h"
#include "TokenComponentAggregation.h"
class Edge;
class GraphFocusHandler;
class QtGraphNode;
@@ -34,7 +33,7 @@ public:
bool isActive,
bool isInteractive,
bool horizontal,
TokenComponentAggregation::Direction direction);
TokenComponentBundledEdges::Direction direction);
virtual ~QtGraphEdge();
const Edge* getData() const;
@@ -60,7 +59,7 @@ public:
void coFocusIn();
void coFocusOut();
void setDirection(TokenComponentAggregation::Direction direction);
void setDirection(TokenComponentBundledEdges::Direction direction);
bool isHorizontal() const;
bool isExpandable() const;
@@ -108,7 +107,7 @@ private:
bool m_isHorizontal = false;
size_t m_weight = 0;
TokenComponentAggregation::Direction m_direction;
TokenComponentBundledEdges::Direction m_direction;
bool m_isTrailEdge = false;
std::vector<Vec4i> m_path;
+1 -1
View File
@@ -243,7 +243,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
Edge::EDGE_TYPE_ARGUMENT,
Edge::EDGE_INCLUDE,
Edge::EDGE_IMPORT,
// Edge::EDGE_AGGREGATION,
// Edge::EDGE_BUNDLED_EDGES,
Edge::EDGE_MACRO_USAGE,
Edge::EDGE_ANNOTATION_USAGE
// Edge::EDGE_MEMBER // has separate checkbox
+7 -7
View File
@@ -390,7 +390,7 @@ void QtGraphView::rebuildGraph(
std::set<Id> visibleEdgeIds;
for (const std::shared_ptr<DummyEdge>& edge: edges)
{
if (!edge->data || !edge->data->isType(Edge::EDGE_AGGREGATION))
if (!edge->data || !edge->data->isType(Edge::EDGE_BUNDLED_EDGES))
{
createEdge(
view,
@@ -404,9 +404,9 @@ void QtGraphView::rebuildGraph(
}
for (const std::shared_ptr<DummyEdge>& edge: edges)
{
if (edge->data && edge->data->isType(Edge::EDGE_AGGREGATION))
if (edge->data && edge->data->isType(Edge::EDGE_BUNDLED_EDGES))
{
createAggregationEdge(view, edge.get(), &visibleEdgeIds, !params.disableInteraction);
createBundledEdgesEdge(view, edge.get(), &visibleEdgeIds, !params.disableInteraction);
}
}
@@ -1203,7 +1203,7 @@ QtGraphEdge* QtGraphView::createEdge(
return nullptr;
}
QtGraphEdge* QtGraphView::createAggregationEdge(
QtGraphEdge* QtGraphView::createBundledEdgesEdge(
QGraphicsView* view, const DummyEdge* edge, std::set<Id>* visibleEdgeIds, bool interactive)
{
if (!edge->visible)
@@ -1212,9 +1212,9 @@ QtGraphEdge* QtGraphView::createAggregationEdge(
}
bool allVisible = true;
std::set<Id> aggregationIds =
edge->data->getComponent<TokenComponentAggregation>()->getAggregationIds();
for (Id edgeId: aggregationIds)
std::set<Id> bundledEdgesIds =
edge->data->getComponent<TokenComponentBundledEdges>()->getBundledEdgesIds();
for (Id edgeId: bundledEdgesIds)
{
if (visibleEdgeIds->find(edgeId) == visibleEdgeIds->end())
{
+1 -1
View File
@@ -128,7 +128,7 @@ private:
QPointF pathOffset,
bool useBezier,
bool interactive);
QtGraphEdge* createAggregationEdge(
QtGraphEdge* createBundledEdgesEdge(
QGraphicsView* view, const DummyEdge* edge, std::set<Id>* visibleEdgeIds, bool interactive);
QRectF itemsBoundingRect(const std::list<QtGraphNode*>& items) const;
@@ -225,10 +225,10 @@ namespace interaction
// TEST: aggregation expand
// TEST: bundled edges expand
// START ----------------------------------------------------------------------
// ACTION 1: Click on aggregation between 'BundleBase -> ExpandedClass'
// ACTION 1: Click on bundled edges between 'BundleBase -> ExpandedClass'
// RESULTS 1:
// - graph shows 6 edges: 4 call, 1 use, 1 type use
// - edges are displayed as bezier curves
@@ -134,12 +134,12 @@ B b; // <- ACTION: activate 'B'
// TEST: Activate aggregation edge
// TEST: Activate bundled edges edge
// START ----------------------------------------------------------------------
// ACTION: Move focus on aggregation 'D -> B'
// ACTION: Move focus on bundled edges 'D -> B'
// ACTION: Press Enter/E
// RESULT: aggregation edge is activated
// RESULT: bundled edges edge is activated
// END ------------------------------------------------------------------------
@@ -25,7 +25,7 @@ int func()
// TEST: Graph aggregation focus restored on back
// TEST: Graph bundled edges focus restored on back
// START ----------------------------------------------------------------------
class HistoryTestUser
@@ -40,9 +40,9 @@ public:
HistoryTest h;
};
// ACTION: Focus and activate aggregation 'HistoryTestUser -> HistoryTest'
// ACTION: Focus and activate bundled edges 'HistoryTestUser -> HistoryTest'
// ACTION: Navigate 'back' in history
// RESULT: The graph for 'HistoryTest' is restored with focus at aggregation edge
// RESULT: The graph for 'HistoryTest' is restored with focus at bundled edges edge
// END ------------------------------------------------------------------------