godot/scene/gui/graph_edit.cpp

/**************************************************************************/
/*  graph_edit.cpp                                                        */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "graph_edit.h"
#include "graph_edit.compat.inc"

#include "core/input/input.h"
#include "core/math/geometry_2d.h"
#include "core/math/math_funcs.h"
#include "core/os/keyboard.h"
#include "scene/2d/line_2d.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/graph_edit_arranger.h"
#include "scene/gui/label.h"
#include "scene/gui/panel_container.h"
#include "scene/gui/scroll_bar.h"
#include "scene/gui/spin_box.h"
#include "scene/gui/view_panner.h"
#include "scene/resources/style_box_flat.h"
#include "scene/theme/theme_db.h"

constexpr int MINIMAP_OFFSET =;
constexpr int MINIMAP_PADDING =;
constexpr int MIN_DRAG_DISTANCE_FOR_VALID_CONNECTION =;
constexpr int MAX_CONNECTION_LINE_CURVE_TESSELATION_STAGES =;
constexpr int GRID_MINOR_STEPS_PER_MAJOR_LINE =;
constexpr int GRID_MINOR_STEPS_PER_MAJOR_DOT =;
constexpr int GRID_MIN_SNAPPING_DISTANCE =;
constexpr int GRID_MAX_SNAPPING_DISTANCE =;

bool GraphEditFilter::has_point(const Point2 &p_point) const {}

GraphEditFilter::GraphEditFilter(GraphEdit *p_edit) {}

Control::CursorShape GraphEditMinimap::get_cursor_shape(const Point2 &p_pos) const {}

void GraphEditMinimap::update_minimap() {}

Rect2 GraphEditMinimap::get_camera_rect() {}

Vector2 GraphEditMinimap::_get_render_size() {}

Vector2 GraphEditMinimap::_get_graph_offset() {}

Vector2 GraphEditMinimap::_get_graph_size() {}

Vector2 GraphEditMinimap::_convert_from_graph_position(const Vector2 &p_position) {}

Vector2 GraphEditMinimap::_convert_to_graph_position(const Vector2 &p_position) {}

void GraphEditMinimap::gui_input(const Ref<InputEvent> &p_ev) {}

void GraphEditMinimap::_adjust_graph_scroll(const Vector2 &p_offset) {}

void GraphEditMinimap::_bind_methods() {}

GraphEditMinimap::GraphEditMinimap(GraphEdit *p_edit) {}

Ref<Shader> GraphEdit::default_connections_shader;

void GraphEdit::init_shaders() {}

void GraphEdit::finish_shaders() {}

Control::CursorShape GraphEdit::get_cursor_shape(const Point2 &p_pos) const {}

PackedStringArray GraphEdit::get_configuration_warnings() const {}

Error GraphEdit::connect_node(const StringName &p_from, int p_from_port, const StringName &p_to, int p_to_port) {}

bool GraphEdit::is_node_connected(const StringName &p_from, int p_from_port, const StringName &p_to, int p_to_port) {}

void GraphEdit::disconnect_node(const StringName &p_from, int p_from_port, const StringName &p_to, int p_to_port) {}

const List<Ref<GraphEdit::Connection>> &GraphEdit::get_connection_list() const {}

void GraphEdit::set_scroll_offset(const Vector2 &p_offset) {}

Vector2 GraphEdit::get_scroll_offset() const {}

void GraphEdit::_scroll_moved(double) {}

void GraphEdit::_update_scroll_offset() {}

void GraphEdit::_update_scroll() {}

void GraphEdit::_ensure_node_order_from(Node *p_node) {}

void GraphEdit::_graph_element_selected(Node *p_node) {}

void GraphEdit::_graph_element_deselected(Node *p_node) {}

void GraphEdit::_graph_element_resize_request(const Vector2 &p_new_minsize, Node *p_node) {}

void GraphEdit::_graph_frame_autoshrink_changed(const Vector2 &p_new_minsize, GraphFrame *p_frame) {}

void GraphEdit::_graph_element_moved(Node *p_node) {}

void GraphEdit::_graph_node_slot_updated(int p_index, Node *p_node) {}

void GraphEdit::_graph_node_rect_changed(GraphNode *p_node) {}

