UI: GraphLayouting

Implemented graph layouting, hybrid approach using spectral and force based layouting

fortune cookie message = Giving credit where it's due ensures loyalty to you.
This commit is contained in:
Manuel
2015-01-29 15:47:02 +01:00
parent 016d692dda
commit a7eaeae432
23 changed files with 2003 additions and 11 deletions
@@ -47,8 +47,9 @@ protected:
struct DummyNode
{
DummyNode(const Node* data)
: data(data)
public:
DummyNode()
: data(nullptr)
, accessType(TokenComponentAccess::ACCESS_NONE)
, active(false)
, connected(false)
@@ -60,6 +61,12 @@ struct DummyNode
{
}
DummyNode(const Node* data)
: data(data)
, accessType(TokenComponentAccess::ACCESS_NONE)
{
}
DummyNode(TokenComponentAccess::AccessType accessType)
: data(nullptr)
, accessType(accessType)
@@ -78,6 +85,45 @@ struct DummyNode
return expanded || autoExpanded;
}
bool operator==(const DummyNode& other) const
{
if (data->getId() == other.data->getId()
&& data->getName() == other.data->getName())
{
return true;
}
return false;
}
bool operator!=(const DummyNode& other) const
{
return !(*this == other);
}
bool operator<(const DummyNode& other) const
{
if (data->getId() < other.data->getId())
{
return true;
}
return false;
}
bool operator>(const DummyNode& other) const
{
return !(*this < other);
}
DummyNode& operator=(const DummyNode& other)
{
data = other.data;
subNodes = other.subNodes;
position = other.position;
topLevelAncestorId = other.topLevelAncestorId;
tokenId = other.tokenId;
return *this;
}
const Node* data;
TokenComponentAccess::AccessType accessType;
@@ -93,7 +139,10 @@ struct DummyNode
size_t invisibleSubNodeCount;
bool visible;
Id topLevelAncestorId;
Id tokenId;
std::vector<DummyNode> subNodes;
};