HDK
|
#include <VOP_LanguageContextTypeList.h>
A class that abstracts shader types and shader context types. It encapsulates shader types that make up a given vopnet node, and also shader contexts conavailable inside that vopnet.
This class is used to determine variables available in Global VOP (as a menu of available context types), constituent shaders in Vars Output VOP (as a menu of available shader type), and final form of a shader source code n View VEX Code (as a menu of shader types), etc.
A shader type represents a shader kind. It could be a surface, a displacement, but also a geometry or a class. It corresponds to VOP_Type.
A context type represents a language support for a given shader type. Context determines global variables and functions available to implement a given shader type in a given language. But not all shader types have corresponding contexts, if they can't be implemented in a given language, for example, like geometry shader type. Context type is represented by VOP_ContextType.
Definition at line 41 of file VOP_LanguageContextTypeList.h.
VOP_LanguageContextTypeList::VOP_LanguageContextTypeList | ( | ) |
Default c-tor de-tor.
VOP_LanguageContextTypeList::~VOP_LanguageContextTypeList | ( | ) |
Default c-tor de-tor.
VOP_LanguageContextTypeList::VOP_LanguageContextTypeList | ( | const VOP_LanguageInfo & | language_info, |
VOP_Type | shader_type, | ||
const VOP_ShaderTypeList * | sub_types = nullptr |
||
) |
Constructor for representing a shader type in a given language. Some shader types (eg, a material or a class) may represent a structured shader that consists of several sub-shader types. In such cases the list of sub-shaders can be provided explicitly.
language_type | Shader's language type. It determines the shader context types that are available, which in turn determine global variables and functions available to the shader. It is needed if (some) shader types are implemented thru VOP networks. |
shader_type | The shader type. For a single-context node, it represents its shader type. For multi-context nodes, it represents the master shader type (eg, material or a class). |
sub_types | For a multi-context node, this parameter explicitly lists the constituent shader types that make up the master shader. Eg, a material may allow surf and disp. |
VOP_LanguageContextTypeList::VOP_LanguageContextTypeList | ( | VOP_LanguageType | language_type, |
VOP_Type | shader_type, | ||
const VOP_ShaderTypeList * | sub_types = nullptr |
||
) |
Deprecated. Uses VOP_LanguageType rather than VOP_LanguageInfo which can't accurately identify a custom language.
VOP_LanguageContextTypeList::VOP_LanguageContextTypeList | ( | VOP_LanguageType | language_type, |
VOP_ContextType | context_type | ||
) |
Deprecated. Uses old VOP_ContextType rather than VOP_Type shader type. Eg, use VOP_CVEX_SHADER instead of VEX_CVEX_CONTEXT.
void VOP_LanguageContextTypeList::getConstituentShaderContexts | ( | VOP_ContextTypeList & | ctxs | ) | const |
Returns a list of shader context types which are valid in the list's language and for which there is a source code that can be generated. Some constituent shader types may not have a corresponding a shader context (eg geometry shader type).
void VOP_LanguageContextTypeList::getConstituentShaderTypes | ( | VOP_ShaderTypeList & | types | ) | const |
Returns a list of shader types that make up the master shader.
VOP_ContextType VOP_LanguageContextTypeList::getDefaultContextType | ( | ) | const |
Obtains the default context.
|
inline |
Definition at line 102 of file VOP_LanguageContextTypeList.h.
|
inline |
Returns the type of the language in which the context types are valid.
Definition at line 100 of file VOP_LanguageContextTypeList.h.
|
inline |
Oringial overarching shader type (eg, class, material, surface).
Definition at line 96 of file VOP_LanguageContextTypeList.h.
void VOP_LanguageContextTypeList::getParmTagShaderTypes | ( | VOP_ContextTypeList & | contexts | ) | const |
Returns a list of shaders whose parameters can appear on the master shader (material) node. Such parameters are tagged for shader context so they can be used in renderer's shader string.
void VOP_LanguageContextTypeList::getSourceCodeShaderTypes | ( | UT_StringArray & | labels, |
VOP_ContextTypeList & | contexts | ||
) | const |
Returns a list of shaders contexts (and labels) for which the master shader node provides source code. These usually correspond to language contexts (surface, displacement), but this can also be just a class. However, procedurals (geometry) usually is not in this list.
bool VOP_LanguageContextTypeList::isClassBasedShader | ( | ) | const |
Returns true if the main shader is a class type.
|
inline |
Returns true if the list represetns a single-context list.
Definition at line 106 of file VOP_LanguageContextTypeList.h.
Sets the object data to reflect the node's shader types and contexts.