HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_Director.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP Library (C++)
7  *
8  * COMMENTS:
9  * The OP_Director class is a collection (network) of managers.
10  * The Managers register themselves with an active OP_Director
11  * when they are created. The active OP_Director is obtained
12  * via the global function (yuch) OPgetDirector().
13  *
14  */
15 
16 #ifndef __OP_Director_h__
17 #define __OP_Director_h__
18 
19 #include "OP_API.h"
20 #include "OP_CommandManager.h"
21 #include "OP_Network.h"
22 #include "OP_Node.h"
23 #include "OP_OTLManager.h"
24 #include "OP_OperatorTable.h"
25 #include "OP_ConnectorId.h"
26 #include <CH/CH_Manager.h>
27 #include <UT/UT_ColorTable.h>
28 #include <UT/UT_IntArray.h>
29 #include <UT/UT_NonCopyable.h>
30 #include <UT/UT_Thread.h>
32 #include <UT/UT_Tuple.h>
33 #include <UT/UT_ValArray.h>
34 #include <SYS/SYS_Types.h>
35 #include <iosfwd>
36 
37 #define OP_POSTLOAD_SCRIPT "456.cmd"
38 
39 class UT_WorkArgs;
40 class UT_WorkBuffer;
41 class UT_Args;
42 class OP_SaveCallback;
43 class OP_Input;
44 class OP_ExprFunc;
45 class op_ShopClerkInfo;
46 class OP_BundleList;
47 class OP_StyleManager;
48 class OP_Take;
49 class OP_FileResolver;
50 class OP_GlobContext;
52 class PRM_ScriptPage;
53 class UT_Obfuscator;
54 class OP_EventScriptPathCache;
55 
57  void *data, void *cbdata);
59 
61 {
62 public:
63  enum EventType
64  {
74  };
75  typedef void (*EventCallback)(EventType type, void *);
76  typedef OP_ERROR (*SaveCallback)(std::ostream &, void *);
77 
78 public:
80  virtual ~OP_Director();
81 
82  virtual OP_OpTypeId getOpTypeID() const { return DIR_OPTYPE_ID; }
83  virtual const char *getOpType() const { return DIR_OPTYPE_NAME; }
84  virtual OP_DataType getCookedDataType() const { return OP_NO_DATA; }
85  virtual void *getCookedData(OP_Context &) { return 0; }
86  virtual void deleteCookedData() { }
87  virtual int saveCookedData(std::ostream &, OP_Context &,
88  int = 0) { return 1; }
89  virtual bool loadCookedData(UT_IStream &, const char * /*data*/=0)
90  { return true; }
91  virtual int saveCookedData(const char *,
92  OP_Context &) { return 1; }
93  virtual OP_OpTypeId getChildTypeID() const { return MGR_OPTYPE_ID; }
94  virtual const char *getChildType() const { return MGR_OPTYPE_NAME; }
95 
96  OP_Network *getManager(const char *name) const;
97  CH_Manager *getChannelManager() { return &myCommandManager; }
98  OP_CommandManager *getCommandManager() { return &myCommandManager; }
99  fpreal32 getVersion() const { return myVersion; }
100 
101  // NB: clearNetwork() will always reload the channel manager options!
102  // However, the user is responsible as to when we save them
103  bool loadChannelManagerOptions();
104  bool saveChannelManagerOptions();
105 
106  virtual void enable(int state);
107 
108  OP_ERROR saveNetwork(std::ostream &os,
109  const OP_SaveFlags &options);
110  bool loadNetwork(UT_IStream &is, int merge=0,
111  const char *mergePattern=0,
112  int overwrite=0);
113  void initializeManagerWireStyles();
114  virtual void clearNetwork( int clear_aliases );
115 
116  // This will go through the entire hip file and cook all the CHOPs
117  // that have their export flags set and cook them with CookOverride
118  // turned on.
119  virtual void opUpdateAllExports();
120 
122  { myOldCHOPOverrideFlag = true; }
124  { return myOldCHOPOverrideFlag; }
126  { myOldCHOPOverrideFlag = false; }
127 
128  /// Create an evaluation context scope with a new node
129  class CwdScope;
130 
132  { return getCwd(SYSgetSTID()); }
133  void getCwd(UT_String &str)
134  { getCwd(SYSgetSTID(), str); }
135 
136  OP_Node *getCwd(int thread);
137  void getCwd(int thread, UT_String &str);
138  void setCwd(int thread, const OP_Node *node,
139  int eval_collection=-1);
140 
141  // pushCwd() pushes the current cwd onto a stack that can later be restored
142  // using popCwd(). The optional new_cwd parameter sets the cwd to it at
143  // the same time.
144  void pushCwd(int thread, const OP_Node *new_cwd = NULL);
145  void popCwd(int thread);
146 
147  int getCwdStackSize(int thread) const
148  {
149  return myCwdContext.getValueForThread(thread)
150  .myCwdStack.size();
151  }
152 
153  void setEditNetworkUI(OP_Network *net);
154 
155  bool getPickedNodes(OP_NodeList &picked_nodes,
156  bool include_hidden=false,
157  bool append_to_list=false) const;
158  bool getPickedItems(OP_NetworkBoxItemList &picked_items,
159  bool include_hidden=false) const;
160  bool getPickedInputs(
161  UT_Array<OP_Input *> &picked_inputs) const;
162  OP_Node *getLastPickedNode(OP_Node *parent = NULL) const;
163  const OP_ItemIdList &getPickedItemIds() const;
164 
165  void clearPickedItems();
166 
167  // Pick the given item, clearing all other picked items first. This is here
168  // so that we can prevent an extra undo if the current state already
169  // matches what we want.
170  void makeOnlyPickedCurrent(OP_NetworkBoxItem &item);
171 
172  // These next 3 methods should only be called from OP_Node::setPicked()
173  // The myPickedItems array can't contain duplicates and maintains the
174  // invariant that:
175  // - node.getPicked() is TRUE iff it is in the list.
176  // - node.getPicked() is FALSE implies that it is NOT in the list.
177  void addPickedNode(const OP_Node &node, bool edit);
178  void removePickedNode(const OP_Node &node, bool edit);
179  void makePickedNodeLast(const OP_Node &node, bool edit);
180 
181  // These methods should only be called from the various
182  // setPicked() functions in OP_NetworkBoxItem subclasses. The
183  // myPickedXXXIds arrays can't contain duplicates and maintain the
184  // invariant that:
185  // - item.getPicked() is TRUE iff it is in the list.
186  // - item.getPicked() is FALSE implies that it is NOT in the list.
187  void addPickedItem(const OP_NetworkBoxItem &item);
188  void removePickedItem(const OP_NetworkBoxItem &item);
189  void itemBeingDeleted(const OP_NetworkBoxItem &item);
190 
191  // These methods should only be called from OP_Input::setPicked(). The
192  // myPickedXXXIds arrays can't contain duplicates and maintain the
193  // invariant that:
194  // - input.getPicked() is TRUE iff it is in the list.
195  // - input.getPicked() is FALSE implies that it is NOT in the list.
196  void addPickedInput(const OP_Input &input);
197  void removePickedInput(const OP_Input &input);
198 
199  // Control time.
200  void setTime(fpreal time);
201  fpreal getTime() const;
202  void setFPS(fpreal fps);
203  void setNFrames(fpreal nframes);
204  void setTimeRange(fpreal tstart, fpreal tend);
205 
206  /// The save callback is called when saving .hip files. It is called with
207  /// a stream reference to the .hip file so that the callback can insert
208  /// hscript commands into the .hip file's .application section. When a
209  /// .hip file is loaded, all the commands in the .application section are
210  /// executed.
211  // @{
212  void setSaveCallback(SaveCallback cb, void *cb_data);
213  void removeSaveCallback(SaveCallback cb, void *cb_data);
214 
215  /// Callbacks for certain global OP_Director events, such as new scene
216  /// and load scene.
217  void addEventCallback(EventType type, EventCallback cb,
218  void *data);
219  void removeEventCallback(EventType type, EventCallback cb);
220  // @}
221 
222  void setUserDisplayOptionSaveCallback(
223  OP_ERROR (*cb)(std::ostream &, void *),
224  void *callbackData);
225  void setSceneFileVisualizersSaveCallback(
226  OP_ERROR (*cb)(std::ostream &, void *),
227  void *callbackData);
228  void addBadLoadData(char *str, int len);
229 
230  int isLoading() const { return (myInLoadCount > 0); }
231  virtual void beginLoading();
232  virtual void endLoading();
233  bool getIsLoadingHip() const
234  { return myIsLoadingHip; }
235  bool getIsQuitting() const
236  { return myIsQuitting; }
238  { myIsDoingExplicitSave = value; }
240  { return myIsDoingExplicitSave; }
241  bool getIsAnyNodeCooking() const;
242 
243  bool getIsMantra() const
244  { return myIsMantra; }
245  void setIsMantra(bool v)
246  { myIsMantra = v; }
247 
248  void destroyFileResolver();
249 
250  void beginTakeSwitch();
251  void endTakeSwitch();
252  bool isSwitchingTake() const
253  { return mySwitchingTake; }
254 
255  virtual int renameNode(OP_Node *, const char *,
257 
258  // These methods are only called by the network load/save
259  void saveChannelGroups(std::ostream &os, int binary);
260  bool loadChannelGroups(UT_IStream &is, const char *path);
261  void saveTimeGroups(std::ostream &os, int binary);
262  bool loadTimeGroups(UT_IStream &is, const char *path);
263  void saveScriptedOpLibrary(std::ostream &os);
264  bool loadScriptedOpLibrary(UT_IStream &is, int modtime);
265  bool loadScriptedOpDefs(UT_IStream &is);
266  void saveInternalOpLibraries(std::ostream &os);
267  bool loadInternalOpLibraries(UT_IStream &is);
268  void saveLibraryPreferences(std::ostream &os);
269  bool loadLibraryPreferences(UT_IStream &is);
270  bool loadHOMSessionModuleSource(UT_IStream &is);
271  void saveUnselectedFilePatterns(std::ostream &os);
272  bool loadUnselectedFilePatterns(UT_IStream &is);
273 
274  void saveOTLBackupInformation(std::ostream &os);
275 
276  OP_ExprFunc *getExprFunctions();
277  void saveExprFunctions(std::ostream &os);
278  bool loadExprFunctions(UT_IStream &is, const char *path);
279 
280  OP_BundleList *getBundles() { return myBundles; }
281 
282  // These track the current update mode: Should an OP recook?
283  int cookEnabled() const
284  { return myCookEnabled; }
285  void setCookEnabled(int state)
286  { myCookEnabled = state; }
287 
288  // These track the simulation update mode: Should simulations cook?
289  int simulationEnabled() const
290  { return mySimulationEnabled; }
291  void setSimulationEnabled(int state)
292  { mySimulationEnabled = state; }
293 
294  // These control whether those simulations reset by output drivers should
295  // reset based on the global or playback playbar range.
297  { return mySkipPlaybarBasedSimulationReset > 0; }
299  { mySkipPlaybarBasedSimulationReset += inc; }
300 
301  // These methods are used by SHOPs to keep track of visible clerks.
302  bool addShopClerk(const char *type);
303  int getNShopClerks() const
304  { return myShopInfo.entries(); }
305  const char *getShopClerkName(int clerk) const;
306  int getShopClerkVisibility(int clerk) const;
307  void setShopClerkVisibility(int clerk, int onoff);
308  bool isCompiledLibrary (OP_OTLLibrary *lib);
309 
310  // This function does nothing at this level, but it is meant to be
311  // overridden to create new OP_OperatorInfos for the given table based
312  // on the existance of VOP networks.
314  const char * /* indexPath */,
315  OP_OTLDefinitionArray & /* defs */)
316  { }
318  const char * /* definitionOp */,
319  OP_Operator * /* op */)
320  { return 0; }
322  OP_Node * /* definitionOp */,
323  UT_String & /* definition */)
324  { }
325  virtual void updateExportedParms(
326  OP_Node * /* definitionOp */)
327  { }
328  // Save the spare parameters section for the specified node. We have
329  // to do this through a virtual function that is actually implemented
330  // in the MOT library because it requires the PI_EditScriptedParms
331  // class.
333  bool,
334  std::ostream &) const
335  { return UT_ERROR_NONE; }
336  // Load the spare parms section for a node. Although it doesn't require
337  // the PI library, this function is also implemented in the MOT library
338  // just to keep the save and load code paths in a similar location.
340  UT_IStream &,
341  UT_String &) const
342  { return true; }
343  // Adds a single spare parm to the specified node. This function exists
344  // for backward compatibility with spare parms from H8. This function is
345  // implemented in the MOT library where we have access to the PI classes
346  // for editing parms (PI_EditScriptedParms).
347  virtual bool addNodeSpareParm(OP_Parameters * /*node*/,
348  PRM_Template * /*parmtemplate*/) const
349  { return false; }
350  // Removes a single spare parm to the specified node. This function exists
351  // for backward compatibility with spare parms from H8. This function is
352  // implemented in the MOT library where we have access to the PI classes
353  // for editing parms (PI_EditScriptedParms).
354  virtual bool removeNodeSpareParm(OP_Parameters * /*node*/,
355  const char * /*parmname*/,
356  UT_StringArray * /*errs*/ = NULL,
357  UT_StringArray * /*warn*/ = NULL
358  ) const
359  { return false; }
360  // Updates the spare parms of a node to match the supplied
361  // PI_EditScriptedParms. This class isn't defined until the PI
362  // library, so this function is actually implemented in MOT_Director.
365  UT_String &) const
366  { }
367  // Save a series of hscript commands to a stream to replicate the
368  // spare parameters of the specified node.
370  std::ostream &,
371  const char *,
372  bool) const
373  { }
374  // Delete spare parameter/base parameter mixing layout. This puts the
375  // spare parameters on their own page.
377  { }
378  // Delete all spare parameters on a node.
380  { }
381 
383  { return 0; }
384 
385  // Functions for saving and loading compiled VEX and RSL code for nodes
386  // with VOP_CodeGenerators in a compiled hip file.
387  virtual void saveNodeCompiledCode(OP_Node *, std::ostream &,
388  bool is_source_code = false)
389  { }
391  bool is_source_code = false)
392  { return true; }
393  virtual void saveNodeCompiledDs(OP_Node *, std::ostream &)
394  { }
396  { return true; }
397 
398  OP_Take *getTakeManager() { return myTakeManager; }
399  OP_StyleManager *getStyleManager() { return myStyleManager; }
400  UT_ColorTable &getGroupColorTable() { return myGroupColorTable; }
401 
402  // deprecated method: interest gets cleared out before every cook
403  virtual void addExtraInput(OP_Node *op, OP_InterestType type);
404 
405  // A utility function to glob (pattern expand) all arguments on a command
406  // line.
407  static int globAllArguments(OP_Node *node, UT_Args &args,
408  UT_WorkBuffer &workbuf,
409  UT_WorkArgs &argv,
410  OP_ItemTypeMask item_type,
412  int startitem = 1);
413 
414  // This function is similar to the one above, except it takes a string
415  // pattern (which may contain spaces) and returns an array of matching
416  // nodes and/or netboxes.
417  static void globAllArgumentsAsArray(OP_Node &relative_to_node,
418  const char *pattern,
419  OP_ItemTypeMask item_type,
420  OP_GlobContext &glob_context,
422 
423  // These functions are the instantiations of the virtual functions
424  // from our OP_OTLManagerSink base class.
425  virtual void definitionsAdded(int libindex,
426  UT_IntArray &defindex);
427  virtual void definitionsRemoved(int libindex,
428  UT_IntArray &defindex,
430 
431  // Given a path of the form "tablename/opname", return the table and
432  // operator indicated by the path. The relativetonode parm is used when
433  // the path is actualy a node path, and we want the table and operator
434  // of the node specified by the path. If it is a relative path, the
435  // relativetonode is the starting point. If it is null, the current
436  // working node is used, or the director.
437  void getTableAndOperator(const char *path,
439  OP_Operator *&op,
440  const OP_Node *relativetonode = 0);
442  { return myOTLManager; }
444  { return myOTLManager; }
445 
446  // This function should be called right before exiting. It will go
447  // through all OP_Operators with active nodes and run the POSTLASTDELETE
448  // event script (though it doesn't actually delete the nodes).
449  void runDeleteScriptsOnQuit();
450 
451  // Add or remove callback functions that get executed whenever we call
452  // OP_Node::opChanged.
453  void addGlobalOpChangedCallback(
454  OP_GlobalOpChangedCallback cb, void *cbdata);
455  void removeGlobalOpChangedCallback(
456  OP_GlobalOpChangedCallback cb, void *cbdata);
457  // This function is called any time OP_Node::opChanged is called. It sends
458  // the change information along to any global op change callback functions
459  // that have been registered by addGlobalOpChangeCallback.
460  void globalOpChanged(OP_Node *node,
461  OP_EventType reason,
462  void *data);
463 
464  // This function creates a backup of the specified file, if the option
465  // to save backup files is turned on. The actual file name and file type
466  // are irrelevent. It returns true if the backup was successful (or was
467  // not required).
468  static bool createBackupFile(const char *filename,
469  bool domove= false);
470  // This function will rename the current file "filename" to the next
471  // filename in the sequence to free up "filename" so that it can be
472  // saved over.
473  static void autoIncrementRename(const char *filename,
474  UT_String &errorstring,
475  bool movefile,
476  bool autosave);
477 
478  void runScript(CMD_Manager *cman, const char *filename);
479  UT_Tuple<bool, int> runPython(CMD_Manager *cman, const char *filename);
480  UT_Tuple<bool, int> runPython(CMD_Manager *cman, int argc,
481  char *argv[]);
482  UT_Tuple<bool, int> runDefaultStartupScripts(CMD_Manager *cman,
483  const char *startup_script,
484  const char *postload_script);
485 
486  // Get the global (i.e. non-operator specific) script path cache.
487  OP_EventScriptPathCache *getGlobalEventScriptPathCache()
488  { return myGlobalEventScriptPathCache; }
489 
490  // Clear all cached paths to global event scripts.
491  void clearGlobalEventScriptPathCache();
492 
493  // Query all cached global event script paths.
494  void getCachedGlobalEventScriptPaths(
495  UT_StringArray &events,
497  bool only_nonempty) const;
498 
499  // Because of code complexity issues, this method must be used to destruct
500  // an OP_Director.
501  static void destroyDirector(OP_Director *opdir);
502 
503  bool getSaveSceneAsText() const;
504  void setSaveSceneAsText(bool onOff);
505  bool getNewFileSaveSceneAsText() const;
506  void setNewFileSaveSceneAsText(bool onOff);
507 
508  /// Run callbacks for before saving a scene,
509  /// 'autosave' indicates if the save was triggered by the autosave timer.
510  void notifyBeforeSceneSave(
511  const UT_StringHolder &filename,
512  bool autosave);
513  /// Run callbacks for before saving a scene,
514  /// 'autosave' indicates if the save was triggered by the autosave timer.
515  /// 'did_succeed' indicates if the save was successful.
516  void notifyAfterSceneSave(
517  const UT_StringHolder &filename,
518  bool autosave,
519  bool did_succeed);
520 
521  static UT_Obfuscator *getObfuscator();
522 
523 protected:
524  virtual OP_ERROR cookMe(OP_Context &) { return UT_ERROR_NONE; }
525  virtual OP_ERROR bypassMe(OP_Context &, int &) { return UT_ERROR_NONE; }
526  virtual const char *getFileExtension(int binary) const
527  { return binary ? ".bhip" : ".hip"; }
528  void clearUnsupportedCommands() const;
529 
530  // This function is called when we update our OTL for an operator. It
531  // does nothing at this level, but in MOT it will clear out the PI
532  // settings that have been saved for the specified operator type.
533  virtual void clearHandleSettings(OP_Operator *) { }
534 
535  // We don't allow spare parms on the director, so just ignore this call.
536  virtual bool changeSpareParms(UT_IStream &, UT_String &errors)
537  {
538  errors += "Spare parameters are not alowed on ";
539  errors += "the root node.";
540  return false;
541  }
542 
543  /// Runs the user-defined post load script when loading
544  /// a new network into Houdini.
545  void runPostLoadScript();
546 
547 private:
548  // Disallow copying of OP_Director, these methods are not implemented
549  // on purpose
550  OP_Director(const OP_Director &copy);
552 
553  void installCommands();
554  void installMoreCommands();
555  void installCHCommands();
556  void installOTLCommands();
557  void installOpRampResolver();
558 
559  void savePreCommands(std::ostream &os);
560  void savePostCommands(std::ostream &os);
561 
562  void notifyEventCallbacks(EventType type);
563 
564  /// Helper function to update to a new operator definition. May delete
565  /// the old operator and return a different one.
566  void updateNewDefinition(
567  OP_Operator *&op,
568  OP_OTLLibrary *newlib,
569  int newdefindex);
570 
571  /// Helper function for runDefaultStartupScripts().
572  /// Pass back the full path of the first startup script file
573  /// found in the Houdini path.
574  static void getFirstFoundStartupScriptFile(
575  UT_StringHolder &script_path,
576  const char *script_file_name);
577 
578  /// Helper function for runDefaultStartupScripts().
579  /// Passes back the full path of the first finding of inputpath
580  /// in the script search directories. The file name of outputpath
581  /// may end in any of the acceptable script file extensions
582  /// (i.e. .py or .cmd).
583  static void getFirstFoundScriptFile(
584  UT_StringHolder &outputpath,
585  const char *inputpath);
586 
587  static void sceneSaveEvent(EventType event, UT_Args &args);
588 
589 private:
590  char *myBadLoadData;
591  int myBadLoadDataLen;
592  OP_CommandManager myCommandManager;
593  fpreal32 myVersion;
594  int myInLoadCount;
595 
596  struct CwdContext
597  {
598  CwdContext() : myCwdId(-1)
599  {
600  }
601  int myCwdId;
602  UT_IntArray myCwdStack;
603  UT_IntArray myEvalCollectionStack;
604  };
606 
607  OP_ItemIdList myPickedItems;
609 
610  OP_SaveCallback *myCallbacks;
611  OP_SaveCallback *myUserDisplayOptionCallback;
612  OP_SaveCallback *mySceneFileVisualizersCallback;
613  OP_BundleList *myBundles;
614  OP_Take *myTakeManager;
615  OP_StyleManager *myStyleManager;
616  OP_FileResolver *myFileResolver;
617  UT_ColorTable myGroupColorTable;
618 
619  int myCookEnabled;
620  int mySimulationEnabled;
621  int mySkipPlaybarBasedSimulationReset;
623 
624  OP_OTLManager myOTLManager;
625  OP_OperatorTableList myTablesToReload;
626  UT_StringSet *myDummyDefinitionActivations;
627 
628  OP_GlobalOpChangedCallbacks myGlobalOpChangedCallbacks;
629  UT_ValArray<void *> myGlobalOpChangedCallbackData;
630 
631  struct EventCallbackInfo
632  {
633  EventCallback cb;
634  void *data;
635  };
636  typedef UT_Map<EventCallback, void *> EventCallbackInfoMap;
637  typedef UT_Map<EventType, EventCallbackInfoMap> EventCallbackMap;
638  EventCallbackMap myEventCallbacks;
639 
640  // Cache of global (i.e. non-operator specific) event script paths.
641  OP_EventScriptPathCache *myGlobalEventScriptPathCache;
642 
643  // This flag tracks whether any OPs that got loaded had the old
644  // style override flag. If so, we know we will have to do a complete
645  // update.
646  bool myOldCHOPOverrideFlag;
647  // This flag tracs whether or not we are inside a call to loadNetwork.
648  // This is different from the isLoading flag, which gets set during any
649  // network load.
650  bool myIsLoadingHip;
651  bool mySwitchingTake;
652  // This value is temporarily set to true when the user explicitly asks
653  // for a hip file save either by executing an mwrite, or choosing Save
654  // or Save As from the File menu.
655  bool myIsDoingExplicitSave;
656  // This flag is set to true while Houdini is exiting.
657  bool myIsQuitting;
658 
659  // This flag is set when the OP director is created for mantra. There are
660  // some OP features which are expensive (i.e. importing the hou python
661  // module). This option disables those features.
662  bool myIsMantra;
663 
664  bool mySaveSceneAsText;
665  bool myNewFileSaveSceneAsText;
666 
667  static UT_Obfuscator *theObfuscator;
668 };
669 
672 
673 /// Create an evaluation context scope with a new node
674 class OP_API OP_Director::CwdScope : UT_NonCopyable
675 {
676 public:
677  CwdScope(int thread, const OP_Node &new_cwd);
678  ~CwdScope();
679 private:
680  int myThread;
681  CH_EvalContext::Scope myEvalScope;
682  int myOldCwdId;
683 };
684 
685 #endif
virtual bool addNodeSpareParm(OP_Parameters *, PRM_Template *) const
Definition: OP_Director.h:347
bool loadNetwork(UT_IStream &is, int merge=0, const char *pattern=NULL, int overwrite=0, const OP_FixNameParms *fix_name_parms=NULL, UT_StringArray *src_names=NULL, UT_StringArray *dest_names=NULL)
UT_ErrorSeverity OP_ERROR
Definition: OP_Error.h:6
virtual const char * getOpType() const
Definition: OP_Director.h:83
UT_ValArray< OP_GlobalOpChangedCallback > OP_GlobalOpChangedCallbacks
Definition: OP_Director.h:58
GLenum GLenum GLenum input
Definition: glew.h:13879
GLuint GLsizei const void GLenum preserve
Definition: glew.h:8474
GT_API const UT_StringHolder filename
GLuint const GLchar * name
Definition: glew.h:1814
OP_StyleManager * getStyleManager()
Definition: OP_Director.h:399
void setIsDoingExplicitSave(bool value)
Definition: OP_Director.h:237
Unsorted map container.
Definition: UT_Map.h:83
OP_API OP_Director * OPsetDirector(OP_Director *boss)
const Args & args
Definition: printf.h:628
GT_API const UT_StringHolder time
UT_ColorTable & getGroupColorTable()
Definition: OP_Director.h:400
bool isSwitchingTake() const
Definition: OP_Director.h:252
bool getIsMantra() const
Definition: OP_Director.h:243
void setOldCHOPOverrideFlag()
Definition: OP_Director.h:121
bool getOldCHOPOverrideFlag()
Definition: OP_Director.h:123
GLenum GLsizei GLenum GLenum const void * table
Definition: glew.h:4940
virtual void findInternalScriptOperators(const char *, OP_OTLDefinitionArray &)
Definition: OP_Director.h:313
virtual bool loadNodeSpareParms(OP_Parameters *, UT_IStream &, UT_String &) const
Definition: OP_Director.h:339
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual void definitionsRemoved(int, UT_IntArray &, OP_OTLLibrary *&)
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
OP_EventScriptPathCache * getGlobalEventScriptPathCache()
Definition: OP_Director.h:487
OP_BundleList * getBundles()
Definition: OP_Director.h:280
const GLdouble * v
Definition: glew.h:1391
virtual int renameNode(OP_Node *node, const char *name, OP_RenameAction action=OP_RENAME_NORMAL)
virtual void clearHandleSettings(OP_Operator *)
Definition: OP_Director.h:533
virtual void deleteAllNodeSpareParms(OP_Parameters *) const
Definition: OP_Director.h:379
static void saveOTLBackupInformation(std::ostream &os, const OP_OperatorList &fallbackops, const OP_OperatorList &dummyops)
CH_Manager * getChannelManager()
Definition: OP_Director.h:97
virtual OP_ERROR cookMe(OP_Context &)
Definition: OP_Director.h:524
OP_OTLManager & getOTLManager()
Definition: OP_Director.h:441
virtual OP_OpTypeId getChildTypeID() const
Definition: OP_Director.h:93
virtual void updateExportedParms(OP_Node *)
Definition: OP_Director.h:325
virtual const char * getFileExtension(int binary) const
Definition: OP_Director.h:526
friend class OP_Director
Definition: OP_Network.h:1050
virtual bool loadNodeCompiledDs(OP_Node *, UT_IStream &)
Definition: OP_Director.h:395
virtual bool loadNodeCompiledCode(OP_Node *, UT_IStream &, bool is_source_code=false)
Definition: OP_Director.h:390
OP_InterestType
Definition: OP_DataTypes.h:45
int getCwdStackSize(int thread) const
Definition: OP_Director.h:147
int cookEnabled() const
Definition: OP_Director.h:283
bool getIsDoingExplicitSave() const
Definition: OP_Director.h:239
void bumpSkipPlaybarBasedSimulationReset(int inc)
Definition: OP_Director.h:298
void clearOldCHOPOverrideFlag()
Definition: OP_Director.h:125
bool getIsQuitting() const
Definition: OP_Director.h:235
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
int getNShopClerks() const
Definition: OP_Director.h:303
const GLuint GLenum const void * binary
Definition: glew.h:3502
int isLoading() const
Definition: OP_Director.h:230
bool getIsLoadingHip() const
Definition: OP_Director.h:233
void
Definition: png.h:1083
void getPickedItems(OP_ItemTypeMask item_type_mask, OP_NetworkBoxItemList &picked, bool include_hidden=false, bool recurse_picked_netboxes=false) const
#define MGR_OPTYPE_NAME
Definition: OP_Node.h:309
OP_Node * getCwd()
Definition: OP_Director.h:131
OP_OpTypeId
Definition: OP_OpTypeId.h:18
*Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
virtual void * getCookedData(OP_Context &)
Definition: OP_Director.h:85
virtual OP_ERROR saveNodeSpareParms(OP_Parameters *, bool, std::ostream &) const
Definition: OP_Director.h:332
virtual bool removeNodeSpareParm(OP_Parameters *, const char *, UT_StringArray *=NULL, UT_StringArray *=NULL) const
Definition: OP_Director.h:354
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
virtual OP_Node * linkInternalScriptOperator(const char *, OP_Operator *)
Definition: OP_Director.h:317
GT_API const UT_StringHolder version
virtual const char * getChildType() const
Definition: OP_Director.h:94
const OP_OTLManager & getOTLManager() const
Definition: OP_Director.h:443
GLsizei const GLchar *const * path
Definition: glew.h:6461
virtual void getInternalScriptDefinition(OP_Node *, UT_String &)
Definition: OP_Director.h:321
virtual void deleteNodeSpareParmLayout(OP_Parameters *) const
Definition: OP_Director.h:376
void setIsMantra(bool v)
Definition: OP_Director.h:245
unsigned int OP_ItemTypeMask
Definition: OP_ItemId.h:43
fpreal32 getVersion() const
Definition: OP_Director.h:99
double fpreal
Definition: SYS_Types.h:276
virtual bool loadCookedData(UT_IStream &, const char *=0)
Definition: OP_Director.h:89
cl_event event
Definition: glew.h:3695
Create an evaluation context scope with a new node.
Definition: OP_Director.h:60
SYS_API int SYSgetSTID()
virtual void addExtraInput(OP_Node *op, OP_InterestType type)
OP_Take * getTakeManager()
Definition: OP_Director.h:398
virtual void saveNodeSpareParmCommands(OP_Parameters *, std::ostream &, const char *, bool) const
Definition: OP_Director.h:369
OP_API OP_Director * OPgetDirector()
#define OP_API
Definition: OP_API.h:10
OIIO_API bool copy(string_view from, string_view to, std::string &err)
virtual void saveNodeCompiledDs(OP_Node *, std::ostream &)
Definition: OP_Director.h:393
virtual int saveCookedData(const char *, OP_Context &)
Definition: OP_Director.h:91
OP_EventType
Definition: OP_Value.h:22
Scope(int thread)
OP_DataType
Definition: OP_DataTypes.h:28
OP_CommandManager * getCommandManager()
Definition: OP_Director.h:98
void getCwd(UT_String &str)
Definition: OP_Director.h:133
GLuint64EXT * result
Definition: glew.h:14007
virtual PRM_ScriptPage * allocateSpareScriptPage(OP_Operator *)
Definition: OP_Director.h:382
virtual OP_DataType getCookedDataType() const
Definition: OP_Director.h:84
virtual OP_OpTypeId getOpTypeID() const
Definition: OP_Director.h:82
void setCookEnabled(int state)
Definition: OP_Director.h:285
virtual OP_ERROR bypassMe(OP_Context &, int &)
Definition: OP_Director.h:525
virtual void definitionsAdded(int, UT_IntArray &)
GLubyte * pattern
Definition: glew.h:5711
virtual void saveNodeCompiledCode(OP_Node *, std::ostream &, bool is_source_code=false)
Definition: OP_Director.h:387
virtual void changeNodeSpareParms(OP_Parameters *, PI_EditScriptedParms &, UT_String &) const
Definition: OP_Director.h:363
int simulationEnabled() const
Definition: OP_Director.h:289
virtual void deleteCookedData()
Definition: OP_Director.h:86
Cooks node data and makes it available through the reader.
virtual int saveCookedData(std::ostream &, OP_Context &, int=0)
Definition: OP_Director.h:87
GLsizei const GLfloat * value
Definition: glew.h:1849
OP_RenameAction
Definition: OP_Network.h:69
float fpreal32
Definition: SYS_Types.h:195
GLboolean enable
Definition: glew.h:2745
virtual bool changeSpareParms(UT_IStream &, UT_String &errors)
Definition: OP_Director.h:536
void setSimulationEnabled(int state)
Definition: OP_Director.h:291
void(* OP_GlobalOpChangedCallback)(OP_Node *node, OP_EventType reason, void *data, void *cbdata)
Definition: OP_Director.h:56
#define DIR_OPTYPE_NAME
Definition: OP_Node.h:310
UT_NonCopyable & operator=(const UT_NonCopyable &)=delete
type
Definition: core.h:528
GLenum GLsizei len
Definition: glew.h:7752
GLenum const void * paths
Definition: glew.h:13589
bool skipPlaybarBasedSimulationReset() const
Definition: OP_Director.h:296