HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_Types.h File Reference
#include "VOP_API.h"
#include <VEX/VEX_VexTypes.h>
#include <VEX/VEX_RslTypes.h>
#include <VEX/VEX_OslTypes.h>
+ Include dependency graph for VOP_Types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_Array< T >
 

Macros

#define VOP_BASE_TYPE(type)   ((VOP_Type)(type&(VOP_TYPE_UNIFORM_MODIFIER-1)))
 
#define VOP_GET_MODIFIER(type)   ((VOP_Type)(type&VOP_TYPE_UNIFORM_MODIFIER))
 
#define VOP_INVALID_TYPE(type)   ((type)==VOP_TYPE_UNDEF||(type)==VOP_TYPE_ERROR)
 
#define VOP_VALID_TYPE(type)   (!VOP_INVALID_TYPE(type))
 
#define VOP_CONTEXT_TYPE_INVALID   0
 

Typedefs

typedef int VOP_ContextType
 
typedef UT_Array< VOP_ContextTypeVOP_ContextTypeList
 A definition of the context type list. More...
 
typedef UT_Array< VOP_TypeVOP_ShaderTypeList
 

Enumerations

enum  VOP_Type {
  VOP_TYPE_UNDEF = VEX_TYPE_UNDEF, VOP_TYPE_INTEGER = VEX_TYPE_INTEGER, VOP_TYPE_FLOAT = VEX_TYPE_FLOAT, VOP_TYPE_STRING = VEX_TYPE_STRING,
  VOP_TYPE_VECTOR2 = VEX_TYPE_VECTOR2, VOP_TYPE_VECTOR = VEX_TYPE_VECTOR, VOP_TYPE_VECTOR4 = VEX_TYPE_VECTOR4, VOP_TYPE_MATRIX2 = VEX_TYPE_MATRIX2,
  VOP_TYPE_MATRIX3 = VEX_TYPE_MATRIX3, VOP_TYPE_MATRIX4 = VEX_TYPE_MATRIX4, VOP_TYPE_BSDF = VEX_TYPE_BSDF, VOP_TYPE_DICT = VEX_TYPE_DICT,
  VOP_TYPE_CUSTOM = VEX_MAX_TYPES, VOP_TYPE_STRUCT = VOP_TYPE_CUSTOM, VOP_TYPE_INTEGER_ARRAY, VOP_TYPE_FLOAT_ARRAY,
  VOP_TYPE_STRING_ARRAY, VOP_TYPE_VECTOR2_ARRAY, VOP_TYPE_VECTOR_ARRAY, VOP_TYPE_VECTOR4_ARRAY,
  VOP_TYPE_MATRIX2_ARRAY, VOP_TYPE_MATRIX3_ARRAY, VOP_TYPE_MATRIX4_ARRAY, VOP_TYPE_DICT_ARRAY,
  VOP_TYPE_POINT, VOP_TYPE_NORMAL, VOP_TYPE_COLOR, VOP_TYPE_POINT_ARRAY,
  VOP_TYPE_NORMAL_ARRAY, VOP_TYPE_COLOR_ARRAY, VOP_TYPE_ERROR, VOP_TYPE_VOID,
  VOP_TYPE_METHOD, VOP_SHADER_START, VOP_SURFACE_SHADER, VOP_SURFACE_SHADOW_SHADER,
  VOP_DISPLACEMENT_SHADER, VOP_GEOMETRY_SHADER, VOP_INTERIOR_SHADER, VOP_LIGHT_SHADER,
  VOP_LIGHT_SHADOW_SHADER, VOP_LIGHT_FILTER_SHADER, VOP_ATMOSPHERE_SHADER, VOP_LENS_SHADER,
  VOP_OUTPUT_SHADER, VOP_BACKGROUND_SHADER, VOP_PHOTON_SHADER, VOP_IMAGE3D_SHADER = VOP_PHOTON_SHADER + 8,
  VOP_SOP_SHADER, VOP_CHOP_SHADER, VOP_COP2_SHADER, VOP_CVEX_SHADER,
  VOP_GENERIC_SHADER, VOP_BSDF_SHADER, VOP_COSHADER_SHADER, VOP_COSHADER_ARRAY,
  VOP_PROPERTIES_SHADER, VOP_MUTABLE_SHADER, VOP_MATERIAL_SHADER, VOP_VOP_MATERIAL_SHADER,
  VOP_SHADER_CLASS_SHADER, VOP_STRUCT_DEF_SHADER, VOP_INTEGRATOR_SHADER, VOP_SHADER_END,
  VOP_MAX_TYPES, VOP_TYPE_UNIFORM_MODIFIER = 0x1000, VOP_TYPE_UINTEGER = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_INTEGER), VOP_TYPE_UFLOAT = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_FLOAT),
  VOP_TYPE_USTRING = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_STRING), VOP_TYPE_UVECTOR = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_VECTOR), VOP_TYPE_UPOINT = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_POINT), VOP_TYPE_UNORMAL = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_NORMAL),
  VOP_TYPE_UCOLOR = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_COLOR), VOP_TYPE_UVECTOR2 = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_VECTOR2), VOP_TYPE_UVECTOR4 = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_VECTOR4), VOP_TYPE_UMATRIX2 = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_MATRIX2),
  VOP_TYPE_UMATRIX3 = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_MATRIX3), VOP_TYPE_UMATRIX4 = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_MATRIX4), VOP_TYPE_UBSDF = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_BSDF), VOP_TYPE_UDICT = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_DICT),
  VOP_TYPE_UCUSTOM = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_CUSTOM), VOP_TYPE_USTRUCT = (VOP_TYPE_UNIFORM_MODIFIER | VOP_TYPE_STRUCT), VOP_TYPE_UVECTOR4_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_VECTOR4_ARRAY), VOP_TYPE_UVECTOR_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_VECTOR_ARRAY),
  VOP_TYPE_UVECTOR2_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_VECTOR2_ARRAY), VOP_TYPE_UFLOAT_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_FLOAT_ARRAY ), VOP_TYPE_UINTEGER_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_INTEGER_ARRAY), VOP_TYPE_USTRING_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_STRING_ARRAY),
  VOP_TYPE_UDICT_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_DICT_ARRAY ), VOP_TYPE_UMATRIX2_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_MATRIX2_ARRAY), VOP_TYPE_UMATRIX3_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_MATRIX3_ARRAY), VOP_TYPE_UMATRIX4_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_MATRIX4_ARRAY),
  VOP_TYPE_UPOINT_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_POINT_ARRAY ), VOP_TYPE_UNORMAL_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_NORMAL_ARRAY), VOP_TYPE_UCOLOR_ARRAY =(VOP_TYPE_UNIFORM_MODIFIER|VOP_TYPE_COLOR_ARRAY )
}
 Enumeration of the built-in (basic) VOP data types. More...
 
