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

#include <OP_CommandManager.h>

+ Inheritance diagram for OP_CommandManager:

Public Member Functions

 OP_CommandManager (const char *appname)
 
 ~OP_CommandManager () override
 
bool isChanRefValid (const CH_ChannelRef &chref) const override
 
virtual void getChRefData (const CH_ChannelRef &r, OP_Node **pnode, CH_Channel **pchp, PRM_Parm **ppparm, int *subindex) const
 
virtual OP_NodegetChRefOpNode (const CH_ChannelRef &r) const
 
virtual int getChRefParmIndex (const CH_ChannelRef &r, int *subindex) const
 
virtual PRM_ParmgetChRefParm (const CH_ChannelRef &r, int *subindex) const
 
virtual PRM_ParmgetChRefFullParm (const CH_ChannelRef &r) const
 
CH_ChannelgetChRefChannel (const CH_ChannelRef &r) const override
 
bool isOwnerExposed (const CH_ChannelRef &r) const override
 
void getChannelsWithNodeId (CH_ChannelList &chans, int node_id) const override
 
bool match (const CH_ChannelRef &r, const char *patt) const
 
bool buildChanRef (CH_ChannelRef &r, const CH_Channel *chp) const override
 
virtual bool buildChanRef (CH_ChannelRef &r, const OP_Node *node, const PRM_Parm *parm) const
 
virtual bool buildChanRef (CH_ChannelRef &r, const OP_Node &node, const char *channel_name) const
 
virtual bool buildChanRef (CH_ChannelRef &r, const OP_Node *node, const PRM_Parm *parm, int subindex) const
 
bool buildChanRef (CH_ChannelRef &r, const char *path) const override
 Use this method to build a channel reference from a channel path. More...
 
int compareChanRefs (const CH_ChannelRef &r1, const CH_ChannelRef &r2) const override
 Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2. More...
 
int compareLayerRefs (const CH_ChannelRef &r1, const CH_ChannelRef &r2) const override
 Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2. More...
 
void getChanRefPath (const CH_ChannelRef &r, UT_String &path, bool use_alias=false) const override
 Use this method to get the full path of the channel referenced by r. More...
 
void getChanRefsPythonListCode (const CH_ChannelRefList &chanrefs, UT_WorkBuffer &result)
 Returns Python code representing the list of channel references. More...
 
bool inTrustedContextForNode (const OP_Node *node, int thread) const
 
bool inTrustedContextForNodeContents (const OP_Node *node, int thread) const
 
CH_ScriptAccessManager * getAccessManager (int thread) override
 
bool resolveChanRefExport (const CH_ChannelRef &r, CH_ChannelRef &out_export) override
 
bool getChannelAutoSelect (const CH_ChannelRef &chref) const override
 
bool getChRefLabelForUI (const CH_ChannelRef &r, UT_String &ret) const override
 
bool getChRefAlias (const CH_ChannelRef &r, UT_String &ret) const override
 
bool getChRefNodePath (const CH_ChannelRef &r, UT_String &ret) const override
 
CH_CollectionaddGeometryChannelsCollection (const UT_StringHolder &name)
 
void destroyGeometryChannelsCollection (const UT_StringHolder &name)
 
OP_GeometryChannelsgetGeometryChannelsCollection (const UT_StringHolder &name) const
 
void beginChannelChanges () override
 
void channelsChanged () override
 
void endChannelChanges () override
 
bool channelsBeingChanged () override
 
bool isHandlingChannelChanges ()
 
void geometryChannelsCollectionChanged (const UT_StringHolder &name)
 
int addGeometryChannelsChangedCallback (const UT_StringHolder &collection_name, OP_GeometryChannelsChangedCallback callback)
 
void removeGeometryChannelsChangedCallback (const UT_StringHolder &collection_name, int id)
 Remove a geometry channels changed callback. More...
 
- Public Member Functions inherited from CMD_Manager
 CMD_Manager (const UT_StringHolder &appname)
 
 ~CMD_Manager () override
 
void setContext () override
 
const UT_StringHolderappName () const
 Return the name of the application. More...
 
void sendInput (const char *input, bool create_block=true)
 
void sendMultiLineInput (const char *input, bool create_block=true)
 
void execute (const char *cmd, bool add_to_history=false, std::ostream *out=0, std::ostream *err=0, bool do_alias_expansion=true, bool create_block=true)
 Force execution of a command. More...
 
void completeCommand (const char *prefix, UT_String &command) const
 
void matchCommands (const char *prefix, UT_StringArray &matches) const
 Return a list of all commands that start with the given prefix. More...
 
void installCommand (const char *name, const char *options, CMD_Callback cb, bool is_safe=true)
 Install a command into the command list. More...
 
bool uninstallCommand (const char *name)
 
bool markCommandForFalseIfStatements (const char *name, CMD_Callback cb)
 
CMD_PostCmdCallback setPostCmdCallback (CMD_PostCmdCallback callback, void *userdata)
 
voidgetPostCmdCallbackData () const
 Return the userdata set in setPostCmdCallback(). More...
 
void setCommandEchoCallback (CMD_CommandEchoCallback callback, void *userdata)
 
voidgetCommandEchoCallbackData () const
 Return the userdata set in setCommandEchoCallback(). More...
 
void commandDump (std::ostream &os, const char *pattern=0, const char *prefix=0) const
 Displays a list of all commands. More...
 
void commandHelp (std::ostream &os, const char *cmd, bool full_match_only=false) const
 
void saveAliases (std::ostream &os)
 
void saveVariables (std::ostream &os, bool level0_locals)
 
int setHistoryCapture (int onOff)
 
CMD_SourcepushSource (const char *filename, int verbose=0)
 
CMD_SourcepopSource (int checkLoop=1)
 
CMD_SourcegetSource ()
 
int getSourceLevel ()
 
void pushOutputStreams (std::ostream &out, std::ostream &err)
 
void popOutputStreams ()
 
void unsetVariable (const char *name)
 Removes the named variable. More...
 
void resetVariables ()
 Resets all variables to their defaults. More...
 
void setVariable (const char *name, const char *value, int local, int uplevel=0)
 
bool hasVariable (const char *name) const
 Returns true if the named variable exists. More...
 
bool getVariable (const char *name, UT_String &value)
 Returns the value of the named variable. More...
 
