Blender V4.5
Node Union Referenceabstract

#include <node.h>

Inherited by Background, BufferParams, BufferPass, Camera, DenoiseParams, Film, Geometry, Integrator, Object, ParticleSystem, Pass, Procedural, Shader, and ShaderNode.

Public Member Functions

 Node (const NodeType *type, ustring name=ustring())
 
virtual ~Node ()=0
 
void set (const SocketType &input, bool value)
 
void set (const SocketType &input, const int value)
 
void set (const SocketType &input, const uint value)
 
void set (const SocketType &input, const uint64_t value)
 
void set (const SocketType &input, const float value)
 
void set (const SocketType &input, const float2 value)
 
void set (const SocketType &input, const float3 value)
 
void set (const SocketType &input, const char *value)
 
void set (const SocketType &input, ustring value)
 
void set (const SocketType &input, const Transform &value)
 
void set (const SocketType &input, Node *value)
 
template<class ValueType , std::enable_if_t< std::is_enum_v< ValueType >, bool > = true>
void set (const SocketType &input, const ValueType &value)
 
void set (const SocketType &input, array< bool > &value)
 
void set (const SocketType &input, array< int > &value)
 
void set (const SocketType &input, array< float > &value)
 
void set (const SocketType &input, array< float2 > &value)
 
void set (const SocketType &input, array< float3 > &value)
 
void set (const SocketType &input, array< ustring > &value)
 
void set (const SocketType &input, array< Transform > &value)
 
void set (const SocketType &input, array< Node * > &value)
 
bool get_bool (const SocketType &input) const
 
int get_int (const SocketType &input) const
 
uint get_uint (const SocketType &input) const
 
uint64_t get_uint64 (const SocketType &input) const
 
float get_float (const SocketType &input) const
 
float2 get_float2 (const SocketType &input) const
 
float3 get_float3 (const SocketType &input) const
 
ustring get_string (const SocketType &input) const
 
Transform get_transform (const SocketType &input) const
 
Nodeget_node (const SocketType &input) const
 
const array< bool > & get_bool_array (const SocketType &input) const
 
const array< int > & get_int_array (const SocketType &input) const
 
const array< float > & get_float_array (const SocketType &input) const
 
const array< float2 > & get_float2_array (const SocketType &input) const
 
const array< float3 > & get_float3_array (const SocketType &input) const
 
const array< ustring > & get_string_array (const SocketType &input) const
 
const array< Transform > & get_transform_array (const SocketType &input) const
 
const array< Node * > & get_node_array (const SocketType &input) const
 
bool has_default_value (const SocketType &input) const
 
void set_default_value (const SocketType &input)
 
bool equals_value (const Node &other, const SocketType &socket) const
 
void copy_value (const SocketType &socket, const Node &other, const SocketType &other_socket)
 
void set_value (const SocketType &socket, const Node &other, const SocketType &other_socket)
 
bool equals (const Node &other) const
 
void hash (MD5Hash &md5)
 
size_t get_total_size_in_bytes () const
 
bool is_a (const NodeType *type)
 
bool socket_is_modified (const SocketType &input) const
 
bool is_modified () const
 
void tag_modified ()
 
void clear_modified ()
 
void print_modified_sockets () const
 
const NodeOwnerget_owner () const
 
void set_owner (const NodeOwner *owner_)
 
int reference_count () const
 
void reference ()
 
void dereference ()
 
void clear_reference_count ()
 

Public Attributes

ustring name
 
const NodeTypetype
 
InternalNode internal
 
LeafNode leaf
 

Protected Member Functions

template<typename T >
void set_if_different (const SocketType &input, T value)
 
void set_if_different (const SocketType &input, Node *value)
 
template<typename T >
void set_if_different (const SocketType &input, array< T > &value)
 
void set_if_different (const SocketType &input, array< Node * > &value)
 
void dereference_all_used_nodes ()
 

Static Protected Member Functions

template<typename T >
static Tget_socket_value (const Node *node, const SocketType &socket)
 

Protected Attributes

const NodeOwnerowner
 
int ref_count {0}
 
SocketModifiedFlags socket_modified
 

Detailed Description

Definition at line 90 of file graph/node.h.

Constructor & Destructor Documentation

◆ Node()

Node::Node ( const NodeType * type,
ustring name = ustring() )
explicit

◆ ~Node()

Node::~Node ( )
pure virtual

Definition at line 36 of file graph/node.cpp.

Member Function Documentation

◆ clear_modified()

void Node::clear_modified ( )

Definition at line 833 of file graph/node.cpp.

References socket_modified.

◆ clear_reference_count()

void Node::clear_reference_count ( )
inline

Definition at line 201 of file graph/node.h.

References ref_count.

◆ copy_value()

◆ dereference()

void Node::dereference ( )
inline

Definition at line 193 of file graph/node.h.

References ref_count.

Referenced by set_if_different().

◆ dereference_all_used_nodes()

void Node::dereference_all_used_nodes ( )
protected

◆ equals()

bool Node::equals ( const Node & other) const

Definition at line 561 of file graph/node.cpp.