enum  VOP_LanguageType {
  VOP_LANGUAGE_INVALID, VOP_LANGUAGE_VEX, VOP_LANGUAGE_RSL, VOP_LANGUAGE_OSL,
  VOP_LANGUAGE_CUSTOM
}
 

Functions

VOP_API bool VOPisArrayType (VOP_Type type)
 Returns true if the type is some kind of an array, and false otherwise. More...
 
VOP_API void VOPgetShaderTypes (UT_Array< VOP_Type > &types)
 
VOP_API const char * VOPgetShaderTypeName (VOP_Type type)
 
VOP_API const char * VOPgetShaderTypeLabel (VOP_Type type)
 
VOP_API VOP_Type VOPgetShaderType (const char *name)
 
VOP_API VOP_ContextType VOPconvertToContextType (VOP_Type shader_type, VOP_LanguageType language)
 
VOP_API VOP_Type VOPconvertToShaderType (VOP_ContextType type, VOP_LanguageType language)
 Converts the context type to a 'shader type'. More...
 
VOP_API bool isValidPassThroughType (VOP_Type type)
 
VOP_API VOP_Type VOPgetElementTypeFromArray (VOP_Type array_type)
 
VOP_API VOP_Type VOPgetArrayTypeFromElement (VOP_Type element_type)
 