bool getVariable (const char *name, fpreal64 &value)
 Returns the value of the named variable as a fpreal64. More...
 
bool getVariable (const char *name, fpreal32 &value)
 Returns the value of the named variable as a float. More...
 
bool getVariable (const char *name, int32 &value)
 Returns the value of the named variable as an int. More...
 
bool getVariable (const char *name, int64 &value)
 Returns the value of the named variable as an int. More...
 
bool hasEnv (const char *name) const
 
bool getEnv (const char *name, UT_String &value)
 
void getVariableNames (UT_StringArray &names, int dirty=0)
 Returns a list of all defined variables. More...
 
int clearDirtyVariables ()
 
int clearDirtyVariables (const UT_StringArray &names)
 
int isVariableNameOk (const char *name)
 
bool setMotName (const char *path, bool dovarchange)
 
void setJob (const char *path)
 Convenience method to set the JOB variable. More...
 
unsigned getCommandsRun () const
 Return the number of commands run. It's possible for this to overflow. More...
 
std::ostream & getError (int printMessage=1)
 
std::ostream * setStandardOut (std::ostream &os)
 
std::ostream * setStandardErr (std::ostream &os)
 
void streamDeleted (std::ostream &os)
 
void setPrompt (const char *prompt)
 
const char * getPrompt (int level=-1) const
 
void pushPrompt (const char *prompt)
 
void popPrompt ()
 
int isLoopCommand (const char *str)
 
int evaluateCondition (const char *expr)
 
int evaluateCondition (int argc, const char *argv[])
 
void dumpHistory (std::ostream &os) const
 Displays the contents of the history buffer. More...
 
void clearHistory ()
 Clears the history buffer. More...
 
const char * getHistoryCommand (int n) const
 
unsigned int getHistoryCount () const
 Returns the number of entries in the history buffer. More...
 
CMD_VariableTablegetGlobalVariables ()
 
CMD_AliasTablegetAliases ()
 
bool getAlias (const char *name, UT_String &value)
 
void setAlias (const char *name, const char *value)
 Create a new alias or override an existing alias. More...
 
void destroyAlias (const char *name)
 Removes the named alias. More...
 
void destroyAliases ()
 Removes all aliases. More...
 
void allowEnvironmentToOverwriteVariable (const char *name, bool onoff)
 
bool isEnvironmentAllowedToOverwriteVariable (const char *name)
 
void setIsLoadingGlobalVariables (bool onoff)
 
bool isLoadingGlobalVariables ()
 Are we loading global variables from the hip file? More...
 
void setVariableChangeNotifier (CMD_VariableChangeNotifier *notifier)
 Register a variable change notification center object. More...
 
CMD_VariableChangeNotifiergetVariableChangeNotifier () const
 Returns a variable change notification center object. More...
 
void saveCommandString (std::ostream &os, const UT_String &str)
 
void getFrameRange (CMD_Args &args, int &fstart, int &fend, int &finc, char oframe= 'f', char ofinc= 'i')
 Now, here, we provide some nice functions to handle getting arguments. More...
 
void setContinueLevel (int level)
 
int getContinueLevel () const
 
void bumpBreakLevel (int dir)
 
int getBreakLevel () const
 
void bumpLoopNestLevel (int dir)
 
int getLoopNestLevel () const
 
CMD_Loop * buildLoop (const char *text)
 
void doPrompt ()
 
void getPrompt (UT_String &str)
 
void setVerbose (int on_off)
 
int getVerbose () const
 
void setCommandEcho (bool on_off)
 
bool getCommandEcho () const
 
void setIORedirection (int on_off)
 
int getIORedirection () const
 
const char * getOptions (const char *cmdName)
 Returns the getopts-style options for the given command. More...
 
int isCommandDefined (const char *name)
 Returns true if the command is defined. More...
 
void getDSOCommands (CMD_CommandList &list)
 
bool isLoading () const
 
void beginLoading ()
 
void endLoading ()
 
void setSafeMode (int safe_mode)
 
int isInSafeMode () const
 
void setBrowserMode (int browser_mode)
 
int isInBrowserMode () const
 
void setStatusCode (int status_code)
 
int getStatusCode () const
 Returns non-zero if the last command failed. More...
 
void closePort (int port)
 Closes a port opened with openPort(). More...
 
void closeAutoPort ()
 
bool beginChannelBlock ()
 
bool endChannelBlock ()
 
void echoOff ()
 
void echoOn ()
 
void sendInputNoLock (const char *input, bool create_block=true)
 
void sendMultiLineInputNoLock (const char *input, bool create_block=true)
 
void executeNoLock (const char *cmd, bool add_to_history=false, std::ostream *out=0, std::ostream *err=0, bool do_alias_expansion=true, bool create_block=true)
 
bool openPort (int port, bool safe, bool quiet, bool wait, CMD_Args &args, const char *execute, pid_t *pid, bool separateerrors, bool suppress=true, const char *ip_mask=0, FS_ServerSocketListener::ChildExitedCallback child_exited_callback=0, bool detach_console_for_execute=false, bool drain_queue_when_waiting_for_exec=true)
 
bool openPort (int port, bool safe, bool quiet, bool wait, std::ostream &error_output, const char *execute, pid_t *pid, bool separateerrors, bool suppress=true, const char *ip_mask=0, FS_ServerSocketListener::ChildExitedCallback child_exited_callback=0, bool detach_console_for_execute=false, bool drain_queue_when_waiting_for_exec=true)
 
bool openPort (int port, bool safe, bool quiet, bool wait, CMD_Args &args, const char *const *execute_argv, pid_t *pid, bool separateerrors, bool suppress=true, const char *ip_mask=0, FS_ServerSocketListener::ChildExitedCallback child_exited_callback=0, bool detach_console_for_execute=false, bool drain_queue_when_waiting_for_exec=true)
 
bool openPort (int port, bool safe, bool quiet, bool wait, std::ostream &error_output, const char *const *execute_argv, pid_t *pid, bool separateerrors, bool suppress=true, const char *ip_mask=0, FS_ServerSocketListener::ChildExitedCallback child_exited_callback=0, bool detach_console_for_execute=false, bool drain_queue_when_waiting_for_exec=true)
 
