nodeviewscene: added basic standard filtering modes

This commit is contained in:
itsmattkc
2020-05-09 03:33:41 +10:00
parent 16d4cccdb5
commit fc694296f1
2 changed files with 15 additions and 1 deletions
+6 -1
View File
@@ -20,6 +20,7 @@
#include "nodeviewscene.h"
#include "common/functiontimer.h"
#include "nodeviewedge.h"
#include "nodeviewitem.h"
@@ -259,7 +260,6 @@ void NodeViewScene::ReorganizeFrom(Node* n)
QPointF parent_pos = n->GetPosition();
int weight_count = DetermineWeight(n);
qDebug() << "Weight" << n->id() << "is" << weight_count;
qreal child_x = parent_pos.x() - 1.0;
qreal children_height = weight_count-1;
@@ -281,6 +281,11 @@ void NodeViewScene::ReorganizeFrom(Node* n)
}
}
void NodeViewScene::SetFilterMode(const NodeViewScene::FilterMode &f)
{
filter_mode_ = f;
}
void NodeViewScene::NodePositionChanged(const QPointF &pos)
{
item_map_.value(static_cast<Node*>(sender()))->SetNodePosition(pos);
+9
View File
@@ -80,6 +80,13 @@ public:
*/
void ReorganizeFrom(Node* n);
enum FilterMode {
kFilterShowAll,
kFilterShowSelectedBlocks
};
void SetFilterMode(const FilterMode& f);
public slots:
/**
* @brief Slot when a Node is added to a graph (SetGraph() connects this)
@@ -124,6 +131,8 @@ private:
NodeViewCommon::FlowDirection direction_;
FilterMode filter_mode_;
private slots:
/**
* @brief Receiver for whenever a node position changes