VOP_API VEX_ContextType VOPconvertToVexContextType (VOP_Type shader_type)
 Utility function to convert between lowel level contexts and shader type. More...
 
VOP_API RSL_ContextType VOPconvertToRslContextType (VOP_Type shader_type)
 Utility function to convert between lowel level contexts and shader type. More...
 
VOP_API OSL_ContextType VOPconvertToOslContextType (VOP_Type shader_type)
 Utility function to convert between lowel level contexts and shader type. More...
 
VOP_API VOP_Type VOPconvertToShaderType (VEX_ContextType type)
 Utility function to convert between lowel level contexts and shader type. More...
 
VOP_API VOP_Type VOPconvertToShaderType (RSL_ContextType type)
 Utility function to convert between lowel level contexts and shader type. More...
 
VOP_API VOP_Type VOPconvertToShaderType (OSL_ContextType type)
 Utility function to convert between lowel level contexts and shader type. More...
 
VOP_API VOP_ContextType VOPconvertToContextType (const char *context_name, VOP_LanguageType language)
 
VOP_API const char * VOPgetContextTypeName (VOP_ContextType context_type, VOP_LanguageType language)
 
VOP_API const char * VOPgetContextTypeLabel (VOP_ContextType context_type, VOP_LanguageType language)
 
VOP_API VOP_ContextType VOPconvertToContextType (VEX_ContextType type)
 Utility functions to turn lower level context types into VOP_ContextType. More...
 
VOP_API VOP_ContextType VOPconvertToContextType (RSL_ContextType type)
 Utility functions to turn lower level context types into VOP_ContextType. More...
 
VOP_API VOP_ContextType VOPconvertToContextType (OSL_ContextType type)
 Utility functions to turn lower level context types into VOP_ContextType. More...
 
VOP_API VEX_ContextType VOPconvertToVexContextType (VOP_ContextType type)
 Utility functions to turn lower level context types into VOP_ContextType. More...
 
VOP_API RSL_ContextType VOPconvertToRslContextType (VOP_ContextType type)
 Utility functions to turn lower level context types into VOP_ContextType. More...
 
VOP_API OSL_ContextType VOPconvertToOslContextType (VOP_ContextType type)
 Utility functions to turn lower level context types into VOP_ContextType. More...
 

Macro Definition Documentation

#define VOP_BASE_TYPE (   type)    ((VOP_Type)(type&(VOP_TYPE_UNIFORM_MODIFIER-1)))

Definition at line 146 of file VOP_Types.h.

#define VOP_CONTEXT_TYPE_INVALID   0

Definition at line 178 of file VOP_Types.h.

#define VOP_GET_MODIFIER (   type)    ((VOP_Type)(type&VOP_TYPE_UNIFORM_MODIFIER))

Definition at line 147 of file VOP_Types.h.

#define VOP_INVALID_TYPE (   type)    ((type)==VOP_TYPE_UNDEF||(type)==VOP_TYPE_ERROR)

Definition at line 148 of file VOP_Types.h.

#define VOP_VALID_TYPE (   type)    (!VOP_INVALID_TYPE(type))

Definition at line 149 of file VOP_Types.h.

Typedef Documentation

A generic shading context type that can be interpreted as VEX_ContextType, RSL_ContextType, or OSL_ContextType. Different languages support different shading contexts, although they share some common ones (eg, surface). Node's shader type may allow a single context (eg, surface shader contains VOPs that are valid only in the surface context), but it may allow several context (eg, material allows surface and displacement variables and fuctions).

Definition at line 177 of file VOP_Types.h.

A definition of the context type list.

Definition at line 181 of file VOP_Types.h.

Definition at line 182 of file VOP_Types.h.

Enumeration Type Documentation

Defines the known languages. Each of the languages has own set of context types.

Enumerator
VOP_LANGUAGE_INVALID 
VOP_LANGUAGE_VEX 
VOP_LANGUAGE_RSL 
VOP_LANGUAGE_OSL 
VOP_LANGUAGE_CUSTOM 

Definition at line 186 of file VOP_Types.h.

enum VOP_Type

Enumeration of the built-in (basic) VOP data types.

Enumerator
VOP_TYPE_UNDEF 
VOP_TYPE_INTEGER 
VOP_TYPE_FLOAT 
VOP_TYPE_STRING 
VOP_TYPE_VECTOR2 
VOP_TYPE_VECTOR 
VOP_TYPE_VECTOR4 
VOP_TYPE_MATRIX2 
VOP_TYPE_MATRIX3 
VOP_TYPE_MATRIX4 
VOP_TYPE_BSDF 
VOP_TYPE_DICT 
VOP_TYPE_CUSTOM 
VOP_TYPE_STRUCT 
VOP_TYPE_INTEGER_ARRAY 
VOP_TYPE_FLOAT_ARRAY 
VOP_TYPE_STRING_ARRAY 
VOP_TYPE_VECTOR2_ARRAY 
VOP_TYPE_VECTOR_ARRAY 
VOP_TYPE_VECTOR4_ARRAY 
VOP_TYPE_MATRIX2_ARRAY 
VOP_TYPE_MATRIX3_ARRAY 
VOP_TYPE_MATRIX4_ARRAY 
VOP_TYPE_DICT_ARRAY 
VOP_TYPE_POINT 
VOP_TYPE_NORMAL 
VOP_TYPE_COLOR 
VOP_TYPE_POINT_ARRAY 
VOP_TYPE_NORMAL_ARRAY 
VOP_TYPE_COLOR_ARRAY 
VOP_TYPE_ERROR 
VOP_TYPE_VOID 
VOP_TYPE_METHOD 
VOP_SHADER_START 
VOP_SURFACE_SHADER 
VOP_SURFACE_SHADOW_SHADER 
VOP_DISPLACEMENT_SHADER 
VOP_GEOMETRY_SHADER 
VOP_INTERIOR_SHADER 
VOP_LIGHT_SHADER 
VOP_LIGHT_SHADOW_SHADER 
VOP_LIGHT_FILTER_SHADER 
VOP_ATMOSPHERE_SHADER 
VOP_LENS_SHADER 
VOP_OUTPUT_SHADER 
VOP_BACKGROUND_SHADER 
VOP_PHOTON_SHADER 
VOP_IMAGE3D_SHADER 
VOP_SOP_SHADER 
VOP_CHOP_SHADER 
VOP_COP2_SHADER 
VOP_CVEX_SHADER 
VOP_GENERIC_SHADER 
VOP_BSDF_SHADER 
VOP_COSHADER_SHADER 
VOP_COSHADER_ARRAY 
VOP_PROPERTIES_SHADER 
VOP_MUTABLE_SHADER 
VOP_MATERIAL_SHADER 
VOP_VOP_MATERIAL_SHADER 
VOP_SHADER_CLASS_SHADER 
VOP_STRUCT_DEF_SHADER 
VOP_INTEGRATOR_SHADER 
VOP_SHADER_END 
VOP_MAX_TYPES 
VOP_TYPE_UNIFORM_MODIFIER 
VOP_TYPE_UINTEGER 
VOP_TYPE_UFLOAT 
VOP_TYPE_USTRING 
VOP_TYPE_UVECTOR 
VOP_TYPE_UPOINT 
VOP_TYPE_UNORMAL 
VOP_TYPE_UCOLOR 
VOP_TYPE_UVECTOR2 
VOP_TYPE_UVECTOR4 
VOP_TYPE_UMATRIX2 
VOP_TYPE_UMATRIX3 
VOP_TYPE_UMATRIX4 
VOP_TYPE_UBSDF 
VOP_TYPE_UDICT 
VOP_TYPE_UCUSTOM 
VOP_TYPE_USTRUCT 
VOP_TYPE_UVECTOR4_ARRAY 
VOP_TYPE_UVECTOR_ARRAY 
VOP_TYPE_UVECTOR2_ARRAY 
VOP_TYPE_UFLOAT_ARRAY 
VOP_TYPE_UINTEGER_ARRAY 
VOP_TYPE_USTRING_ARRAY 
VOP_TYPE_UDICT_ARRAY 
VOP_TYPE_UMATRIX2_ARRAY 
VOP_TYPE_UMATRIX3_ARRAY 
VOP_TYPE_UMATRIX4_ARRAY 
VOP_TYPE_UPOINT_ARRAY 
VOP_TYPE_UNORMAL_ARRAY 
VOP_TYPE_UCOLOR_ARRAY 