- Public Member Functions inherited from CH_Manager
 CH_Manager (bool init_the_expression_library=true)
 
virtual ~CH_Manager ()
 
int condenseCommon (UT_String &path)
 
void resetPlayback ()
 
void resetChannelOptions (bool notify=true)
 
bool loadChannelOptions (const char *filename)
 
bool saveChannelOptions (const char *filename)
 
void setDefaultExpression (const char *s, bool notify=false)
 
const char * getDefaultExpression () const
 
bool shouldShowFakeAccelHandles () const
 
void setDefaultRotationExpression (const char *s)
 
const char * getDefaultRotationExpression () const
 
void setAutoSlope (SlopeMode m)
 
SlopeMode getAutoSlope () const
 
void setDefaultSlope (fpreal slope)
 
fpreal getDefaultSlope () const
 
void setAutoSplit (bool onoff)
 
bool getAutoSplit () const
 
void setDefaultSplitExpression (const char *expr)
 
const char * getDefaultSplitExpression () const
 
void setHoldLastKey (bool onoff)
 
int getHoldLastKey () const
 
const char * getChanCreateKeyExpression () const
 
void setChanCreateKeyExpression (const char *s)
 
bool getAlwaysCommitKeyChange () const
 
void setAlwaysCommitKeyChange (bool onoff)
 
void clearChannelScope ()
 
void getScopedChannels (CH_ChannelList &channels, bool sorted=false)
 
int getNumScopedChanRefs ()
 
void getScopedChanRefs (CH_ChannelRefList &chanrefs, unsigned mask=0, bool sorted=false) const
 
void getSelectedScopedChanRefs (CH_ChannelRefList &chanrefs, bool sorted=false, int operate_on=CH_SELECTED)
 
void getScopedChannelsKeyFrames (UT_IntArray &frames, int minframe, int maxframe)
 
void blockModifyScope (int on_off)
 
void scopeChannel (const CH_ChannelRef &chref, bool on_off)
 
void scopeChannel (const char *full_chan_path, bool on_off)
 
bool scopeChannelInternal (const CH_Channel *chp, bool on_off)
 
bool scopeChannelInternal (const CH_ChannelRef &chref, bool on_off)
 
void scopeChanged (unsigned flags, bool propagate=true)
 
bool isChannelScoped (CH_Channel *chp) const
 
bool isChannelScoped (const char *full_chan_path) const
 
bool isChannelScoped (const CH_ChannelRef &chref) const
 
void clearPendingChannels ()
 
void getPendingChannels (CH_ChannelList &channels) const
 
bool hasPendingChannels () const
 
void addPendingChannel (CH_Channel *chp)
 
void removePendingChannel (CH_Channel *chp)
 
bool isChannelDisplayed (CH_Channel *chp) const
 
bool isChannelDisplayed (const CH_ChannelRef &chref) const
 
bool isChannelDisplayed (const char *full_chan_path) const
 
void clearDisplayedChannels (bool propagate=true)
 
void displayAllScopedChannels (bool propagate=true)
 
void displaySelectedScopedChannels (bool propagate=true)
 
void displayChannel (const CH_ChannelRef &chref, bool propagate=true)
 
void displayChannel (const char *full_chan_path, bool propagate=true)
 
void undisplayChannel (const CH_ChannelRef &chref, bool propagate=true)
 
void undisplayChannel (const char *full_chan_path, bool propagate=true)
 
bool isChannelSelected (const CH_ChannelRef &chref) const
 
bool isChannelSelected (const char *full_chan_path) const
 
void clearSelectedChannels (bool propagate=true)
 
void selectAllScopedChannels (bool propagate=true)
 
void selectChannel (const CH_ChannelRef &chref, bool propagate=true)
 
void selectChannel (const char *full_chan_path, bool propagate=true)
 
void deselectChannel (const CH_ChannelRef &chref, bool propagate=true)
 
void deselectChannel (const char *full_chan_path, bool propagate=true)
 
void togglePinAllScopedChannels ()
 
void togglePinScopedChannels (const CH_ChannelRefList &chanrefs)
 
void pinAllScopedChannels (bool propagate=true)
 
void unpinAllScopedChannels (bool propagate=true)
 
void pinSelectedChannels (bool propagate=true, int operate_on=CH_SELECTED)
 
void unpinSelectedChannels (bool propagate=true, int operate_on=CH_SELECTED)
 
void pinChannels (const CH_ChannelRefList &chanrefs, bool propagate=true)
 
void unpinChannels (const CH_ChannelRefList &chanrefs, bool propagate=true)
 
void clearLayerScope ()
 
bool isLayerScoped (CH_Channel *chp) const
 
bool isLayerScoped (const char *full_chan_path) const
 
bool isLayerScoped (const CH_ChannelRef &chref) const
 
void scopeLayer (const CH_ChannelRef &chref, bool on_off)
 
void scopeLayer (const char *full_chan_path, bool on_off)
 
bool scopeLayerInternal (CH_Channel *chp, bool on_off)
 
bool scopeLayerInternal (const CH_ChannelRef &chref, bool on_off)
 
bool isLayerSelected (const CH_ChannelRef &chref) const
 
bool isLayerSelected (const char *full_chan_path) const
 
void clearSelectedLayers (bool propagate=true)
 
void selectAllScopedLayers (bool propagate=true)
 
void selectLayer (const CH_ChannelRef &chref, bool propagate=true)
 
void selectLayer (const char *full_chan_path, bool propagate=true)
 
void deselectLayer (const CH_ChannelRef &chref, bool propagate=true)
 
void deselectLayer (const char *full_chan_path, bool propagate=true)
 
void togglePinAllScopedLayers ()
 
void togglePinScopedLayers (const CH_ChannelRefList &chanrefs)
 
void pinAllScopedLayers (bool propagate=true)
 
void unpinAllScopedLayers (bool propagate=true)
 
void pinSelectedLayers (bool propagate=true, int operate_on=CH_LAYER_SELECTED)
 
void unpinSelectedLayers (bool propagate=true, int operate_on=CH_LAYER_SELECTED)
 
void pinLayers (const CH_ChannelRefList &chanrefs, bool propagate=true)
 
void unpinLayers (const CH_ChannelRefList &chanrefs, bool propagate=true)
 
