Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

src: Rename aggregation edge to bundled edges #1051

Merged
merged 4 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/app/data/color_scheme_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
<include></include>
<macro_use></macro_use>

<aggregation></aggregation>
<bundled_edges></bundled_edges>
</edge>
</graph>

Expand Down
2 changes: 1 addition & 1 deletion bin/app/data/color_schemes/bad_rainbow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@
<macro_use>#4E82F6</macro_use>
<annotation_use>#4E82F6</annotation_use>

<aggregation>#666666</aggregation>
<bundled_edges>#666666</bundled_edges>
</edge>
</graph>

Expand Down
2 changes: 1 addition & 1 deletion bin/app/data/color_schemes/bright.xml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
<macro_use>#719660</macro_use>
<annotation_use>#719660</annotation_use>

<aggregation>#CCC</aggregation>
<bundled_edges>#CCC</bundled_edges>
</edge>
</graph>

Expand Down
2 changes: 1 addition & 1 deletion bin/app/data/color_schemes/dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
<macro_use>#247368</macro_use>
<annotation_use>#247368</annotation_use>

<aggregation>#4D4D4D</aggregation>
<bundled_edges>#4D4D4D</bundled_edges>
</edge>
</graph>

Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ <h3>2. Graph Visualization</h3>

<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">
Expand Down Expand Up @@ -1565,13 +1565,13 @@ <h3>Edges</h3>
<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 edge’s type.</li>
</ul>

Expand Down
4 changes: 2 additions & 2 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/lib/component/controller/ActivationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/lib/component/controller/BookmarkController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/component/controller/CodeController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
70 changes: 35 additions & 35 deletions src/lib/component/controller/GraphController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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>(
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}

{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/component/controller/UndoRedoController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/component/controller/helper/BucketLayouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
28 changes: 14 additions & 14 deletions src/lib/component/controller/helper/DummyEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "types.h"

#include "Edge.h"
#include "TokenComponentAggregation.h"
#include "TokenComponentBundledEdges.h"

class Edge;

Expand All @@ -21,7 +21,7 @@ struct DummyEdge
, active(false)
, layoutHorizontal(true)
, weight(0)
, direction(TokenComponentAggregation::DIRECTION_INVALID)
, direction(TokenComponentBundledEdges::DIRECTION_INVALID)
{
}

Expand All @@ -34,7 +34,7 @@ struct DummyEdge
, active(false)
, layoutHorizontal(true)
, weight(0)
, direction(TokenComponentAggregation::DIRECTION_INVALID)
, direction(TokenComponentBundledEdges::DIRECTION_INVALID)
{
}

Expand All @@ -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;
Expand All @@ -98,7 +98,7 @@ struct DummyEdge

// BundleEdge
int weight;
TokenComponentAggregation::Direction direction;
TokenComponentBundledEdges::Direction direction;
};

#endif // DUMMY_EDGE_H
Loading