HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_Language Class Referenceabstract

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_StringSetgetReservedWords () 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_NodeParmManagergetParmManager () 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_LanguagegetVex ()
 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...
 

Detailed Description

Reprsents a language for which VOPs can generate source code.

Definition at line 29 of file VOP_Language.h.

Constructor & Destructor Documentation

VOP_Language::VOP_Language ( )

Constructor and destructor.

virtual VOP_Language::~VOP_Language ( )
virtual

Member Function Documentation

virtual bool VOP_Language::canDirectlyAssign ( const VOP_TypeInfo dst_type,
const VOP_TypeInfo src_type 
) const
virtual

Returns ture if the second type can be assigned directly to first.

virtual bool VOP_Language::canUseShaderCalls ( VOP_ContextType  context) const
pure virtual

Returns true if it's possible to use shader calls to call a shader function for this context.

virtual VOP_Type VOP_Language::conditionType ( VOP_Type  type) const
pure virtual

Take an arbitrary type and return the type supported by the language.

Examples:
VOP/VOP_Switch.C.
virtual void VOP_Language::getArrayBracketsCode ( UT_String code,
const VOP_TypeInfo type_info 
) const
virtual

Gets array declaration brackets string for a given type. If the type is indeed a string, returns "[]", otherwise returns an empty string "".

virtual void VOP_Language::getConstantCode ( UT_String code,
const VOP_TypeInfo type_info,
bool  unquoted,
const UT_StringArray value 
) const
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.

void VOP_Language::getConstantCode ( UT_StringHolder code,
const VOP_TypeInfo type_info,
bool  unquoted,
const UT_StringArray value 
) const
inline

Definition at line 87 of file VOP_Language.h.

virtual void VOP_Language::getCustomTypeCode ( UT_String code,
const VOP_TypeInfo type_info 
) const
virtual

Get the source code that declares a variable of the given struct type.

virtual void VOP_Language::getCustomTypeEmptyConstantCode ( UT_String code,
const VOP_TypeInfo type_info 
) const
virtual

Get the source code for a default value of a struct given in type_info.

virtual void VOP_Language::getEmptyConstantCode ( UT_String code,
const VOP_TypeInfo type_info 
) const
pure virtual

Gets the source code snippet that represents a default constant value for the variable of a given type.

Examples:
VOP/VOP_Switch.C.
virtual const char* VOP_Language::getExportKeyword ( ) const
pure virtual

Returns the keyword used for shader export (output) parameters.

virtual const char* VOP_Language::getFileExtension ( ) const
pure virtual

Gets source code file extension used for code written in this language.

virtual void VOP_Language::getFunctionCall ( UT_String str,
const UT_String func_name,
const UT_StringArray args 
) const
pure virtual

Writes out a function call to the buffer.

virtual void VOP_Language::getGlobalVariables ( UT_Array< VOP_VarInfo > &  global_vars,
VOP_ContextType  context 
) const
virtual

Obtains the list of global variables available in the given context.

virtual const char* VOP_Language::getIsBoundFunction ( ) const
pure virtual

Returns the name of the isbound() function, or NULL if none.

virtual VOP_LanguageInfo VOP_Language::getLanguageInfo ( ) const
pure virtual

Returns the enumerated type of this language.

virtual VOP_LanguageType VOP_Language::getLanguageType ( ) const
inlinevirtual

Definition at line 49 of file VOP_Language.h.

virtual void VOP_Language::getMemberVarAccessOpCode ( UT_String access_op) const
virtual

Get the variable member access operator for structs/classes.

virtual UT_StringHolder VOP_Language::getName ( ) const
pure virtual

Returns the name of the language.

const VOP_NodeParmManager& VOP_Language::getParmManager ( ) const
inline

Returns a manager that maps VOP types to PRM node parameters.

Definition at line 162 of file VOP_Language.h.

virtual const UT_StringSet& VOP_Language::getReservedWords ( ) const
pure virtual

Gets the list of words reserved for special language meaning. These words cannot be used as variable or function names, etc.

virtual void VOP_Language::getShaderCall ( UT_String buffer,
const UT_String shader_name,
const UT_StringArray arg_names,
const UT_StringArray arg_vals 
) const
pure virtual

Writes out a co-shader call to the buffer.

virtual const char* VOP_Language::getShaderParmSeparator ( ) const
virtual

Returns the separator character between shader arguments in the shader function definition.

virtual void VOP_Language::getShaderTypeCode ( UT_String code,
VOP_ContextType  context 
) const
virtual

Get the source code keyword for the given shader type.

virtual const char* VOP_Language::getSprintf ( ) const
pure virtual

Returns the name of formated print function, or NULL if none.

void VOP_Language::getStringValue ( UT_String value,
const UT_StringArray values,
int  index,
bool  unquoted 
) const
protected

Returns an element at a given array index, quoting it if requested.

virtual void VOP_Language::getStructDefinitionTerminator ( UT_String term) const
virtual

Returns the terminator that follows the struct definition (usually a semicolon or NULL, if terminator is not required.

virtual void VOP_Language::getSupportedShaderTypes ( VOP_ShaderTypeList list) const
virtual

Get the shader contexts available in that language.

virtual void VOP_Language::getTypeCode ( UT_String code,
const VOP_TypeInfo type_info 
) const
pure virtual

Gets type source code keyword for declaring variables of that type.

virtual void VOP_Language::getTypeDefinitionCode ( UT_String type_definition,
const VOP_TypeInfo type_info 
) const
virtual

Get the source code that defines the given type (eg, struct definition).

virtual const char* VOP_Language::getTypeUIColor ( VOP_Type  type) const
virtual

Returns a color name for the connectors of the given type.

virtual void VOP_Language::getVaryingTypeCode ( UT_String code,
const VOP_TypeInfo type_info 
) const
virtual

Gets type source code keyword for declaring variables of that type.

static const VOP_Language* VOP_Language::getVex ( )
static

Convenience function to get the default language (VEX).

virtual const char* VOP_Language::getVopnetMaskTarget ( VOP_ContextType  context_type) const
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 bool VOP_Language::hasTypeAutoconvert ( ) const
virtual

Return true if the language has casting functions that automatically converts the value between some types.

int VOP_Language::isTypeSupported ( VOP_Type  type) const
inline

Take an arbitrary type and return the type supported by the language.

Definition at line 180 of file VOP_Language.h.

virtual bool VOP_Language::isTypeUniformVarying ( VOP_Type  type) const
virtual

Returns true, if the language supports uniform varying variables.

bool VOP_Language::isVex ( ) const
virtual bool VOP_Language::matchesMask ( const UT_StringRef mask) 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 bool VOP_Language::needsFunctionParmExportKeyword ( ) const
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 bool VOP_Language::shouldSpecifyMemberDefaults ( ) const
virtual

Returns true if structs and class definitions should include the default values for their members.

virtual bool VOP_Language::supportsUniformVarying ( ) const
virtual

Returns true, if the language supports uniform varying variables.


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