bool isLayerDisplayed (CH_Channel *chp) const
 
bool isLayerDisplayed (const CH_ChannelRef &chref) const
 
bool isLayerDisplayed (const char *full_chan_path) const
 
void clearDisplayedLayers (bool propagate=true)
 
void displayAllScopedLayers (bool propagate=true)
 
void displaySelectedScopedLayers (bool propagate=true)
 
void displayLayer (const CH_ChannelRef &chref, bool propagate=true)
 
void displayLayer (const char *full_chan_path, bool propagate=true)
 
void undisplayLayer (const CH_ChannelRef &chref, bool propagate=true)
 
void undisplayLayer (const char *full_chan_path, bool propagate=true)
 
void setChannelFlags (const CH_ChannelRef &chref, unsigned flags, bool on_off, bool propagate=true)
 
unsigned getChannelFlags (const CH_ChannelRef &chref) const
 
int expandString (const char *string, UT_String &expanded, fpreal time, CH_Collection *local=nullptr, int thread=0, int expansion_type=CH_EXPANSION_TYPE_DEFAULT, const DEP_ContextOptionsStack *context_options_stack=nullptr, DEP_ContextOptionsReadHandle context_options=DEP_ContextOptionsReadHandle())
 
void buildStringOpDependencies (const char *str, void *ref_id, CH_Collection *locals, int thread)
 
bool scanForVariableInString (const char *variable, const char *string) const
 
bool changeStringOpRef (UT_String &str, const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name, CH_Collection *locals, int thread)
 
fpreal evaluate (const char *expr, fpreal now, CH_Collection *local=nullptr, int *frame_dep=nullptr, int thread=0, CH_ExprLanguage language=CH_OLD_EXPR_LANGUAGE, const DEP_ContextOptionsStack *context_options_stack=nullptr, DEP_ContextOptionsReadHandle context_options=DEP_ContextOptionsReadHandle())
 
int evaluateString (const char *expr, UT_String &result, fpreal now, CH_Collection *local=nullptr, int thread=0, CH_ExprLanguage language=CH_OLD_EXPR_LANGUAGE, const DEP_ContextOptionsStack *context_options_stack=nullptr, DEP_ContextOptionsReadHandle context_options=DEP_ContextOptionsReadHandle())
 
bool getIsSettingGlobalParam () const
 
void getGlobalParamF (const char *token, CH_Collection *scope, fpreal &result, fpreal def, int thread, bool add_dependencies)
 
void getGlobalParamS (const char *token, CH_Collection *scope, UT_String &result, const char *def, int thread, bool add_dependencies)
 
void getGlobalParamAnyScopeF (const char *token, CH_Collection *scope, fpreal &result, fpreal def, int thread, bool add_dependencies)
 
void getGlobalParamAnyScopeS (const char *token, CH_Collection *scope, UT_String &result, const char *def, int thread, bool add_dependencies)
 
int setGlobalFloatParam (const char *token, fpreal val, CH_Collection *&owner)
 
int setGlobalStringParam (const char *token, const char *strval, CH_Collection *&owner)
 
int removeGlobalParamOwner (CH_Collection *owner)
 
void dumpGlobalParams (std::ostream &out) const
 
void dirtyOrphanGlobalParamDependents (const char *token, CH_Collection *scope, bool recurse, UT_Set< CH_Collection * > *dependents)
 
bool getIsSettingGuideParam () const
 
CH_GroupgetTopGroup () const
 
CH_GroupfindGroup (const char *const_path, bool create=false, CH_Group *head=nullptr)
 
void findGroups (CH_GroupList &groups, const char *pattern, bool minimal)
 
void findChannelsFromGroups (CH_ChannelList &channels, const char *pattern)
 
void findChanRefsFromGroups (CH_ChannelRefList &chanrefs, const char *pattern)
 
CH_GroupList getSelectedGroups ()
 
CH_GroupgetCurrentGroup ()
 
void updateGroupSelection (const CH_GroupList &groups, void *by, bool propagate=true)
 
void updateGroupSelectionFromScoped (void *by, bool propagate=true)
 
void updateCurrentGroup (CH_Group *group, void *by, bool propagate=true)
 
void enforceLeafOnlyChannels (CH_Group *group, const char *name="new_group")
 
CH_GroupcreateGroup (const char *const_path, bool do_rename=true, CH_Group *head=nullptr)
 
void renameGroup (CH_Group *group, const char *newname)
 
void deleteGroup (CH_Group *group)
 
void extractGroup (CH_Group *group, CollisionBehaviour cb)
 
CH_GroupcollapseGroups (CH_GroupList const &groups, const char *name)
 
void collapseChildren (CH_Group *parent)
 
void copyIntoGroup (CH_Group *source, CH_Group *target, CollisionBehaviour cb, const char *new_name=nullptr)
 
void moveIntoGroup (CH_Group *source, CH_Group *target, CollisionBehaviour cb, const char *new_name=nullptr)
 
void addToGroup (CH_Group *source, CH_Group *target, CollisionBehaviour cb)
 
void mergeWithGroup (CH_Group *source, CH_Group *target, CollisionBehaviour cb)
 
void channelCreated (const CH_Channel *chp)
 
void channelDeleted (const CH_Channel *chp)
 
void saveGroup (CH_Group *g, std::ostream &os, int binary)
 
CH_GrouploadGroup (UT_IStream &is)
 
bool saveBookmarks (UT_JSONWriter &w, bool include_temporary=false)
 
bool saveBookmarks (UT_JSONWriter &w, const UT_Array< CH_Bookmark * > &bookmarks)
 
bool loadBookmarks (UT_JSONParser &w, bool remove_existing=true)
 
CH_ExprLanguage getDefaultExprLanguage ()
 
void setDefaultExprLanguage (CH_ExprLanguage language)
 
bool isGlobalScopedChannels (CH_ScopedChannelsBase *p)
 
CH_ScopedChannelsgetGlobalScopedChannels ()
 
const CH_ScopedChannelsgetGlobalScopedChannels () const
 
bool hasExternalCollection (const CH_Collection *collection) const
 
void scopeExternalCollection (CH_Collection *collection, bool on_off=true)
 
CH_CollectiongetExternalCollection (const UT_StringHolder &name) const
 