References assert, equals_value(), NodeType::inputs, and type.

Referenced by ImageSlotTextureNode::equals().

◆ equals_value()

◆ get_bool()

bool Node::get_bool ( const SocketType & input) const

Definition at line 181 of file graph/node.cpp.

References assert, SocketType::BOOLEAN, get_socket_value(), and input.

◆ get_bool_array()

const array< bool > & Node::get_bool_array ( const SocketType & input) const

Definition at line 250 of file graph/node.cpp.

References assert, SocketType::BOOLEAN_ARRAY, get_socket_value(), and input.

◆ get_float()

◆ get_float2()

float2 Node::get_float2 ( const SocketType & input) const

Definition at line 211 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::POINT2.

◆ get_float2_array()

const array< float2 > & Node::get_float2_array ( const SocketType & input) const

Definition at line 268 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::POINT2_ARRAY.

◆ get_float3()

◆ get_float3_array()

const array< float3 > & Node::get_float3_array ( const SocketType & input) const

Definition at line 274 of file graph/node.cpp.

References assert, get_socket_value(), input, and is_socket_array_float3().

◆ get_float_array()

const array< float > & Node::get_float_array ( const SocketType & input) const

Definition at line 262 of file graph/node.cpp.

References assert, SocketType::FLOAT_ARRAY, get_socket_value(), and input.

◆ get_int()

int Node::get_int ( const SocketType & input) const

Definition at line 187 of file graph/node.cpp.

References assert, SocketType::ENUM, get_socket_value(), input, and SocketType::INT.

◆ get_int_array()

const array< int > & Node::get_int_array ( const SocketType & input) const

Definition at line 256 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::INT_ARRAY.

◆ get_node()

Node * Node::get_node ( const SocketType & input) const

Definition at line 243 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::NODE.

◆ get_node_array()

const array< Node * > & Node::get_node_array ( const SocketType & input) const

Definition at line 292 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::NODE_ARRAY.

◆ get_owner()

const NodeOwner * Node::get_owner ( ) const

Definition at line 787 of file graph/node.cpp.

References owner.

◆ get_socket_value()

◆ get_string()

ustring Node::get_string ( const SocketType & input) const

◆ get_string_array()

const array< ustring > & Node::get_string_array ( const SocketType & input) const

Definition at line 280 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::STRING_ARRAY.

◆ get_total_size_in_bytes()

◆ get_transform()

Transform Node::get_transform ( const SocketType & input) const

Definition at line 237 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::TRANSFORM.

◆ get_transform_array()

const array< Transform > & Node::get_transform_array ( const SocketType & input) const

Definition at line 286 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::TRANSFORM_ARRAY.

◆ get_uint()

uint Node::get_uint ( const SocketType & input) const

Definition at line 193 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::UINT.

◆ get_uint64()

uint64_t Node::get_uint64 ( const SocketType & input) const

Definition at line 199 of file graph/node.cpp.

References assert, get_socket_value(), input, and SocketType::UINT64.

◆ has_default_value()

bool Node::has_default_value ( const SocketType & input) const

Definition at line 300 of file graph/node.cpp.

References get_socket_value(), and input.

◆ hash()

◆ is_a()

bool Node::is_a ( const NodeType * type)

Definition at line 777 of file graph/node.cpp.

References NodeType::base, and type.

◆ is_modified()

◆ print_modified_sockets()

void Node::print_modified_sockets ( ) const

Definition at line 900 of file graph/node.cpp.

References NodeType::inputs, name, SocketType::name, printf, socket_is_modified(), and type.

◆ reference()

void Node::reference ( )
inline

Definition at line 188 of file graph/node.h.

References ref_count.

Referenced by ShaderManager::add_default().

◆ reference_count()

int Node::reference_count ( ) const
inline

◆ set() [1/20]

void Node::set ( const SocketType & input,
array< bool > & value )

Definition at line 132 of file graph/node.cpp.

References assert, SocketType::BOOLEAN_ARRAY, input, set_if_different(), and value.

◆ set() [2/20]

void Node::set ( const SocketType & input,
array< float > & value )

Definition at line 144 of file graph/node.cpp.

References assert, SocketType::FLOAT_ARRAY, input, set_if_different(), and value.

◆ set() [3/20]

void Node::set ( const SocketType & input,
array< float2 > & value )

Definition at line 150 of file graph/node.cpp.

References assert, input, SocketType::POINT2_ARRAY, set_if_different(), and value.

◆ set() [4/20]

void Node::set ( const SocketType & input,
array< float3 > & value )

Definition at line 156 of file graph/node.cpp.

References assert, input, is_socket_array_float3(), set_if_different(), and value.

◆ set() [5/20]

void Node::set ( const SocketType & input,
array< int > & value )

Definition at line 138 of file graph/node.cpp.

References assert, input, SocketType::INT_ARRAY, set_if_different(), and value.

◆ set() [6/20]

void Node::set ( const SocketType & input,
array< Node * > & value )

Definition at line 174 of file graph/node.cpp.

References assert, input, SocketType::NODE_ARRAY, set_if_different(), and value.

◆ set() [7/20]