void GraphEdit::_ensure_node_order_from_root(const StringName &p_node) {}

void GraphEdit::add_child_notify(Node *p_child) {}

void GraphEdit::remove_child_notify(Node *p_child) {}

void GraphEdit::_update_theme_item_cache() {}

void GraphEdit::_notification(int p_what) {}

Rect2 GraphEdit::_compute_shrinked_frame_rect(const GraphFrame *p_frame) {}

void GraphEdit::_update_graph_frame(GraphFrame *p_frame) {}

void GraphEdit::_set_drag_frame_attached_nodes(GraphFrame *p_frame, bool p_drag) {}

void GraphEdit::_set_position_of_frame_attached_nodes(GraphFrame *p_frame, const Vector2 &p_pos) {}

bool GraphEdit::_filter_input(const Point2 &p_point) {}

void GraphEdit::_top_connection_layer_input(const Ref<InputEvent> &p_ev) {}

bool GraphEdit::_check_clickable_control(Control *p_control, const Vector2 &mpos, const Vector2 &p_offset) {}

bool GraphEdit::is_in_input_hotzone(GraphNode *p_graph_node, int p_port_idx, const Vector2 &p_mouse_pos, const Vector2i &p_port_size) {}

bool GraphEdit::is_in_output_hotzone(GraphNode *p_graph_node, int p_port_idx, const Vector2 &p_mouse_pos, const Vector2i &p_port_size) {}

bool GraphEdit::is_in_port_hotzone(const Vector2 &p_pos, const Vector2 &p_mouse_pos, const Vector2i &p_port_size, bool p_left) {}

PackedVector2Array GraphEdit::get_connection_line(const Vector2 &p_from, const Vector2 &p_to) const {}

Ref<GraphEdit::Connection> GraphEdit::get_closest_connection_at_point(const Vector2 &p_point, float p_max_distance) const {}

List<Ref<GraphEdit::Connection>> GraphEdit::get_connections_intersecting_with_rect(const Rect2 &p_rect) const {}

void GraphEdit::_draw_minimap_connection_line(const Vector2 &p_from_graph_position, const Vector2 &p_to_graph_position, const Color &p_from_color, const Color &p_to_color) {}

void GraphEdit::_update_connections() {}

void GraphEdit::_top_layer_draw() {}

void GraphEdit::_update_top_connection_layer() {}

void GraphEdit::_minimap_draw() {}

void GraphEdit::_draw_grid() {}

void GraphEdit::set_selected(Node *p_child) {}

void GraphEdit::gui_input(const Ref<InputEvent> &p_ev) {}

void GraphEdit::_pan_callback(Vector2 p_scroll_vec, Ref<InputEvent> p_event) {}

void GraphEdit::_zoom_callback(float p_zoom_factor, Vector2 p_origin, Ref<InputEvent> p_event) {}

void GraphEdit::set_connection_activity(const StringName &p_from, int p_from_port, const StringName &p_to, int p_to_port, float p_activity) {}

void GraphEdit::reset_all_connection_activity() {}

void GraphEdit::clear_connections() {}

void GraphEdit::force_connection_drag_end() {}

bool GraphEdit::is_node_hover_valid(const StringName &p_from, const int p_from_port, const StringName &p_to, const int p_to_port) {}

void GraphEdit::set_panning_scheme(PanningScheme p_scheme) {}

GraphEdit::PanningScheme GraphEdit::get_panning_scheme() const {}

void GraphEdit::set_zoom(float p_zoom) {}

void GraphEdit::set_zoom_custom(float p_zoom, const Vector2 &p_center) {}

float GraphEdit::get_zoom() const {}

void GraphEdit::set_zoom_step(float p_zoom_step) {}

float GraphEdit::get_zoom_step() const {}

void GraphEdit::set_zoom_min(float p_zoom_min) {}

float GraphEdit::get_zoom_min() const {}

void GraphEdit::set_zoom_max(float p_zoom_max) {}

float GraphEdit::get_zoom_max() const {}

void GraphEdit::set_right_disconnects(bool p_enable) {}

bool GraphEdit::is_right_disconnects_enabled() const {}

void GraphEdit::add_valid_right_disconnect_type(int p_type) {}

void GraphEdit::remove_valid_right_disconnect_type(int p_type) {}