CH_ChannelgetExternalChannel (const char *collection, const char *name) const
 Returns an external channel given a collection and a channel name. More...
 
CH_ChannelfindExternalChannel (const UT_StringHolder &path)
 
*to get _Base exint globExternalChannels (const UT_StringHolder &pattern, CH_ChannelList &chans)
 
const UT_StringMap
< UT_UniquePtr< CH_Collection > > & 
getExternalCollections () const
 
void timeGroupsChanged ()
 
void addTimeGroup (CH_TimeGroup *group, bool do_rename=true, bool force=false)
 
void destroyTimeGroup (const CH_TimeGroup *group)
 
void destroyTimeGroup (int i)
 
void renameTimeGroup (CH_TimeGroup *group, const char *newname, bool force=false)
 
int getNTimeGroups () const
 
CH_TimeGroupgetTimeGroup (int i)
 
const CH_TimeGroupgetTimeGroup (int i) const
 
CH_TimeGroupgetTimeGroup (const char *name)
 
const CH_TimeGroupgetTimeGroup (const char *name) const
 
int getTimeGroupIdx (const char *name) const
 
void bookmarksChanged (CH_BookmarkEvent action, int64 bookmark_id)
 
DEP_MicroNodegetBookmarksMicroNode ()
 
int addBookmark (UT_UniquePtr< CH_Bookmark > &&bookmark, bool create=true)
 
int sortBookmark (CH_Bookmark *bookmark, bool notify=true)
 
void destroyBookmark (int index, bool create_undo=true, bool notify=true)
 
void destroyBookmarks (const UT_Array< CH_Bookmark * > &bookmarks, bool create_undo=true, bool notify=true)
 
void destroyBookmark (CH_Bookmark *bookmark, bool create_undo=true, bool notify=true)
 
void frameBookmark (int index, bool store_previous_range=true)
 
void frameBookmark (CH_Bookmark *bookmark, bool store_previous_range=true)
 
void clearBookmarks ()
 
CH_BookmarkgetMostRecentBookmark () const
 
CH_BookmarkgetLeastRecentBookmark () const
 
void setMostRecentBookmark (CH_Bookmark *bookmark)
 
void setLeastRecentBookmark (CH_Bookmark *bookmark)
 
CH_BookmarkgetFramedBookmark () const
 
int getFramedBookmarkIndex () const
 
int getNBookmarks () const
 
int getBookmarkIndex (CH_Bookmark *bookmark)
 
CH_BookmarkgetBookmark (int i)
 
const CH_BookmarkgetBookmark (int i) const
 
CH_BookmarkgetBookmarkBySessionId (int64 bookmark_id) const
 
UT_Array< CH_Bookmark * > getBookmarksBySessionIds (const UT_Array< int64 > &ids) const
 
const UT_Array< exint > & getBookmarksOrderByRecentUsage ()
 
int niceFrameSeparation (fpreal initial_sep, int minimum_sep=1) const
 
void stretchCollections (CH_Collection *from, fpreal ostart, fpreal oend)
 
void preserveCollectionKeyframes (CH_Collection *grp, fpreal old_fps)
 
void shiftCollections (CH_Collection *grp, fpreal time_delta)
 Shifts all collections by the given time_delta. More...
 
fpreal getNumSamples () const
 
void setRawNumSamples (int n, bool notify=true)
 
fpreal getSamplesPerSec () const
 
void setSamplesPerSec (fpreal fps, bool notify=true)
 
fpreal getSecsPerSample () const
 
void setRawSamplesPerSec (fpreal fps, bool notify=true)
 
int getChopMotionSamples () const
 
void setChopMotionSamples (int n, bool notify=true)
 
fpreal getGlobalStart () const
 
fpreal getGlobalEnd () const
 
int getGlobalStartFrame () const
 
int getGlobalEndFrame () const
 
void setGlobalTime (fpreal start, fpreal end, bool notify=true)
 
void setGlobalStart (fpreal start, bool notify=true)
 
void setRawInterpolation (int state)
 
int getRawInterpolation ()
 
fpreal getTolerance () const
 
fpreal getFrameTolerance () const
 
fpreal getTime (fpreal sample) const
 
fpreal getSampleRaw (fpreal t) const
 
fpreal getSample (fpreal t) const
 
int getFrame (fpreal t) const
 
fpreal getTimeDelta (fpreal sample_delta) const
 
fpreal getSampleDelta (fpreal time_delta) const
 
fpreal getSnapToFrameTime (fpreal t) const
 
fpreal getSnapToSubframeTime (fpreal t) const
 
fpreal getSnapSample (fpreal frame) const
 
fpreal getSnapSubsample (fpreal frame) const
 
fpreal getSnapToFrameDelta (fpreal base_time, fpreal time_delta) const
 
bool getIsAtFrame (fpreal t) const
 
void getTimeCode (char *buf, fpreal t)
 
int setTimeCode (const char *buf, fpreal &t)
 
void setTimeCodeOffset (fpreal t)
 
fpreal getTimeCodeOffset (fpreal) const
 
int getIntegerFrameFlag () const
 
void setIntegerFrameFlag (int flag, bool notify=true)
 
int getRestrictRangeFlag () const
 
void setRestrictRangeFlag (int flag, bool notify=true)
 
int getShowRangeFlag () const
 
void setShowRangeFlag (int flag, bool notify=true)
 
int getShowTicksFlag () const
 
void setShowTicksFlag (int flag, bool notify=true)
 
int getShowAudioFlag () const
 
void setShowAudioFlag (int flag, bool notify=true)
 
int getShowKeysFlag () const
 
void setShowKeysFlag (int flag, bool notify=true)
 
int getShowBookmarksFlag () const
 
void setShowBookmarksFlag (int flag, bool notify=true)
 
int getShowSimCacheFlag () const
 
void setShowSimCacheFlag (int flag, bool notify=true)
 
int getShowAnimBarFlag () const
 
void setShowAnimBarFlag (int flag, bool notify=true)
 
fpreal getAudioLevel () const
 
void setAudioLevel (fpreal lvl)
 
fpreal getUnitLength () const
 
void setUnitLength (fpreal unitlength)
 
fpreal getUnitMass () const
 
void setUnitMass (fpreal unitmass)
 
void parseUnitsString (const char *units, fpreal &distexp, fpreal &massexp) const
 