void Node::set ( const SocketType & input,
array< Transform > & value )

Definition at line 168 of file graph/node.cpp.

References assert, input, set_if_different(), SocketType::TRANSFORM_ARRAY, and value.

◆ set() [8/20]

void Node::set ( const SocketType & input,
array< ustring > & value )

Definition at line 162 of file graph/node.cpp.

References assert, input, set_if_different(), SocketType::STRING_ARRAY, and value.

◆ set() [9/20]

void Node::set ( const SocketType & input,
bool value )

Definition at line 53 of file graph/node.cpp.

References assert, SocketType::BOOLEAN, input, set_if_different(), and value.

Referenced by BKE_scene_base_iter_next(), set(), set(), and set_value().

◆ set() [10/20]

void Node::set ( const SocketType & input,
const char * value )

Definition at line 95 of file graph/node.cpp.

References input, set(), and value.

◆ set() [11/20]

void Node::set ( const SocketType & input,
const float value )

Definition at line 77 of file graph/node.cpp.

References assert, SocketType::FLOAT, input, set_if_different(), and value.

◆ set() [12/20]

void Node::set ( const SocketType & input,
const float2 value )

Definition at line 83 of file graph/node.cpp.

References assert, input, SocketType::POINT2, set_if_different(), and value.

◆ set() [13/20]

void Node::set ( const SocketType & input,
const float3 value )

Definition at line 89 of file graph/node.cpp.

References assert, input, is_socket_float3(), set_if_different(), and value.

◆ set() [14/20]

void Node::set ( const SocketType & input,
const int value )

Definition at line 59 of file graph/node.cpp.

References assert, SocketType::ENUM, input, SocketType::INT, set_if_different(), and value.

◆ set() [15/20]

void Node::set ( const SocketType & input,
const Transform & value )

Definition at line 119 of file graph/node.cpp.

References assert, input, set_if_different(), SocketType::TRANSFORM, and value.

◆ set() [16/20]

void Node::set ( const SocketType & input,
const uint value )

Definition at line 65 of file graph/node.cpp.

References assert, input, set_if_different(), SocketType::UINT, and value.

◆ set() [17/20]

void Node::set ( const SocketType & input,
const uint64_t value )

Definition at line 71 of file graph/node.cpp.

References assert, input, set_if_different(), SocketType::UINT64, and value.

◆ set() [18/20]

template<class ValueType , std::enable_if_t< std::is_enum_v< ValueType >, bool > = true>
void Node::set ( const SocketType & input,
const ValueType & value )
inline

Definition at line 110 of file graph/node.h.

References input, set(), and value.

◆ set() [19/20]

void Node::set ( const SocketType & input,
Node * value )

Definition at line 125 of file graph/node.cpp.

References assert, input, SocketType::NODE, set_if_different(), and value.

◆ set() [20/20]

void Node::set ( const SocketType & input,
ustring value )

◆ set_default_value()

void Node::set_default_value ( const SocketType & input)

Definition at line 307 of file graph/node.cpp.

References input.

Referenced by Node().

◆ set_if_different() [1/4]

void Node::set_if_different ( const SocketType & input,
array< Node * > & value )
protected

Definition at line 879 of file graph/node.cpp.

References get_socket_value(), input, socket_is_modified(), socket_modified, and value.

◆ set_if_different() [2/4]

template<typename T >
void Node::set_if_different ( const SocketType & input,
array< T > & value )
protected

Definition at line 867 of file graph/node.cpp.

References get_socket_value(), input, socket_is_modified(), socket_modified, and value.

◆ set_if_different() [3/4]

void Node::set_if_different ( const SocketType & input,
Node * value )
protected

Definition at line 848 of file graph/node.cpp.

References dereference(), get_socket_value(), input, socket_modified, and value.

◆ set_if_different() [4/4]

template<typename T >
void Node::set_if_different ( const SocketType & input,
T value )
protected

Definition at line 838 of file graph/node.cpp.

References get_socket_value(), input, socket_modified, and value.

Referenced by set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), and set().

◆ set_owner()

void Node::set_owner ( const NodeOwner * owner_)

Definition at line 792 of file graph/node.cpp.

References assert, and owner.

Referenced by Scene::create_node().

◆ set_value()

◆ socket_is_modified()

bool Node::socket_is_modified ( const SocketType & input) const

Definition at line 818 of file graph/node.cpp.

References input, and socket_modified.

Referenced by print_modified_sockets(), set_if_different(), and set_if_different().

◆ tag_modified()

Member Data Documentation

◆ internal

InternalNode Node::internal

Definition at line 163 of file octree.h.

Referenced by Octree::scanConvert().

◆ leaf

LeafNode Node::leaf

Definition at line 164 of file octree.h.

◆ name

◆ owner

const NodeOwner* Node::owner
protected

Definition at line 207 of file graph/node.h.

Referenced by get_owner(), Node(), and set_owner().

◆ ref_count

int Node::ref_count {0}
protected

Definition at line 208 of file graph/node.h.

Referenced by clear_reference_count(), dereference(), reference(), and reference_count().

◆ socket_modified

◆ type


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