MaterialX 1.38.2
IfNode.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_IFNODE_H
7#define MATERIALX_IFNODE_H
8
10
11namespace MaterialX
12{
13
16class MX_GENSHADER_API IfNode : public ShaderNodeImpl
17{
18 public:
19 void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
20
21 private:
23 virtual const string& equalityString() const = 0;
24
25 static const StringVec INPUT_NAMES;
26};
27
30class MX_GENSHADER_API IfGreaterNode : public IfNode
31{
32 public:
33 static ShaderNodeImplPtr create();
34 private:
35 const string& equalityString() const override
36 {
37 return EQUALITY_STRING;
38 }
39 static string EQUALITY_STRING;
40};
41
44class MX_GENSHADER_API IfGreaterEqNode : public IfNode
45{
46 public:
47 static ShaderNodeImplPtr create();
48 private:
49 const string& equalityString() const override
50 {
51 return EQUALITY_STRING;
52 }
53 static string EQUALITY_STRING;
54};
55
58class MX_GENSHADER_API IfEqualNode : public IfNode
59{
60 public:
61 static ShaderNodeImplPtr create();
62 private:
63 const string& equalityString() const override
64 {
65 return EQUALITY_STRING;
66 }
67 static string EQUALITY_STRING;
68};
69
70} // namespace MaterialX
71
72#endif
vector< string > StringVec
A vector of strings.
Definition: Library.h:56
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Base class for shader node implementations.
A context class for shader generation.
Definition: GenContext.h:27
"ifequal" node implementation
Definition: IfNode.h:59
"ifgreatereq" node implementation
Definition: IfNode.h:45
"ifgreater" node implementation
Definition: IfNode.h:31
Abstract base class for implementions which handle if conditions.
Definition: IfNode.h:17
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