ui: Improved horizontal graph layout

* extend horizontal edges to origin column width
* leave horizontal gap in the middle of the left and right buckets for routing edges
* move left and right buckets vertically so that edges enter and leave horizontally
* removed third pivoting for graph edges, all edges enter and leave relative to the node center now
This commit is contained in:
Eberhard Graether
2018-04-10 01:45:56 +02:00
parent 535f7c1a9c
commit 20f87b084f
10 changed files with 194 additions and 68 deletions
@@ -133,7 +133,6 @@ void QtGraphEdge::updateLine()
QtLineItemBezier* bezier = new QtLineItemBezier(this);
bezier->updateLine(ownerRect, rect, ownerParentRect, rect, style, m_weight, false);
bezier->setRoute(route);
bezier->setPivot(QtLineItemBase::PIVOT_MIDDLE);
QtLineItemStraight* line = new QtLineItemStraight(this);
if (route == QtLineItemBase::ROUTE_HORIZONTAL)
@@ -154,7 +153,6 @@ void QtGraphEdge::updateLine()
QtLineItemBezier* bezier = new QtLineItemBezier(this);
bezier->updateLine(ownerRect, targetRect, ownerParentRect, targetParentRect, style, m_weight, showArrow);
bezier->setRoute(route);
bezier->setPivot(QtLineItemBase::PIVOT_MIDDLE);
if (ownerNonGroupParent == targetNonGroupParent)
{
@@ -170,6 +168,11 @@ void QtGraphEdge::updateLine()
}
else
{
const Vec2i& ownerColumnSize = m_owner->getLastParent()->getColumnSize();
const Vec2i& targetColumnSize = m_target->getLastParent()->getColumnSize();
ownerParentRect.z = std::max(ownerParentRect.x + ownerColumnSize.x, ownerParentRect.z());
targetParentRect.z = std::max(targetParentRect.x + targetColumnSize.x, targetParentRect.z());
if (!m_child)
{
m_child = new QtLineItemAngled(this);
@@ -214,11 +217,6 @@ void QtGraphEdge::updateLine()
child->setRoute(QtLineItemBase::ROUTE_HORIZONTAL);
}
if (type == Edge::EDGE_AGGREGATION || type == Edge::EDGE_INHERITANCE)
{
child->setPivot(QtLineItemBase::PIVOT_MIDDLE);
}
bool showArrow = true;
if (type == Edge::EDGE_AGGREGATION)
{