ui: bundling nodes in the graph view
This change bundles similar nodes in the graph view together. When the bundled node or it's aggregation edge are clicked, then the bundle is split. This change also adds an arrow to the aggregation edge based on the direction of it's edges.
This commit is contained in:
@@ -5,11 +5,11 @@ template<class T>
|
||||
class Property
|
||||
{
|
||||
public:
|
||||
Property(T* valuePointer);
|
||||
explicit Property(T* valuePointer);
|
||||
~Property();
|
||||
|
||||
T& operator=(const T& value);
|
||||
T& operator=(const Property& property);
|
||||
Property<T>& operator=(const Property<T>& property);
|
||||
|
||||
operator const T&() const;
|
||||
|
||||
@@ -36,10 +36,9 @@ T& Property<T>::operator=(const T& value)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T& Property<T>::operator=(const Property& property)
|
||||
Property<T>& Property<T>::operator=(const Property<T>& property)
|
||||
{
|
||||
*m_valuePointer = *property.m_valuePointer;
|
||||
return *m_valuePointer;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
T operator[](const unsigned int index);
|
||||
|
||||
template<class U>
|
||||
void operator=(const VectorBase<U, N>& other);
|
||||
VectorBase<U, N>& operator=(const VectorBase<U, N>& other);
|
||||
|
||||
template<class U>
|
||||
VectorBase<T, N> operator+(const VectorBase<U, N>& other) const;
|
||||
@@ -339,9 +339,10 @@ T VectorBase<T, N>::operator[](const unsigned int index)
|
||||
|
||||
template<class T, unsigned int N>
|
||||
template<class U>
|
||||
void VectorBase<T, N>::operator=(const VectorBase<U, N>& other)
|
||||
VectorBase<U, N>& VectorBase<T, N>::operator=(const VectorBase<U, N>& other)
|
||||
{
|
||||
assign(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class T, unsigned int N>
|
||||
|
||||
@@ -10,7 +10,6 @@ public:
|
||||
MessageActivateTokens(const std::vector<Id>& tokenIds)
|
||||
: tokenIds(tokenIds)
|
||||
, isEdge(false)
|
||||
, isAggregation(false)
|
||||
, isFromSystem(false)
|
||||
{
|
||||
}
|
||||
@@ -18,7 +17,6 @@ public:
|
||||
MessageActivateTokens(Id tokenId)
|
||||
: tokenIds(1, tokenId)
|
||||
, isEdge(false)
|
||||
, isAggregation(false)
|
||||
, isFromSystem(false)
|
||||
{
|
||||
}
|
||||
@@ -31,7 +29,7 @@ public:
|
||||
const std::vector<Id> tokenIds;
|
||||
|
||||
bool isEdge;
|
||||
bool isAggregation;
|
||||
bool isBundle;
|
||||
bool isFromSystem;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef MESSAGE_GRAPH_NODE_BUNDLE_SPLIT_H
|
||||
#define MESSAGE_GRAPH_NODE_BUNDLE_SPLIT_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
class MessageGraphNodeBundleSplit
|
||||
: public Message<MessageGraphNodeBundleSplit>
|
||||
{
|
||||
public:
|
||||
MessageGraphNodeBundleSplit(Id bundleId)
|
||||
: bundleId(bundleId)
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageGraphNodeBundleSplit";
|
||||
}
|
||||
|
||||
Id bundleId;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_GRAPH_NODE_BUNDLE_SPLIT_H
|
||||
@@ -43,3 +43,16 @@ bool utility::intersectionPoint(Vec2f a1, Vec2f b1, Vec2f a2, Vec2f b2, Vec2f* i
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t utility::digits(size_t n)
|
||||
{
|
||||
int digits = 1;
|
||||
|
||||
while (n >= 10)
|
||||
{
|
||||
n /= 10;
|
||||
digits++;
|
||||
}
|
||||
|
||||
return digits;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace utility
|
||||
void append(std::set<T>& a, const std::set<T>& b);
|
||||
|
||||
bool intersectionPoint(Vec2f a1, Vec2f b1, Vec2f a2, Vec2f b2, Vec2f* i);
|
||||
|
||||
size_t digits(size_t n);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user