Definition at line 25 of file VOP_Types.h.

Function Documentation

VOP_API bool isValidPassThroughType ( VOP_Type  type)
VOP_API VOP_ContextType VOPconvertToContextType ( VOP_Type  shader_type,
VOP_LanguageType  language 
)

Converts the 'shader_type' based on a language to a VEX or RSL context type encoded into the returned value of VOP_ContextType.

VOP_API VOP_ContextType VOPconvertToContextType ( const char *  context_name,
VOP_LanguageType  language 
)

Utility function to find out the context type based on the token name (plus the language type), and vice versa.

VOP_API VOP_ContextType VOPconvertToContextType ( VEX_ContextType  type)

Utility functions to turn lower level context types into VOP_ContextType.

VOP_API VOP_ContextType VOPconvertToContextType ( RSL_ContextType  type)

Utility functions to turn lower level context types into VOP_ContextType.

VOP_API VOP_ContextType VOPconvertToContextType ( OSL_ContextType  type)

Utility functions to turn lower level context types into VOP_ContextType.

VOP_API OSL_ContextType VOPconvertToOslContextType ( VOP_Type  shader_type)

Utility function to convert between lowel level contexts and shader type.

VOP_API OSL_ContextType VOPconvertToOslContextType ( VOP_ContextType  type)

Utility functions to turn lower level context types into VOP_ContextType.

VOP_API RSL_ContextType VOPconvertToRslContextType ( VOP_Type  shader_type)

Utility function to convert between lowel level contexts and shader type.

VOP_API RSL_ContextType VOPconvertToRslContextType ( VOP_ContextType  type)

Utility functions to turn lower level context types into VOP_ContextType.

VOP_API VOP_Type VOPconvertToShaderType ( VEX_ContextType  type)

Utility function to convert between lowel level contexts and shader type.

VOP_API VOP_Type VOPconvertToShaderType ( RSL_ContextType  type)

Utility function to convert between lowel level contexts and shader type.

VOP_API VOP_Type VOPconvertToShaderType ( OSL_ContextType  type)

Utility function to convert between lowel level contexts and shader type.

VOP_API VOP_Type VOPconvertToShaderType ( VOP_ContextType  type,
VOP_LanguageType  language 
)

Converts the context type to a 'shader type'.

VOP_API VEX_ContextType VOPconvertToVexContextType ( VOP_Type  shader_type)

Utility function to convert between lowel level contexts and shader type.

VOP_API VEX_ContextType VOPconvertToVexContextType ( VOP_ContextType  type)

Utility functions to turn lower level context types into VOP_ContextType.

VOP_API VOP_Type VOPgetArrayTypeFromElement ( VOP_Type  element_type)

Returns the element type of an array and an array type based on array element type, respectively.

VOP_API const char* VOPgetContextTypeLabel ( VOP_ContextType  context_type,
VOP_LanguageType  language 
)

Utility function to find out the context type based on the token name (plus the language type), and vice versa.

VOP_API const char* VOPgetContextTypeName ( VOP_ContextType  context_type,
VOP_LanguageType  language 
)

Utility function to find out the context type based on the token name (plus the language type), and vice versa.

VOP_API VOP_Type VOPgetElementTypeFromArray ( VOP_Type  array_type)

Returns the element type of an array and an array type based on array element type, respectively.

VOP_API VOP_Type VOPgetShaderType ( const char *  name)
VOP_API const char* VOPgetShaderTypeLabel ( VOP_Type  type)
VOP_API const char* VOPgetShaderTypeName ( VOP_Type  type)
VOP_API void VOPgetShaderTypes ( UT_Array< VOP_Type > &  types)

Obtains the shader type based on its name. A shader node has a single shader type, which can correspond to a shading context in a given languate, such as surface or displacement. But, it can be also a material or a class that has no such correspondence.

VOP_API bool VOPisArrayType ( VOP_Type  type)

Returns true if the type is some kind of an array, and false otherwise.