All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OP_ScriptOperator Class Reference

#include <OP_ScriptOperator.h>

+ Inheritance diagram for OP_ScriptOperator:

Public Types

- Public Types inherited from OP_Operator

Public Member Functions

virtual ~OP_ScriptOperator ()
virtual bool hasLoadedParmTemplates () const
virtual int updateParmTemplates ()
virtual void forceUpdateParmTemplates ()
void getScriptName (UT_String &name, bool forvex, bool for_python=false, const char *section_name=NULL) const
void getScriptFunctionName (UT_String &name) const
void getScriptSecondaryFunctionsNames (UT_StringMap< UT_StringHolder > &functions) const
bool hasExplicitScriptSection (VEX_ContextType context_type)
bool hasCachedCode ()
 Returns true if the operator has cached code. More...
void resetTemplate (OP_TemplatePair *pair)
int buildVexCommand (UT_String &result, OP_Node *node, fpreal now)
void buildIndexEntry (UT_String &result, const UT_String &dsloc)
int traverseCommand (OP_Node *node, OP_ScriptParmFunc traverseFunc, void *data, fpreal now)
virtual int handleUnknownToken (DS_Stream &is, UT_String &token)
UT_StringgetScriptHelp ()
virtual const char * getOperatorShortHelpString ()
virtual void getOperatorSpecificInfoText (int verbose, UT_WorkBuffer &text)
virtual void fillInfoTreeOperatorSpecific (UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
void editScriptFile (const char *pathprefix, const char *context="surface", const char *extension=".vfl", const char *title="VEX Function", const char **obj_extensions=0, int localdir=1)
PY_CompiledCodegetCachedCompiledPythonCookCode ()
bool isCompiledPythonCookCodeCached ()
virtual void clearOTLIndexFile ()
void dirtyParmTemplates ()
fpreal getUnitLength () const
fpreal getUnitMass () const
- Public Member Functions inherited from OP_Operator
 OP_Operator (const char *name, const char *english, OP_Constructor construct, PRM_Template *templates, unsigned min_sources, unsigned max_sources=9999, CH_LocalVariable *variables=0, unsigned flags=0, const char **inputlabels=0, int maxoutputs=1, const char *tab_submenu_path=0)
 Note: The 'inputlabels' array is expected to be null-terminated. More...
 OP_Operator (const char *name, const char *english, OP_Constructor construct, OP_TemplatePair *template_pair, unsigned min_sources, unsigned max_sources=9999, OP_VariablePair *variable_pair=0, unsigned flags=0, const char **inputlabels=0, int maxoutputs=1, const char *tab_submenu_path=0)
 OP_Operator (const char *name, const char *english, OP_Constructor construct, PRM_Template *templates, const char *child_table_name, unsigned min_sources, unsigned max_sources=9999, CH_LocalVariable *variables=0, unsigned flags=0, const char **inputlabels=0, int maxoutputs=1, const char *tab_submenu_path=0)
 OP_Operator (const char *name, const char *english, OP_Constructor construct, OP_TemplatePair *template_pair, const char *child_table_name, unsigned min_sources, unsigned max_sources=9999, OP_VariablePair *variable_pair=0, unsigned flags=0, const char **inputlabels=0, int maxoutputs=1, const char *tab_submenu_path=0)
virtual ~OP_Operator ()
OP_NodeconstructNode (OP_Network *net, const char *name)
int getNumActiveNodes () const
OP_NodegetActiveNode (int i) const
void nodeDestroyed (OP_Node *node)
virtual OP_SpecificDatagetOpSpecificData ()
virtual const OP_SpecificDatagetOpSpecificData () const
const UT_StringgetName () const
void getTableAndName (UT_WorkBuffer &name) const
void getTableAndName (UT_String &name) const
const UT_StringgetEnglish () const
UT_Color getDefaultColor () const
const UT_StringHoldergetDefaultShape () const
virtual bool getHDKHelp (UT_String &) const
virtual bool getOpHelpURL (UT_String &url)
virtual bool getOpTabSubMenuPath (UT_String &tab_submenu_path)
void setOpTabSubMenuPath (const char *tab_submenu_path)
bool getOTLHelp (UT_String &str)
void getEditableSubNodes (UT_String &pattern)
void getMessageSubNodes (UT_String &pattern)
void getDiveTarget (UT_String &divetarget)
void getDescriptiveParmName (UT_String &descrparm)
void getDefaultState (UT_String &statename)
void getFunctionName (UT_String &function_name)
void getSecondaryFunctionsNames (UT_StringMap< UT_StringHolder > &functions)
void getComment (UT_String &comment)
virtual bool getVersion (UT_String &version)
void getHelpFileDirAndName (UT_String &script_dir, UT_String &name)
void getDefinitionSource (UT_String &defsource) const
OP_NodegetDefiningNetwork () const
const UT_StringgetIndexPath () const
const UT_StringgetIndexFile () const
bool getScriptIsSubnet () const
bool getScriptIsVex () const
bool getScriptIsRsl () const
VEX_ContextType getVexContextType () const
RSL_ContextType getRslContextType () const
int getModTime () const
bool getIsDummyDefinition () const
bool getScriptIsPython () const
void setScriptIsPython (bool is_python)
const UT_StringgetExtraInfo () const
void setOTLDefinition (const OP_OTLDefinition &definition)
void getOTLDefinition (OP_OTLDefinition &definition) const
void setOTLLibrary (OP_OTLLibrary *library)
OP_OTLLibrarygetOTLLibrary ()
FS_IndexFilegetOTLIndexFile ()
bool hasContentsSection ()
FS_IndexFilecreateDefaultOTLIndexFile () const
FS_IndexFilecreateOTLIndexFile (bool reservedsectionsonly, UT_StringArray *externalfiles)
void getDefinitionSectionName (UT_String &sectname) const
void listContainedOperators (UT_StringSet &contents_list)
 List all operators found in the contents section. More...
const char * getIconName () const
void setIconName (const char *name)
void setDefaultIconName ()
unsigned minInputs () const
unsigned maxInputs () const
virtual unsigned maxOutputs ()
OP_SpareParmsloadSpareParms (UT_IStream &is)
PRM_TemplategetParmTemplates ()
PRM_ScriptImportsgetParmTemplateImports ()
PRM_TemplategetLayoutParmTemplates ()
PRM_ScriptImportsgetLayoutParmTemplateImports ()
virtual const PRM_TemplategetBaseParmTemplates ()
PRM_TemplategetBaseOverrideLayoutParmTemplates ()
virtual PRM_TemplategetObsoleteTemplates ()
void setObsoleteTemplates (PRM_Template *tmpl)
bool getOverrideLayoutParmTemplateFile (UT_StringWrap &ds_path) const
CH_LocalVariablegetVariable (int i) const
CH_LocalVariablegetVariable (const char *name) const
CH_LocalVariablegetVariables () const
int getVariableCount () const
void resetVariables (OP_VariablePair *variable_pair)
unsigned isNetwork () const
unsigned isGenerator () const
unsigned isScriptedOp () const
bool isCustomDSO () const
unsigned unorderedInputs () const
unsigned isManagementOp () const
unsigned isOutputOp () const
bool getIsPrimarySubnetType () const
bool isCreatingNode () const
bool isChangingParmTemplates () const
bool hasNodeLoadingContentsSection () const
void beginLoadingContentsSectionForNode ()
void endLoadingContentsSectionForNode ()
bool shouldPreserve () const
virtual int compareOperator (const OP_Operator *other, int method) const
void changeParmTemplate (PRM_Template *tp)
unsigned getPermissionMask () const
virtual void getRefreshPICommands (OP_Node *, std::ostream &)
virtual bool wantsParametersAnimatable () const
virtual bool wantsInputEditor () const
virtual bool wantsParmOrderEditor () const
virtual bool wantsOutputNameEditor () const
virtual bool wantsParentInputs () const
void fillInfoTree (UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
const char * getTableName () const
OP_OperatorTablegetTable () const
const UT_StringHoldergetChildTableName () const
OP_OperatorTablegetChildOperatorTable () const
OP_OTLLicenseType getLicense ()
void setDefinition (const char *def)
void setEnglish (const char *english)
void informOfTabMenuFlagChange ()
virtual void setName (const char *name)
void setMinInputs (int inputs)
void setMaxInputs (int inputs)
void setIsGenerator (bool isgen)
void updatePresetInfo ()
PRM_PresetInfogetPresetInfo ()
bool runEventScript (const char *event, OP_Node *node_arg=NULL, bool full_path=false, UT_Options *extra_args=NULL, bool *node_deleted_by_script=NULL)
PY_EvaluationContextgetPythonModuleDicts ()
bool hasLoadedPythonModuleSection () const
void loadPythonModuleSection (bool force=false)
void clearEventScriptPathCache ()
void getCachedEventScriptPaths (UT_StringArray &events, UT_StringArray &paths, bool only_nonempty) const
bool isThreadSafe () const
void setIsThreadSafe (bool is_safe)
bool isCompiled ()
bool isBlackBoxed ()
 Returns true if this operator is black boxed, and false otherwise. More...
void constructIndexFileSectionPath (UT_String &path, const char *opdef_or_oplib, const char *section_name) const
void constructIndexFileSectionPath (UT_String &path, const char *opdef_or_oplib, const UT_StringArray &section_names) const
void setLegacyInputsMap (const char *map)
void getLegacyInputsMap (UT_String &map) const
const UT_StringArraygetLegacyInputsIndexMap () const
const UT_StringHoldergetInputName (int idx) const
 Accessing operator inputs name, label, and reference flag. More...
const UT_StringArraygetInputNames () const
 Accessing operator inputs name, label, and reference flag. More...
const UT_StringHoldergetInputLabel (int idx) const
 Accessing operator inputs name, label, and reference flag. More...
const UT_StringArraygetInputLabels () const
 Accessing operator inputs name, label, and reference flag. More...
bool getInputIsReference (int idx) const
 Accessing operator inputs name, label, and reference flag. More...
const UT_Array< bool > & getInputAreReferences () const
 Accessing operator inputs name, label, and reference flag. More...
virtual bool allowsInputNameEditing () const
 Accessing operator inputs name, label, and reference flag. More...
const UT_StringHoldergetOutputLabel (int idx) const
const UT_StringArraygetOutputLabels () const
void getOpBasedFileName (UT_String &filename)
void getOpBasedFileName (UT_WorkBuffer &filename)

Static Public Member Functions

static OP_ScriptOperatorcreateMantraScriptOp (const char *name, const char *english)
static int findScriptOperators (const char *path, const char *filename, OP_OTLDefinitionArray &defs)
static UT_StringSetgetAllIndexFiles ()
- Static Public Member Functions inherited from OP_Operator
static void clearOperatorHelpCache ()
static int loadFromOpType (const char *fname, const char *savedir)
static int uninstallOpType (const char *path, const char *tablename, const char *opname, const char *indexpath, const char *indexfile)
static void removeHelpCardOverrides (UT_FileUtil *fu, const char *path, const char *tablename, const char *opname, int flags)
static void removeRenameOverrides (UT_FileUtil *fu, const char *path, const char *tablename, const char *opname, int flags)
static void removeIconOverrides (UT_FileUtil *fu, const char *path, const char *tablename, const char *opname, int flags)
static void removeCmdOverrides (UT_FileUtil *fu, const char *path, const char *tablename, const char *opname, int flags)
static void getDefaultIconName (const char *tablename, const char *opname, UT_String &iconname)
static const char * getCurrentPythonModuleKey ()
static const OP_OperatormapSecurityKeyToOperator (const char *key)
static void registerPythonModuleKeyClient (void *client)
static bool verifyPythonModuleKeyClient (const OP_Operator *op, void *client)
static PRM_TemplategetEmptyTemplateList ()
static int operatorNameCompare (const OP_Operator *a, const OP_Operator *b)

Protected Member Functions

 OP_ScriptOperator (const char *name, const char *english, OP_Constructor construct, PRM_Template *templates, const char *child_table_name, unsigned min_sources, unsigned max_sources=9999, CH_LocalVariable *variables=0, unsigned flags=0, const char **inputlabels=0, int maxoutputs=1)
void getDefinitionSourceText (UT_String &defsource)
 Obtains a string that specifies the definition source of this operator. More...
virtual bool loadParmTemplatesSubclass ()
virtual void removeAllBindings ()
virtual void refreshAllBindings ()
virtual PRM_TemplateloadParmTemplates (UT_IStream &, const char *, UT_String &, PRM_ScriptImports *&)
- Protected Member Functions inherited from OP_Operator
void notifyUpdateTemplatesSinksOfUpdate ()
void notifyUpdateTemplatesSinksOfDelete ()
void notifyActiveNodesOfTemplatesUpdate ()
void setDescriptiveParmName (const UT_StringHolder &parm)
void dirtyParmTemplatesLoaded ()
bool loadAndCreateLayoutParmTemplates (PRM_ScriptPage *page, DS_Stream &ds_is, PRM_Template *&base_tplates, PRM_Template *&layout_tplates, PRM_ScriptImports *&imports, PRM_Template *&tplates, int base_controls_switcher_index, int base_controls_insert_index, int base_controls_switcher_page_num, PRM_Default *&base_controls_switcher_defaults, bool hide_default_parms)
 Load parameter templates from the specified file stream. More...

Static Protected Member Functions

static void freeParmTemplates (PRM_Template *templates)
static void freeSwitcherDefaults (PRM_Default *defs)
- Static Protected Member Functions inherited from OP_Operator
static PRM_TemplateaddTemplates (OP_TemplatePair *)
static CH_LocalVariableaddVariables (OP_VariablePair *, int &)

Protected Attributes

UT_String myScriptName
UT_String myHelp
fpreal myUnitLength
fpreal myUnitMass
time_t myDialogTimeStamp
int myStartParm
int myEndParm
int myBaseControlsSwitcherIndex
int myBaseControlsSwitcherPageNum
int myBaseControlsInsertIndex
unsigned mySyntax
UT_String myInfoText
UT_Lock myCachedCompiledPythonCookLock
int myHasCachedCode
 State var indicating if cached code is saved with HDA definition. More...
- Protected Attributes inherited from OP_Operator
bool myParmTemplatesLoaded
UT_StringArray myInputNames
UT_StringArray myInputLabels
UT_StringArray myOutputLabels
UT_DeepString myTabSubmenuPath
UT_Array< bool > myInputReferences
int myNvariables
UT_StringHolder myChildTableName
OP_OTLDefinition myOTLDefinition
VEX_ContextType myVexContextType
RSL_ContextType myRslContextType
unsigned myFlags
bool myHasContentsSection
UT_SharedPtr< PRM_ScriptPagemyOverrideLayoutParmScriptPage

Static Protected Attributes

static UT_StringSet theAllIndexFiles

Detailed Description

Definition at line 34 of file OP_ScriptOperator.h.

Member Enumeration Documentation

anonymous enum

Definition at line 105 of file OP_ScriptOperator.h.

Constructor & Destructor Documentation

virtual OP_ScriptOperator::~OP_ScriptOperator ( )
OP_ScriptOperator::OP_ScriptOperator ( const char *  name,
const char *  english,
OP_Constructor  construct,
PRM_Template templates,
const char *  child_table_name,
unsigned  min_sources,
unsigned  max_sources = 9999,
CH_LocalVariable variables = 0,
unsigned  flags = 0,
const char **  inputlabels = 0,
int  maxoutputs = 1 

Member Function Documentation

void OP_ScriptOperator::buildIndexEntry ( UT_String result,
const UT_String dsloc 
int OP_ScriptOperator::buildVexCommand ( UT_String result,
OP_Node node,
fpreal  now 
virtual void OP_ScriptOperator::clearOTLIndexFile ( )

Reimplemented from OP_Operator.

static OP_ScriptOperator* OP_ScriptOperator::createMantraScriptOp ( const char *  name,
const char *  english 
void OP_ScriptOperator::dirtyParmTemplates ( )
void OP_ScriptOperator::editScriptFile ( const char *  pathprefix,
const char *  context = "surface",
const char *  extension = ".vfl",
const char *  title = "VEX Function",
const char **  obj_extensions = 0,
int  localdir = 1 
virtual void OP_ScriptOperator::fillInfoTreeOperatorSpecific ( UT_InfoTree tree,
const OP_NodeInfoTreeParms parms 

Fill in this info tree with details about this operator (similar to getOperatorSpecificInfoText(..)

Reimplemented from OP_Operator.

static int OP_ScriptOperator::findScriptOperators ( const char *  path,
const char *  filename,
OP_OTLDefinitionArray defs 
virtual void OP_ScriptOperator::forceUpdateParmTemplates ( )

Reimplemented from OP_Operator.

static void OP_ScriptOperator::freeParmTemplates ( PRM_Template templates)
static void OP_ScriptOperator::freeSwitcherDefaults ( PRM_Default defs)
static UT_StringSet& OP_ScriptOperator::getAllIndexFiles ( )
PY_CompiledCode* OP_ScriptOperator::getCachedCompiledPythonCookCode ( )
void OP_ScriptOperator::getDefinitionSourceText ( UT_String defsource)

Obtains a string that specifies the definition source of this operator.

virtual const char* OP_ScriptOperator::getOperatorShortHelpString ( )

Reimplemented from OP_Operator.

virtual void OP_ScriptOperator::getOperatorSpecificInfoText ( int  verbose,
UT_WorkBuffer text 

Reimplemented from OP_Operator.

void OP_ScriptOperator::getScriptFunctionName ( UT_String name) const

Obtains the function (shader) name used for script. It provieds the shader name that should be used in code.

UT_String& OP_ScriptOperator::getScriptHelp ( )

Definition at line 116 of file OP_ScriptOperator.h.

void OP_ScriptOperator::getScriptName ( UT_String name,
bool  forvex,
bool  for_python = false,
const char *  section_name = NULL 
) const

Obtains the full name of the script provided by this operator. It idendifies the script using an operator name, "opdef:"or "op:' path, or using the script name (refering to a file on disk).

void OP_ScriptOperator::getScriptSecondaryFunctionsNames ( UT_StringMap< UT_StringHolder > &  functions) const

Obtains the secondary function (shader) names (as keys) provided by this operator, along with the section names (as mapped values) where the function definition is stored.

fpreal OP_ScriptOperator::getUnitLength ( ) const

Definition at line 152 of file OP_ScriptOperator.h.

fpreal OP_ScriptOperator::getUnitMass ( ) const

Definition at line 153 of file OP_ScriptOperator.h.

virtual int OP_ScriptOperator::handleUnknownToken ( DS_Stream is,
UT_String token 

Reimplemented in VOP_ScriptOperator.

bool OP_ScriptOperator::hasCachedCode ( )

Returns true if the operator has cached code.

bool OP_ScriptOperator::hasExplicitScriptSection ( VEX_ContextType  context_type)

Tests if the script operator has a script section corresponding to the given type. Returns true if operator is defined by an HDA that a script section for the type. If the operator is not defined by a library or the library definition has no such section, this method returns false.

virtual bool OP_ScriptOperator::hasLoadedParmTemplates ( ) const

Reimplemented from OP_Operator.

bool OP_ScriptOperator::isCompiledPythonCookCodeCached ( )
virtual PRM_Template* OP_ScriptOperator::loadParmTemplates ( UT_IStream ,
const char *  ,
UT_String ,
PRM_ScriptImports *&   

Reimplemented in VOP_ScriptOperator, PI_ScriptOperator, and OBJ_ScriptOperator.

Definition at line 178 of file OP_ScriptOperator.h.

virtual bool OP_ScriptOperator::loadParmTemplatesSubclass ( )

Reimplemented from OP_Operator.

virtual void OP_ScriptOperator::refreshAllBindings ( )

Reimplemented in PI_ScriptOperator.

Definition at line 176 of file OP_ScriptOperator.h.

virtual void OP_ScriptOperator::removeAllBindings ( )

Reimplemented in PI_ScriptOperator.

Definition at line 174 of file OP_ScriptOperator.h.

void OP_ScriptOperator::resetTemplate ( OP_TemplatePair pair)
int OP_ScriptOperator::traverseCommand ( OP_Node node,
OP_ScriptParmFunc  traverseFunc,
void data,
fpreal  now 
virtual int OP_ScriptOperator::updateParmTemplates ( )

Reimplemented from OP_Operator.

Reimplemented in VOP_ScriptOperator.

Member Data Documentation

int OP_ScriptOperator::myBaseControlsInsertIndex

Definition at line 203 of file OP_ScriptOperator.h.

int OP_ScriptOperator::myBaseControlsSwitcherIndex

Definition at line 201 of file OP_ScriptOperator.h.

int OP_ScriptOperator::myBaseControlsSwitcherPageNum

Definition at line 202 of file OP_ScriptOperator.h.

PRM_Default* OP_ScriptOperator::myBaseSwitcherDefaults

Definition at line 204 of file OP_ScriptOperator.h.

PY_CompiledCode* OP_ScriptOperator::myCachedCompiledPythonCookCode

Definition at line 212 of file OP_ScriptOperator.h.

UT_Lock OP_ScriptOperator::myCachedCompiledPythonCookLock

Definition at line 213 of file OP_ScriptOperator.h.

time_t OP_ScriptOperator::myDialogTimeStamp

Definition at line 195 of file OP_ScriptOperator.h.

int OP_ScriptOperator::myEndParm

Definition at line 196 of file OP_ScriptOperator.h.

int OP_ScriptOperator::myHasCachedCode

State var indicating if cached code is saved with HDA definition.

Definition at line 216 of file OP_ScriptOperator.h.

UT_String OP_ScriptOperator::myHelp

Definition at line 191 of file OP_ScriptOperator.h.

UT_String OP_ScriptOperator::myInfoText

Definition at line 210 of file OP_ScriptOperator.h.

PRM_ScriptPage* OP_ScriptOperator::myPage

Definition at line 194 of file OP_ScriptOperator.h.

UT_String OP_ScriptOperator::myScriptName

Definition at line 190 of file OP_ScriptOperator.h.

int OP_ScriptOperator::myStartParm

Definition at line 196 of file OP_ScriptOperator.h.

unsigned OP_ScriptOperator::mySyntax

Definition at line 207 of file OP_ScriptOperator.h.

fpreal OP_ScriptOperator::myUnitLength

Definition at line 192 of file OP_ScriptOperator.h.

fpreal OP_ScriptOperator::myUnitMass

Definition at line 193 of file OP_ScriptOperator.h.

UT_StringSet OP_ScriptOperator::theAllIndexFiles

Definition at line 219 of file OP_ScriptOperator.h.

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