summaryrefslogtreecommitdiff
path: root/scene/gui/graph_edit.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/graph_edit.h')
-rw-r--r--scene/gui/graph_edit.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h
index 5251de1722..aeb35f2e02 100644
--- a/scene/gui/graph_edit.h
+++ b/scene/gui/graph_edit.h
@@ -116,6 +116,8 @@ private:
Button *minimap_button;
+ Button *layout_button;
+
HScrollBar *h_scroll;
VScrollBar *v_scroll;
@@ -230,6 +232,24 @@ private:
bool _check_clickable_control(Control *p_control, const Vector2 &pos);
+ bool arranging_graph = false;
+
+ enum SET_OPERATIONS {
+ IS_EQUAL,
+ IS_SUBSET,
+ DIFFERENCE,
+ UNION,
+ };
+
+ int _set_operations(SET_OPERATIONS p_operation, Set<StringName> &r_u, const Set<StringName> &r_v);
+ HashMap<int, Vector<StringName>> _layering(const Set<StringName> &r_selected_nodes, const HashMap<StringName, Set<StringName>> &r_upper_neighbours);
+ Vector<StringName> _split(const Vector<StringName> &r_layer, const HashMap<StringName, Dictionary> &r_crossings);
+ void _horizontal_alignment(Dictionary &r_root, Dictionary &r_align, const HashMap<int, Vector<StringName>> &r_layers, const HashMap<StringName, Set<StringName>> &r_upper_neighbours, const Set<StringName> &r_selected_nodes);
+ void _crossing_minimisation(HashMap<int, Vector<StringName>> &r_layers, const HashMap<StringName, Set<StringName>> &r_upper_neighbours);
+ void _calculate_inner_shifts(Dictionary &r_inner_shifts, const Dictionary &r_root, const Dictionary &r_node_names, const Dictionary &r_align, const Set<StringName> &r_block_heads, const HashMap<StringName, Pair<int, int>> &r_port_info);
+ float _calculate_threshold(StringName p_v, StringName p_w, const Dictionary &r_node_names, const HashMap<int, Vector<StringName>> &r_layers, const Dictionary &r_root, const Dictionary &r_align, const Dictionary &r_inner_shift, real_t p_current_threshold, const HashMap<StringName, Vector2> &r_node_positions);
+ void _place_block(StringName p_v, float p_delta, const HashMap<int, Vector<StringName>> &r_layers, const Dictionary &r_root, const Dictionary &r_align, const Dictionary &r_node_name, const Dictionary &r_inner_shift, Dictionary &r_sink, Dictionary &r_shift, HashMap<StringName, Vector2> &r_node_positions);
+
protected:
static void _bind_methods();
virtual void add_child_notify(Node *p_child) override;
@@ -304,6 +324,8 @@ public:
HBoxContainer *get_zoom_hbox();
+ void arrange_nodes();
+
GraphEdit();
};