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

#include <PRM_ParmList.h>

Public Member Functions

 PRM_ParmList (PRM_Template *thetemplates, CH_Collection *thechgroupptr, PRM_ParmOwner *node, PRM_PresetInfo *presetinfo, const UT_StringRef &optype, bool clear_channels)
 
 PRM_ParmList (PRM_ParmList *thesrcptr, PRM_Template *thenewtemplate, PRM_ParmOwner *node, PRM_PresetInfo *presetinfo, const UT_StringRef &optype, bool leavedefaultsunchanged)
 
 ~PRM_ParmList ()
 
int getEntries () const
 
void setChannelGroupPtr (CH_Collection *thechgroupptr)
 
CH_CollectiongetChannelGroupPtr () const
 
fpreal getEvalTime (int thread) const
 
fpreal findNextKey (fpreal theoldtime)
 
fpreal findPrevKey (fpreal theoldtime)
 
int allDefaults () const
 
void buildDelayedDefaults (bool clear_channels=true)
 
PRM_ParmgetParmPtr (const UT_StringRef &theparmname, int &theparmidx)
 
PRM_ParmgetParmPtr (const UT_StringRef &theparmname)
 
const PRM_ParmgetParmPtr (const UT_StringRef &theparmname) const
 
PRM_ParmgetParmPtr (const PRM_Name &name)
 
const PRM_ParmgetParmPtr (const PRM_Name &name) const
 
PRM_ParmgetParmPtr (const int theindex)
 
const PRM_ParmgetParmPtr (const int theindex) const
 
int getParmIndex (const PRM_Parm *parm) const
 
int getParmIndex (const UT_StringRef &parmname) const
 
int getParmIndex (const PRM_Name &name) const
 
SYS_FORCE_INLINE const PRM_ParmgetParmPtrFromChannel (const UT_StringRef &channel, int *vecidx=nullptr) const
 
SYS_FORCE_INLINE PRM_ParmgetParmPtrFromChannel (const UT_StringRef &channel, int *vecidx=nullptr)
 
int getParmIndex (const UT_StringRef &channel_name, int &subidx, bool allow_alias=true) const
 
int getParmIndexFromChannel (const UT_StringRef &channel, int *vecidx, bool allow_alias) const
 
void clearAllDirtyFlags ()
 
int areAllFlagsClean () const
 
void clearAllUndoSavedFlags ()
 
void revertToDefaults (fpreal time)
 
void revertValuesToFactoryDefaults ()
 
void updateFromOldTemplate (PRM_ParmList *oldlist)
 
void updateSpareParmTemplates (PRM_Template *newtemplates, bool leavedefaultsunchanged)
 
void saveSingle (PRM_Parm *, std::ostream &os, int binary) const
 
void save (std::ostream &os, int binary, bool compiled) const
 
bool load (UT_IStream &is, const char *path, PRM_ParmList *obsoleteparms)
 
void saveUndoData (PRM_UndoDataList &data) const
 
void saveSingleUndoData (const PRM_Parm *parm, PRM_UndoDataList &data) const
 
void loadUndoData (const PRM_UndoDataList &data, const char *path, PRM_ParmList *obsoleteparms)
 
bool hasChannelAliases () const
 
void clearAndDestroyChannels ()
 
int hasAnyChannels ()
 
int addChannel (const UT_StringRef &name)
 
void reloadChannelPtrs ()
 
int channelPtrModified (const UT_StringRef &name)
 
unsigned getUserMask () const
 
void setUserMask (unsigned m)
 
unsigned getPermissions () const
 
void setPermissions (unsigned mask)
 
unsigned getAssetPermissionMask () const
 
void setAssetPermissionMask (unsigned mask)
 
int canAccess (unsigned mask=PRM_WRITE_OK, const PRM_Type &type=PRM_TYPE_ZERO) const
 
int canAccessIgnoringAssetMask (unsigned mask=PRM_WRITE_OK, const PRM_Type &type=PRM_TYPE_ZERO) const
 
int canAccessCheckingOnlyAssetMask (unsigned mask=PRM_WRITE_OK, const PRM_Type &type=PRM_TYPE_ZERO) const
 
void hardenChanges (fpreal time, bool forceflag=0, const char *patt=0, CH_ChannelRefList *list=0)
 
