#include <VOP_HDACodeCompiler.h>
A class that compiles a node into a script-based HDA. This is a base class that presents two interface functions, compileVexCodeToSections() and compileNewOperatorType() and the derived class should implement at least one of them.
Definition at line 42 of file VOP_HDACodeCompiler.h.
VOP_HDACodeCompiler::VOP_HDACodeCompiler |
( |
| ) |
|
virtual VOP_HDACodeCompiler::~VOP_HDACodeCompiler |
( |
| ) |
|
|
virtual |
static bool VOP_HDACodeCompiler::canCompileNode |
( |
OP_Node * |
srcnode | ) |
|
|
static |
Tests if the node can be compiled into vex code sections.
- Returns
- True if node can be compiled; otherwise, false.
void VOP_HDACodeCompiler::clearStatus |
( |
| ) |
|
|
protected |
Allow subclasses to set the error and warning messages.
virtual bool VOP_HDACodeCompiler::compileNewOperatorType |
( |
OP_Node * |
srcnode, |
|
|
const char * |
name, |
|
|
const char * |
label, |
|
|
const char * |
path, |
|
|
const char * |
metasrc, |
|
|
const VOP_ContextTypeList * |
types = NULL |
|
) |
| |
|
virtual |
Compiles a given node to a new script-based HDA (ie, the content nodes are not saved; only the vex code that they generate is saved). This is used for HDAs that don't have contents network, and only use the compiled code for cooking.
- Parameters
-
srcnode | The node from which to create the new HDA. |
name | The name of the new operator. |
label | The label of the new operator. |
path | The file path of the OTL to which the new HDA is saved. |
metasrc | The meta source for the OTL containing new HDA. |
types | The shader context types to save. If NULL, all implemented context types are saved. |
- Returns
- True if creation of new HDA succeeded. On failure, false is returned and the member error message is set.
Reimplemented in VOP_ShaderHDACompilerOTL.
virtual bool VOP_HDACodeCompiler::compileVexCodeToSections |
( |
OP_Node * |
srcnode, |
|
|
FS_IndexFile * |
hda, |
|
|
const char * |
context_mask = 0 |
|
) |
| |
|
virtual |
Compiles a given node to the sections of a given HDA (already existing). This is used for HDAs that have contents network, but also want to store cached vfl/vex code.
- Parameters
-
srcnode | The node from which to obtain vex code. |
hda | The HDA definition to which save the vfl and vex code. |
Reimplemented in VOP_ShaderHDACompilerHDA, and VOP_VopHDACompiler.
bool VOP_HDACodeCompiler::getForceCompilationOnOpNameConflict |
( |
| ) |
|
|
inline |
Configures the flag to force creation of the new operator even if there is already one by that name.
Definition at line 65 of file VOP_HDACodeCompiler.h.
Obtains info about imported shaders that needed to be also compiled and saved in HDA sections. Eg, imported shaders that are implemented as nested Material Builders (or HDAs based on them). The keys are the shader function names and mapped values are the section names where they are stored.
Definition at line 119 of file VOP_HDACodeCompiler.h.
Returns an error or a warning message from the last compilation.
bool VOP_HDACodeCompiler::isOK |
( |
| ) |
const |
|
inlineprotected |
Utility function for cleaning up HDA of any compiled sections. node The node defined by the HDA saved in file. It is used to determine the section name convention for the given type of HDA (shader vs. vop).
Saves the code to section.
void VOP_HDACodeCompiler::setForceCompilationOnOpNameConflict |
( |
bool |
flag | ) |
|
|
inline |
Configures the flag to force creation of the new operator even if there is already one by that name.
Definition at line 63 of file VOP_HDACodeCompiler.h.
void VOP_HDACodeCompiler::setShaderName |
( |
const char * |
shader_name | ) |
|
|
inline |
void VOP_HDACodeCompiler::setStatus |
( |
UT_ErrorSeverity |
sev, |
|
|
const char * |
msg, |
|
|
const char * |
details = 0 |
|
) |
| |
|
protected |
Allow subclasses to set the error and warning messages.
Utility function for compiling node to code sections, but also to update function name section if needed. Returns true on success; false otherwise (along with error message)
The documentation for this class was generated from the following file: