HDK
|
Class that defines a type composed by assembling other types as members. More...
#include <VOP_CompositeTypeDefinition.h>
Public Member Functions | |
VOP_CompositeTypeDefinition () | |
Constructor and destructor. More... | |
~VOP_CompositeTypeDefinition () override | |
virtual UT_StringHolder | getCodeTypeKeyword () const =0 |
void | getTypeDefinitionSourceCode (UT_String &code, const VOP_Language *language) const override |
bool | load (const UT_JSONValue &json) override |
Saves to or loades from a JSON value. More... | |
bool | save (UT_JSONValue &json) const override |
Saves to or loades from a JSON value. More... | |
int | getMemberVarCount () const |
const VOP_MemberVarInfo & | getMemberVarInfo (int index) const |
const VOP_MemberVarInfo * | findMemberVarInfo (const char *member_name, bool check_old_names=false) const |
int | findMemberVarInfoIndex (const char *member_name, bool check_old_names=false) const |
void | appendMemberVarInfo (const VOP_MemberVarInfo &info) |
int | getMethodCount () const |
Getters and setter for member methods. More... | |
const VOP_MemberMethodInfo & | getMethodInfo (int index) const |
Getters and setter for member methods. More... | |
const VOP_MemberMethodInfo * | findMethodInfo (const char *method_name) const |
Getters and setter for member methods. More... | |
void | appendMethodInfo (const VOP_MemberMethodInfo &info) |
Getters and setter for member methods. More... | |
void | setIsAdHoc (bool flag) |
True if the type is ad-hoc (eg, defined by a Struct VOP node). More... | |
bool | isAdHoc () const |
True if the type is ad-hoc (eg, defined by a Struct VOP node). More... | |
void | setExplicitDefinitionCode (const char *code) |
const char * | getExplicitDefinitionCode () const |
Public Member Functions inherited from VOP_TypeDefinition | |
VOP_TypeDefinition () | |
Constructor and destructor. More... | |
virtual | ~VOP_TypeDefinition () |
virtual UT_StringHolder | getMetaType () const =0 |
const UT_StringHolder & | getTypeName () const |
Sets and gets the type definition unique name identifier. More... | |
void | setTypeName (const char *name) |
Sets and gets the type definition unique name identifier. More... | |
const UT_StringHolder & | getName () const |
Sets and gets the type definition unique name identifier. More... | |
const UT_StringHolder & | getTypeLabel () const |
Sets and gets the type definition unique name identifier. More... | |
void | setTypeLabel (const char *label) |
Sets and gets the type definition unique name identifier. More... | |
const UT_Color * | getConnectorColor () const |
Methods for the color of the connector of this type. More... | |
void | setSpecificConnectorColor (const UT_Color &clr) |
Methods for the color of the connector of this type. More... | |
void | setDefaultConnectorColor () |
Methods for the color of the connector of this type. More... | |
void | setCodeTypeName (const char *code_type_name) |
Sets and gets the type name used in the generated code. More... | |
const UT_StringHolder & | getCodeTypeName () const |
Sets and gets the type name used in the generated code. More... | |
const UT_StringHolder & | getCodeTypeNameRaw () const |
Sets and gets the type name used in the generated code. More... | |
bool | operator== (const VOP_TypeDefinition &other) const |
Standard comparison operators. More... | |
bool | operator!= (const VOP_TypeDefinition &other) const |
Standard comparison operators. More... | |
Protected Member Functions | |
void | generateTypeDefinition (UT_String &code, const char *meta_type_keyword, const VOP_Language *language) const |
Generates a type definition for the source code from the member info. More... | |
bool | isEqual (const VOP_TypeDefinition &other) const override |
Standard overrides from the base class. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from VOP_TypeDefinition | |
static const UT_StringHolder | METATYPE_KEY |
Class that defines a type composed by assembling other types as members.
Definition at line 98 of file VOP_CompositeTypeDefinition.h.
VOP_CompositeTypeDefinition::VOP_CompositeTypeDefinition | ( | ) |
Constructor and destructor.
|
override |
void VOP_CompositeTypeDefinition::appendMemberVarInfo | ( | const VOP_MemberVarInfo & | info | ) |
Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.
void VOP_CompositeTypeDefinition::appendMethodInfo | ( | const VOP_MemberMethodInfo & | info | ) |
Getters and setter for member methods.
const VOP_MemberVarInfo* VOP_CompositeTypeDefinition::findMemberVarInfo | ( | const char * | member_name, |
bool | check_old_names = false |
||
) | const |
Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.
int VOP_CompositeTypeDefinition::findMemberVarInfoIndex | ( | const char * | member_name, |
bool | check_old_names = false |
||
) | const |
Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.
const VOP_MemberMethodInfo* VOP_CompositeTypeDefinition::findMethodInfo | ( | const char * | method_name | ) | const |
Getters and setter for member methods.
|
protected |
Generates a type definition for the source code from the member info.
|
pure virtual |
Returns a keyword to be used in the source code for defining this composite type (eg, "struct", "class", etc).
Implemented in VOP_ClassTypeDefinition, and VOP_StructTypeDefinition.
const char* VOP_CompositeTypeDefinition::getExplicitDefinitionCode | ( | ) | const |
Sets and gets the source code that should be used in the shader definision source code. If explicit code is NULL, then whenever an actual definition source code is needed, this class will auto-generate the it from the info about its members. This is the case for majority of vop structs/classes. This override method is useful for struct definitions that are outside of vops (eg, in a header file, in which case this override would likely just specify #include directive).
int VOP_CompositeTypeDefinition::getMemberVarCount | ( | ) | const |
Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.
const VOP_MemberVarInfo& VOP_CompositeTypeDefinition::getMemberVarInfo | ( | int | index | ) | const |
Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.
int VOP_CompositeTypeDefinition::getMethodCount | ( | ) | const |
Getters and setter for member methods.
const VOP_MemberMethodInfo& VOP_CompositeTypeDefinition::getMethodInfo | ( | int | index | ) | const |
Getters and setter for member methods.
|
overridevirtual |
Obtains the source code that defines the type in the programming (scripting) language.
Reimplemented from VOP_TypeDefinition.
bool VOP_CompositeTypeDefinition::isAdHoc | ( | ) | const |
True if the type is ad-hoc (eg, defined by a Struct VOP node).
|
overrideprotectedvirtual |
Standard overrides from the base class.
Implements VOP_TypeDefinition.
|
overridevirtual |
Saves to or loades from a JSON value.
Reimplemented from VOP_TypeDefinition.
|
overridevirtual |
Saves to or loades from a JSON value.
Reimplemented from VOP_TypeDefinition.
Sets and gets the source code that should be used in the shader definision source code. If explicit code is NULL, then whenever an actual definition source code is needed, this class will auto-generate the it from the info about its members. This is the case for majority of vop structs/classes. This override method is useful for struct definitions that are outside of vops (eg, in a header file, in which case this override would likely just specify #include directive).
void VOP_CompositeTypeDefinition::setIsAdHoc | ( | bool | flag | ) |
True if the type is ad-hoc (eg, defined by a Struct VOP node).