PRM_ChanState getChanState (fpreal time)
 
void sendChangeEvent (CH_CHANGE_TYPE what, PRM_Parm *who=0)
 
void setEventHandler (void *data, void(*handler)(void *, CH_CHANGE_TYPE, int))
 
int checkTimeDependence (bool evaluate_channels=false)
 
SYS_FORCE_INLINE void setTimeDependent (bool onOff)
 
SYS_FORCE_INLINE bool getTimeDependent () const
 
SYS_FORCE_INLINE void setCookTimeDependent (bool onOff)
 
SYS_FORCE_INLINE bool getCookTimeDependent () const
 
void addContextOptionDep (const UT_StringHolder &opt)
 
void clearContextOptionDeps ()
 
const DEP_ContextOptionDepsgetContextOptionDeps () const
 
void addCookContextOptionDep (const UT_StringHolder &opt)
 
void clearCookContextOptionDeps ()
 
const DEP_ContextOptionDepsgetCookContextOptionDeps () const
 
void pushVariables ()
 
void popVariables ()
 
int findString (const char *str, bool fullword, bool usewildcards) const
 
int changeString (const char *from, const char *to, bool fullword)
 
bool notifyVarChange (const char *varname)
 
int getNumSendExtra () const
 This used to be called getSendExtraEvent() More...
 
void bumpNumSendExtra (int n)
 
void getMagicString (UT_TokenString &string, fpreal t, int parm_group=1)
 
void setUndoSavedFlag ()
 
void setAutoTakeUndoSavedFlag ()
 
void appendMultiParms (const PRM_Multi &multiparmowner, PRM_Template *templ, int num, bool spare, const UT_IntArray &instance, UT_ValArray< PRM_Parm * > &newparms)
 
void removeAndDestroyParm (int index)
 
void insertMultiParmItem (int index, int i)
 
void removeMultiParmItem (int index, int i)
 
PRM_ParmOwnergetParmOwner () const
 
PRM_PresetInfogetPresetInfo () const
 
void clearParmOwner ()
 
bool checkMultiParmInstance (const UT_StringRef &parmname, bool do_owner_init)
 
bool setChannelAlias (PRM_Parm &parm, int subindex, const UT_StringHolder &chan_alias)
 
int64 getMemoryUsage (bool inclusive) const
 
unsigned long getAddRemoveCount () const
 
void setAddRemoveCount (unsigned long count)
 
DEP_MicroNodeparmMicroNode (int parm_idx, int vi)
 
bool hasParmMicroNode (int parm_idx) const
 
void getParmMicroNodes (DEP_MicroNodeList &micronodes) const
 Get all parm micronodes for the entire parm list. More...
 
void propagateDirtyParmMicroNodes (int parm_index, DEP_MicroNode::Visitor client_visit, DEP_MicroNode *parmlist_micronode, bool force)
 
void clearMicroNodeInputs ()
 
void getParmInputList (DEP_MicroNodeList &inputs, bool cooking_only=false) const
 
int getNumParmInputs () const
 
void getParmOutputList (DEP_MicroNodeList &outputs, bool cooking_only=false) const
 
void dumpMicroNodes (std::ostream &os, bool as_DOT, int indent_level=0) const
 
int64 getMicroNodesMemoryUsage () const
 
PRM_ParmgetParmPtrInst (const UT_StringRef &parm_name, const int *instance, int nest_level)
 
PRM_ParmgetParmPtrInst (const UT_StringRef &parm_name, const int *instance, int nest_level, int &theparmidx)
 
const PRM_ParmgetParmPtrInst (const UT_StringRef &parm_name, const int *instance, int nest_level) const
 
const PRM_ParmgetParmPtrInst (const UT_StringRef &parm_name, const int *instance, int nest_level, int &theparmidx) const
 
void saveChannelAliases (std::ostream &os, int binary)
 
bool loadChannelAliases (UT_IStream &is, const char *path)
 
void evalStringRaw (UT_String &value, const UT_StringRef &pn, int vi, fpreal t)
 
void evalString (UT_String &value, const UT_StringRef &pn, int vi, fpreal t)
 
void setString (const UT_String &value, CH_StringMeaning meaning, const UT_StringRef &pn, int vi, fpreal t, bool propagate)
 
