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

#include <CMD_Manager.h>

+ Inheritance diagram for CMD_Manager:

Public Member Functions

 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 ()
 
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
 
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)
 
virtual void getChannelsWithNodeId (CH_ChannelList &chans, int node_id) const
 
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
 
virtual CH_ScriptAccessManager * getAccessManager (int)
 
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)
 
virtual CH_ChannelgetChRefChannel (const CH_ChannelRef &r) const
 
virtual bool isOwnerExposed (const CH_ChannelRef &r) const
 
virtual bool buildChanRef (CH_ChannelRef &r, const CH_Channel *chp) const
 Use this method to build a channel reference from a channel pointer. More...
 
virtual bool buildChanRef (CH_ChannelRef &r, const char *path) const
 Use this method to build a channel reference from a channel path. More...
 
bool buildChannelRefs (CH_ChannelRefList &reflist, const CH_ChannelList &chlist)
 
bool buildChannelRefs (CH_ChannelRefList &reflist, const UT_StringArray &chlist)
 
virtual int compareChanRefs (const CH_ChannelRef &r1, const CH_ChannelRef &r2) const
 
virtual int compareLayerRefs (const CH_ChannelRef &r1, const CH_ChannelRef &r2) const
 
virtual void getChanRefPath (const CH_ChannelRef &r, UT_String &path, bool use_alias=false) const
 Use this method to get the full path of the channel referenced by r. More...
 
virtual bool isChanRefValid (const CH_ChannelRef &chref) const
 
void changeReferencesToNodeId (int old_id, int new_id)
 
void removeReferencesToNodeId (int node_id)
 
void displayScope () const
 
virtual bool resolveChanRefExport (const CH_ChannelRef &r, CH_ChannelRef &out_export)
 
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 ()
 
virtual bool getChannelAutoSelect (const CH_ChannelRef &chref) const
 
bool getIgnoreUpdateScopeFlag () const
 
void setIgnoreUpdateScopeFlag (bool onoff)
 
virtual void beginChannelChanges ()
 
virtual void channelsChanged ()
 
virtual void endChannelChanges ()
 
virtual bool channelsBeingChanged ()
 
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 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)
 

Protected Member Functions

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)
 

Friends

class cmd_SendInput
 
class cmd_SendMultiLineInput
 
class cmd_Execute
 

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
 

Detailed Description

This class to keeps track of the hscript context, installed commands, variables, aliases, command buffer, and the prompt.

Examples:
expr/channel.C, expr/command.C, expr/functions.C, expr/globalvar.C, FS/FS_Background.C, standalone/standalone.C, and ui/cmd_ui.C.

Definition at line 63 of file CMD_Manager.h.

Constructor & Destructor Documentation

CMD_Manager::CMD_Manager ( const UT_StringHolder appname)
CMD_Manager::~CMD_Manager ( )
override

Member Function Documentation

void CMD_Manager::allowEnvironmentToOverwriteVariable ( const char *  name,
bool  onoff 
)

Specify whether a global hscript variable may be overwritten by an environment variable's value when loading the hip file, instead of just using the value saved in the hip file.

const UT_StringHolder& CMD_Manager::appName ( ) const
inline

Return the name of the application.

Definition at line 84 of file CMD_Manager.h.

bool CMD_Manager::beginChannelBlock ( )
void CMD_Manager::beginLoading ( )
inline

Definition at line 383 of file CMD_Manager.h.

CMD_Loop* CMD_Manager::buildLoop ( const char *  text)
static void CMD_Manager::buildQuotedCommandLineStringForBinaryData ( const UT_StringRef data,
UT_WorkBuffer result 
)
static
void CMD_Manager::bumpBreakLevel ( int  dir)
inline

Definition at line 347 of file CMD_Manager.h.

void CMD_Manager::bumpLoopNestLevel ( int  dir)
inline

Definition at line 349 of file CMD_Manager.h.

