Skip to content

Commit 1151b59

Browse files
committed
Add FlowScene::allNodes() paceholder#229
1 parent c41a038 commit 1151b59

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

include/nodes/internal/FlowScene.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,21 @@ class NODE_EDITOR_PUBLIC FlowScene
7272

7373
void iterateOverNodeDataDependentOrder(std::function<void(NodeDataModel*)> const & visitor);
7474

75-
QPointF getNodePosition(const Node& node) const;
75+
QPointF getNodePosition(Node const& node) const;
7676

77-
void setNodePosition(Node& node, const QPointF& pos) const;
77+
void setNodePosition(Node& node, QPointF const& pos) const;
78+
79+
QSizeF getNodeSize(Node const& node) const;
7880

79-
QSizeF getNodeSize(const Node& node) const;
80-
8181
public:
8282

83-
std::unordered_map<QUuid, std::unique_ptr<Node> > const &nodes() const;
83+
std::unordered_map<QUuid, std::unique_ptr<Node> > const & nodes() const;
84+
85+
std::unordered_map<QUuid, std::shared_ptr<Connection> > const & connections() const;
8486

85-
std::unordered_map<QUuid, std::shared_ptr<Connection> > const &connections() const;
87+
std::vector<Node*> allNodes() const;
8688

87-
std::vector<Node*>selectedNodes() const;
89+
std::vector<Node*> selectedNodes() const;
8890

8991
public:
9092

@@ -144,7 +146,7 @@ class NODE_EDITOR_PUBLIC FlowScene
144146
private Q_SLOTS:
145147

146148
void setupConnectionSignals(Connection const& c);
147-
149+
148150
void sendConnectionCreatedToNodes(Connection const& c);
149151
void sendConnectionDeletedToNodes(Connection const& c);
150152

src/FlowScene.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,21 @@ connections() const
413413
}
414414

415415

416+
std::vector<Node*>
417+
FlowScene::
418+
allNodes() const
419+
{
420+
std::vector<Node*> nodes;
421+
422+
std::transform(_nodes.begin(),
423+
_nodes.end(),
424+
std::back_inserter(nodes),
425+
[](std::pair<QUuid const, std::unique_ptr<Node>> const & p) { return p.second.get(); });
426+
427+
return nodes;
428+
}
429+
430+
416431
std::vector<Node*>
417432
FlowScene::
418433
selectedNodes() const

0 commit comments

Comments
 (0)