int evalInt (const UT_StringRef &pn, int vi, fpreal t)
 
void setInt (int value, const UT_StringRef &pn, int vi, fpreal t, bool propagate)
 
fpreal evalFloat (const UT_StringRef &pn, int vi, fpreal t)
 
void setFloat (fpreal value, const UT_StringRef &pn, int vi, fpreal t, bool propagate)
 

Static Public Member Functions

static void beginLoading ()
 
static void endLoading ()
 
static bool isLoading ()
 
static PRM_ORCallbackgetORCallback (void)
 
static void setORCallback (PRM_ORCallback *impl)
 
static void removeOpSharedInfo (const UT_StringRef &optoken)
 
static void renameOpSharedInfo (const UT_StringRef &oldoptoken, const UT_StringHolder &newoptoken)
 

Detailed Description

Definition at line 82 of file PRM_ParmList.h.

Constructor & Destructor Documentation

PRM_ParmList::PRM_ParmList ( PRM_Template thetemplates,
CH_Collection thechgroupptr,
PRM_ParmOwner node,
PRM_PresetInfo presetinfo,
const UT_StringRef optype,
bool  clear_channels 
)
PRM_ParmList::PRM_ParmList ( PRM_ParmList thesrcptr,
PRM_Template thenewtemplate,
PRM_ParmOwner node,
PRM_PresetInfo presetinfo,
const UT_StringRef optype,
bool  leavedefaultsunchanged 
)

Constructor used to make a new parm list when loading a new PRM_Template. This assumes that the channel collection and variables remains the same.

PRM_ParmList::~PRM_ParmList ( )

Member Function Documentation

int PRM_ParmList::addChannel ( const UT_StringRef name)
void PRM_ParmList::addContextOptionDep ( const UT_StringHolder opt)
inline

Definition at line 305 of file PRM_ParmList.h.

void PRM_ParmList::addCookContextOptionDep ( const UT_StringHolder opt)
inline

Definition at line 317 of file PRM_ParmList.h.

int PRM_ParmList::allDefaults ( ) const

returns 1 if all the parms in the list are at their default values returns 0 otherwise

void PRM_ParmList::appendMultiParms ( const PRM_Multi &  multiparmowner,
PRM_Template templ,
int  num,
bool  spare,
const UT_IntArray instance,
UT_ValArray< PRM_Parm * > &  newparms 
)
int PRM_ParmList::areAllFlagsClean ( ) const
static void PRM_ParmList::beginLoading ( )
static
void PRM_ParmList::buildDelayedDefaults ( bool  clear_channels = true)
void PRM_ParmList::bumpNumSendExtra ( int  n)
inline

Definition at line 348 of file PRM_ParmList.h.

int PRM_ParmList::canAccess ( unsigned  mask = PRM_WRITE_OK,
const PRM_Type type = PRM_TYPE_ZERO 
) const
int PRM_ParmList::canAccessCheckingOnlyAssetMask ( unsigned  mask = PRM_WRITE_OK,
const PRM_Type type = PRM_TYPE_ZERO 
) const
int PRM_ParmList::canAccessIgnoringAssetMask ( unsigned  mask = PRM_WRITE_OK,
const PRM_Type type = PRM_TYPE_ZERO 
) const
int PRM_ParmList::changeString ( const char *  from,
const char *  to,
bool  fullword 
)
int PRM_ParmList::channelPtrModified ( const UT_StringRef name)
bool PRM_ParmList::checkMultiParmInstance ( const UT_StringRef parmname,
bool  do_owner_init 
)

checkMultiParmInstance() will return true if the given parm name matches a multi-parm instance name. If the multi-parm instance isn't created yet, then it will be created before this function returns. In that case, do_owner_init specifies if the new instance should be initialized.

int PRM_ParmList::checkTimeDependence ( bool  evaluate_channels = false)

If the parm list is not already flagged as time dependent then checkTimeDependence will scan the parms for time dependencies and return the new time dependence flag.

Note
Expressions will not be flagged as time dependent until they're evaluated. So, if it's possible that the channels have not been evaluated, set evaluate_channels to true.
void PRM_ParmList::clearAllDirtyFlags ( )
void PRM_ParmList::clearAllUndoSavedFlags ( )
void PRM_ParmList::clearAndDestroyChannels ( )
void PRM_ParmList::clearContextOptionDeps ( )
inline

