ui: moved subnode layouting from GraphView to GraphController
This change moves nested layouting of the Graph to GraphController. The DummyNodes get the correct size assigned, as well as a visible flag. Mouse interaction with the Graph is now handled via the GraphController, which makes it easier to undo them or reuse the changed state after graph updates.
This commit is contained in:
@@ -33,6 +33,8 @@ struct DummyEdge
|
||||
: ownerId(o)
|
||||
, targetId(t)
|
||||
, data(data)
|
||||
, visible(false)
|
||||
, active(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,6 +42,9 @@ struct DummyEdge
|
||||
Id targetId;
|
||||
|
||||
const Edge* data;
|
||||
|
||||
bool visible;
|
||||
bool active;
|
||||
};
|
||||
|
||||
#endif // GRAPH_EDGE_H
|
||||
|
||||
@@ -26,9 +26,12 @@ public:
|
||||
void setData(const Node* data);
|
||||
|
||||
virtual Vec2i getPosition() const = 0;
|
||||
virtual void setPosition(const Vec2i& position) = 0;
|
||||
virtual bool setPosition(const Vec2i& position) = 0;
|
||||
virtual void moveTo(const Vec2i& position) = 0;
|
||||
|
||||
virtual Vec2i getSize() const = 0;
|
||||
virtual void setSize(const Vec2i& size) = 0;
|
||||
|
||||
virtual Vec4i getBoundingRect() const = 0;
|
||||
virtual Vec4i getParentBoundingRect() const = 0;
|
||||
|
||||
@@ -47,19 +50,39 @@ struct DummyNode
|
||||
DummyNode(const Node* data)
|
||||
: data(data)
|
||||
, accessType(TokenComponentAccess::ACCESS_NONE)
|
||||
, active(false)
|
||||
, connected(false)
|
||||
, expanded(false)
|
||||
, invisibleSubNodeCount(0)
|
||||
, visible(false)
|
||||
{
|
||||
}
|
||||
|
||||
DummyNode(TokenComponentAccess::AccessType accessType)
|
||||
: data(nullptr)
|
||||
, accessType(accessType)
|
||||
, active(false)
|
||||
, connected(false)
|
||||
, expanded(false)
|
||||
, invisibleSubNodeCount(0)
|
||||
, visible(false)
|
||||
{
|
||||
}
|
||||
|
||||
const Node* data;
|
||||
const TokenComponentAccess::AccessType accessType;
|
||||
TokenComponentAccess::AccessType accessType;
|
||||
|
||||
Vec2i position;
|
||||
Vec2i size;
|
||||
|
||||
bool active;
|
||||
bool connected;
|
||||
|
||||
bool expanded;
|
||||
size_t invisibleSubNodeCount;
|
||||
|
||||
bool visible;
|
||||
|
||||
std::vector<DummyNode> subNodes;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user