HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_OperatorTable Class Reference

#include <OP_OperatorTable.h>

+ Inheritance diagram for OP_OperatorTable:

Public Member Functions

 OP_OperatorTable (const char *table_name, const char *script_directory)
 
 ~OP_OperatorTable ()
 
OP_NodecreateNode (OP_Network *parent, const char *type, const char *name=0, int *aliasedScriptedOp=0, bool exact_type=false)
 
OP_OperatorgetOperator (const char *name) const
 
bool addOperator (OP_Operator *op, std::ostream *err=nullptr)
 
void removeOperator (OP_Operator *op)
 
OP_OperatorgetPrimarySubnetOperator ()
 
void setScriptCreator (OP_ScriptCreatorFunc creator_func, OP_ScriptCanReuseFunc reuse_func)
 
void addScriptIndexFile (const char *indexpath, const char *indexfile, const char *classid, const char *extrainfo, int defaultMinInputs, int defaultMaxInputs, bool issubnet, bool ispython)
 
bool loadScriptOperator (const char *opname, UT_IStream &is, OP_OTLLibrary *addToLib)
 
bool addOperatorIfNew (const OP_OTLDefinition &definition)
 
bool canReuseOperator (const OP_OTLDefinition &new_definition, const OP_Operator *op=0) const
 
void requestReload ()
 
void runDSOInstall ()
 
bool loadDSO (const char *dso_file)
 
int entries () const
 
void getOperatorList (UT_StringArray &list, bool english=true) const
 
int getOperators (OP_OperatorList &list, OP_Network *net=0, bool filterhidden=false) const
 
OP_OpTypeId getOpTypeID () const
 
int getUniqueOpTypeID () const
 
void sortOperators (OP_OperatorList &list, OP_Operator::OP_OperatorCompare method=OP_Operator::OP_COMPARE_GEN_NAME)
 
const UT_StringgetName () const
 
const UT_StringgetScriptPath () const
 
unsigned getOperatorStatus (OP_Operator *op) const
 
unsigned getStatus () const
 
void setDefaultType (const char *type)
 
const char * getDefaultType () const
 
bool setOpRename (const char *optype, const char *newname, std::ostream *err=nullptr)
 
void outputOpRenames (std::ostream &os) const
 
bool setOpAlias (const char *optype, const char *alias, std::ostream *err=nullptr)
 
bool setOpFirstName (const char *type, const char *firstname, std::ostream *err=nullptr)
 
void outputOpAliases (std::ostream &os) const
 
void outputOpFirstNames (std::ostream &os) const
 
void getOpAliases (const char *opname, UT_StringArray &opaliases) const
 
const char * getOpFromAlias (const char *alias) const
 
bool setOpOverride (const char *optype, const char *override, bool keep_parms, bool keep_contents, std::ostream *err=nullptr)
 
bool clearOpOverride (const char *optype, std::ostream *err=nullptr)
 
void outputOpOverrides (std::ostream &os) const
 
void getOpOverrides (const char *opname, UT_StringArray &opoverridees) const
 
bool addOpExcluded (const char *opname, std::ostream *err=nullptr)
 
bool isOpExcluded (const char *opname) const
 
void outputOpExcluded (std::ostream &os) const
 
bool addOpHidden (const char *opname, std::ostream *err=nullptr)
 
void delOpHidden (const char *opname)
 
bool isOpHidden (const char *opname) const
 
void getOpHidden (UT_StringArray &opnames) const
 
bool isOpExperimental (const UT_StringRef &opname) const
 
bool addOpExperimental (const char *opname, std::ostream *err=nullptr)
 
bool setOpDeprecated (const char *opname, const char *version, const char *replacement=0, std::ostream *err=nullptr)
 
bool isOpDeprecated (const char *opname) const
 
bool getDeprecationInfo (const char *opname, UT_StringHolder &version, UT_StringHolder &replacement) const
 
void outputOpDeprecated (std::ostream &os) const
 
bool setOpDefaultColor (const UT_StringHolder &optype, const UT_Color &clr, std::ostream *err=nullptr)
 