Definition at line 310 of file PRM_ParmList.h.

void PRM_ParmList::clearCookContextOptionDeps ( )
inline

Definition at line 322 of file PRM_ParmList.h.

void PRM_ParmList::clearMicroNodeInputs ( )
void PRM_ParmList::clearParmOwner ( )
void PRM_ParmList::dumpMicroNodes ( std::ostream &  os,
bool  as_DOT,
int  indent_level = 0 
) const
static void PRM_ParmList::endLoading ( )
static
fpreal PRM_ParmList::evalFloat ( const UT_StringRef pn,
int  vi,
fpreal  t 
)

Convenience functions for evaluating and setting parameters

int PRM_ParmList::evalInt ( const UT_StringRef pn,
int  vi,
fpreal  t 
)

Convenience functions for evaluating and setting parameters

void PRM_ParmList::evalString ( UT_String value,
const UT_StringRef pn,
int  vi,
fpreal  t 
)

Convenience functions for evaluating and setting parameters

void PRM_ParmList::evalStringRaw ( UT_String value,
const UT_StringRef pn,
int  vi,
fpreal  t 
)

Convenience functions for evaluating and setting parameters

fpreal PRM_ParmList::findNextKey ( fpreal  theoldtime)
fpreal PRM_ParmList::findPrevKey ( fpreal  theoldtime)
int PRM_ParmList::findString ( const char *  str,
bool  fullword,
bool  usewildcards 
) const
unsigned long PRM_ParmList::getAddRemoveCount ( ) const
inline

Definition at line 392 of file PRM_ParmList.h.

unsigned PRM_ParmList::getAssetPermissionMask ( ) const
inline

Definition at line 245 of file PRM_ParmList.h.

CH_Collection* PRM_ParmList::getChannelGroupPtr ( ) const
inline

Definition at line 109 of file PRM_ParmList.h.

PRM_ChanState PRM_ParmList::getChanState ( fpreal  time)
const DEP_ContextOptionDeps& PRM_ParmList::getContextOptionDeps ( ) const
inline

Definition at line 314 of file PRM_ParmList.h.

const DEP_ContextOptionDeps& PRM_ParmList::getCookContextOptionDeps ( ) const
inline

Definition at line 326 of file PRM_ParmList.h.

SYS_FORCE_INLINE bool PRM_ParmList::getCookTimeDependent ( ) const
inline

Definition at line 302 of file PRM_ParmList.h.

int PRM_ParmList::getEntries ( ) const
inline

Definition at line 103 of file PRM_ParmList.h.

fpreal PRM_ParmList::getEvalTime ( int  thread) const
void PRM_ParmList::getMagicString ( UT_TokenString string,
fpreal  t,
int  parm_group = 1 
)

Return a unique identifier for the current parameter settings. If this is called outside of a cook, place a PRM_AutoBlockErrors around the call.

int64 PRM_ParmList::getMemoryUsage ( bool  inclusive) const
int64 PRM_ParmList::getMicroNodesMemoryUsage ( ) const
int PRM_ParmList::getNumParmInputs ( ) const
int PRM_ParmList::getNumSendExtra ( ) const
inline

This used to be called getSendExtraEvent()

Definition at line 346 of file PRM_ParmList.h.

static PRM_ORCallback* PRM_ParmList::getORCallback ( void  )
inlinestatic

Definition at line 331 of file PRM_ParmList.h.

int PRM_ParmList::getParmIndex ( const PRM_Parm parm) const
int PRM_ParmList::getParmIndex ( const UT_StringRef parmname) const
int PRM_ParmList::getParmIndex ( const PRM_Name name) const
inline

Definition at line 149 of file PRM_ParmList.h.

int PRM_ParmList::getParmIndex ( const UT_StringRef channel_name,
int subidx,
bool  allow_alias = true 
) const
inline

Definition at line 174 of file PRM_ParmList.h.

int PRM_ParmList::getParmIndexFromChannel ( const UT_StringRef channel,
int vecidx,
bool  allow_alias 
) const
void PRM_ParmList::getParmInputList ( DEP_MicroNodeList inputs,
bool  cooking_only = false 
) const
void PRM_ParmList::getParmMicroNodes ( DEP_MicroNodeList micronodes) const