void GraphEdit::add_valid_left_disconnect_type(int p_type) {}

void GraphEdit::remove_valid_left_disconnect_type(int p_type) {}

TypedArray<Dictionary> GraphEdit::_get_connection_list() const {}

Dictionary GraphEdit::_get_closest_connection_at_point(const Vector2 &p_point, float p_max_distance) const {}

TypedArray<Dictionary> GraphEdit::_get_connections_intersecting_with_rect(const Rect2 &p_rect) const {}

void GraphEdit::_zoom_minus() {}

void GraphEdit::_zoom_reset() {}

void GraphEdit::_zoom_plus() {}

void GraphEdit::_update_zoom_label() {}

void GraphEdit::_invalidate_connection_line_cache() {}

float GraphEdit::_get_shader_line_width() {}

void GraphEdit::add_valid_connection_type(int p_type, int p_with_type) {}

void GraphEdit::remove_valid_connection_type(int p_type, int p_with_type) {}

bool GraphEdit::is_valid_connection_type(int p_type, int p_with_type) const {}

void GraphEdit::attach_graph_element_to_frame(const StringName &p_graph_element, const StringName &p_parent_frame) {}

void GraphEdit::detach_graph_element_from_frame(const StringName &p_graph_element) {}

GraphFrame *GraphEdit::get_element_frame(const StringName &p_attached_graph_element) {}

TypedArray<StringName> GraphEdit::get_attached_nodes_of_frame(const StringName &p_graph_frame) {}

void GraphEdit::set_snapping_enabled(bool p_enable) {}

bool GraphEdit::is_snapping_enabled() const {}

void GraphEdit::set_snapping_distance(int p_snapping_distance) {}

int GraphEdit::get_snapping_distance() const {}

void GraphEdit::set_show_grid(bool p_show) {}

bool GraphEdit::is_showing_grid() const {}

void GraphEdit::set_grid_pattern(GridPattern p_pattern) {}

GraphEdit::GridPattern GraphEdit::get_grid_pattern() const {}

void GraphEdit::_snapping_toggled() {}

void GraphEdit::_snapping_distance_changed(double) {}

void GraphEdit::_show_grid_toggled() {}

void GraphEdit::set_minimap_size(Vector2 p_size) {}

Vector2 GraphEdit::get_minimap_size() const {}

void GraphEdit::set_minimap_opacity(float p_opacity) {}

float GraphEdit::get_minimap_opacity() const {}

void GraphEdit::set_minimap_enabled(bool p_enable) {}

bool GraphEdit::is_minimap_enabled() const {}

void GraphEdit::set_show_menu(bool p_hidden) {}

bool GraphEdit::is_showing_menu() const {}

void GraphEdit::set_show_zoom_label(bool p_hidden) {}

bool GraphEdit::is_showing_zoom_label() const {}

void GraphEdit::set_show_zoom_buttons(bool p_hidden) {}

bool GraphEdit::is_showing_zoom_buttons() const {}

void GraphEdit::set_show_grid_buttons(bool p_hidden) {}

bool GraphEdit::is_showing_grid_buttons() const {}

void GraphEdit::set_show_minimap_button(bool p_hidden) {}

bool GraphEdit::is_showing_minimap_button() const {}

void GraphEdit::set_show_arrange_button(bool p_hidden) {}

bool GraphEdit::is_showing_arrange_button() const {}

void GraphEdit::override_connections_shader(const Ref<Shader> &p_shader) {}

void GraphEdit::_minimap_toggled() {}

void GraphEdit::set_connection_lines_curvature(float p_curvature) {}

float GraphEdit::get_connection_lines_curvature() const {}

void GraphEdit::set_connection_lines_thickness(float p_thickness) {}

float GraphEdit::get_connection_lines_thickness() const {}

void GraphEdit::set_connection_lines_antialiased(bool p_antialiased) {}

bool GraphEdit::is_connection_lines_antialiased() const {}

HBoxContainer *GraphEdit::get_menu_hbox() {}

Ref<ViewPanner> GraphEdit::get_panner() {}

void GraphEdit::set_warped_panning(bool p_warped) {}

void GraphEdit::arrange_nodes() {}

void GraphEdit::_bind_methods() {}

GraphEdit::GraphEdit() {}