nodeview: stripped out auto-position function
Hopefully this shouldn't be necessary anymore
This commit is contained in:
@@ -108,7 +108,6 @@ void NodeView::SetGraph(NodeGraph *graph, const QVector<Node*> &nodes)
|
||||
if (graph_changed) {
|
||||
if (graph_) {
|
||||
// Disconnect from current graph
|
||||
//disconnect(graph_, &NodeGraph::NodeAdded, this, &NodeView::AddNode);
|
||||
disconnect(graph_, &NodeGraph::NodeRemoved, this, &NodeView::RemoveNode);
|
||||
disconnect(graph_, &NodeGraph::InputConnected, this, &NodeView::AddEdge);
|
||||
disconnect(graph_, &NodeGraph::InputDisconnected, this, &NodeView::RemoveEdge);
|
||||
@@ -120,7 +119,6 @@ void NodeView::SetGraph(NodeGraph *graph, const QVector<Node*> &nodes)
|
||||
|
||||
if (graph_) {
|
||||
// Connect to new graph
|
||||
//connect(graph_, &NodeGraph::NodeAdded, this, &NodeView::AddNode);
|
||||
connect(graph_, &NodeGraph::NodeRemoved, this, &NodeView::RemoveNode);
|
||||
connect(graph_, &NodeGraph::InputConnected, this, &NodeView::AddEdge);
|
||||
connect(graph_, &NodeGraph::InputDisconnected, this, &NodeView::RemoveEdge);
|
||||
@@ -940,12 +938,6 @@ void NodeView::ShowContextMenu(const QPoint &pos)
|
||||
// Color menu
|
||||
MenuShared::instance()->AddColorCodingMenu(&m);
|
||||
|
||||
m.addSeparator();
|
||||
|
||||
// Auto-position action
|
||||
QAction* autopos = m.addAction(tr("Auto-Position"));
|
||||
connect(autopos, &QAction::triggered, this, &NodeView::AutoPositionDescendents);
|
||||
|
||||
ViewerOutput* viewer = dynamic_cast<ViewerOutput*>(selected.first()->GetNode());
|
||||
if (viewer) {
|
||||
m.addSeparator();
|
||||
@@ -1030,15 +1022,6 @@ void NodeView::ContextMenuSetDirection(QAction *action)
|
||||
SetFlowDirection(static_cast<NodeViewCommon::FlowDirection>(action->data().toInt()));
|
||||
}
|
||||
|
||||
void NodeView::AutoPositionDescendents()
|
||||
{
|
||||
QVector<Node*> selected = scene_.GetSelectedNodes();
|
||||
|
||||
for (Node* n : selected) {
|
||||
scene_.ReorganizeFrom(n);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeView::ContextMenuFilterChanged(QAction *action)
|
||||
{
|
||||
FilterMode mode = static_cast<FilterMode>(action->data().toInt());
|
||||
|
||||
@@ -259,11 +259,6 @@ private slots:
|
||||
*/
|
||||
void ContextMenuSetDirection(QAction* action);
|
||||
|
||||
/**
|
||||
* @brief Receiver for auto-position descendents menu action
|
||||
*/
|
||||
void AutoPositionDescendents();
|
||||
|
||||
/**
|
||||
* @brief Receiver for the user changing the filter
|
||||
*/
|
||||
|
||||
@@ -247,41 +247,6 @@ NodeViewCommon::FlowDirection NodeViewScene::GetFlowDirection() const
|
||||
return direction_;
|
||||
}
|
||||
|
||||
void NodeViewScene::ReorganizeFrom(Node* n)
|
||||
{
|
||||
/*
|
||||
QVector<Node*> immediates = n->GetImmediateDependencies();
|
||||
|
||||
if (immediates.isEmpty()) {
|
||||
// Nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
QPointF parent_pos = n->GetPosition();
|
||||
|
||||
int weight_count = DetermineWeight(n);
|
||||
|
||||
qreal child_x = parent_pos.x() - 1.0;
|
||||
qreal children_height = weight_count-1;
|
||||
qreal children_y = parent_pos.y() - children_height * 0.5;
|
||||
|
||||
int weight_counter = 0;
|
||||
|
||||
foreach (Node* i, immediates) {
|
||||
if (i->GetRoutesTo(n) == 1) {
|
||||
int weight = DetermineWeight(i);
|
||||
|
||||
i->SetPosition(QPointF(child_x,
|
||||
children_y + weight_counter + (weight - 1) * 0.5));
|
||||
|
||||
weight_counter += weight;
|
||||
|
||||
ReorganizeFrom(i);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void NodeViewScene::SetEdgesAreCurved(bool curved)
|
||||
{
|
||||
if (curved_edges_ != curved) {
|
||||
|
||||
@@ -79,8 +79,6 @@ public:
|
||||
return curved_edges_;
|
||||
}
|
||||
|
||||
void ReorganizeFrom(Node* n);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Slot when a Node is added to a graph (SetGraph() connects this)
|
||||
|
||||
Reference in New Issue
Block a user