HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_LanguageContextTypeList Class Reference

#include <VOP_LanguageContextTypeList.h>

Public Member Functions

 VOP_LanguageContextTypeList (const VOP_LanguageInfo &language_info, VOP_Type shader_type, const VOP_ShaderTypeList *sub_types=nullptr)
 
 VOP_LanguageContextTypeList (VOP_LanguageType language_type, VOP_Type shader_type, const VOP_ShaderTypeList *sub_types=nullptr)
 
 VOP_LanguageContextTypeList (VOP_LanguageType language_type, VOP_ContextType context_type)
 
void setFromNode (OP_Node *node)
 Sets the object data to reflect the node's shader types and contexts. More...
 
VOP_ContextType getDefaultContextType () const
 Obtains the default context. More...
 
VOP_Type getMasterShaderType () const
 Oringial overarching shader type (eg, class, material, surface). More...
 
VOP_LanguageType getLanguageType () const
 Returns the type of the language in which the context types are valid. More...
 
VOP_LanguageInfo getLanguageInfo () const
 
bool isSingleContextType () const
 Returns true if the list represetns a single-context list. More...
 
bool isClassBasedShader () const
 Returns true if the main shader is a class type. More...
 
void getConstituentShaderTypes (VOP_ShaderTypeList &types) const
 Returns a list of shader types that make up the master shader. More...
 
void getConstituentShaderContexts (VOP_ContextTypeList &ctxs) const
 
void getParmTagShaderTypes (VOP_ContextTypeList &contexts) const
 
void getSourceCodeShaderTypes (UT_StringArray &labels, VOP_ContextTypeList &contexts) const
 
 VOP_LanguageContextTypeList ()
 Default c-tor de-tor. More...
 
 ~VOP_LanguageContextTypeList ()
 Default c-tor de-tor. More...
 

Detailed Description

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.

Examples:
SOP/SOP_PrimVOP.C.

Definition at line 41 of file VOP_LanguageContextTypeList.h.

Constructor & Destructor Documentation

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.

Parameters
language_typeShader'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_typeThe 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_typesFor 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.

Member Function Documentation

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.

VOP_LanguageInfo VOP_LanguageContextTypeList::getLanguageInfo ( ) const
inline

Definition at line 102 of file VOP_LanguageContextTypeList.h.

VOP_LanguageType VOP_LanguageContextTypeList::getLanguageType ( ) const
inline

Returns the type of the language in which the context types are valid.

Definition at line 100 of file VOP_LanguageContextTypeList.h.

VOP_Type VOP_LanguageContextTypeList::getMasterShaderType ( ) const
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.

bool VOP_LanguageContextTypeList::isSingleContextType ( ) const
inline

Returns true if the list represetns a single-context list.

Definition at line 106 of file VOP_LanguageContextTypeList.h.

void VOP_LanguageContextTypeList::setFromNode ( OP_Node node)

Sets the object data to reflect the node's shader types and contexts.


The documentation for this class was generated from the following file: