mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-20 06:50:40 -04:00
* minor changes required to get the gui working with PGP,
* improved NetworkView to show signatures, and friends. I expect these will be cleaned up later - these were purely functional so i could test pgp. Enable using RS_USE_PGPSSL in rsiface/rsinit.h git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1266 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5f28f76b07
commit
100cf75439
19 changed files with 695 additions and 208 deletions
|
@ -41,6 +41,7 @@
|
|||
#include <QMenu>
|
||||
|
||||
#include "edge.h"
|
||||
#include "arrow.h"
|
||||
#include "node.h"
|
||||
#include "graphwidget.h"
|
||||
#include <math.h>
|
||||
|
@ -65,6 +66,17 @@ QList<Edge *> Node::edges() const
|
|||
return edgeList;
|
||||
}
|
||||
|
||||
void Node::addArrow(Arrow *arrow)
|
||||
{
|
||||
arrowList << arrow;
|
||||
arrow->adjust();
|
||||
}
|
||||
|
||||
QList<Arrow *> Node::arrows() const
|
||||
{
|
||||
return arrowList;
|
||||
}
|
||||
|
||||
void Node::calculateForces()
|
||||
{
|
||||
if (!scene() || scene()->mouseGrabberItem() == this) {
|
||||
|
@ -103,6 +115,20 @@ void Node::calculateForces()
|
|||
yvel += pos.y() / weight;
|
||||
}
|
||||
|
||||
|
||||
// Now subtract all forces pulling items together
|
||||
// alternative weight??
|
||||
weight = sqrt(arrowList.size() + 1) * 10;
|
||||
foreach (Arrow *arrow, arrowList) {
|
||||
QPointF pos;
|
||||
if (arrow->sourceNode() == this)
|
||||
pos = mapFromItem(arrow->destNode(), 0, 0);
|
||||
else
|
||||
pos = mapFromItem(arrow->sourceNode(), 0, 0);
|
||||
xvel += pos.x() / weight;
|
||||
yvel += pos.y() / weight;
|
||||
}
|
||||
|
||||
// push away from edges too.
|
||||
QRectF sceneRect = scene()->sceneRect();
|
||||
int mid_x = (sceneRect.left() + sceneRect.right()) / 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue