6#ifndef MATERIALX_UNITSYSTEM_H
7#define MATERIALX_UNITSYSTEM_H
21MATERIALX_NAMESPACE_BEGIN
30struct MX_GENSHADER_API UnitTransform
32 UnitTransform(
const string& ss,
const string& ts,
TypeDesc t,
const string& unittype);
42 return sourceUnit == rhs.sourceUnit &&
43 targetUnit == rhs.targetUnit &&
45 unitType == rhs.unitType;
51class MX_GENSHADER_API UnitSystem
54 virtual ~UnitSystem() { }
62 return UnitSystem::UNITSYSTEM_NAME;
84 static const string UNITSYSTEM_NAME;
88 UnitSystem(
const string& target);
96MATERIALX_NAMESPACE_END
shared_ptr< NodeDef > NodeDefPtr
A shared pointer to a NodeDef.
Definition Definition.h:32
The top-level Document class.
shared_ptr< Document > DocumentPtr
A shared pointer to a Document.
Definition Document.h:22
Macros for declaring imported and exported symbols.
Classes for nodes created during shader generation.
shared_ptr< class ShaderNode > ShaderNodePtr
Shared pointer to a ShaderNode.
Definition ShaderNode.h:35
Base class for shader node implementations.
Type descriptor for a MaterialX data type.
shared_ptr< UnitConverterRegistry > UnitConverterRegistryPtr
A shared pointer to a UnitConverterRegistry.
Definition Unit.h:33
shared_ptr< class UnitSystem > UnitSystemPtr
A shared pointer to a UnitSystem.
Definition UnitSystem.h:26
A context class for shader generation.
Definition GenContext.h:31
Base class for shader generators All third-party shader generators should derive from this class.
Definition ShaderGenerator.h:31
Class representing a graph (DAG) for shader generation.
Definition ShaderGraph.h:44
A type descriptor for MaterialX data types.
Definition TypeDesc.h:36
virtual UnitConverterRegistryPtr getUnitConverterRegistry() const
Returns the currently assigned unit converter registry.
ShaderNodePtr createNode(ShaderGraph *parent, const UnitTransform &transform, const string &name, GenContext &context) const
Create a node to use to perform the given unit space transformation.
virtual void loadLibrary(DocumentPtr document)
assign document with unit implementations replacing any previously loaded content.
bool supportsTransform(const UnitTransform &transform) const
Returns whether this unit system supports a provided transform.
virtual const string & getName() const
Return the UnitSystem name.
Definition UnitSystem.h:60
virtual NodeDefPtr getNodeDef(const UnitTransform &transform) const
Returns a nodedef for a given transform.
static UnitSystemPtr create(const string &target)
Create a new UnitSystem.
virtual void setUnitConverterRegistry(UnitConverterRegistryPtr registry)
Assign unit converter registry replacing any previous assignment.