int CMD_Manager::clearDirtyVariables ( )
int CMD_Manager::clearDirtyVariables ( const UT_StringArray names)
void CMD_Manager::clearHistory ( )

Clears the history buffer.

void CMD_Manager::closeAutoPort ( )
void CMD_Manager::closePort ( int  port)

Closes a port opened with openPort().

static void CMD_Manager::cmd_python ( CMD_Args args)
static

Command for handling python command. This is a static public function so that the overridden version can call this default implementation depending on the command format.

void CMD_Manager::commandDump ( std::ostream &  os,
const char *  pattern = 0,
const char *  prefix = 0 
) const

Displays a list of all commands.

void CMD_Manager::commandHelp ( std::ostream &  os,
const char *  cmd,
bool  full_match_only = false 
) const

Displays help documentation for the given command. Returns true if a single command matched, false if multiple commands matched and a help message or a dump is printed out.

void CMD_Manager::completeCommand ( const char *  prefix,
UT_String command 
) const

Try to complete the given command prefix to the longest common string. If an exact match is found, append a " ".

void CMD_Manager::destroyAlias ( const char *  name)

Removes the named alias.

void CMD_Manager::destroyAliases ( )

Removes all aliases.

void CMD_Manager::doPrompt ( )
void CMD_Manager::dumpHistory ( std::ostream &  os) const

Displays the contents of the history buffer.

void CMD_Manager::echoOff ( )
void CMD_Manager::echoOn ( )
bool CMD_Manager::endChannelBlock ( )
void CMD_Manager::endLoading ( )
inline

Definition at line 384 of file CMD_Manager.h.

int CMD_Manager::evaluateCondition ( const char *  expr)
int CMD_Manager::evaluateCondition ( int  argc,
const char *  argv[] 
)
void CMD_Manager::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.

void CMD_Manager::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 
)

Non-threadsafe versions of sendInput()/sendMultiLineInput()/execute(). These methods cannot be called on the same CMD_Manager object from multiple threads.

static void CMD_Manager::expandControlSequences ( UT_String str)
static
bool CMD_Manager::getAlias ( const char *  name,
UT_String value 
)

Returns the replacement for the named alias. Returns false if the alias is not found.

CMD_AliasTable* CMD_Manager::getAliases ( )
inline

Definition at line 300 of file CMD_Manager.h.

int CMD_Manager::getBreakLevel ( ) const
inline

Definition at line 348 of file CMD_Manager.h.

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

Reimplemented from CH_Manager.

Reimplemented in OP_CommandManager.

bool CMD_Manager::getChRefLabelForUI ( const CH_ChannelRef r,
UT_String ret 
) const
overridevirtual

Reimplemented from CH_Manager.

Reimplemented in OP_CommandManager.

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

Reimplemented from CH_Manager.

Reimplemented in OP_CommandManager.

bool CMD_Manager::getCommandEcho ( ) const
inline

Definition at line 367 of file CMD_Manager.h.

void* CMD_Manager::getCommandEchoCallbackData ( ) const
inline

Return the userdata set in setCommandEchoCallback().

Definition at line 165 of file CMD_Manager.h.

unsigned CMD_Manager::getCommandsRun ( ) const
inline

Return the number of commands run. It's possible for this to overflow.

Definition at line 244 of file CMD_Manager.h.

static CMD_Manager* CMD_Manager::getContext ( )
inlinestatic

retrieves the global CMD_Manager

Definition at line 77 of file CMD_Manager.h.

static bool CMD_Manager::getContextExists ( )
inlinestatic

Definition at line 74 of file CMD_Manager.h.

int CMD_Manager::getContinueLevel ( ) const
inline

Definition at line 346 of file CMD_Manager.h.

void CMD_Manager::getDSOCommands ( CMD_CommandList list)
bool CMD_Manager::getEnv ( const char *  name,
UT_String value 
)
std::ostream& CMD_Manager::getError ( int  printMessage = 1)
void CMD_Manager::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.

CMD_VariableTable* CMD_Manager::getGlobalVariables ( )
inline

