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

#include <VOP_HDACodeCompiler.h>

+ Inheritance diagram for VOP_ShaderHDACompiler:

Public Member Functions

 VOP_ShaderHDACompiler ()
 Constructor. More...
 
void setRManPath (const char *path)
 
const UT_StringgetRManPath () const
 
- Public Member Functions inherited from VOP_HDACodeCompiler
 VOP_HDACodeCompiler ()
 
virtual ~VOP_HDACodeCompiler ()
 
virtual bool compileVexCodeToSections (OP_Node *srcnode, FS_IndexFile *hda, const char *context_mask=0)
 
virtual bool compileNewOperatorType (OP_Node *srcnode, const char *name, const char *label, const char *path, const char *metasrc, const VOP_ContextTypeList *types=NULL)
 
const UT_StringMap
< UT_StringHolder > & 
getFunctionsSectionsMap () const
 
void setShaderName (const char *shader_name)
 Main shader name used in compilation. More...
 
const UT_StringHoldergetShaderName () const
 Main shader name used in compilation. More...
 
UT_ErrorSeverity getStatus (UT_String &message, UT_String *details=0)
 
void setForceCompilationOnOpNameConflict (bool flag)
 
bool getForceCompilationOnOpNameConflict ()
 

Static Public Member Functions

static void removeShaderCodeSections (FS_IndexFile *file)
 Utility function for cleaning up HDA of any compiled sections. More...
 
- Static Public Member Functions inherited from VOP_HDACodeCompiler
static bool canCompileNode (OP_Node *srcnode)
 
static void removeCodeSections (OP_Node *node, FS_IndexFile *file)
 
static bool updateCodeSections (OP_Node *node, FS_IndexFile *file, UT_String *message)
 

Protected Member Functions

bool initForShaderCompilation (OP_Node *srcnode)
 Sets up member variables to be ready for compilation. More...
 
virtual void getContextTypesForCompilation (VOP_ContextTypeList &contexts) const =0
 
virtual void doCompile (FS_IndexFile *hda, VOP_CodeGenerator *code_generator, VOP_ContextType context_type, const char *section_name, OP_Node *output_node)=0
 
bool compilePrimaryOutputNodes (FS_IndexFile *hda, opui_ScriptMaterialCodeMapper &mapper)
 
void compileMappedNodes (FS_IndexFile *hda, opui_ScriptMaterialCodeMapper &mapper)
 
OP_NodegetNode () const
 
VOP_CodeGeneratorgetCodeGenerator () const
 
OP_OperatorTablegetTable () const
 
- Protected Member Functions inherited from VOP_HDACodeCompiler
void saveVflCodeToSection (FS_IndexFile *hda, OP_Node *shader_node, VOP_CodeGenerator *code_generator, VOP_ContextType context_type, const char *section_name, OP_Node *output_node)
 Saves the code to section. More...
 
bool isOK () const
 Checks if there was an error during compilation up till now. More...
 
void setStatus (UT_ErrorSeverity sev, const char *msg, const char *details=0)
 
void clearStatus ()
 

Detailed Description

A class that compiles a shader (or vop-based operator like Vop SOP), into a script-based HDA (with or without the contents network).

Definition at line 216 of file VOP_HDACodeCompiler.h.

Constructor & Destructor Documentation

VOP_ShaderHDACompiler::VOP_ShaderHDACompiler ( )

Constructor.

Member Function Documentation

void VOP_ShaderHDACompiler::compileMappedNodes ( FS_IndexFile hda,
opui_ScriptMaterialCodeMapper &  mapper 
)
protected

Inspects the mapper for vop nodes it has mapped and compiles vex code associated with each mapped node. The code is saved to HDA section.

bool VOP_ShaderHDACompiler::compilePrimaryOutputNodes ( FS_IndexFile hda,
opui_ScriptMaterialCodeMapper &  mapper 
)
protected

Compiles the vex code for the Output VOP nodes. If there are a few oputput nodes for the same context (connecting to collect vop via a switch), then the currently selected one is used.

Returns
Returns true if the HDA definition was actually created (it may not be if there are no primary output nodes).
virtual void VOP_ShaderHDACompiler::doCompile ( FS_IndexFile hda,
VOP_CodeGenerator code_generator,
VOP_ContextType  context_type,
const char *  section_name,
OP_Node output_node 
)
protectedpure virtual

Compiles the given context type of the source node to the HDA in OTL.

Parameters
code_generatorThe code generator to use for compilation.
context_typeThe context for which to compile the code.
section_nameThe name of the HDA section in which to save the compiled code.
output_nodeThe node to use for generating the code, in case there are several output nodes for the same context.

Implemented in VOP_ShaderHDACompilerHDA, and VOP_ShaderHDACompilerOTL.

VOP_CodeGenerator* VOP_ShaderHDACompiler::getCodeGenerator ( ) const
inlineprotected

Accessors for the member data, available to derived classes.

Definition at line 238 of file VOP_HDACodeCompiler.h.

virtual void VOP_ShaderHDACompiler::getContextTypesForCompilation ( VOP_ContextTypeList contexts) const
protectedpure virtual

Obtains the context types for which to compile the code. The subclass needs to implement this virtual to provide that information.

Implemented in VOP_ShaderHDACompilerHDA, and VOP_ShaderHDACompilerOTL.

OP_Node* VOP_ShaderHDACompiler::getNode ( void  ) const
inlineprotected

Accessors for the member data, available to derived classes.

Definition at line 236 of file VOP_HDACodeCompiler.h.

const UT_String& VOP_ShaderHDACompiler::getRManPath ( ) const
inline

Configures the file path where PRMan shaders are located.

Definition at line 226 of file VOP_HDACodeCompiler.h.

OP_OperatorTable* VOP_ShaderHDACompiler::getTable ( ) const
inlineprotected

Accessors for the member data, available to derived classes.

Definition at line 240 of file VOP_HDACodeCompiler.h.

bool VOP_ShaderHDACompiler::initForShaderCompilation ( OP_Node srcnode)
protected

Sets up member variables to be ready for compilation.

static void VOP_ShaderHDACompiler::removeShaderCodeSections ( FS_IndexFile file)
static

Utility function for cleaning up HDA of any compiled sections.

void VOP_ShaderHDACompiler::setRManPath ( const char *  path)
inline

Configures the file path where PRMan shaders are located.

Definition at line 224 of file VOP_HDACodeCompiler.h.


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