Get all parm micronodes for the entire parm list.

void PRM_ParmList::getParmOutputList ( DEP_MicroNodeList outputs,
bool  cooking_only = false 
) const
PRM_ParmOwner* PRM_ParmList::getParmOwner ( ) const
inline

Definition at line 372 of file PRM_ParmList.h.

PRM_Parm* PRM_ParmList::getParmPtr ( const UT_StringRef theparmname,
int theparmidx 
)
PRM_Parm* PRM_ParmList::getParmPtr ( const UT_StringRef theparmname)
const PRM_Parm* PRM_ParmList::getParmPtr ( const UT_StringRef theparmname) const
PRM_Parm* PRM_ParmList::getParmPtr ( const PRM_Name name)
const PRM_Parm* PRM_ParmList::getParmPtr ( const PRM_Name name) const
PRM_Parm* PRM_ParmList::getParmPtr ( const int  theindex)
inline

Definition at line 133 of file PRM_ParmList.h.

const PRM_Parm* PRM_ParmList::getParmPtr ( const int  theindex) const
inline

Definition at line 139 of file PRM_ParmList.h.

SYS_FORCE_INLINE const PRM_Parm* PRM_ParmList::getParmPtrFromChannel ( const UT_StringRef channel,
int vecidx = nullptr 
) const
inline

Definition at line 153 of file PRM_ParmList.h.

SYS_FORCE_INLINE PRM_Parm* PRM_ParmList::getParmPtrFromChannel ( const UT_StringRef channel,
int vecidx = nullptr 
)
inline

Definition at line 164 of file PRM_ParmList.h.

PRM_Parm* PRM_ParmList::getParmPtrInst ( const UT_StringRef parm_name,
const int instance,
int  nest_level 
)
inline

Definition at line 455 of file PRM_ParmList.h.

PRM_Parm* PRM_ParmList::getParmPtrInst ( const UT_StringRef parm_name,
const int instance,
int  nest_level,
int theparmidx 
)
inline

Definition at line 464 of file PRM_ParmList.h.

const PRM_Parm* PRM_ParmList::getParmPtrInst ( const UT_StringRef parm_name,
const int instance,
int  nest_level 
) const
inline

Definition at line 473 of file PRM_ParmList.h.

const PRM_Parm* PRM_ParmList::getParmPtrInst ( const UT_StringRef parm_name,
const int instance,
int  nest_level,
int theparmidx 
) const
unsigned PRM_ParmList::getPermissions ( ) const
inline

Definition at line 236 of file PRM_ParmList.h.

PRM_PresetInfo* PRM_ParmList::getPresetInfo ( ) const
inline

Definition at line 373 of file PRM_ParmList.h.

SYS_FORCE_INLINE bool PRM_ParmList::getTimeDependent ( ) const
inline

Definition at line 296 of file PRM_ParmList.h.

unsigned PRM_ParmList::getUserMask ( ) const
inline

Definition at line 233 of file PRM_ParmList.h.

void PRM_ParmList::hardenChanges ( fpreal  time,
bool  forceflag = 0,
const char *  patt = 0,
CH_ChannelRefList list = 0 
)
int PRM_ParmList::hasAnyChannels ( )
bool PRM_ParmList::hasChannelAliases ( ) const

Returns true if any of our parms have an alias and false otherwise

bool PRM_ParmList::hasParmMicroNode ( int  parm_idx) const
void PRM_ParmList::insertMultiParmItem ( int  index,
int  i 
)
static bool PRM_ParmList::isLoading ( )
static
bool PRM_ParmList::load ( UT_IStream is,
const char *  path,
PRM_ParmList obsoleteparms 
)
bool PRM_ParmList::loadChannelAliases ( UT_IStream is,
const char *  path 
)

Methods to load and save channel aliases

