Blender V4.3
blender::fn::lazy_function::Graph Class Reference

#include <FN_lazy_function_graph.hh>

Inherits blender::NonCopyable, and blender::NonMovable.

Classes

class  ToDotOptions
 

Public Member Functions

 Graph (StringRef name="unkown")
 
 ~Graph ()
 
FunctionNodeadd_function (const LazyFunction &fn)
 
GraphInputSocketadd_input (const CPPType &type, std::string name="")
 
GraphOutputSocketadd_output (const CPPType &type, std::string name="")
 
void add_link (OutputSocket &from, InputSocket &to)
 
void clear_origin (InputSocket &socket)
 
void update_node_indices ()
 
void update_socket_indices ()
 
bool node_indices_are_valid () const
 
std::string to_dot (const ToDotOptions &options={}) const
 
#Graph Inline Methods
StringRefNull name () const
 
Span< const Node * > nodes () const
 
Span< Node * > nodes ()
 
Span< const FunctionNode * > function_nodes () const
 
Span< FunctionNode * > function_nodes ()
 
Span< GraphInputSocket * > graph_inputs ()
 
Span< GraphOutputSocket * > graph_outputs ()
 
Span< const GraphInputSocket * > graph_inputs () const
 
Span< const GraphOutputSocket * > graph_outputs () const
 
int socket_num () const
 

Detailed Description

A container for an arbitrary number of nodes and links between their sockets.

Definition at line 205 of file FN_lazy_function_graph.hh.

Constructor & Destructor Documentation

◆ Graph()

blender::fn::lazy_function::Graph::Graph ( StringRef name = "unkown")

◆ ~Graph()

blender::fn::lazy_function::Graph::~Graph ( )

Definition at line 22 of file lazy_function_graph.cc.

References function_nodes().

Member Function Documentation

◆ add_function()

◆ add_input()

◆ add_link()

void blender::fn::lazy_function::Graph::add_link ( OutputSocket & from,
InputSocket & to )

Add a link between the two given sockets. This has undefined behavior when the input is linked to something else already.

Definition at line 99 of file lazy_function_graph.cc.

References BLI_assert, and from.

Referenced by blender::nodes::LazyFunctionForForeachGeometryElementZone::build_graph_contents().

◆ add_output()

◆ clear_origin()

void blender::fn::lazy_function::Graph::clear_origin ( InputSocket & socket)

If the socket is linked, remove the link.

Definition at line 107 of file lazy_function_graph.cc.

◆ function_nodes() [1/2]

Span< FunctionNode * > blender::fn::lazy_function::Graph::function_nodes ( )
inline

◆ function_nodes() [2/2]

Span< const FunctionNode * > blender::fn::lazy_function::Graph::function_nodes ( ) const
inline

◆ graph_inputs() [1/2]

Span< GraphInputSocket * > blender::fn::lazy_function::Graph::graph_inputs ( )
inline

Definition at line 523 of file FN_lazy_function_graph.hh.

◆ graph_inputs() [2/2]

Span< const GraphInputSocket * > blender::fn::lazy_function::Graph::graph_inputs ( ) const
inline

Definition at line 533 of file FN_lazy_function_graph.hh.

◆ graph_outputs() [1/2]

Span< GraphOutputSocket * > blender::fn::lazy_function::Graph::graph_outputs ( )
inline

Definition at line 528 of file FN_lazy_function_graph.hh.

◆ graph_outputs() [2/2]

Span< const GraphOutputSocket * > blender::fn::lazy_function::Graph::graph_outputs ( ) const
inline

Definition at line 538 of file FN_lazy_function_graph.hh.

◆ name()

StringRefNull blender::fn::lazy_function::Graph::name ( ) const
inline

Definition at line 498 of file FN_lazy_function_graph.hh.

◆ node_indices_are_valid()

bool blender::fn::lazy_function::Graph::node_indices_are_valid ( ) const

Can be used to assert that update_node_indices has been called.

Definition at line 136 of file lazy_function_graph.cc.

Referenced by blender::fn::lazy_function::Executor::Executor().

◆ nodes() [1/2]

Span< Node * > blender::fn::lazy_function::Graph::nodes ( )
inline

Definition at line 508 of file FN_lazy_function_graph.hh.

◆ nodes() [2/2]

Span< const Node * > blender::fn::lazy_function::Graph::nodes ( ) const
inline

Get all nodes in the graph. The index in the span corresponds to Node::index_in_graph.

Definition at line 503 of file FN_lazy_function_graph.hh.

Referenced by blender::fn::lazy_function::GraphExecutor::GraphExecutor().

◆ socket_num()

int blender::fn::lazy_function::Graph::socket_num ( ) const
inline

Number of sockets in the graph.

Definition at line 543 of file FN_lazy_function_graph.hh.

◆ to_dot()

◆ update_node_indices()

void blender::fn::lazy_function::Graph::update_node_indices ( )

◆ update_socket_indices()

void blender::fn::lazy_function::Graph::update_socket_indices ( )

Make sure that Socket::index_in_graph is up to date.

Definition at line 122 of file lazy_function_graph.cc.


The documentation for this class was generated from the following files: