HDK
|
Reprsents a language for which VOPs can generate source code. More...
#include <VOP_Language.h>
Public Member Functions | |
VOP_Language () | |
Constructor and destructor. More... | |
virtual | ~VOP_Language () |
virtual UT_StringHolder | getName () const =0 |
Returns the name of the language. More... | |
virtual bool | matchesMask (const UT_StringRef &mask) const =0 |
virtual VOP_LanguageInfo | getLanguageInfo () const =0 |
Returns the enumerated type of this language. More... | |
virtual VOP_LanguageType | getLanguageType () const |
bool | isVex () const |
virtual const char * | getFileExtension () const =0 |
Gets source code file extension used for code written in this language. More... | |
virtual const UT_StringSet & | getReservedWords () const =0 |
virtual const char * | getExportKeyword () const =0 |
Returns the keyword used for shader export (output) parameters. More... | |
virtual const char * | getShaderParmSeparator () const |
virtual const char * | getSprintf () const =0 |
Returns the name of formated print function, or NULL if none. More... | |
virtual const char * | getIsBoundFunction () const =0 |
Returns the name of the isbound() function, or NULL if none. More... | |
virtual void | getEmptyConstantCode (UT_String &code, const VOP_TypeInfo &type_info) const =0 |
virtual void | getCustomTypeEmptyConstantCode (UT_String &code, const VOP_TypeInfo &type_info) const |
Get the source code for a default value of a struct given in type_info. More... | |
virtual void | getConstantCode (UT_String &code, const VOP_TypeInfo &type_info, bool unquoted, const UT_StringArray &value) const =0 |
void | getConstantCode (UT_StringHolder &code, const VOP_TypeInfo &type_info, bool unquoted, const UT_StringArray &value) const |
virtual void | getSupportedShaderTypes (VOP_ShaderTypeList &list) const |
Get the shader contexts available in that language. More... | |
virtual void | getShaderTypeCode (UT_String &code, VOP_ContextType context) const |
Get the source code keyword for the given shader type. More... | |
virtual void | getCustomTypeCode (UT_String &code, const VOP_TypeInfo &type_info) const |
Get the source code that declares a variable of the given struct type. More... | |
virtual void | getTypeDefinitionCode (UT_String &type_definition, const VOP_TypeInfo &type_info) const |
Get the source code that defines the given type (eg, struct definition). More... | |
virtual void | getMemberVarAccessOpCode (UT_String &access_op) const |
Get the variable member access operator for structs/classes. More... | |
virtual bool | shouldSpecifyMemberDefaults () const |
virtual void | getStructDefinitionTerminator (UT_String &term) const |
virtual bool | needsFunctionParmExportKeyword () const |
virtual bool | canUseShaderCalls (VOP_ContextType context) const =0 |
virtual void | getFunctionCall (UT_String &str, const UT_String &func_name, const UT_StringArray &args) const =0 |
Writes out a function call to the buffer. More... | |
virtual void | getShaderCall (UT_String &buffer, const UT_String &shader_name, const UT_StringArray &arg_names, const UT_StringArray &arg_vals) const =0 |
Writes out a co-shader call to the buffer. More... | |
virtual void | getGlobalVariables (UT_Array< VOP_VarInfo > &global_vars, VOP_ContextType context) const |
Obtains the list of global variables available in the given context. More... | |
const VOP_NodeParmManager & | getParmManager () const |
Returns a manager that maps VOP types to PRM node parameters. More... | |
virtual const char * | getVopnetMaskTarget (VOP_ContextType context_type) const |
virtual const char * | getTypeUIColor (VOP_Type type) const |
Returns a color name for the connectors of the given type. More... | |
virtual bool | canDirectlyAssign (const VOP_TypeInfo &dst_type, const VOP_TypeInfo &src_type) const |
Returns ture if the second type can be assigned directly to first. More... | |
virtual bool | hasTypeAutoconvert () const |
virtual void | getTypeCode (UT_String &code, const VOP_TypeInfo &type_info) const =0 |
Gets type source code keyword for declaring variables of that type. More... | |
virtual void | getVaryingTypeCode (UT_String &code, const VOP_TypeInfo &type_info) const |
Gets type source code keyword for declaring variables of that type. More... | |
virtual void | getArrayBracketsCode (UT_String &code, const VOP_TypeInfo &type_info) const |
virtual bool | supportsUniformVarying () const |
Returns true, if the language supports uniform varying variables. More... | |
virtual bool | isTypeUniformVarying (VOP_Type type) const |
Returns true, if the language supports uniform varying variables. More... | |
virtual VOP_Type | conditionType (VOP_Type type) const =0 |
Take an arbitrary type and return the type supported by the language. More... | |
int | isTypeSupported (VOP_Type type) const |
Take an arbitrary type and return the type supported by the language. More... | |
Static Public Member Functions | |
static const VOP_Language * | getVex () |
Convenience function to get the default language (VEX). More... | |
Protected Member Functions | |
void | getStringValue (UT_String &value, const UT_StringArray &values, int index, bool unquoted) const |
Returns an element at a given array index, quoting it if requested. More... | |
Reprsents a language for which VOPs can generate source code.
Definition at line 29 of file VOP_Language.h.
VOP_Language::VOP_Language | ( | ) |
Constructor and destructor.
|
virtual |
|
virtual |
Returns ture if the second type can be assigned directly to first.
|
pure virtual |
Returns true if it's possible to use shader calls to call a shader function for this context.
Take an arbitrary type and return the type supported by the language.
|
virtual |
Gets array declaration brackets string for a given type. If the type is indeed a string, returns "[]", otherwise returns an empty string "".
|
pure virtual |
Gets the source code snippet that represents a constant for a variable of the given type, whose value is given in the 'value' argument.
|
inline |
Definition at line 87 of file VOP_Language.h.
|
virtual |
Get the source code that declares a variable of the given struct type.
|
virtual |
Get the source code for a default value of a struct given in type_info.
|
pure virtual |
Gets the source code snippet that represents a default constant value for the variable of a given type.
|
pure virtual |
Returns the keyword used for shader export (output) parameters.
|
pure virtual |
Gets source code file extension used for code written in this language.
|
pure virtual |
Writes out a function call to the buffer.
|
virtual |
Obtains the list of global variables available in the given context.
|
pure virtual |
Returns the name of the isbound() function, or NULL if none.
|
pure virtual |
Returns the enumerated type of this language.
|
inlinevirtual |
Definition at line 49 of file VOP_Language.h.
Get the variable member access operator for structs/classes.
|
pure virtual |
Returns the name of the language.
|
inline |
Returns a manager that maps VOP types to PRM node parameters.
Definition at line 162 of file VOP_Language.h.
|
pure virtual |
Gets the list of words reserved for special language meaning. These words cannot be used as variable or function names, etc.
|
pure virtual |
Writes out a co-shader call to the buffer.
|
virtual |
Returns the separator character between shader arguments in the shader function definition.
|
virtual |
Get the source code keyword for the given shader type.
|
pure virtual |
Returns the name of formated print function, or NULL if none.
|
protected |
Returns an element at a given array index, quoting it if requested.
Returns the terminator that follows the struct definition (usually a semicolon or NULL, if terminator is not required.
|
virtual |
Get the shader contexts available in that language.
|
pure virtual |
Gets type source code keyword for declaring variables of that type.
|
virtual |
Get the source code that defines the given type (eg, struct definition).
|
virtual |
Returns a color name for the connectors of the given type.
|
virtual |
Gets type source code keyword for declaring variables of that type.
|
static |
Convenience function to get the default language (VEX).
|
virtual |
Returns the name that encodes the given language and context. This name is then targetted by various VOP nodes with a vopnet mask, to see if these VOPs can show up in that vopnet or not.
|
virtual |
Return true if the language has casting functions that automatically converts the value between some types.
Take an arbitrary type and return the type supported by the language.
Definition at line 180 of file VOP_Language.h.
|
virtual |
Returns true, if the language supports uniform varying variables.
bool VOP_Language::isVex | ( | ) | const |
|
pure virtual |
Returns true if the language matches the given mask. The mask is usually the "render mask" used in VOPs: ie, any VOP whose mask matches this keyword belongs to this language
|
virtual |
Returns true if function parameters are const references by default and outgoing parameters need an explicit "export" keyword. Otherwise, returns false (eg for VEX whose function paramerers are non-const references by default).
|
virtual |
Returns true if structs and class definitions should include the default values for their members.
|
virtual |
Returns true, if the language supports uniform varying variables.