Definition at line 299 of file CMD_Manager.h.

const char* CMD_Manager::getHistoryCommand ( int  n) const

Returns an entry from the history buffer. Index 0 being the most recent command.

unsigned int CMD_Manager::getHistoryCount ( ) const

Returns the number of entries in the history buffer.

static int CMD_Manager::getHScriptPort ( )
static

Retrieve an automatically-generated port via openport -a Will be the same from call to call unless the port is closed

int CMD_Manager::getIORedirection ( ) const
int CMD_Manager::getLoopNestLevel ( ) const
inline

Definition at line 357 of file CMD_Manager.h.

const char* CMD_Manager::getOptions ( const char *  cmdName)

Returns the getopts-style options for the given command.

void* CMD_Manager::getPostCmdCallbackData ( ) const
inline

Return the userdata set in setPostCmdCallback().

Definition at line 155 of file CMD_Manager.h.

const char* CMD_Manager::getPrompt ( int  level = -1) const
inline

Definition at line 257 of file CMD_Manager.h.

void CMD_Manager::getPrompt ( UT_String str)
CMD_Source* CMD_Manager::getSource ( )
inline

Definition at line 190 of file CMD_Manager.h.

int CMD_Manager::getSourceLevel ( )
inline

Definition at line 195 of file CMD_Manager.h.

int CMD_Manager::getStatusCode ( ) const
inline

Returns non-zero if the last command failed.

Definition at line 396 of file CMD_Manager.h.

static bool CMD_Manager::getUpdatePythonEnvironmentVariables ( )
static
bool CMD_Manager::getVariable ( const char *  name,
UT_String value 
)
inline

Returns the value of the named variable.

Definition at line 212 of file CMD_Manager.h.

bool CMD_Manager::getVariable ( const char *  name,
fpreal64 value 
)
inline

Returns the value of the named variable as a fpreal64.

Definition at line 215 of file CMD_Manager.h.

bool CMD_Manager::getVariable ( const char *  name,
fpreal32 value 
)
inline

Returns the value of the named variable as a float.

Definition at line 218 of file CMD_Manager.h.

bool CMD_Manager::getVariable ( const char *  name,
int32 value 
)
inline

Returns the value of the named variable as an int.

Definition at line 221 of file CMD_Manager.h.

bool CMD_Manager::getVariable ( const char *  name,
int64 value 
)
inline

Returns the value of the named variable as an int.

Definition at line 224 of file CMD_Manager.h.

CMD_VariableChangeNotifier* CMD_Manager::getVariableChangeNotifier ( ) const
inline

Returns a variable change notification center object.

Definition at line 335 of file CMD_Manager.h.

void CMD_Manager::getVariableNames ( UT_StringArray names,
int  dirty = 0 
)

Returns a list of all defined variables.

bool CMD_Manager::getVariableString ( const char *  name,
UT_String value,
int timeDepend,
int  thread 
)
overrideprotectedvirtual

Reimplemented from CH_Manager.

int CMD_Manager::getVerbose ( ) const
bool CMD_Manager::hasEnv ( const char *  name) const
bool CMD_Manager::hasVariable ( const char *  name) const

Returns true if the named variable exists.

void CMD_Manager::installCommand ( const char *  name,
const char *  options,
CMD_Callback  cb,
bool  is_safe = true 
)

Install a command into the command list.

Examples:
expr/command.C, FS/FS_Background.C, and ui/cmd_ui.C.
int CMD_Manager::isCommandDefined ( const char *  name)
inline

Returns true if the command is defined.

Definition at line 376 of file CMD_Manager.h.

bool CMD_Manager::isEnvironmentAllowedToOverwriteVariable ( const char *  name)

Should we use the environment variable value when loading this variable from the hip file?

int CMD_Manager::isInBrowserMode ( ) const
int CMD_Manager::isInSafeMode ( ) const
bool CMD_Manager::isLoading ( ) const
inline