UT_Color getOpDefaultColor (const UT_StringRef &optype) const
 
bool hasSpecificOpDefaultColor (const UT_StringRef &optype) const
 
void clearOpDefaultColors ()
 
void outputOpDefaultColors (std::ostream &os) const
 
bool setOpDefaultShape (const UT_StringHolder &optype, const UT_StringHolder &shape, std::ostream *err=nullptr)
 
const UT_StringHoldergetOpDefaultShape (const UT_StringRef &optype) const
 
bool hasSpecificOpDefaultShape (const UT_StringRef &optype) const
 
void clearOpDefaultShapes ()
 
void outputOpDefaultShapes (std::ostream &os) const
 
const UT_StringHoldergetDefaultWireStyle () const
 
void setDefaultWireStyle (const UT_StringHolder &wirestyle)
 
void getDefaultNodeName (const char *type, UT_String &name)
 
const char * getScriptedSubnetIndex () const
 
void notifyUpdateTableSinksOfUpdate ()
 
void getCandidateOperatorNamesInPrecedenceOrder (UT_StringArray &precedence_order, const char *op_name, const UT_StringArray *scope_network_stack)
 
const char * getPreferredOperatorName (const char *opname, const UT_StringArray *scope_network_stack)
 
bool nodeNameImpliesType (OP_Operator *op, const UT_String &node_name) const
 

Static Public Member Functions

static int getAllOperatorTables (OP_OperatorTableList &list)
 
static int getLoadDSOFlag ()
 
static void setLoadDSOFlag (int i)
 
static unsigned getPermissionMask (const OP_Operator *op)
 
static void clearPermissionMask (const OP_Operator *op)
 
static void initializeOpThemes ()
 
static void buildOpTypeNamespaceHierarchy ()
 
static const char * getOpTypeNamespaceHierarchyPref ()
 
static bool alwaysReuseScriptOperatorCallback (const OP_ScriptOperator *script_operator, const OP_OTLDefinition &new_definition)
 Convenience functions for the second callback in setScriptCreator(). More...
 
static bool neverReuseScriptOperatorCallback (const OP_ScriptOperator *script_operator, const OP_OTLDefinition &new_definition)
 

Friends

class OP_UpdateTableSink
 

Detailed Description

Constructor & Destructor Documentation

OP_OperatorTable::OP_OperatorTable ( const char *  table_name,
const char *  script_directory 
)
OP_OperatorTable::~OP_OperatorTable ( )

Member Function Documentation

bool OP_OperatorTable::addOperatorIfNew ( const OP_OTLDefinition definition)
bool OP_OperatorTable::addOpExcluded ( const char *  opname,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::addOpExperimental ( const char *  opname,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::addOpHidden ( const char *  opname,
std::ostream *  err = nullptr 
)
void OP_OperatorTable::addScriptIndexFile ( const char *  indexpath,
const char *  indexfile,
const char *  classid,
const char *  extrainfo,
int  defaultMinInputs,
int  defaultMaxInputs,
bool  issubnet,
bool  ispython 
)
static bool OP_OperatorTable::alwaysReuseScriptOperatorCallback ( const OP_ScriptOperator script_operator,
const OP_OTLDefinition new_definition 
)
static

Convenience functions for the second callback in setScriptCreator().

static void OP_OperatorTable::buildOpTypeNamespaceHierarchy ( )
static

Builds (or rebuilds) the operator type namespace hierarchy. The optype precedense is given by the environment variable HOUDINI_OPTYPE_NAMESPACE_HIERARCHY, which is processed by this method.

bool OP_OperatorTable::canReuseOperator ( const OP_OTLDefinition new_definition,
const OP_Operator op = 0 
) const
void OP_OperatorTable::clearOpDefaultColors ( )
void OP_OperatorTable::clearOpDefaultShapes ( )
bool OP_OperatorTable::clearOpOverride ( const char *  optype,
std::ostream *  err = nullptr 
)
static void OP_OperatorTable::clearPermissionMask ( const OP_Operator op)
static
OP_Node* OP_OperatorTable::createNode ( OP_Network parent,
const char *  type,
const char *  name = 0,
int aliasedScriptedOp = 0,
bool  exact_type = false 
)

Creates a new node of a given type inside a parent and names it as a give name.

Parameters
exact_typeIf true, the operator name parameter 'type', is used verbatim to lookup the operator. Otherwise, a preferred operator name that matches 'type' specification is found first and then is used to lookup the operator. For example, "hda" may match "hda::2.0", which is the preferred operator definition.
void OP_OperatorTable::delOpHidden ( const char *  opname)
int OP_OperatorTable::entries ( ) const
inline

Definition at line 97 of file OP_OperatorTable.h.

static int OP_OperatorTable::getAllOperatorTables ( OP_OperatorTableList list)
static
void OP_OperatorTable::getCandidateOperatorNamesInPrecedenceOrder ( UT_StringArray precedence_order,
const char *  op_name,
const UT_StringArray scope_network_stack 
)

Obtains a list of available operator names that have the same base (core) name as the given operator. If scope network name is not NULL, the list includes only operators whose nodes can be created in that network (otherwise all operators are included). The list is sorted according to the descending precedence order.

void OP_OperatorTable::getDefaultNodeName ( const char *  type,
UT_String name 
)
const char* OP_OperatorTable::getDefaultType ( ) const
const UT_StringHolder& OP_OperatorTable::getDefaultWireStyle ( ) const
bool OP_OperatorTable::getDeprecationInfo ( const char *  opname,
UT_StringHolder version,
UT_StringHolder replacement 
) const
static int OP_OperatorTable::getLoadDSOFlag ( )
inlinestatic

Definition at line 251 of file OP_OperatorTable.h.

const UT_String& OP_OperatorTable::getName ( ) const
inline

Definition at line 117 of file OP_OperatorTable.h.

void OP_OperatorTable::getOpAliases ( const char *  opname,
UT_StringArray opaliases 
) const
UT_Color OP_OperatorTable::getOpDefaultColor ( const UT_StringRef optype) const
const UT_StringHolder& OP_OperatorTable::getOpDefaultShape ( const UT_StringRef optype) const
OP_Operator* OP_OperatorTable::getOperator ( const char *  name) const
void OP_OperatorTable::getOperatorList ( UT_StringArray list,
bool  english = true 
) const
int OP_OperatorTable::getOperators ( OP_OperatorList list,
OP_Network net = 0,
bool  filterhidden = false 
) const
unsigned OP_OperatorTable::getOperatorStatus ( OP_Operator op) const
const char* OP_OperatorTable::getOpFromAlias ( const char *  alias) const
void OP_OperatorTable::getOpHidden ( UT_StringArray opnames) const
void OP_OperatorTable::getOpOverrides ( const char *  opname,
UT_StringArray opoverridees 
) const
OP_OpTypeId OP_OperatorTable::getOpTypeID ( ) const
static const char* OP_OperatorTable::getOpTypeNamespaceHierarchyPref ( )
static

Obtains the value of the environment variable used to construct the hierarchy.

static unsigned OP_OperatorTable::getPermissionMask ( const OP_Operator op)
static
const char* OP_OperatorTable::getPreferredOperatorName ( const char *  opname,
const UT_StringArray scope_network_stack 
)

Obtains the preferred operator name that matches the given op_name. Any name component included in the op_name must match the returned op type name, and any component not present in op_name is assumed to match the returned op type. For example 'hda' will match any scope, namespace, or version, while 'userA::hda' will match any scope and version, but the namespace must be 'userA'. For global namespace use '::hda' and for versionless opname use 'hda::'. If the scope_network_stack is also given (ie, non-null) then the returned opname must match one of the scopes listed in that array too. Returns the name of the highest precedence operator that matches the given op_name.

OP_Operator* OP_OperatorTable::getPrimarySubnetOperator ( )
inline

Definition at line 68 of file OP_OperatorTable.h.

const char* OP_OperatorTable::getScriptedSubnetIndex ( ) const
const UT_String& OP_OperatorTable::getScriptPath ( ) const
inline

Definition at line 119 of file OP_OperatorTable.h.

unsigned OP_OperatorTable::getStatus ( ) const
int OP_OperatorTable::getUniqueOpTypeID ( ) const
inline

Definition at line 110 of file OP_OperatorTable.h.

bool OP_OperatorTable::hasSpecificOpDefaultColor ( const UT_StringRef optype) const
bool OP_OperatorTable::hasSpecificOpDefaultShape ( const UT_StringRef optype) const
static void OP_OperatorTable::initializeOpThemes ( )
static

Called once all basic operator types are loaded to call the python code which will initialize node color and shape themes.

bool OP_OperatorTable::isOpDeprecated ( const char *  opname) const
bool OP_OperatorTable::isOpExcluded ( const char *  opname) const
bool OP_OperatorTable::isOpExperimental ( const UT_StringRef opname) const
bool OP_OperatorTable::isOpHidden ( const char *  opname) const
bool OP_OperatorTable::loadDSO ( const char *  dso_file)
bool OP_OperatorTable::loadScriptOperator ( const char *  opname,
UT_IStream is,
OP_OTLLibrary addToLib 
)
static bool OP_OperatorTable::neverReuseScriptOperatorCallback ( const OP_ScriptOperator script_operator,
const OP_OTLDefinition new_definition 
)
static
bool OP_OperatorTable::nodeNameImpliesType ( OP_Operator op,
const UT_String node_name 
) const

Returns true if the provided node name is "close enough" to the operator type name, english name, or first name to imply what the operator type is.

void OP_OperatorTable::notifyUpdateTableSinksOfUpdate ( )
void OP_OperatorTable::outputOpAliases ( std::ostream &  os) const
void OP_OperatorTable::outputOpDefaultColors ( std::ostream &  os) const
void OP_OperatorTable::outputOpDefaultShapes ( std::ostream &  os) const
void OP_OperatorTable::outputOpDeprecated ( std::ostream &  os) const
void OP_OperatorTable::outputOpExcluded ( std::ostream &  os) const
void OP_OperatorTable::outputOpFirstNames ( std::ostream &  os) const
void OP_OperatorTable::outputOpOverrides ( std::ostream &  os) const
void OP_OperatorTable::outputOpRenames ( std::ostream &  os) const
void OP_OperatorTable::removeOperator ( OP_Operator op)
void OP_OperatorTable::requestReload ( )
void OP_OperatorTable::runDSOInstall ( )
void OP_OperatorTable::setDefaultType ( const char *  type)
void OP_OperatorTable::setDefaultWireStyle ( const UT_StringHolder wirestyle)
static void OP_OperatorTable::setLoadDSOFlag ( int  i)
inlinestatic

Definition at line 253 of file OP_OperatorTable.h.

bool OP_OperatorTable::setOpAlias ( const char *  optype,
const char *  alias,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::setOpDefaultColor ( const UT_StringHolder optype,
const UT_Color clr,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::setOpDefaultShape ( const UT_StringHolder optype,
const UT_StringHolder shape,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::setOpDeprecated ( const char *  opname,
const char *  version,
const char *  replacement = 0,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::setOpFirstName ( const char *  type,
const char *  firstname,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::setOpOverride ( const char *  optype,
const char *  override,
bool  keep_parms,
bool  keep_contents,
std::ostream *  err = nullptr 
)
bool OP_OperatorTable::setOpRename ( const char *  optype,
const char *  newname,
std::ostream *  err = nullptr 
)
void OP_OperatorTable::setScriptCreator ( OP_ScriptCreatorFunc  creator_func,
OP_ScriptCanReuseFunc  reuse_func 
)
void OP_OperatorTable::sortOperators ( OP_OperatorList list,
OP_Operator::OP_OperatorCompare  method = OP_Operator::OP_COMPARE_GEN_NAME 
)

Friends And Related Function Documentation

friend class OP_UpdateTableSink
friend

Definition at line 388 of file OP_OperatorTable.h.


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