nodeviewscene: added basic standard filtering modes
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user