void PRM_ParmList::loadUndoData ( const PRM_UndoDataList data,
const char *  path,
PRM_ParmList obsoleteparms 
)
bool PRM_ParmList::notifyVarChange ( const char *  varname)
DEP_MicroNode& PRM_ParmList::parmMicroNode ( int  parm_idx,
int  vi 
)
void PRM_ParmList::popVariables ( )
void PRM_ParmList::propagateDirtyParmMicroNodes ( int  parm_index,
DEP_MicroNode::Visitor  client_visit,
DEP_MicroNode parmlist_micronode,
bool  force 
)
void PRM_ParmList::pushVariables ( )
void PRM_ParmList::reloadChannelPtrs ( )
void PRM_ParmList::removeAndDestroyParm ( int  index)
void PRM_ParmList::removeMultiParmItem ( int  index,
int  i 
)
static void PRM_ParmList::removeOpSharedInfo ( const UT_StringRef optoken)
static
static void PRM_ParmList::renameOpSharedInfo ( const UT_StringRef oldoptoken,
const UT_StringHolder newoptoken 
)
static
void PRM_ParmList::revertToDefaults ( fpreal  time)
void PRM_ParmList::revertValuesToFactoryDefaults ( )
void PRM_ParmList::save ( std::ostream &  os,
int  binary,
bool  compiled 
) const
void PRM_ParmList::saveChannelAliases ( std::ostream &  os,
int  binary 
)

Methods to load and save channel aliases

void PRM_ParmList::saveSingle ( PRM_Parm ,
std::ostream &  os,
int  binary 
) const
void PRM_ParmList::saveSingleUndoData ( const PRM_Parm parm,
PRM_UndoDataList data 
) const
void PRM_ParmList::saveUndoData ( PRM_UndoDataList data) const
void PRM_ParmList::sendChangeEvent ( CH_CHANGE_TYPE  what,
PRM_Parm who = 0 
)
void PRM_ParmList::setAddRemoveCount ( unsigned long  count)
inline

Definition at line 394 of file PRM_ParmList.h.

void PRM_ParmList::setAssetPermissionMask ( unsigned  mask)
inline

Definition at line 247 of file PRM_ParmList.h.

void PRM_ParmList::setAutoTakeUndoSavedFlag ( )
inline

Definition at line 358 of file PRM_ParmList.h.

bool PRM_ParmList::setChannelAlias ( PRM_Parm parm,
int  subindex,
const UT_StringHolder chan_alias 
)

This method is used to alias a channel name to a another name Returns true if successful and false otherwise. NOTE: you should not need to use this directly, you should instead call the OP_Node version.

void PRM_ParmList::setChannelGroupPtr ( CH_Collection thechgroupptr)
inline

Definition at line 107 of file PRM_ParmList.h.

SYS_FORCE_INLINE void PRM_ParmList::setCookTimeDependent ( bool  onOff)
inline

Definition at line 299 of file PRM_ParmList.h.

void PRM_ParmList::setEventHandler ( void data,
void(*)(void *, CH_CHANGE_TYPE, int handler 
)
inline

Definition at line 277 of file PRM_ParmList.h.

void PRM_ParmList::setFloat ( fpreal  value,
const UT_StringRef pn,
int  vi,
fpreal  t,
bool  propagate 
)

Convenience functions for evaluating and setting parameters

void PRM_ParmList::setInt ( int  value,
const UT_StringRef pn,
int  vi,
fpreal  t,
bool  propagate 
)

Convenience functions for evaluating and setting parameters

static void PRM_ParmList::setORCallback ( PRM_ORCallback impl)
inlinestatic

Definition at line 332 of file PRM_ParmList.h.

void PRM_ParmList::setPermissions ( unsigned  mask)
inline

Definition at line 237 of file PRM_ParmList.h.

void PRM_ParmList::setString ( const UT_String value,
CH_StringMeaning  meaning,
const UT_StringRef pn,
int  vi,
fpreal  t,
bool  propagate 
)

Convenience functions for evaluating and setting parameters

SYS_FORCE_INLINE void PRM_ParmList::setTimeDependent ( bool  onOff)
inline

Definition at line 293 of file PRM_ParmList.h.

void PRM_ParmList::setUndoSavedFlag ( )
inline

Definition at line 357 of file PRM_ParmList.h.

void PRM_ParmList::setUserMask ( unsigned  m)
inline

Definition at line 234 of file PRM_ParmList.h.

void PRM_ParmList::updateFromOldTemplate ( PRM_ParmList oldlist)
void PRM_ParmList::updateSpareParmTemplates ( PRM_Template newtemplates,
bool  leavedefaultsunchanged 
)

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