fpreal scaleToMKS (const char *fromunits) const
 
fpreal scaleFromMKS (const char *tounits) const
 
int getRealTimeFlag () const
 
void setRealTimeFlag (int flag, bool notify=true)
 
fpreal getRealTimeFactor () const
 
void setRealTimeFactor (fpreal f, bool notify=true)
 
bool getRealTimeDisableSkip () const
 
void setRealTimeDisableSkip (bool b, bool notify=true)
 
fpreal getSampleStep () const
 
void setSampleStep (fpreal s, bool notify=true)
 
void getSampleRange (fpreal &start, fpreal &end)
 
void setSampleRange (fpreal start, fpreal end, bool notify=true)
 
int getHoldFlag () const
 
void setHoldFlag (int flag)
 
int saveChannels (const char *filename, bool binary, bool compiled, const CH_ChannelList &channels, bool displayed=false) const
 
int loadChannels (const char *filename, const char *src_pattern, const char *dest_pattern, bool use_range, const fpreal *tstart, const fpreal *tend, CH_CollectionList &parents, bool delete_keys=false, CH_ChannelRefList *displayed_parms=nullptr)
 
void addExpressionDefine (CH_ExprDefine *def)
 
void setEvalCollection (CH_Collection *g, int thread)
 
CH_CollectiongetEvalCollection (int thread) const
 
void setRootCollection (CH_Collection *root)
 
CH_CollectiongetRootCollection () const
 
const CH_EvalContextevalContext (int thread) const
 
CH_EvalContextevalContext (int thread)
 
const CH_ChannelgetEvalChannel (int thread) const
 
const CH_SegmentgetEvalSegment (int thread) const
 
const char * getEvalChannelName (int thread) const
 
const DEP_ContextOptionsStackgetEvalChannelContextOptionsStack (int thread) const
 
DEP_ContextOptionsReadHandle getEvalChannelContextOptions (int thread) const
 
fpreal getEvaluateTime () const
 
CH_LocalVariablegetLocalVariableTable () const
 
bool getVariableValue (UT_String &str, int i, int thread) const
 
bool getVariableValue (fpreal &val, int i, int thread) const
 
bool getVariableValue (int &val, int i, int thread) const
 
int addVariable (const CH_LocalVariable &var, CH_StringVarEvalFunc strfunc, CH_FloatVarEvalFunc floatfunc, CH_IntVarEvalFunc intfunc) const
 
void removeParamDependency (CH_Collection *coll)
 
bool buildChannelRefs (CH_ChannelRefList &reflist, const CH_ChannelList &chlist)
 
bool buildChannelRefs (CH_ChannelRefList &reflist, const UT_StringArray &chlist)
 
void changeReferencesToNodeId (int old_id, int new_id)
 
void removeReferencesToNodeId (int node_id)
 
void displayScope () const
 
bool getAutoKeyTuples () const
 Auto-Key all Tuples is a preference to key tuples together. More...
 
void setAutoKeyTuples (bool b)
 
bool getAutoScopeOnChannelCreate () const
 
void setAutoScopeOnChannelCreate (bool b)
 
bool getAutoScopeIncludeAnimated () const
 
void setAutoScopeIncludeAnimated (bool b)
 
bool getFollowScopedChannelReferences () const
 
void setFollowScopedChannelReferences (bool b)
 
fpreal evalBezierFunc (int thread)
 
fpreal evalConstantFunc (int thread)
 
fpreal evalCubicFunc (int thread)
 
fpreal evalCycleFunc (fpreal start_frame, fpreal end_frame, int thread)
 
fpreal evalCycletFunc (fpreal start_frame, fpreal end_frame, int thread)
 
fpreal evalCycleOffsetFunc (fpreal start_frame, fpreal end_frame, int thread)
 
fpreal evalCycleOffsettFunc (fpreal start_frame, fpreal end_frame, int thread)
 
fpreal evalEaseFunc (int thread)
 
fpreal evalEaseinFunc (int thread)
 
fpreal evalEaseinpFunc (fpreal ease_speed, int thread)
 
fpreal evalEaseoutFunc (int thread)
 
fpreal evalEaseoutpFunc (fpreal ease_speed, int thread)
 
fpreal evalEasepFunc (fpreal ease_speed, int thread)
 
fpreal evalLinearFunc (int thread)
 
fpreal evalMatchFunc (int thread)
 
fpreal evalMatchinFunc (int thread)
 
fpreal evalMatchoutFunc (int thread)
 
fpreal evalQcubicFunc (int thread)
 
fpreal evalQlinearFunc (int thread)
 
fpreal evalQuinticFunc (int thread)
 
fpreal evalRepeatFunc (fpreal start_frame, fpreal end_frame, int thread)
 
fpreal evalRepeattFunc (fpreal start_frame, fpreal end_frame, int thread)
 
fpreal evalSplineFunc (int thread)
 
fpreal evalVmatchFunc (int thread)
 
fpreal evalVmatchinFunc (int thread)
 
fpreal evalVmatchoutFunc (int thread)
 
bool getAutoScopeIncludeChild () const
 
void setAutoScopeIncludeChild (bool b)
 
bool getAutoScopeIncludeConstraints () const
 
void setAutoScopeIncludeConstraints (bool b)
 
DEP_ContextOptionsHandle getDefaultContextOptions () const
 
DEP_MicroNodegetDefaultContextOptionMicroNode (const UT_StringHolder &opt)
 
void setDefaultContextOption (const UT_StringHolder &opt, const UT_StringHolder &value, bool create_undo)
 
void setDefaultContextOption (const UT_StringHolder &opt, fpreal64 value, bool create_undo)
 
const UT_StringHoldergetDefaultContextOptionUiConfig (const UT_StringHolder &opt) const
 
void setDefaultContextOptionUiConfig (const UT_StringHolder &opt, const UT_StringHolder &ui_config)
 
void removeDefaultContextOption (const UT_StringHolder &opt, bool create_undo)
 
void clearDefaultContextOptions (bool create_undo)
 
bool saveDefaultContextOptions (std::ostream &os) const
 
bool loadDefaultContextOptions (UT_IStream &is)
 
int addDefaultContextOptionCallback (CH_DefaultContextOptionCallback cb)
 
