pub struct ShaderGraphEditor {Show 13 fields
pub library: ShaderGraphLibrary,
pub active_tool: ShaderEditorTool,
pub selected_nodes: HashSet<ShaderNodeId>,
pub dragging_node: Option<(ShaderNodeId, [f32; 2])>,
pub connecting_from: Option<ShaderPortId>,
pub search_query: String,
pub search_open: bool,
pub search_results: Vec<NodeSearchResult>,
pub compile_result: Option<ShaderCompileResult>,
pub auto_compile: bool,
pub show_node_previews: bool,
pub grid_snap: bool,
pub grid_size: f32,
/* private fields */
}Fields§
§library: ShaderGraphLibrary§active_tool: ShaderEditorTool§selected_nodes: HashSet<ShaderNodeId>§dragging_node: Option<(ShaderNodeId, [f32; 2])>§connecting_from: Option<ShaderPortId>§search_query: String§search_open: bool§search_results: Vec<NodeSearchResult>§compile_result: Option<ShaderCompileResult>§auto_compile: bool§show_node_previews: bool§grid_snap: bool§grid_size: f32Implementations§
Source§impl ShaderGraphEditor
impl ShaderGraphEditor
pub fn new() -> Self
pub fn compile_active(&mut self)
pub fn add_node_at( &mut self, kind: ShaderNodeKind, x: f32, y: f32, ) -> Option<ShaderNodeId>
pub fn remove_selected(&mut self)
pub fn try_connect(&mut self, from: ShaderPortId, to: ShaderPortId) -> bool
pub fn move_node(&mut self, id: ShaderNodeId, dx: f32, dy: f32)
pub fn select_all(&mut self)
pub fn deselect_all(&mut self)
pub fn search(&mut self, query: &str)
pub fn undo(&mut self)
pub fn redo(&mut self)
pub fn glsl_source(&self) -> Option<String>
pub fn has_errors(&self) -> bool
pub fn graph_stats(&self) -> Option<(usize, usize)>
Trait Implementations§
Source§impl Debug for ShaderGraphEditor
impl Debug for ShaderGraphEditor
Auto Trait Implementations§
impl Freeze for ShaderGraphEditor
impl RefUnwindSafe for ShaderGraphEditor
impl Send for ShaderGraphEditor
impl Sync for ShaderGraphEditor
impl Unpin for ShaderGraphEditor
impl UnsafeUnpin for ShaderGraphEditor
impl UnwindSafe for ShaderGraphEditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.