pub struct NodeEditor<'ui> { /* private fields */ }Expand description
RAII token for a node editor frame
Implementations§
Source§impl<'ui> NodeEditor<'ui>
impl<'ui> NodeEditor<'ui>
Sourcepub fn minimap(&self, size_fraction: f32, location: MiniMapLocation)
pub fn minimap(&self, size_fraction: f32, location: MiniMapLocation)
Draw a minimap in the editor
Sourcepub fn minimap_with_callback<F: FnMut(i32)>(
&self,
size_fraction: f32,
location: MiniMapLocation,
callback: &mut F,
)
pub fn minimap_with_callback<F: FnMut(i32)>( &self, size_fraction: f32, location: MiniMapLocation, callback: &mut F, )
Draw a minimap with a node-hover callback (invoked during this call)
Sourcepub fn input_attr(&self, id: i32, shape: PinShape) -> AttributeToken<'_>
pub fn input_attr(&self, id: i32, shape: PinShape) -> AttributeToken<'_>
Begin an input attribute pin
Sourcepub fn output_attr(&self, id: i32, shape: PinShape) -> AttributeToken<'_>
pub fn output_attr(&self, id: i32, shape: PinShape) -> AttributeToken<'_>
Begin an output attribute pin
Sourcepub fn static_attr(&self, id: i32) -> AttributeToken<'_>
pub fn static_attr(&self, id: i32) -> AttributeToken<'_>
Begin a static attribute region
Sourcepub fn is_link_created(&self) -> Option<LinkCreated>
pub fn is_link_created(&self) -> Option<LinkCreated>
Query if a link was created this frame (attribute-id version)
Sourcepub fn is_link_created_with_nodes(&self) -> Option<LinkCreatedEx>
pub fn is_link_created_with_nodes(&self) -> Option<LinkCreatedEx>
Query link created with node ids and attribute ids
Sourcepub fn selected_nodes(&self) -> Vec<i32>
pub fn selected_nodes(&self) -> Vec<i32>
Selection helpers
pub fn selected_links(&self) -> Vec<i32>
pub fn clear_selection(&self)
Sourcepub fn is_editor_hovered(&self) -> bool
pub fn is_editor_hovered(&self) -> bool
Hover queries
pub fn hovered_node(&self) -> Option<i32>
pub fn hovered_link(&self) -> Option<i32>
pub fn hovered_pin(&self) -> Option<i32>
Sourcepub fn is_attribute_active(&self) -> bool
pub fn is_attribute_active(&self) -> bool
Attribute active state
pub fn any_attribute_active(&self) -> Option<i32>
Sourcepub fn is_link_started(&self) -> Option<i32>
pub fn is_link_started(&self) -> Option<i32>
Link drag/drop lifecycle
pub fn is_link_dropped(&self, including_detached: bool) -> Option<i32>
Sourcepub fn set_style_flag(&self, flag: StyleFlags, enabled: bool)
pub fn set_style_flag(&self, flag: StyleFlags, enabled: bool)
Toggle style flags (GridLines, GridLinesPrimary, GridSnapping, NodeOutline)
Sourcepub fn enable_link_detach_with_ctrl(&self)
pub fn enable_link_detach_with_ctrl(&self)
Enable link detach with Ctrl by binding to ImGui IO KeyCtrl
Sourcepub fn enable_multiple_select_with_ctrl(&self)
pub fn enable_multiple_select_with_ctrl(&self)
Enable multiple select modifier as Ctrl
Sourcepub fn enable_multiple_select_with_shift(&self)
pub fn enable_multiple_select_with_shift(&self)
Enable multiple select modifier as Shift
Emulate three-button mouse with Alt
IO tweaks
pub fn set_auto_panning_speed(&self, speed: f32)
Sourcepub fn style_colors_dark(&self)
pub fn style_colors_dark(&self)
Style preset helpers
pub fn style_colors_classic(&self)
pub fn style_colors_light(&self)
Sourcepub fn set_node_pos_grid(&self, node_id: i32, pos: [f32; 2])
pub fn set_node_pos_grid(&self, node_id: i32, pos: [f32; 2])
Node positions in grid space
pub fn get_node_pos_grid(&self, node_id: i32) -> [f32; 2]
Sourcepub fn set_grid_spacing(&self, spacing: f32)
pub fn set_grid_spacing(&self, spacing: f32)
Persistent style setters
pub fn set_link_thickness(&self, thickness: f32)
pub fn set_node_corner_rounding(&self, rounding: f32)
pub fn set_node_padding(&self, padding: [f32; 2])
pub fn set_pin_circle_radius(&self, r: f32)
pub fn set_pin_quad_side_length(&self, v: f32)
pub fn set_pin_triangle_side_length(&self, v: f32)
pub fn set_pin_line_thickness(&self, v: f32)
pub fn set_pin_hover_radius(&self, v: f32)
pub fn set_pin_offset(&self, offset: f32)
pub fn set_link_hover_distance(&self, v: f32)
pub fn set_link_line_segments_per_length(&self, v: f32)
pub fn set_node_border_thickness(&self, v: f32)
pub fn set_minimap_padding(&self, padding: [f32; 2])
pub fn set_minimap_offset(&self, offset: [f32; 2])
pub fn set_color(&self, elem: ColorElement, color: [f32; 4])
Sourcepub fn get_color(&self, elem: ColorElement) -> [f32; 4]
pub fn get_color(&self, elem: ColorElement) -> [f32; 4]
Get a style color as RGBA floats [0,1]
Sourcepub fn set_node_pos_screen(&self, node_id: i32, pos: [f32; 2])
pub fn set_node_pos_screen(&self, node_id: i32, pos: [f32; 2])
Node positions in screen/editor space
pub fn set_node_pos_editor(&self, node_id: i32, pos: [f32; 2])
pub fn get_node_pos_screen(&self, node_id: i32) -> [f32; 2]
pub fn get_node_pos_editor(&self, node_id: i32) -> [f32; 2]
Sourcepub fn set_node_draggable(&self, node_id: i32, draggable: bool)
pub fn set_node_draggable(&self, node_id: i32, draggable: bool)
Node drag/size helpers
pub fn snap_node_to_grid(&self, node_id: i32)
pub fn get_node_dimensions(&self, node_id: i32) -> [f32; 2]
Sourcepub fn is_link_destroyed(&self) -> Option<i32>
pub fn is_link_destroyed(&self) -> Option<i32>
Check if a link was destroyed this frame, returning its id
Source§impl<'ui> NodeEditor<'ui>
impl<'ui> NodeEditor<'ui>
Sourcepub fn end(self) -> PostEditor
pub fn end(self) -> PostEditor
Explicitly end the node editor and return post-editor query handle
Source§impl<'ui> NodeEditor<'ui>
Style helpers available from NodeEditor
impl<'ui> NodeEditor<'ui>
Style helpers available from NodeEditor