2016-06-18 12:46:12 +00:00
/**************************************************************************/
/* graph_edit.h */
/**************************************************************************/
/* 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. */
/**************************************************************************/
2018-01-04 23:50:27 +00:00
2015-01-03 19:52:37 +00:00
# ifndef GRAPH_EDIT_H
# define GRAPH_EDIT_H
2018-06-19 01:10:48 +00:00
# include "scene/gui/box_container.h"
2024-02-07 01:37:26 +00:00
# include "scene/gui/graph_frame.h"
2015-01-03 19:52:37 +00:00
# include "scene/gui/graph_node.h"
2016-02-08 19:28:12 +00:00
2023-10-02 11:43:08 +00:00
class Button ;
2015-01-03 19:52:37 +00:00
class GraphEdit ;
2023-07-10 15:26:02 +00:00
class GraphEditArranger ;
2023-10-02 11:43:08 +00:00
class HScrollBar ;
class Label ;
2024-01-18 15:16:17 +00:00
class Line2D ;
2023-10-02 11:43:08 +00:00
class PanelContainer ;
class SpinBox ;
2021-09-28 16:00:16 +00:00
class ViewPanner ;
2023-10-02 11:43:08 +00:00
class VScrollBar ;
2015-01-03 19:52:37 +00:00
class GraphEditFilter : public Control {
2017-01-03 02:03:46 +00:00
GDCLASS ( GraphEditFilter , Control ) ;
2015-01-03 19:52:37 +00:00
2015-07-21 01:15:06 +00:00
friend class GraphEdit ;
2020-11-06 19:16:45 +00:00
friend class GraphEditMinimap ;
2023-09-12 13:01:42 +00:00
2022-04-04 13:06:57 +00:00
GraphEdit * ge = nullptr ;
2023-07-10 15:26:02 +00:00
2020-07-10 10:34:39 +00:00
virtual bool has_point ( const Point2 & p_point ) const override ;
2015-01-03 19:52:37 +00:00
public :
2015-07-21 01:15:06 +00:00
GraphEditFilter ( GraphEdit * p_edit ) ;
2015-01-03 19:52:37 +00:00
} ;
2020-11-06 19:16:45 +00:00
class GraphEditMinimap : public Control {
GDCLASS ( GraphEditMinimap , Control ) ;
friend class GraphEdit ;
friend class GraphEditFilter ;
2023-07-10 15:26:02 +00:00
2022-04-04 13:06:57 +00:00
GraphEdit * ge = nullptr ;
2020-11-06 19:16:45 +00:00
Vector2 minimap_padding ;
Vector2 minimap_offset ;
2023-09-12 13:01:42 +00:00
Vector2 graph_proportions = Vector2 ( 1 , 1 ) ;
Vector2 graph_padding = Vector2 ( 0 , 0 ) ;
Vector2 camera_position = Vector2 ( 100 , 50 ) ;
Vector2 camera_size = Vector2 ( 200 , 200 ) ;
bool is_pressing = false ;
bool is_resizing = false ;
struct ThemeCache {
Ref < StyleBox > panel ;
Ref < StyleBox > node_style ;
Ref < StyleBox > camera_style ;
2020-11-06 19:16:45 +00:00
2023-09-12 13:01:42 +00:00
Ref < Texture2D > resizer ;
Color resizer_color ;
} theme_cache ;
2020-11-06 19:16:45 +00:00
Vector2 _get_render_size ( ) ;
Vector2 _get_graph_offset ( ) ;
Vector2 _get_graph_size ( ) ;
Vector2 _convert_from_graph_position ( const Vector2 & p_position ) ;
Vector2 _convert_to_graph_position ( const Vector2 & p_position ) ;
2021-08-22 15:37:22 +00:00
virtual void gui_input ( const Ref < InputEvent > & p_ev ) override ;
2020-11-06 19:16:45 +00:00
void _adjust_graph_scroll ( const Vector2 & p_offset ) ;
2023-09-12 13:01:42 +00:00
protected :
static void _bind_methods ( ) ;
public :
virtual CursorShape get_cursor_shape ( const Point2 & p_pos = Point2i ( ) ) const override ;
void update_minimap ( ) ;
Rect2 get_camera_rect ( ) ;
GraphEditMinimap ( GraphEdit * p_edit ) ;
2020-11-06 19:16:45 +00:00
} ;
2015-01-03 19:52:37 +00:00
class GraphEdit : public Control {
2017-01-03 02:03:46 +00:00
GDCLASS ( GraphEdit , Control ) ;
2015-01-03 19:52:37 +00:00
2017-03-05 15:44:50 +00:00
public :
2024-01-18 15:16:17 +00:00
struct Connection : RefCounted {
2023-07-10 15:26:02 +00:00
StringName from_node ;
StringName to_node ;
2021-02-09 17:24:36 +00:00
int from_port = 0 ;
int to_port = 0 ;
float activity = 0.0 ;
2024-01-18 15:16:17 +00:00
private :
struct Cache {
bool dirty = true ;
Vector2 from_pos ; // In graph space.
Vector2 to_pos ; // In graph space.
Color from_color ;
Color to_color ;
Rect2 aabb ; // In local screen space.
Line2D * line = nullptr ; // In local screen space.
} _cache ;
friend class GraphEdit ;
2015-07-21 01:15:06 +00:00
} ;
2016-02-08 19:28:12 +00:00
2021-09-28 16:00:16 +00:00
// Should be in sync with ControlScheme in ViewPanner.
enum PanningScheme {
SCROLL_ZOOMS ,
SCROLL_PANS ,
} ;
2023-10-22 16:01:03 +00:00
enum GridPattern {
GRID_PATTERN_LINES ,
GRID_PATTERN_DOTS
} ;
2017-03-05 15:44:50 +00:00
private :
2023-07-10 15:26:02 +00:00
struct ConnectionType {
union {
struct {
uint32_t type_a ;
uint32_t type_b ;
} ;
uint64_t key = 0 ;
} ;
2016-02-08 19:28:12 +00:00
2023-07-10 15:26:02 +00:00
static uint32_t hash ( const ConnectionType & p_conn ) {
return hash_one_uint64 ( p_conn . key ) ;
}
bool operator = = ( const ConnectionType & p_type ) const {
return key = = p_type . key ;
}
ConnectionType ( uint32_t a = 0 , uint32_t b = 0 ) {
type_a = a ;
type_b = b ;
}
} ;
Label * zoom_label = nullptr ;
Button * zoom_minus_button = nullptr ;
Button * zoom_reset_button = nullptr ;
Button * zoom_plus_button = nullptr ;
2016-08-04 03:05:35 +00:00
2023-07-10 15:26:02 +00:00
Button * toggle_snapping_button = nullptr ;
SpinBox * snapping_distance_spinbox = nullptr ;
2023-10-02 11:43:08 +00:00
Button * toggle_grid_button = nullptr ;
2022-04-04 13:06:57 +00:00
Button * minimap_button = nullptr ;
2023-10-02 11:43:08 +00:00
Button * arrange_button = nullptr ;
2021-08-10 19:14:19 +00:00
2023-07-10 15:26:02 +00:00
HScrollBar * h_scrollbar = nullptr ;
VScrollBar * v_scrollbar = nullptr ;
2015-01-03 19:52:37 +00:00
2021-09-28 16:00:16 +00:00
Ref < ViewPanner > panner ;
2022-01-19 18:59:12 +00:00
bool warped_panning = true ;
2021-09-28 16:00:16 +00:00
2023-10-02 11:43:08 +00:00
bool show_menu = true ;
bool show_zoom_label = false ;
bool show_grid_buttons = true ;
bool show_zoom_buttons = true ;
bool show_minimap_button = true ;
bool show_arrange_button = true ;
2022-05-04 05:31:53 +00:00
2023-07-10 15:26:02 +00:00
bool snapping_enabled = true ;
int snapping_distance = 20 ;
bool show_grid = true ;
2023-10-22 16:01:03 +00:00
GridPattern grid_pattern = GRID_PATTERN_LINES ;
2023-07-10 15:26:02 +00:00
2021-02-09 17:24:36 +00:00
bool connecting = false ;
2024-01-18 15:16:17 +00:00
StringName connecting_from_node ;
bool connecting_from_output = false ;
2021-02-09 17:24:36 +00:00
int connecting_type = 0 ;
2015-07-21 01:15:06 +00:00
Color connecting_color ;
2024-01-18 15:16:17 +00:00
Vector2 connecting_to_point ; // In local screen space.
bool connecting_target_valid = false ;
StringName connecting_target_node ;
int connecting_from_port_index = 0 ;
int connecting_target_port_index = 0 ;
2023-07-10 15:26:02 +00:00
2021-02-09 17:24:36 +00:00
bool just_disconnected = false ;
bool connecting_valid = false ;
2023-07-10 15:26:02 +00:00
2020-07-04 05:00:17 +00:00
Vector2 click_pos ;
2015-01-03 19:52:37 +00:00
2021-09-28 16:00:16 +00:00
PanningScheme panning_scheme = SCROLL_ZOOMS ;
2021-02-09 17:24:36 +00:00
bool dragging = false ;
bool just_selected = false ;
bool moving_selection = false ;
2015-07-21 01:15:06 +00:00
Vector2 drag_accum ;
2015-01-03 19:52:37 +00:00
2021-02-09 17:24:36 +00:00
float zoom = 1.0 ;
2021-06-16 13:14:25 +00:00
float zoom_step = 1.2 ;
2022-05-02 14:28:25 +00:00
// Proper values set in constructor.
float zoom_min = 0.0 ;
float zoom_max = 0.0 ;
2021-06-16 13:14:25 +00:00
2021-02-09 17:24:36 +00:00
bool box_selecting = false ;
bool box_selection_mode_additive = false ;
2015-07-25 00:59:48 +00:00
Point2 box_selecting_from ;
Point2 box_selecting_to ;
Rect2 box_selecting_rect ;
2023-08-09 16:31:15 +00:00
List < GraphElement * > prev_selected ;
2015-07-25 00:59:48 +00:00
2023-07-10 15:26:02 +00:00
bool setting_scroll_offset = false ;
2021-02-09 17:24:36 +00:00
bool right_disconnects = false ;
bool updating = false ;
bool awaiting_scroll_offset_update = false ;
2015-01-03 19:52:37 +00:00
2024-01-18 15:16:17 +00:00
List < Ref < Connection > > connections ;
HashMap < StringName , List < Ref < Connection > > > connection_map ;
Ref < Connection > hovered_connection ;
float lines_thickness = 4.0f ;
2022-05-30 13:38:13 +00:00
float lines_curvature = 0.5f ;
2020-12-18 13:13:28 +00:00
bool lines_antialiased = true ;
2023-10-02 11:43:08 +00:00
PanelContainer * menu_panel = nullptr ;
2023-07-10 15:26:02 +00:00
HBoxContainer * menu_hbox = nullptr ;
Control * connections_layer = nullptr ;
2024-01-18 15:16:17 +00:00
GraphEditFilter * top_connection_layer = nullptr ; // Draws a dragged connection. Necessary since the connection line shader can't be applied to the whole top layer.
Line2D * dragged_connection_line = nullptr ;
Control * top_layer = nullptr ; // Used for drawing the box selection rect. Contains the minimap, menu panel and the scrollbars.
2023-07-10 15:26:02 +00:00
GraphEditMinimap * minimap = nullptr ;
2024-01-18 15:16:17 +00:00
static Ref < Shader > default_connections_shader ;
Ref < Shader > connections_shader ;
2023-07-10 15:26:02 +00:00
Ref < GraphEditArranger > arranger ;
HashSet < ConnectionType , ConnectionType > valid_connection_types ;
HashSet < int > valid_left_disconnect_types ;
HashSet < int > valid_right_disconnect_types ;
2023-09-12 13:01:42 +00:00
struct ThemeCache {
float base_scale = 1.0 ;
Ref < StyleBox > panel ;
Color grid_major ;
Color grid_minor ;
Color activity_color ;
2024-01-18 15:16:17 +00:00
Color connection_hover_tint_color ;
Color connection_valid_target_tint_color ;
Color connection_rim_color ;
2023-09-12 13:01:42 +00:00
Color selection_fill ;
Color selection_stroke ;
2023-10-02 11:43:08 +00:00
Ref < StyleBox > menu_panel ;
2023-09-12 13:01:42 +00:00
Ref < Texture2D > zoom_in ;
Ref < Texture2D > zoom_out ;
Ref < Texture2D > zoom_reset ;
Ref < Texture2D > snapping_toggle ;
Ref < Texture2D > grid_toggle ;
Ref < Texture2D > minimap_toggle ;
Ref < Texture2D > layout ;
float port_hotzone_inner_extent = 0.0 ;
float port_hotzone_outer_extent = 0.0 ;
} theme_cache ;
2024-02-07 01:37:26 +00:00
// This separates the children in two layers to ensure the order
// of both background nodes (e.g frame nodes) and foreground nodes (connectable nodes).
int background_nodes_separator_idx = 0 ;
HashMap < StringName , HashSet < StringName > > frame_attached_nodes ;
HashMap < StringName , StringName > linked_parent_map ;
2023-07-10 15:26:02 +00:00
void _pan_callback ( Vector2 p_scroll_vec , Ref < InputEvent > p_event ) ;
void _zoom_callback ( float p_zoom_factor , Vector2 p_origin , Ref < InputEvent > p_event ) ;
void _zoom_minus ( ) ;
void _zoom_reset ( ) ;
void _zoom_plus ( ) ;
void _update_zoom_label ( ) ;
2023-08-09 16:31:15 +00:00
void _graph_element_selected ( Node * p_node ) ;
void _graph_element_deselected ( Node * p_node ) ;
2024-02-07 01:37:26 +00:00
void _graph_element_resize_request ( const Vector2 & p_new_minsize , Node * p_node ) ;
void _graph_frame_autoshrink_changed ( const Vector2 & p_new_minsize , GraphFrame * p_frame ) ;
2023-08-09 16:31:15 +00:00
void _graph_element_moved ( Node * p_node ) ;
void _graph_node_slot_updated ( int p_index , Node * p_node ) ;
2024-01-18 15:16:17 +00:00
void _graph_node_rect_changed ( GraphNode * p_node ) ;
2015-01-03 19:52:37 +00:00
2024-02-07 01:37:26 +00:00
void _ensure_node_order_from_root ( const StringName & p_node ) ;
void _ensure_node_order_from ( Node * p_node ) ;
2015-07-21 01:15:06 +00:00
void _update_scroll ( ) ;
2023-07-10 15:26:02 +00:00
void _update_scroll_offset ( ) ;
2015-07-21 01:15:06 +00:00
void _scroll_moved ( double ) ;
2021-08-22 15:37:22 +00:00
virtual void gui_input ( const Ref < InputEvent > & p_ev ) override ;
2024-01-18 15:16:17 +00:00
void _top_connection_layer_input ( const Ref < InputEvent > & p_ev ) ;
2018-05-13 03:34:35 +00:00
2024-01-18 15:16:17 +00:00
float _get_shader_line_width ( ) ;
void _draw_minimap_connection_line ( CanvasItem * p_where , const Vector2 & p_from , const Vector2 & p_to , const Color & p_color , const Color & p_to_color ) ;
void _invalidate_connection_line_cache ( ) ;
void _update_top_connection_layer ( ) ;
void _update_connections ( ) ;
2018-05-13 03:34:35 +00:00
2015-07-21 01:15:06 +00:00
void _top_layer_draw ( ) ;
2020-11-06 19:16:45 +00:00
void _minimap_draw ( ) ;
2023-10-22 16:01:03 +00:00
void _draw_grid ( ) ;
2024-01-18 15:16:17 +00:00
bool is_in_port_hotzone ( const Vector2 & p_pos , const Vector2 & p_mouse_pos , const Vector2i & p_port_size , bool p_left ) ;
2022-08-05 18:35:08 +00:00
TypedArray < Dictionary > _get_connection_list ( ) const ;
2024-01-18 15:16:17 +00:00
Dictionary _get_closest_connection_at_point ( const Vector2 & p_point , float p_max_distance = 4.0 ) const ;
TypedArray < Dictionary > _get_connections_intersecting_with_rect ( const Rect2 & p_rect ) const ;
2015-01-08 03:41:34 +00:00
2024-02-07 01:37:26 +00:00
Rect2 _compute_shrinked_frame_rect ( const GraphFrame * p_frame ) ;
void _set_drag_frame_attached_nodes ( GraphFrame * p_frame , bool p_drag ) ;
void _set_position_of_frame_attached_nodes ( GraphFrame * p_frame , const Vector2 & p_pos ) ;
2015-07-21 01:15:06 +00:00
friend class GraphEditFilter ;
bool _filter_input ( const Point2 & p_point ) ;
2023-07-10 15:26:02 +00:00
void _snapping_toggled ( ) ;
void _snapping_distance_changed ( double ) ;
void _show_grid_toggled ( ) ;
2015-01-03 19:52:37 +00:00
2020-11-06 19:16:45 +00:00
friend class GraphEditMinimap ;
void _minimap_toggled ( ) ;
2022-05-30 13:48:58 +00:00
bool _check_clickable_control ( Control * p_control , const Vector2 & r_mouse_pos , const Vector2 & p_offset ) ;
2018-08-20 16:38:18 +00:00
2023-10-02 11:43:08 +00:00
# ifndef DISABLE_DEPRECATED
bool _is_arrange_nodes_button_hidden_bind_compat_81582 ( ) const ;
void _set_arrange_nodes_button_hidden_bind_compat_81582 ( bool p_enable ) ;
2024-01-18 15:16:17 +00:00
PackedVector2Array _get_connection_line_bind_compat_86158 ( const Vector2 & p_from , const Vector2 & p_to ) ;
2023-10-02 11:43:08 +00:00
# endif
2015-01-03 19:52:37 +00:00
protected :
2023-09-12 13:01:42 +00:00
virtual void _update_theme_item_cache ( ) override ;
2023-07-10 15:26:02 +00:00
2020-07-10 10:34:39 +00:00
virtual void add_child_notify ( Node * p_child ) override ;
virtual void remove_child_notify ( Node * p_child ) override ;
2023-07-10 15:26:02 +00:00
2015-07-21 01:15:06 +00:00
void _notification ( int p_what ) ;
2023-09-12 13:01:42 +00:00
static void _bind_methods ( ) ;
2023-10-02 11:43:08 +00:00
# ifndef DISABLE_DEPRECATED
static void _bind_compatibility_methods ( ) ;
# endif
2015-01-03 19:52:37 +00:00
2023-08-09 16:31:15 +00:00
virtual bool is_in_input_hotzone ( GraphNode * p_graph_node , int p_port_idx , const Vector2 & p_mouse_pos , const Vector2i & p_port_size ) ;
virtual bool is_in_output_hotzone ( GraphNode * p_graph_node , int p_port_idx , const Vector2 & p_mouse_pos , const Vector2i & p_port_size ) ;
2023-06-19 03:54:55 +00:00
2021-08-22 15:37:22 +00:00
GDVIRTUAL2RC ( Vector < Vector2 > , _get_connection_line , Vector2 , Vector2 )
2021-12-29 17:27:44 +00:00
GDVIRTUAL3R ( bool , _is_in_input_hotzone , Object * , int , Vector2 )
GDVIRTUAL3R ( bool , _is_in_output_hotzone , Object * , int , Vector2 )
2021-08-01 01:19:55 +00:00
GDVIRTUAL4R ( bool , _is_node_hover_valid , StringName , int , StringName , int ) ;
2021-08-22 15:37:22 +00:00
2015-07-21 01:15:06 +00:00
public :
2024-01-18 15:16:17 +00:00
static void init_shaders ( ) ;
static void finish_shaders ( ) ;
2023-05-07 14:14:57 +00:00
virtual CursorShape get_cursor_shape ( const Point2 & p_pos = Point2i ( ) ) const override ;
2024-02-17 18:03:21 +00:00
PackedStringArray get_configuration_warnings ( ) const override ;
2022-09-14 16:09:21 +00:00
2024-02-07 01:37:26 +00:00
// This method has to be public (for undo redo).
// TODO: Find a better way to do this.
void _update_graph_frame ( GraphFrame * p_frame ) ;
// Connection related methods.
2015-07-21 01:15:06 +00:00
Error connect_node ( const StringName & p_from , int p_from_port , const StringName & p_to , int p_to_port ) ;
bool is_node_connected ( const StringName & p_from , int p_from_port , const StringName & p_to , int p_to_port ) ;
void disconnect_node ( const StringName & p_from , int p_from_port , const StringName & p_to , int p_to_port ) ;
void clear_connections ( ) ;
2024-01-18 15:16:17 +00:00
2021-07-26 14:31:31 +00:00
void force_connection_drag_end ( ) ;
2024-01-18 15:16:17 +00:00
const List < Ref < Connection > > & get_connection_list ( ) const ;
virtual PackedVector2Array get_connection_line ( const Vector2 & p_from , const Vector2 & p_to ) const ;
Ref < Connection > get_closest_connection_at_point ( const Vector2 & p_point , float p_max_distance = 4.0 ) const ;
List < Ref < Connection > > get_connections_intersecting_with_rect ( const Rect2 & p_rect ) const ;
2023-06-19 03:54:55 +00:00
2021-08-01 01:19:55 +00:00
virtual bool is_node_hover_valid ( const StringName & p_from , int p_from_port , const StringName & p_to , int p_to_port ) ;
2015-01-03 19:52:37 +00:00
2018-06-19 01:10:48 +00:00
void set_connection_activity ( const StringName & p_from , int p_from_port , const StringName & p_to , int p_to_port , float p_activity ) ;
2024-01-18 15:16:17 +00:00
void reset_all_connection_activity ( ) ;
2018-06-19 01:10:48 +00:00
2016-08-02 22:11:05 +00:00
void add_valid_connection_type ( int p_type , int p_with_type ) ;
void remove_valid_connection_type ( int p_type , int p_with_type ) ;
bool is_valid_connection_type ( int p_type , int p_with_type ) const ;
2024-02-07 01:37:26 +00:00
// GraphFrame related methods.
void attach_graph_element_to_frame ( const StringName & p_graph_element , const StringName & p_parent_frame ) ;
void detach_graph_element_from_frame ( const StringName & p_graph_element ) ;
GraphFrame * get_element_frame ( const StringName & p_attached_graph_element ) ;
TypedArray < StringName > get_attached_nodes_of_frame ( const StringName & p_graph_frame ) ;
2021-09-28 16:00:16 +00:00
void set_panning_scheme ( PanningScheme p_scheme ) ;
PanningScheme get_panning_scheme ( ) const ;
2016-01-18 23:32:37 +00:00
void set_zoom ( float p_zoom ) ;
2017-11-01 20:49:39 +00:00
void set_zoom_custom ( float p_zoom , const Vector2 & p_center ) ;
2016-01-18 23:32:37 +00:00
float get_zoom ( ) const ;
2021-06-16 13:14:25 +00:00
void set_zoom_min ( float p_zoom_min ) ;
float get_zoom_min ( ) const ;
void set_zoom_max ( float p_zoom_max ) ;
float get_zoom_max ( ) const ;
void set_zoom_step ( float p_zoom_step ) ;
float get_zoom_step ( ) const ;
2020-11-06 19:16:45 +00:00
void set_minimap_size ( Vector2 p_size ) ;
Vector2 get_minimap_size ( ) const ;
void set_minimap_opacity ( float p_opacity ) ;
float get_minimap_opacity ( ) const ;
void set_minimap_enabled ( bool p_enable ) ;
bool is_minimap_enabled ( ) const ;
2023-10-02 11:43:08 +00:00
void set_show_menu ( bool p_hidden ) ;
bool is_showing_menu ( ) const ;
void set_show_zoom_label ( bool p_hidden ) ;
bool is_showing_zoom_label ( ) const ;
void set_show_grid_buttons ( bool p_hidden ) ;
bool is_showing_grid_buttons ( ) const ;
void set_show_zoom_buttons ( bool p_hidden ) ;
bool is_showing_zoom_buttons ( ) const ;
void set_show_minimap_button ( bool p_hidden ) ;
bool is_showing_minimap_button ( ) const ;
void set_show_arrange_button ( bool p_hidden ) ;
bool is_showing_arrange_button ( ) const ;
2022-05-04 05:31:53 +00:00
2024-01-18 15:16:17 +00:00
Control * get_top_layer ( ) const { return top_layer ; }
2020-11-06 19:16:45 +00:00
GraphEditMinimap * get_minimap ( ) const { return minimap ; }
2023-07-10 15:26:02 +00:00
2024-01-18 15:16:17 +00:00
void override_connections_shader ( const Ref < Shader > & p_shader ) ;
2015-01-03 19:52:37 +00:00
2015-07-21 01:15:06 +00:00
void set_right_disconnects ( bool p_enable ) ;
bool is_right_disconnects_enabled ( ) const ;
2016-03-08 23:00:52 +00:00
2016-08-02 22:11:05 +00:00
void add_valid_right_disconnect_type ( int p_type ) ;
void remove_valid_right_disconnect_type ( int p_type ) ;
void add_valid_left_disconnect_type ( int p_type ) ;
void remove_valid_left_disconnect_type ( int p_type ) ;
2023-07-10 15:26:02 +00:00
void set_scroll_offset ( const Vector2 & p_ofs ) ;
Vector2 get_scroll_offset ( ) const ;
2015-01-07 04:45:46 +00:00
2016-08-02 22:11:05 +00:00
void set_selected ( Node * p_child ) ;
2023-07-10 15:26:02 +00:00
void set_snapping_enabled ( bool p_enable ) ;
bool is_snapping_enabled ( ) const ;
void set_snapping_distance ( int p_snapping_distance ) ;
int get_snapping_distance ( ) const ;
2016-08-04 03:05:35 +00:00
2023-07-10 15:26:02 +00:00
void set_show_grid ( bool p_enable ) ;
bool is_showing_grid ( ) const ;
2015-01-03 19:52:37 +00:00
2023-10-22 16:01:03 +00:00
void set_grid_pattern ( GridPattern p_pattern ) ;
GridPattern get_grid_pattern ( ) const ;
2022-05-30 13:38:13 +00:00
void set_connection_lines_curvature ( float p_curvature ) ;
float get_connection_lines_curvature ( ) const ;
2020-12-18 13:13:28 +00:00
void set_connection_lines_thickness ( float p_thickness ) ;
float get_connection_lines_thickness ( ) const ;
void set_connection_lines_antialiased ( bool p_antialiased ) ;
bool is_connection_lines_antialiased ( ) const ;
2023-07-10 15:26:02 +00:00
HBoxContainer * get_menu_hbox ( ) ;
2022-01-19 18:59:12 +00:00
Ref < ViewPanner > get_panner ( ) ;
void set_warped_panning ( bool p_warped ) ;
2018-06-19 01:10:48 +00:00
2021-08-10 19:14:19 +00:00
void arrange_nodes ( ) ;
2015-07-21 01:15:06 +00:00
GraphEdit ( ) ;
2015-01-03 19:52:37 +00:00
} ;
2021-09-28 16:00:16 +00:00
VARIANT_ENUM_CAST ( GraphEdit : : PanningScheme ) ;
2023-10-22 16:01:03 +00:00
VARIANT_ENUM_CAST ( GraphEdit : : GridPattern ) ;
2021-09-28 16:00:16 +00:00
2022-07-23 21:41:51 +00:00
# endif // GRAPH_EDIT_H