void removeDefaultContextOptionCallback (int id)
 
bool isAutomaticContextOption (const UT_StringHolder &opt) const
 
bool isAutomaticContextOptionOverridden (const UT_StringHolder &opt) const
 
void pushRopCookContextOptions ()
 
void pushRopCookContextOptions (bool ropcook, fpreal fstart, fpreal fend, fpreal finc, const UT_StringHolder &ropname, const UT_StringHolder &roppath)
 
void resetRopCookContextOptions ()
 
void updateRopCookContextOptions (bool ropcook, fpreal fstart, fpreal fend, fpreal finc, const UT_StringHolder &ropname, const UT_StringHolder &roppath)
 
void popRopCookContextOptions ()
 
void setChannelColorManager (CH_ChannelColorManager *mgr)
 
CH_ChannelColorManagerchannelColorManager ()
 
void setChannelChanged (CH_ChannelChanged *mgr)
 
CH_ChannelChangedgetChannelChanged ()
 
void triggerChannelChanged ()
 
CH_TweenergetChannelTweener ()
 
bool getIgnoreUpdateScopeFlag () const
 
void setIgnoreUpdateScopeFlag (bool onoff)
 
fpreal getEvaluateTime (int thread) const
 Functions for obtaining and setting the current evaluation time. More...
 
void setEvaluateTime (fpreal time, int thread)
 Functions for obtaining and setting the current evaluation time. More...
 
void setEvaluateTime (SYS_Flicks fl, int thread)
 Functions for obtaining and setting the current evaluation time. More...
 

Static Public Member Functions

static void getChRefUniqueNodes (const CH_ChannelRefList &chanrefs, UT_ValArray< OP_Node * > &nodes)
 
- Static Public Member Functions inherited from CMD_Manager
static bool getContextExists ()
 
static CMD_ManagergetContext ()
 retrieves the global CMD_Manager More...
 
static void saveProtectedString (std::ostream &os, const char *s)
 
static void expandControlSequences (UT_String &str)
 
static void buildQuotedCommandLineStringForBinaryData (const UT_StringRef &data, UT_WorkBuffer &result)
 
static void retrieveBinaryDataFromInsideCommand (const char *encoded_data, UT_WorkBuffer &result)
 
static int getHScriptPort ()
 
static void cmd_python (CMD_Args &args)
 
static void setUpdatePythonEnvironmentVariables (bool b)
 
static bool getUpdatePythonEnvironmentVariables ()
 
- Static Public Member Functions inherited from CH_Manager
static CH_ManagergetContext ()
 
static bool getContextExists ()
 
static void evaluationError (int err, int thread, const char *path)
 
static CH_KeyState getKeyState (fpreal gtime, const CH_ChannelList &channels, bool loose=false)
 
static bool makeGroupPathValid (UT_String &path)
 
static bool makeGroupNameValid (UT_String &path)
 
static bool couldExpandString (const char *str)
 
static fpreal niceNumber (fpreal num, int digits=6)
 
static fpreal getDefaultFPS ()
 
static fpreal getDefaultLength (fpreal fps)
 
static fpreal getDefaultLengthFrames (fpreal fps)
 
static int getDefaultChopMotionSamples ()
 
static bool readCHNFileHeader (UT_IStream &is, bool quiet, fpreal32 &version, int &binary, bool &is_fp64, fpreal64 &tstart, fpreal64 &tend)
 
static bool skipCHNFileHeaderForCollection (UT_IStream &is, bool &is_fp64)
 
static bool getFileType (const char *filename, int &raw, int &binary)
 
static bool printFileInfo (std::ostream &os, const char *filename, CH_Collection *load_coll, bool print_segments=true)
 
static void lookupVariable (const char *name, UT_String &val, int thread)
 
static void lookupVariableNoThread (const char *name, UT_String &val)
 
static void lookupExpression (const char *name, UT_String &val, int thread)
 
static void lookupExpressionNoThread (const char *name, UT_String &val)
 
static int getSimpleSegmentTypeFromExpression (const char *expr)
 

Additional Inherited Members

- Public Types inherited from CH_Manager
enum  CollisionBehaviour { CH_ON_COLLISION_RENAME, CH_ON_COLLISION_MERGE, CH_ON_COLLISION_REPLACE, CH_ON_COLLISION_ASSERT }
 
enum  ExpansionType {
  CH_EXPANSION_TYPE_EXPRESSION = 1, CH_EXPANSION_TYPE_VARIABLE = 1 << 1, CH_EXPANSION_TYPE_TILDE = 1 << 2, CH_EXPANSION_TYPE_NO_COMMENTS = 1 << 3,
  CH_EXPANSION_TYPE_NO_RAWSTRINGS = 1 << 4, CH_EXPANSION_TYPE_DEFAULT
}
 
enum  SlopeMode { CH_SLOPE_MANUAL, CH_SLOPE_MANUAL_KEEP, CH_SLOPE_AUTOMATIC }
 
typedef CollisionBehaviour(* CBCallback )(CH_Group *source, CH_Group *target)
 
- Public Attributes inherited from CH_Manager
*to get everything
 
- Static Public Attributes inherited from CH_Manager
static constexpr int CH_SCOPE_REPLACED = 0
 
static constexpr int CH_SCOPE_FILTERED = 1
 
- Protected Member Functions inherited from CMD_Manager
bool getVariableString (const char *name, UT_String &value, int &timeDepend, int thread) override
 
- Protected Member Functions inherited from CH_Manager
void setTolerance (fpreal tol)
 
void initExpressionLibrary ()
 
void initLibraryGlue ()
 
CH_CollectionaddExternalCollection (UT_UniquePtr< CH_Collection > &&collection)
 
void destroyExternalCollection (const UT_StringHolder &name)
 

Detailed Description

Definition at line 26 of file OP_CommandManager.h.

Constructor & Destructor Documentation

OP_CommandManager::OP_CommandManager ( const char *  appname)
OP_CommandManager::~OP_CommandManager ( )
override

Member Function Documentation

int OP_CommandManager::addGeometryChannelsChangedCallback ( const UT_StringHolder collection_name,
OP_GeometryChannelsChangedCallback  callback 
)

Register a new callback to notify of changes to geometry channels within a geometry channel collection

