6#ifndef MATERIALX_MDLSYNTAX_H
7#define MATERIALX_MDLSYNTAX_H
16MATERIALX_NAMESPACE_BEGIN
25class MX_GENMDL_API MdlSyntax :
public Syntax
30 static SyntaxPtr create() {
return std::make_shared<MdlSyntax>(); }
42 static const string CONST_QUALIFIER;
43 static const string UNIFORM_QUALIFIER;
44 static const string SOURCE_FILE_EXTENSION;
50 static const StringVec ADDRESSMODE_MEMBERS;
51 static const StringVec COORDINATESPACE_MEMBERS;
52 static const StringVec FILTERLOOKUPMODE_MEMBERS;
53 static const StringVec FILTERTYPE_MEMBERS;
54 static const StringVec DISTRIBUTIONTYPE_MEMBERS;
55 static const StringVec SCATTER_MODE_MEMBERS;
56 static const string PORT_NAME_PREFIX;
63 bool remapEnumeration(
const string& value,
TypeDesc type,
const string& enumNames, std::pair<TypeDesc, ValuePtr>& result)
const override;
73 string replaceSourceCodeMarkers(
const string& nodeName,
const string& soureCode, std::function<
string(
const string&)> lambda)
const;
82TYPEDESC_DEFINE_TYPE(MDL_COORDINATESPACE,
"coordinatespace", TypeDesc::BASETYPE_NONE, TypeDesc::SEMANTIC_ENUM, 0)
91MATERIALX_NAMESPACE_END
vector< string > StringVec
A vector of strings.
Definition Library.h:60
Macros for declaring imported and exported symbols.
shared_ptr< MdlSyntax > MdlSyntaxPtr
Shared pointer to an MdlSyntax.
Definition MdlSyntax.h:21
Base class for syntax handling for shader generators.
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
Definition Syntax.h:28
#define TYPEDESC_DEFINE_TYPE(T, name, basetype, semantic, size)
Macro to define global type descriptions for commonly used types.
Definition TypeDesc.h:192
Syntax class for MDL (Material Definition Language)
Definition MdlSyntax.h:26
string replaceSourceCodeMarkers(const string &nodeName, const string &soureCode, std::function< string(const string &)> lambda) const
Replaces all markers in a source code string indicated by {{...}}.
const string & getMdlVersionSuffixMarker() const
Get the MDL language versing marker: {{MDL_VERSION_SUFFIX}}.
bool remapEnumeration(const string &value, TypeDesc type, const string &enumNames, std::pair< TypeDesc, ValuePtr > &result) const override
Given an input specification attempt to remap this to an enumeration which is accepted by the shader ...
const string & getConstantQualifier() const override
Get the qualifier used when declaring constant variables.
Definition MdlSyntax.h:32
string modifyPortName(const string &word) const
To avoid collisions with reserved names in MDL, input and output names are prefixed.
const string & getUniformQualifier() const override
Get the qualifier used when declaring uniform variables.
Definition MdlSyntax.h:33
const string & getSourceFileExtension() const override
Return the file extension used for source code files in this language.
Definition MdlSyntax.h:34
string getArrayTypeSuffix(TypeDesc type, const Value &value) const override
Override to return array type suffix.
void makeValidName(string &name) const override
Modify the given name string to remove any invalid characters or tokens.
string getArrayVariableSuffix(TypeDesc, const Value &) const override
Override to indicate array variables have no array suffix.
Definition MdlSyntax.h:40
TypeDesc getEnumeratedType(const string &value) const
Get an type description for an enumeration based on member value.
Syntax()
Protected constructor.
A type descriptor for MaterialX data types.
Definition TypeDesc.h:36
A generic, discriminated value, whose type may be queried dynamically.
Definition Value.h:46