Definition at line 382 of file CMD_Manager.h.

bool CMD_Manager::isLoadingGlobalVariables ( )
inline

Are we loading global variables from the hip file?

Definition at line 326 of file CMD_Manager.h.

int CMD_Manager::isLoopCommand ( const char *  str)
int CMD_Manager::isVariableNameOk ( const char *  name)

Returns true if the name is legal and no variable with the name is currently defined.

bool CMD_Manager::markCommandForFalseIfStatements ( const char *  name,
CMD_Callback  cb 
)

Mark a command as having a special callback when inside a "false" if block. That is, usually commands are skipped when they are inside an if block which has evaluated as false. If this method is called, the command will have the given callback invoked in false if statements.

void CMD_Manager::matchCommands ( const char *  prefix,
UT_StringArray matches 
) const

Return a list of all commands that start with the given prefix.

bool CMD_Manager::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 
)

The following versions of openPort vary slightly from one another. Some versions take CMD_Args for error output while some take an ostream. Some versions take a const char * for the command to execute, while others take a "const char *const*" array of arguments for the command.

Note that if we're told to execute a program, the port will be closed when the program exits.

bool CMD_Manager::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 
)

The following versions of openPort vary slightly from one another. Some versions take CMD_Args for error output while some take an ostream. Some versions take a const char * for the command to execute, while others take a "const char *const*" array of arguments for the command.

Note that if we're told to execute a program, the port will be closed when the program exits.

bool CMD_Manager::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 
)

The following versions of openPort vary slightly from one another. Some versions take CMD_Args for error output while some take an ostream. Some versions take a const char * for the command to execute, while others take a "const char *const*" array of arguments for the command.

Note that if we're told to execute a program, the port will be closed when the program exits.

bool CMD_Manager::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 
)

The following versions of openPort vary slightly from one another. Some versions take CMD_Args for error output while some take an ostream. Some versions take a const char * for the command to execute, while others take a "const char *const*" array of arguments for the command.

Note that if we're told to execute a program, the port will be closed when the program exits.

void CMD_Manager::popOutputStreams ( )
void CMD_Manager::popPrompt ( )
CMD_Source* CMD_Manager::popSource ( int  checkLoop = 1)
void CMD_Manager::pushOutputStreams ( std::ostream &  out,
std::ostream &  err 
)
void CMD_Manager::pushPrompt ( const char *  prompt)
CMD_Source* CMD_Manager::pushSource ( const char *  filename,
int  verbose = 0 
)
void CMD_Manager::resetVariables ( )

Resets all variables to their defaults.

static void CMD_Manager::retrieveBinaryDataFromInsideCommand ( const char *  encoded_data,
UT_WorkBuffer result 
)
static
void CMD_Manager::saveAliases ( std::ostream &  os)
void CMD_Manager::saveCommandString ( std::ostream &  os,
const UT_String str 
)
static void CMD_Manager::saveProtectedString ( std::ostream &  os,
const char *  s 
)
static

These two functions are inverses of each other. If the string is written out using saveProtectedString(), then you MUST use expandControlSequences() when loading the string back in.

void CMD_Manager::saveVariables ( std::ostream &  os,
bool  level0_locals 
)
void CMD_Manager::sendInput ( const char *  input,
bool  create_block = true 
)

Send input to the command manager. If the command is complete, the command will be executed, otherwise there will be input pending with the remainder of the input sitting in a buffer until there's a full command.

Examples:
standalone/standalone.C.
void CMD_Manager::sendInputNoLock ( const char *  input,
bool  create_block = true 
)

Non-threadsafe versions of sendInput()/sendMultiLineInput()/execute(). These methods cannot be called on the same CMD_Manager object from multiple threads.

void CMD_Manager::sendMultiLineInput ( const char *  input,
bool  create_block = true 
)

This version splits the input into lines and sends them to the single line sendInput. We need a non-const char * so we can avoid copying the data. The components of the string are modified, and then restored, so you don't actually have to worry about the string being modified.