CH_Collection* OP_CommandManager::addGeometryChannelsCollection ( const UT_StringHolder name)
void OP_CommandManager::beginChannelChanges ( )
overridevirtual

Reimplemented from CH_Manager.

bool OP_CommandManager::buildChanRef ( CH_ChannelRef r,
const CH_Channel chp 
) const
overridevirtual

The following methods are used to build channel references using, nodes, parms or channels. The passed in channel reference r will be filled in with the appropriate data. Return true if success, false otherwise.

Reimplemented from CH_Manager.

virtual bool OP_CommandManager::buildChanRef ( CH_ChannelRef r,
const OP_Node node,
const PRM_Parm parm 
) const
virtual
virtual bool OP_CommandManager::buildChanRef ( CH_ChannelRef r,
const OP_Node node,
const char *  channel_name 
) const
virtual
virtual bool OP_CommandManager::buildChanRef ( CH_ChannelRef r,
const OP_Node node,
const PRM_Parm parm,
int  subindex 
) const
virtual
bool OP_CommandManager::buildChanRef ( CH_ChannelRef r,
const char *  path 
) const
overridevirtual

Use this method to build a channel reference from a channel path.

Reimplemented from CH_Manager.

bool OP_CommandManager::channelsBeingChanged ( )
overridevirtual

Reimplemented from CH_Manager.

void OP_CommandManager::channelsChanged ( )
overridevirtual

Reimplemented from CH_Manager.

int OP_CommandManager::compareChanRefs ( const CH_ChannelRef r1,
const CH_ChannelRef r2 
) const
overridevirtual

Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2.

Reimplemented from CH_Manager.

int OP_CommandManager::compareLayerRefs ( const CH_ChannelRef r1,
const CH_ChannelRef r2 
) const
overridevirtual

Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2.

Reimplemented from CH_Manager.

void OP_CommandManager::destroyGeometryChannelsCollection ( const UT_StringHolder name)
void OP_CommandManager::endChannelChanges ( )
overridevirtual

Reimplemented from CH_Manager.

void OP_CommandManager::geometryChannelsCollectionChanged ( const UT_StringHolder name)

Mark a geometry channels collection as changed. beginChannelChanges must have been called previously. On the next call to endChannelChanges, "Finished" notifications will be sent out for all collections registered with this method.

CH_ScriptAccessManager* OP_CommandManager::getAccessManager ( int  thread)
overridevirtual

Reimplemented from CH_Manager.

bool OP_CommandManager::getChannelAutoSelect ( const CH_ChannelRef chref) const
overridevirtual

Reimplemented from CH_Manager.

void OP_CommandManager::getChannelsWithNodeId ( CH_ChannelList chans,
int  node_id 
) const
overridevirtual

Reimplemented from CH_Manager.

void OP_CommandManager::getChanRefPath ( const CH_ChannelRef r,
UT_String path,
bool  use_alias = false 
) const
overridevirtual

Use this method to get the full path of the channel referenced by r.

Reimplemented from CH_Manager.

void OP_CommandManager::getChanRefsPythonListCode ( const CH_ChannelRefList chanrefs,
UT_WorkBuffer result 
)

Returns Python code representing the list of channel references.

bool OP_CommandManager::getChRefAlias ( const CH_ChannelRef r,
UT_String ret 
) const
overridevirtual

Reimplemented from CMD_Manager.

CH_Channel* OP_CommandManager::getChRefChannel ( const CH_ChannelRef r) const
overridevirtual

Use this method to translate a channel reference to a channel pointer. May return NULL if the channel reference does not reference a valid channel.

Reimplemented from CH_Manager.

virtual void OP_CommandManager::getChRefData ( const CH_ChannelRef r,
OP_Node **  pnode,
CH_Channel **  pchp,
PRM_Parm **  ppparm,
int subindex 
) const
virtual

The following methods are used to extract information from channel references.

virtual PRM_Parm* OP_CommandManager::getChRefFullParm ( const CH_ChannelRef r) const
virtual
bool OP_CommandManager::getChRefLabelForUI ( const CH_ChannelRef r,
UT_String ret 
) const
overridevirtual

Reimplemented from CMD_Manager.

bool OP_CommandManager::getChRefNodePath ( const CH_ChannelRef r,
UT_String ret 
) const
overridevirtual

Reimplemented from CMD_Manager.

virtual OP_Node* OP_CommandManager::getChRefOpNode ( const CH_ChannelRef r) const
virtual
virtual PRM_Parm* OP_CommandManager::getChRefParm ( const CH_ChannelRef r,
int subindex 
) const
virtual
virtual int OP_CommandManager::getChRefParmIndex ( const CH_ChannelRef r,
int subindex 
) const
virtual
static void OP_CommandManager::getChRefUniqueNodes ( const CH_ChannelRefList chanrefs,
UT_ValArray< OP_Node * > &  nodes 
)
static

Returns a list of unique nodes corresponding to the given channel ref list. The order of the nodes will match chanrefs.

OP_GeometryChannels* OP_CommandManager::getGeometryChannelsCollection ( const UT_StringHolder name) const
bool OP_CommandManager::inTrustedContextForNode ( const OP_Node node,
int  thread 
) const
bool OP_CommandManager::inTrustedContextForNodeContents ( const OP_Node node,
int  thread 
) const
bool OP_CommandManager::isChanRefValid ( const CH_ChannelRef chref) const
overridevirtual

Reimplemented from CH_Manager.

bool OP_CommandManager::isHandlingChannelChanges ( )
inline

Definition at line 163 of file OP_CommandManager.h.

bool OP_CommandManager::isOwnerExposed ( const CH_ChannelRef r) const
overridevirtual

Use this method to determine if the owner of the channel reference is exposed or not.

Reimplemented from CH_Manager.

bool OP_CommandManager::match ( const CH_ChannelRef r,
const char *  patt 
) const

This method will return true if the channel reference r matches the pattern patt, or false otherwise.

void OP_CommandManager::removeGeometryChannelsChangedCallback ( const UT_StringHolder collection_name,
int  id 
)

Remove a geometry channels changed callback.

bool OP_CommandManager::resolveChanRefExport ( const CH_ChannelRef r,
CH_ChannelRef out_export 
)
overridevirtual

Reimplemented from CH_Manager.


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