MaterialX 1.38.2
CompoundNode.h
1//
2// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3// All rights reserved. See LICENSE.txt for license.
4//
5
6#ifndef MATERIALX_COMPOUNDNODE_H
7#define MATERIALX_COMPOUNDNODE_H
8
12
13namespace MaterialX
14{
15
17class MX_GENSHADER_API CompoundNode : public ShaderNodeImpl
18{
19 public:
20 static ShaderNodeImplPtr create();
21
22 void initialize(const InterfaceElement& element, GenContext& context) override;
23
24 void createVariables(const ShaderNode& node, GenContext& context, Shader& shader) const override;
25
26 void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
27
28 void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
29
30 ShaderGraph* getGraph() const override { return _rootGraph.get(); }
31
32 protected:
33 ShaderGraphPtr _rootGraph;
34 string _functionName;
35};
36
37} // namespace MaterialX
38
39#endif
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Shader instance class created during shader generation.
Shader graph class.
shared_ptr< class ShaderGraph > ShaderGraphPtr
A shared pointer to a shader graph.
Definition: ShaderGraph.h:40
Base class for shader node implementations.
Compound node implementation.
Definition: CompoundNode.h:18
ShaderGraph * getGraph() const override
Return a pointer to the graph if this implementation is using a graph, or returns nullptr otherwise.
Definition: CompoundNode.h:30
A context class for shader generation.
Definition: GenContext.h:27
The base class for interface elements such as Node, NodeDef, and NodeGraph.
Definition: Interface.h:317
Class representing a graph (DAG) for shader generation.
Definition: ShaderGraph.h:45
Class containing all data needed during shader generation.
Definition: Shader.h:34
Class representing a node in the shader generation DAG.
Definition: ShaderNode.h:326
Class handling the shader generation implementation for a node.
Definition: ShaderNodeImpl.h:32
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:124