Blender V5.0
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="unknown")
 ~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 = "unknown")

Definition at line 13 of file lazy_function_graph.cc.

References name().

◆ ~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()

◆ 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

Definition at line 513 of file FN_lazy_function_graph.hh.

References blender::Span< T >::cast(), and blender::Span< T >::drop_front().

Referenced by ~Graph().

◆ graph_inputs() [1/2]

◆ 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]

◆ 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

◆ 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.

References i.

◆ 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.

◆ 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()

◆ 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.

References i, inputs, and outputs.


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