6 #ifndef MATERIALX_SHADERGENERATOR_H
7 #define MATERIALX_SHADERGENERATOR_H
35 virtual const string& getTarget()
const = 0;
45 virtual void emitScopeEnd(
ShaderStage& stage,
bool semicolon =
false,
bool newline =
true)
const;
48 virtual void emitLineBegin(
ShaderStage& stage)
const;
51 virtual void emitLineEnd(
ShaderStage& stage,
bool semicolon =
true)
const;
54 virtual void emitLineBreak(
ShaderStage& stage)
const;
57 virtual void emitString(
const string& str,
ShaderStage& stage)
const;
60 virtual void emitLine(
const string& str,
ShaderStage& stage,
bool semicolon =
true)
const;
63 virtual void emitComment(
const string& str,
ShaderStage& stage)
const;
122 bool assignValue =
true)
const;
131 bool assignValue =
true)
const;
134 virtual void getClosureContexts(
const ShaderNode& node, vector<ClosureContext*>& cct)
const;
143 void registerImplementation(
const string&
name, CreatorFunction<ShaderNodeImpl> creator);
146 bool implementationRegistered(
const string&
name)
const;
154 _colorManagementSystem = colorManagementSystem;
160 return _colorManagementSystem;
166 _unitSystem = unitSystem;
178 return _tokenSubstitutions;
230 #endif // MATERIALX_SHADERGENERATOR_H
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
const Syntax & getSyntax() const
Return the syntax object for the language used by the code generator.
GLenum GLenum GLenum input
shared_ptr< class UnitSystem > UnitSystemPtr
A shared pointer to a UnitSystem.
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
GLuint const GLchar * name
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.
void setFunctionName(const string &functionName)
Set stage function name.
ColorManagementSystemPtr getColorManagementSystem() const
Returns the color management system.
Exception(const string &msg)
shared_ptr< ShaderStage > ShaderStagePtr
Shared pointer to a ShaderStage.
Punctuation
Punctuation types.
UnitSystemPtr getUnitSystem() const
Returns the unit system.
GLsizei const GLfloat * value
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.
StringMap _tokenSubstitutions