void CMD_Manager::sendMultiLineInputNoLock ( const char *  input,
bool  create_block = true 
)

Non-threadsafe versions of sendInput()/sendMultiLineInput()/execute(). These methods cannot be called on the same CMD_Manager object from multiple threads.

void CMD_Manager::setAlias ( const char *  name,
const char *  value 
)

Create a new alias or override an existing alias.

void CMD_Manager::setBrowserMode ( int  browser_mode)
void CMD_Manager::setCommandEcho ( bool  on_off)
inline

Definition at line 365 of file CMD_Manager.h.

void CMD_Manager::setCommandEchoCallback ( CMD_CommandEchoCallback  callback,
void userdata 
)

Install a callback that gets run after every command is echoed, if echoing is turned on. Your callback may never keep a pointer to the data that is passed in.

void CMD_Manager::setContext ( )
overridevirtual

Reimplemented from CH_Manager.

void CMD_Manager::setContinueLevel ( int  level)
inline

Definition at line 345 of file CMD_Manager.h.

int CMD_Manager::setHistoryCapture ( int  onOff)
inline

Toggle to enable/disable recording of commands in the history buffer. The previous value of the toggle is returned.

Definition at line 182 of file CMD_Manager.h.

void CMD_Manager::setIORedirection ( int  on_off)
void CMD_Manager::setIsLoadingGlobalVariables ( bool  onoff)
inline

Say that we're loading the global variables from a hip file or that we're done loading them.

Definition at line 323 of file CMD_Manager.h.

void CMD_Manager::setJob ( const char *  path)

Convenience method to set the JOB variable.

bool CMD_Manager::setMotName ( const char *  path,
bool  dovarchange 
)

Sets the current hip file name, which also sets the HIP and HIPFILE variables. Returns true if HIP was changed by this call.

CMD_PostCmdCallback CMD_Manager::setPostCmdCallback ( CMD_PostCmdCallback  callback,
void userdata 
)

Install a callback that gets executed after every command. 'userdata' is passed on each call to the callback. Returns the previous installed post command callback.

void CMD_Manager::setPrompt ( const char *  prompt)
void CMD_Manager::setSafeMode ( int  safe_mode)
std::ostream* CMD_Manager::setStandardErr ( std::ostream &  os)
std::ostream* CMD_Manager::setStandardOut ( std::ostream &  os)

These two return pointers to their previous streams so that you can restore them if you need to:

void CMD_Manager::setStatusCode ( int  status_code)
inline

Sets the status code. Use a non-zero value to indicate the last command failed.

Definition at line 393 of file CMD_Manager.h.

static void CMD_Manager::setUpdatePythonEnvironmentVariables ( bool  b)
static

Prevent python os.environ from being update when setting Houdini global variables.

void CMD_Manager::setVariable ( const char *  name,
const char *  value,
int  local,
int  uplevel = 0 
)

Sets a value for the named variable, creating it if necessary. Set 'local' to 0 if the value should be exported.

void CMD_Manager::setVariableChangeNotifier ( CMD_VariableChangeNotifier notifier)
inline

Register a variable change notification center object.

Definition at line 331 of file CMD_Manager.h.

void CMD_Manager::setVerbose ( int  on_off)
void CMD_Manager::streamDeleted ( std::ostream &  os)

Call this if you are deleting a stream that was previously used in a call to setStandard[Out|Err].

bool CMD_Manager::uninstallCommand ( const char *  name)

Uninstall a command from the command list - this replaces it with the previous version of the command. The method returns false if there was no such command.

void CMD_Manager::unsetVariable ( const char *  name)

Removes the named variable.

Friends And Related Function Documentation

friend class cmd_Execute
friend

Definition at line 490 of file CMD_Manager.h.

friend class cmd_SendInput
friend

Definition at line 488 of file CMD_Manager.h.

friend class cmd_SendMultiLineInput
friend

Definition at line 489 of file CMD_Manager.h.


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