pub struct FlowGraphNode { /* private fields */ }Expand description
The node of a flow graph containing lines of text tokens, and edges flowing into and out of it.
A node can also be backed by a BasicBlock, which makes the node function as a basic block node.
A node is positioned absolutely within the flow graph and is typically positioned by a FlowGraphLayout.
Implementations§
Source§impl FlowGraphNode
impl FlowGraphNode
pub fn new(graph: &FlowGraph) -> Ref<Self>
pub fn basic_block<C: BlockContext>( &self, context: C, ) -> Option<Ref<BasicBlock<C>>>
pub fn set_basic_block<C: BlockContext>(&self, block: Option<&BasicBlock<C>>)
pub fn lines(&self) -> Array<DisassemblyTextLine>
pub fn set_lines(&self, lines: impl IntoIterator<Item = DisassemblyTextLine>)
Sourcepub fn set_position(&self, x: i32, y: i32)
pub fn set_position(&self, x: i32, y: i32)
Sets the graph position of the node.
pub fn highlight_color(&self) -> HighlightColor
pub fn set_highlight_color(&self, highlight: HighlightColor)
Sourcepub fn incoming_edges(&self) -> Array<FlowGraphEdge>
pub fn incoming_edges(&self) -> Array<FlowGraphEdge>
Edges flowing into this node.
Sourcepub fn outgoing_edges(&self) -> Array<FlowGraphEdge>
pub fn outgoing_edges(&self) -> Array<FlowGraphEdge>
Edges flowing out of this node.
Sourcepub fn add_outgoing_edge(
&self,
type_: BranchType,
target: &FlowGraphNode,
edge_style: EdgeStyle,
)
pub fn add_outgoing_edge( &self, type_: BranchType, target: &FlowGraphNode, edge_style: EdgeStyle, )
Connects two flow graph nodes with an edge.
Sourcepub fn set_outgoing_edge_points(&self, edge_idx: usize, points: &[Point])
pub fn set_outgoing_edge_points(&self, edge_idx: usize, points: &[Point])
Sets the outgoing edge points for edge_idx.
This is typically called when laying out a FlowGraph using FlowGraphLayout, without
calling this for all given node edges in a graph; the nodes will be rendered without any
edges between them, as edge routing is not automatic.
Sourcepub fn set_visibility_region(&self, x: i32, y: i32, w: i32, h: i32)
pub fn set_visibility_region(&self, x: i32, y: i32, w: i32, h: i32)
Sets the graph-coordinate bounding rectangle used for visibility/layout calculations.
This is what is used to determine the nodes returned by FlowGraph::visible_nodes.
Custom FlowGraphLayout implementations should call this after positioning the node and
routing its outgoing edges, before setting the final graph size. The region should cover the
node itself and any routed edge points owned by this node, so the renderer can determine what
part of the graph needs to be visible/redrawn for the node.