6 #ifndef MATERIALX_TYPEDESC_H
7 #define MATERIALX_TYPEDESC_H
57 static const TypeDesc* registerType(
const string&
name,
unsigned char basetype,
unsigned char semantic = SEMANTIC_NONE,
71 const string&
getName()
const {
return _name; }
78 int getChannelIndex(
char channel)
const;
104 bool isFloat2()
const {
return _size == 2 && (_semantic == SEMANTIC_COLOR || _semantic == SEMANTIC_VECTOR); }
107 bool isFloat3()
const {
return _size == 3 && (_semantic == SEMANTIC_COLOR || _semantic == SEMANTIC_VECTOR); }
110 bool isFloat4()
const {
return _size == 4 && (_semantic == SEMANTIC_COLOR || _semantic == SEMANTIC_VECTOR); }
113 bool isClosure()
const {
return (_semantic == SEMANTIC_CLOSURE || _semantic == SEMANTIC_SHADER || _semantic == SEMANTIC_MATERIAL); }
116 TypeDesc(
const string& name,
unsigned char basetype,
unsigned char semantic,
size_t size,
117 bool editable,
const ChannelMap& channelMapping);
120 const unsigned char _basetype;
121 const unsigned char _semantic;
123 const bool _editable;
MX_GENSHADER_API const TypeDesc * FLOATARRAY
MX_GENSHADER_API const TypeDesc * MATRIX44
#define MATERIALX_NAMESPACE_BEGIN
MX_GENSHADER_API const TypeDesc * SURFACESHADER
const string & getName() const
Return the name of the type.
unsigned char getSemantic() const
Return the semantic for the type.
MX_GENSHADER_API const TypeDesc * BSDF
MX_GENSHADER_API const TypeDesc * VOLUMESHADER
MX_GENSHADER_API const TypeDesc * VECTOR3
MX_GENSHADER_API const TypeDesc * MATERIAL
MX_GENSHADER_API const TypeDesc * COLOR4
MX_GENSHADER_API const TypeDesc * MATRIX33
MX_GENSHADER_API const TypeDesc * COLOR3
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
unsigned char getBaseType() const
Return the basetype for the type.
bool isClosure() const
Return true if the type represents a closure.
MX_GENSHADER_API const TypeDesc * VDF
MX_GENSHADER_API const TypeDesc * LIGHTSHADER
bool isFloat2() const
Return true if the type is an aggregate of 2 floats.
GLuint const GLchar * name
MX_GENSHADER_API const TypeDesc * STRING
MX_GENSHADER_API const TypeDesc * VECTOR2
MX_GENSHADER_API const TypeDesc * BOOLEAN
MX_GENSHADER_API const TypeDesc * NONE
bool isAggregate() const
Return true if the type is an aggregate type.
MX_GENSHADER_API const TypeDesc * INTEGERARRAY
MX_GENSHADER_API const TypeDesc * DISPLACEMENTSHADER
MX_GENSHADER_API const TypeDesc * VECTOR4
bool isFloat3() const
Return true if the type is an aggregate of 3 floats.
MX_GENSHADER_API const TypeDesc * EDF
MX_GENSHADER_API const TypeDesc * FLOAT
bool isScalar() const
Return true if the type is a scalar type.
MX_GENSHADER_API const TypeDesc * FILENAME
#define MATERIALX_NAMESPACE_END
MX_GENSHADER_API const TypeDesc * INTEGER
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
std::unordered_map< char, int > ChannelMap
bool isArray() const
Return true if the type is an array type.
bool isFloat4() const
Return true if the type is an aggregate of 4 floats.