6 #ifndef MATERIALX_SHADERGENERATOR_H
7 #define MATERIALX_SHADERGENERATOR_H
53 virtual void emitScopeEnd(
ShaderStage& stage,
bool semicolon =
false,
bool newline =
true)
const;
56 virtual void emitLineBegin(
ShaderStage& stage)
const;
59 virtual void emitLineEnd(
ShaderStage& stage,
bool semicolon =
true)
const;
62 virtual void emitLineBreak(
ShaderStage& stage)
const;
65 virtual void emitString(
const string& str,
ShaderStage& stage)
const;
68 virtual void emitLine(
const string& str,
ShaderStage& stage,
bool semicolon =
true)
const;
71 virtual void emitComment(
const string& str,
ShaderStage& stage)
const;
132 bool assignValue =
true)
const;
141 bool assignValue =
true)
const;
144 virtual void getClosureContexts(
const ShaderNode& node, vector<ClosureContext*>& cct)
const;
153 void registerImplementation(
const string&
name, CreatorFunction<ShaderNodeImpl> creator);
156 void registerImplementation(
const StringVec& nameVec, CreatorFunction<ShaderNodeImpl> creator);
159 bool implementationRegistered(
const string&
name)
const;
167 _colorManagementSystem = colorManagementSystem;
173 return _colorManagementSystem;
179 _unitSystem = unitSystem;
191 return _tokenSubstitutions;
247 #endif // MATERIALX_SHADERGENERATOR_H
GT_API const UT_StringHolder filename
ColorManagementSystemPtr _colorManagementSystem
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
void setFunctionName(const string &functionName, ShaderStage &stage) const
Set function name for a stage.
Factory< ShaderNodeImpl > _implFactory
void addValue(const T &value)
Add a value.
void setColorManagementSystem(ColorManagementSystemPtr colorManagementSystem)
Sets the color management system.
static const string T_FILE_TRANSFORM_UV
#define MATERIALX_NAMESPACE_BEGIN
vector< string > StringVec
A vector of strings.
GLsizei const GLfloat * value
const Syntax & getSyntax() const
Return the syntax object for the language used by the code generator.
shared_ptr< class UnitSystem > UnitSystemPtr
A shared pointer to a UnitSystem.
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
void setUnitSystem(UnitSystemPtr unitSystem)
Sets the unit system.
const StringMap & getTokenSubstitutions() const
Return the map of token substitutions used by the generator.
shared_ptr< class ColorManagementSystem > ColorManagementSystemPtr
A shared pointer to a ColorManagementSystem.
void emitValue(const T &value, ShaderStage &stage) const
Add a value.
UnitSystemPtr _unitSystem
shared_ptr< Document > DocumentPtr
A shared pointer to a Document.
GLuint const GLchar * name
shared_ptr< class ShaderGraph > ShaderGraphPtr
A shared pointer to a shader graph.
void setFunctionName(const string &functionName)
Set stage function name.
ColorManagementSystemPtr getColorManagementSystem() const
Returns the color management system.
virtual const string & getTarget() const
Return the name of the target this generator is for.
Exception(const string &msg)
shared_ptr< ShaderStage > ShaderStagePtr
Shared pointer to a ShaderStage.
Punctuation
Punctuation types.
UnitSystemPtr getUnitSystem() const
Returns the unit system.
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
#define MATERIALX_NAMESPACE_END
virtual ~ShaderGenerator()
Destructor.
virtual ShaderPtr generate(const string &, ElementPtr, GenContext &) const
StringMap _tokenSubstitutions