Blender V2.61 - r43446
|
#include <graph.h>
Public Member Functions | |
ShaderGraph () | |
~ShaderGraph () | |
ShaderGraph * | copy () |
ShaderNode * | add (ShaderNode *node) |
ShaderNode * | output () |
void | connect (ShaderOutput *from, ShaderInput *to) |
void | disconnect (ShaderInput *to) |
void | finalize (bool do_bump=false, bool do_osl=false) |
Public Attributes | |
list< ShaderNode * > | nodes |
bool | finalized |
Protected Types | |
typedef pair< ShaderNode *const, ShaderNode * > | NodePair |
Protected Member Functions | |
void | find_dependencies (set< ShaderNode * > &dependencies, ShaderInput *input) |
void | copy_nodes (set< ShaderNode * > &nodes, map< ShaderNode *, ShaderNode * > &nnodemap) |
void | remove_proxy_nodes (vector< bool > &removed) |
void | break_cycles (ShaderNode *node, vector< bool > &visited, vector< bool > &on_stack) |
void | clean () |
void | bump_from_displacement () |
void | default_inputs (bool do_osl) |
typedef pair<ShaderNode* const, ShaderNode*> ShaderGraph::NodePair [protected] |
ShaderGraph::ShaderGraph | ( | ) |
ShaderNode * ShaderGraph::add | ( | ShaderNode * | node | ) |
Definition at line 144 of file graph.cpp.
References assert, finalized, ShaderNode::id, and nodes.
Referenced by ShaderManager::add_default(), add_node(), add_nodes(), bump_from_displacement(), connect(), copy(), default_inputs(), ShaderGraph(), and xml_read_shader_graph().
void ShaderGraph::break_cycles | ( | ShaderNode * | node, |
vector< bool > & | visited, | ||
vector< bool > & | on_stack | ||
) | [protected] |
Definition at line 331 of file graph.cpp.
References disconnect(), ShaderNode::id, ShaderNode::inputs, ShaderInput::link, and ShaderOutput::parent.
Referenced by clean().
void ShaderGraph::bump_from_displacement | ( | ) | [protected] |
Definition at line 444 of file graph.cpp.
References add(), connect(), copy_nodes(), ShaderInput::default_value, find_dependencies(), ShaderNode::input(), ShaderNode::inputs, ShaderInput::link, ShaderOutput::name, nodes, ShaderInput::NORMAL, ShaderNode::output(), output(), ShaderOutput::parent, SHADER_BUMP_CENTER, SHADER_BUMP_DX, and SHADER_BUMP_DY.
Referenced by finalize().
void ShaderGraph::clean | ( | ) | [protected] |
Definition at line 355 of file graph.cpp.
References break_cycles(), ShaderNode::id, nodes, output(), and remove_proxy_nodes().
Referenced by finalize().
void ShaderGraph::connect | ( | ShaderOutput * | from, |
ShaderInput * | to | ||
) |
Definition at line 177 of file graph.cpp.
References add(), assert, PixelFormat::convert(), finalized, ShaderNode::inputs, ShaderInput::link, ShaderOutput::links, ShaderNode::outputs, SHADER_SOCKET_CLOSURE, ShaderOutput::type, and ShaderInput::type.
Referenced by ShaderManager::add_default(), add_nodes(), bump_from_displacement(), copy_nodes(), default_inputs(), remove_proxy_nodes(), and xml_read_shader_graph().
ShaderGraph * ShaderGraph::copy | ( | ) |
Definition at line 157 of file graph.cpp.
References add(), copy_nodes(), nodes, and ShaderGraph().
void ShaderGraph::copy_nodes | ( | set< ShaderNode * > & | nodes, |
map< ShaderNode *, ShaderNode * > & | nnodemap | ||
) | [protected] |
Definition at line 248 of file graph.cpp.
References ShaderNode::clone(), connect(), ShaderNode::input(), ShaderNode::inputs, ShaderInput::link, ShaderOutput::links, ShaderInput::name, ShaderOutput::name, NULL, ShaderNode::output(), output(), ShaderNode::outputs, ShaderInput::parent, and ShaderOutput::parent.
Referenced by bump_from_displacement(), and copy().
void ShaderGraph::default_inputs | ( | bool | do_osl | ) | [protected] |
Definition at line 393 of file graph.cpp.
References add(), connect(), ShaderInput::default_value, ShaderInput::INCOMING, ShaderNode::inputs, ShaderInput::link, nodes, ShaderInput::NORMAL, NULL, ShaderInput::osl_only, ShaderNode::output(), ShaderInput::POSITION, ShaderInput::TEXTURE_GENERATED, and ShaderInput::TEXTURE_UV.
Referenced by finalize().
void ShaderGraph::disconnect | ( | ShaderInput * | to | ) |
Definition at line 207 of file graph.cpp.
References assert, finalized, ShaderInput::link, ShaderOutput::links, and NULL.
Referenced by break_cycles(), and remove_proxy_nodes().
void ShaderGraph::finalize | ( | bool | do_bump = false , |
bool | do_osl = false |
||
) |
Definition at line 218 of file graph.cpp.
References bump_from_displacement(), clean(), default_inputs(), and finalized.
void ShaderGraph::find_dependencies | ( | set< ShaderNode * > & | dependencies, |
ShaderInput * | input | ||
) | [protected] |
Definition at line 235 of file graph.cpp.
References ShaderNode::inputs, ShaderInput::link, NULL, and ShaderOutput::parent.
Referenced by bump_from_displacement().
ShaderNode * ShaderGraph::output | ( | ) |
Definition at line 152 of file graph.cpp.
References nodes.
Referenced by ShaderManager::add_default(), add_node(), bump_from_displacement(), clean(), SVMCompiler::compile_type(), copy_nodes(), remove_proxy_nodes(), and xml_read_shader_graph().
void ShaderGraph::remove_proxy_nodes | ( | vector< bool > & | removed | ) | [protected] |
Definition at line 295 of file graph.cpp.
References connect(), disconnect(), ShaderNode::id, ShaderNode::inputs, ShaderInput::link, ShaderOutput::links, nodes, output(), ShaderNode::outputs, ShaderInput::set(), and ShaderInput::value.
Referenced by clean().
Definition at line 199 of file graph.h.
Referenced by add(), connect(), disconnect(), finalize(), and ShaderGraph().
list<ShaderNode*> ShaderGraph::nodes |
Definition at line 198 of file graph.h.
Referenced by add(), bump_from_displacement(), clean(), SVMCompiler::compile_type(), copy(), default_inputs(), output(), remove_proxy_nodes(), SVMCompiler::stack_backup(), SVMCompiler::stack_restore(), Shader::tag_update(), and ~ShaderGraph().