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:
79  OP_Director(const char *name, const fpreal32 version);
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  void setEditNetworkUI(OP_Network *net);
148 
149  bool getPickedNodes(OP_NodeList &picked_nodes,
150  bool include_hidden=false,
151  bool append_to_list=false) const;
152  bool getPickedItems(OP_NetworkBoxItemList &picked_items,
153  bool include_hidden=false) const;
154  bool getPickedInputs(
155  UT_Array<OP_Input *> &picked_inputs) const;
156  OP_Node *getLastPickedNode(OP_Node *parent = NULL) const;
157  const OP_ItemIdList &getPickedItemIds() const;
158 
159  void clearPickedItems();
160 
161  // Pick the given item, clearing all other picked items first. This is here
162  // so that we can prevent an extra undo if the current state already
163  // matches what we want.
164  void makeOnlyPickedCurrent(OP_NetworkBoxItem &item);
165 
166  // These next 3 methods should only be called from OP_Node::setPicked()
167  // The myPickedItems array can't contain duplicates and maintains the
168  // invariant that:
169  // - node.getPicked() is TRUE iff it is in the list.
170  // - node.getPicked() is FALSE implies that it is NOT in the list.
171  void addPickedNode(const OP_Node &node, bool edit);
172  void removePickedNode(const OP_Node &node, bool edit);
173  void makePickedNodeLast(const OP_Node &node, bool edit);
174 
175  // These methods should only be called from the various
176  // setPicked() functions in OP_NetworkBoxItem subclasses. The
177  // myPickedXXXIds arrays can't contain duplicates and maintain the
178  // invariant that:
179  // - item.getPicked() is TRUE iff it is in the list.
180  // - item.getPicked() is FALSE implies that it is NOT in the list.
181  void addPickedItem(const OP_NetworkBoxItem &item);
182  void removePickedItem(const OP_NetworkBoxItem &item);
183  void itemBeingDeleted(const OP_NetworkBoxItem &item);
184 
185  // These methods should only be called from OP_Input::setPicked(). The
186  // myPickedXXXIds arrays can't contain duplicates and maintain the
187  // invariant that:
188  // - input.getPicked() is TRUE iff it is in the list.
189  // - input.getPicked() is FALSE implies that it is NOT in the list.
190  void addPickedInput(const OP_Input &input);
191  void removePickedInput(const OP_Input &input);
192 
193  // Control time.
194  void setTime(fpreal time);
195  fpreal getTime() const;
196  void setFPS(fpreal fps);
197  void setNFrames(fpreal nframes);
198  void setTimeRange(fpreal tstart, fpreal tend);
199 
200  /// The save callback is called when saving .hip files. It is called with
201  /// a stream reference to the .hip file so that the callback can insert
202  /// hscript commands into the .hip file's .application section. When a
203  /// .hip file is loaded, all the commands in the .application section are
204  /// executed.
205  // @{
206  void setSaveCallback(SaveCallback cb, void *cb_data);
207  void removeSaveCallback(SaveCallback cb, void *cb_data);
208 
209  /// Callbacks for certain global OP_Director events, such as new scene
210  /// and load scene.
211  void addEventCallback(EventType type, EventCallback cb,
212  void *data);
213  void removeEventCallback(EventType type, EventCallback cb);
214  // @}
215 
216  void setUserDisplayOptionSaveCallback(
217  OP_ERROR (*cb)(std::ostream &, void *),
218  void *callbackData);
219  void setSceneFileVisualizersSaveCallback(
220  OP_ERROR (*cb)(std::ostream &, void *),
221  void *callbackData);
222  void addBadLoadData(char *str, int len);
223 
224  int isLoading() const { return (myInLoadCount > 0); }
225  virtual void beginLoading();
226  virtual void endLoading();
227  bool getIsLoadingHip() const
228  { return myIsLoadingHip; }
229  bool getIsQuitting() const
230  { return myIsQuitting; }
232  { myIsDoingExplicitSave = value; }
234  { return myIsDoingExplicitSave; }
235  bool getIsAnyNodeCooking() const;
236 
237  bool getIsMantra() const
238  { return myIsMantra; }
239  void setIsMantra(bool v)
240  { myIsMantra = v; }
241 
242  void destroyFileResolver();
243 
244  void beginTakeSwitch();
245  void endTakeSwitch();
246  bool isSwitchingTake() const
247  { return mySwitchingTake; }
248 
249  virtual int renameNode(OP_Node *, const char *,
251 
252  // These methods are only called by the network load/save
253  void saveChannelGroups(std::ostream &os, int binary);
254  bool loadChannelGroups(UT_IStream &is, const char *path);
255  void saveTimeGroups(std::ostream &os, int binary);
256  bool loadTimeGroups(UT_IStream &is, const char *path);
257  void saveScriptedOpLibrary(std::ostream &os);
258  bool loadScriptedOpLibrary(UT_IStream &is, int modtime);
259  bool loadScriptedOpDefs(UT_IStream &is);
260  void saveInternalOpLibraries(std::ostream &os);
261  bool loadInternalOpLibraries(UT_IStream &is);
262  void saveLibraryPreferences(std::ostream &os);
263  bool loadLibraryPreferences(UT_IStream &is);
264  bool loadHOMSessionModuleSource(UT_IStream &is);
265  void saveUnselectedFilePatterns(std::ostream &os);
266  bool loadUnselectedFilePatterns(UT_IStream &is);
267 
268  void saveOTLBackupInformation(std::ostream &os);
269 
270  OP_ExprFunc *getExprFunctions();
271  void saveExprFunctions(std::ostream &os);
272  bool loadExprFunctions(UT_IStream &is, const char *path);
273 
274  OP_BundleList *getBundles() { return myBundles; }
275 
276  // These track the current update mode: Should an OP recook?
277  int cookEnabled() const
278  { return myCookEnabled; }
279  void setCookEnabled(int state)
280  { myCookEnabled = state; }
281 
282  // These track the simulation update mode: Should simulations cook?
283  int simulationEnabled() const
284  { return mySimulationEnabled; }
285  void setSimulationEnabled(int state)
286  { mySimulationEnabled = state; }
287 
288  // These control whether those simulations reset by output drivers should
289  // reset based on the global or playback playbar range.
291  { return mySkipPlaybarBasedSimulationReset > 0; }
293  { mySkipPlaybarBasedSimulationReset += inc; }
294 
295  // These methods are used by SHOPs to keep track of visible clerks.
296  bool addShopClerk(const char *type);
297  int getNShopClerks() const
298  { return myShopInfo.entries(); }
299  const char *getShopClerkName(int clerk) const;
300  int getShopClerkVisibility(int clerk) const;
301  void setShopClerkVisibility(int clerk, int onoff);
302  bool isCompiledLibrary (OP_OTLLibrary *lib);
303 
304  // This function does nothing at this level, but it is meant to be
305  // overridden to create new OP_OperatorInfos for the given table based
306  // on the existance of VOP networks.
308  const char * /* indexPath */,
309  OP_OTLDefinitionArray & /* defs */)
310  { }
312  const char * /* definitionOp */,
313  OP_Operator * /* op */)
314  { return 0; }
316  OP_Node * /* definitionOp */,
317  UT_String & /* definition */)
318  { }
319  virtual void updateExportedParms(
320  OP_Node * /* definitionOp */)
321  { }
322  // Save the spare parameters section for the specified node. We have
323  // to do this through a virtual function that is actually implemented
324  // in the MOT library because it requires the PI_EditScriptedParms
325  // class.
327  bool,
328  std::ostream &) const
329  { return UT_ERROR_NONE; }
330  // Load the spare parms section for a node. Although it doesn't require
331  // the PI library, this function is also implemented in the MOT library
332  // just to keep the save and load code paths in a similar location.
334  UT_IStream &,
335  UT_String &) const
336  { return true; }
337  // Adds a single spare parm to the specified node. This function exists
338  // for backward compatibility with spare parms from H8. This function is
339  // implemented in the MOT library where we have access to the PI classes
340  // for editing parms (PI_EditScriptedParms).
341  virtual bool addNodeSpareParm(OP_Parameters * /*node*/,
342  PRM_Template * /*parmtemplate*/) const
343  { return false; }
344  // Removes a single spare parm to the specified node. This function exists
345  // for backward compatibility with spare parms from H8. This function is
346  // implemented in the MOT library where we have access to the PI classes
347  // for editing parms (PI_EditScriptedParms).
348  virtual bool removeNodeSpareParm(OP_Parameters * /*node*/,
349  const char * /*parmname*/,
350  UT_StringArray * /*errs*/ = NULL,
351  UT_StringArray * /*warn*/ = NULL
352  ) const
353  { return false; }
354  // Updates the spare parms of a node to match the supplied
355  // PI_EditScriptedParms. This class isn't defined until the PI
356  // library, so this function is actually implemented in MOT_Director.
359  UT_String &) const
360  { }
361  // Save a series of hscript commands to a stream to replicate the
362  // spare parameters of the specified node.
364  std::ostream &,
365  const char *,
366  bool) const
367  { }
368  // Delete spare parameter/base parameter mixing layout. This puts the
369  // spare parameters on their own page.
371  { }
372  // Delete all spare parameters on a node.
374  { }
375 
377  { return 0; }
378 
379  // Functions for saving and loading compiled VEX and RSL code for nodes
380  // with VOP_CodeGenerators in a compiled hip file.
381  virtual void saveNodeCompiledCode(OP_Node *, std::ostream &,
382  bool is_source_code = false)
383  { }
385  bool is_source_code = false)
386  { return true; }
387  virtual void saveNodeCompiledDs(OP_Node *, std::ostream &)
388  { }
390  { return true; }
391 
392  OP_Take *getTakeManager() { return myTakeManager; }
393  OP_StyleManager *getStyleManager() { return myStyleManager; }
394  UT_ColorTable &getGroupColorTable() { return myGroupColorTable; }
395 
396  // deprecated method: interest gets cleared out before every cook
397  virtual void addExtraInput(OP_Node *op, OP_InterestType type);
398 
399  // A utility function to glob (pattern expand) all arguments on a command
400  // line.
401  static int globAllArguments(OP_Node *node, UT_Args &args,
402  UT_WorkBuffer &workbuf,
403  UT_WorkArgs &argv,
404  OP_ItemTypeMask item_type,
405  OP_GlobContext *context,
406  int startitem = 1);
407 
408  // This function is similar to the one above, except it takes a string
409  // pattern (which may contain spaces) and returns an array of matching
410  // nodes and/or netboxes.
411  static void globAllArgumentsAsArray(OP_Node &relative_to_node,
412  const char *pattern,
413  OP_ItemTypeMask item_type,
414  OP_GlobContext &glob_context,
416 
417  // These functions are the instantiations of the virtual functions
418  // from our OP_OTLManagerSink base class.
419  virtual void definitionsAdded(int libindex,
420  UT_IntArray &defindex);
421  virtual void definitionsRemoved(int libindex,
422  UT_IntArray &defindex,
423  OP_OTLLibrary *&preserve);
424 
425  // Given a path of the form "tablename/opname", return the table and
426  // operator indicated by the path. The relativetonode parm is used when
427  // the path is actualy a node path, and we want the table and operator
428  // of the node specified by the path. If it is a relative path, the
429  // relativetonode is the starting point. If it is null, the current
430  // working node is used, or the director.
431  void getTableAndOperator(const char *path,
432  OP_OperatorTable *&table,
433  OP_Operator *&op,
434  const OP_Node *relativetonode = 0);
436  { return myOTLManager; }
438  { return myOTLManager; }
439 
440  // This function should be called right before exiting. It will go
441  // through all OP_Operators with active nodes and run the POSTLASTDELETE
442  // event script (though it doesn't actually delete the nodes).
443  void runDeleteScriptsOnQuit();
444 
445  // Add or remove callback functions that get executed whenever we call
446  // OP_Node::opChanged.
447  void addGlobalOpChangedCallback(
448  OP_GlobalOpChangedCallback cb, void *cbdata);
449  void removeGlobalOpChangedCallback(
450  OP_GlobalOpChangedCallback cb, void *cbdata);
451  // This function is called any time OP_Node::opChanged is called. It sends
452  // the change information along to any global op change callback functions
453  // that have been registered by addGlobalOpChangeCallback.
454  void globalOpChanged(OP_Node *node,
455  OP_EventType reason,
456  void *data);
457 
458  // This function creates a backup of the specified file, if the option
459  // to save backup files is turned on. The actual file name and file type
460  // are irrelevent. It returns true if the backup was successful (or was
461  // not required).
462  static bool createBackupFile(const char *filename,
463  bool domove= false);
464  // This function will rename the current file "filename" to the next
465  // filename in the sequence to free up "filename" so that it can be
466  // saved over.
467  static void autoIncrementRename(const char *filename,
468  UT_String &errorstring,
469  bool movefile,
470  bool autosave);
471 
472  void runScript(CMD_Manager *cman, const char *filename);
473  UT_Tuple<bool, int> runPython(CMD_Manager *cman, const char *filename);
474  UT_Tuple<bool, int> runPython(CMD_Manager *cman, int argc,
475  char *argv[]);
476  UT_Tuple<bool, int> runDefaultStartupScripts(CMD_Manager *cman,
477  const char *startup_script,
478  const char *postload_script);
479 
480  // Get the global (i.e. non-operator specific) script path cache.
481  OP_EventScriptPathCache *getGlobalEventScriptPathCache()
482  { return myGlobalEventScriptPathCache; }
483 
484  // Clear all cached paths to global event scripts.
485  void clearGlobalEventScriptPathCache();
486 
487  // Query all cached global event script paths.
488  void getCachedGlobalEventScriptPaths(
489  UT_StringArray &events,
490  UT_StringArray &paths,
491  bool only_nonempty) const;
492 
493  // Because of code complexity issues, this method must be used to destruct
494  // an OP_Director.
495  static void destroyDirector(OP_Director *opdir);
496 
497  bool getSaveSceneAsText() const;
498  void setSaveSceneAsText(bool onOff);
499  bool getNewFileSaveSceneAsText() const;
500  void setNewFileSaveSceneAsText(bool onOff);
501 
502  /// Run callbacks for before saving a scene,
503  /// 'autosave' indicates if the save was triggered by the autosave timer.
504  void notifyBeforeSceneSave(
505  const UT_StringHolder &filename,
506  bool autosave);
507  /// Run callbacks for before saving a scene,
508  /// 'autosave' indicates if the save was triggered by the autosave timer.
509  /// 'did_succeed' indicates if the save was successful.
510  void notifyAfterSceneSave(
511  const UT_StringHolder &filename,
512  bool autosave,
513  bool did_succeed);
514 
515  static UT_Obfuscator *getObfuscator();
516 
517 protected:
518  virtual OP_ERROR cookMe(OP_Context &) { return UT_ERROR_NONE; }
519  virtual OP_ERROR bypassMe(OP_Context &, int &) { return UT_ERROR_NONE; }
520  virtual const char *getFileExtension(int binary) const
521  { return binary ? ".bhip" : ".hip"; }
522  void clearUnsupportedCommands() const;
523 
524  // This function is called when we update our OTL for an operator. It
525  // does nothing at this level, but in MOT it will clear out the PI
526  // settings that have been saved for the specified operator type.
527  virtual void clearHandleSettings(OP_Operator *) { }
528 
529  // We don't allow spare parms on the director, so just ignore this call.
530  virtual bool changeSpareParms(UT_IStream &, UT_String &errors)
531  {
532  errors += "Spare parameters are not alowed on ";
533  errors += "the root node.";
534  return false;
535  }
536 
537  /// Runs the user-defined post load script when loading
538  /// a new network into Houdini.
539  void runPostLoadScript();
540 
541 private:
542  // Disallow copying of OP_Director, these methods are not implemented
543  // on purpose
544  OP_Director(const OP_Director &copy);
545  OP_Director &operator =(const OP_Director &copy);
546 
547  void installCommands();
548  void installMoreCommands();
549  void installCHCommands();
550  void installOTLCommands();
551  void installOpRampResolver();
552 
553  void savePreCommands(std::ostream &os);
554  void savePostCommands(std::ostream &os);
555 
556  void notifyEventCallbacks(EventType type);
557 
558  /// Helper function to update to a new operator definition. May delete
559  /// the old operator and return a different one.
560  void updateNewDefinition(
561  OP_Operator *&op,
562  OP_OTLLibrary *newlib,
563  int newdefindex);
564 
565  /// Helper function for runDefaultStartupScripts().
566  /// Pass back the full path of the first startup script file
567  /// found in the Houdini path.
568  static void getFirstFoundStartupScriptFile(
569  UT_StringHolder &script_path,
570  const char *script_file_name);
571 
572  /// Helper function for runDefaultStartupScripts().
573  /// Passes back the full path of the first finding of inputpath
574  /// in the script search directories. The file name of outputpath
575  /// may end in any of the acceptable script file extensions
576  /// (i.e. .py or .cmd).
577  static void getFirstFoundScriptFile(
578  UT_StringHolder &outputpath,
579  const char *inputpath);
580 
581  static void sceneSaveEvent(EventType event, UT_Args &args);
582 
583 private:
584  char *myBadLoadData;
585  int myBadLoadDataLen;
586  OP_CommandManager myCommandManager;
587  fpreal32 myVersion;
588  int myInLoadCount;
589 
590  struct CwdContext
591  {
592  CwdContext() : myCwdId(-1)
593  {
594  }
595  int myCwdId;
596  UT_IntArray myCwdStack;
597  UT_IntArray myEvalCollectionStack;
598  };
600 
601  OP_ItemIdList myPickedItems;
603 
604  OP_SaveCallback *myCallbacks;
605  OP_SaveCallback *myUserDisplayOptionCallback;
606  OP_SaveCallback *mySceneFileVisualizersCallback;
607  OP_BundleList *myBundles;
608  OP_Take *myTakeManager;
609  OP_StyleManager *myStyleManager;
610  OP_FileResolver *myFileResolver;
611  UT_ColorTable myGroupColorTable;
612 
613  int myCookEnabled;
614  int mySimulationEnabled;
615  int mySkipPlaybarBasedSimulationReset;
617 
618  OP_OTLManager myOTLManager;
619  OP_OperatorTableList myTablesToReload;
620  UT_StringSet *myDummyDefinitionActivations;
621 
622  OP_GlobalOpChangedCallbacks myGlobalOpChangedCallbacks;
623  UT_ValArray<void *> myGlobalOpChangedCallbackData;
624 
625  struct EventCallbackInfo
626  {
627  EventCallback cb;
628  void *data;
629  };
630  typedef UT_Map<EventCallback, void *> EventCallbackInfoMap;
631  typedef UT_Map<EventType, EventCallbackInfoMap> EventCallbackMap;
632  EventCallbackMap myEventCallbacks;
633 
634  // Cache of global (i.e. non-operator specific) event script paths.
635  OP_EventScriptPathCache *myGlobalEventScriptPathCache;
636 
637  // This flag tracks whether any OPs that got loaded had the old
638  // style override flag. If so, we know we will have to do a complete
639  // update.
640  bool myOldCHOPOverrideFlag;
641  // This flag tracs whether or not we are inside a call to loadNetwork.
642  // This is different from the isLoading flag, which gets set during any
643  // network load.
644  bool myIsLoadingHip;
645  bool mySwitchingTake;
646  // This value is temporarily set to true when the user explicitly asks
647  // for a hip file save either by executing an mwrite, or choosing Save
648  // or Save As from the File menu.
649  bool myIsDoingExplicitSave;
650  // This flag is set to true while Houdini is exiting.
651  bool myIsQuitting;
652 
653  // This flag is set when the OP director is created for mantra. There are
654  // some OP features which are expensive (i.e. importing the hou python
655  // module). This option disables those features.
656  bool myIsMantra;
657 
658  bool mySaveSceneAsText;
659  bool myNewFileSaveSceneAsText;
660 
661  static UT_Obfuscator *theObfuscator;
662 };
663 
666 
667 /// Create an evaluation context scope with a new node
668 class OP_API OP_Director::CwdScope : UT_NonCopyable
669 {
670 public:
671  CwdScope(int thread, const OP_Node &new_cwd);
672  ~CwdScope();
673 private:
674  int myThread;
675  CH_EvalContext::Scope myEvalScope;
676  int myOldCwdId;
677 };
678 
679 #endif
virtual bool addNodeSpareParm(OP_Parameters *, PRM_Template *) const
Definition: OP_Director.h:341
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
GT_API const UT_StringHolder filename
OP_StyleManager * getStyleManager()
Definition: OP_Director.h:393
void setIsDoingExplicitSave(bool value)
Definition: OP_Director.h:231
Unsorted map container.
Definition: UT_Map.h:83
OP_API OP_Director * OPsetDirector(OP_Director *boss)
GT_API const UT_StringHolder time
UT_ColorTable & getGroupColorTable()
Definition: OP_Director.h:394
const GLdouble * v
Definition: glcorearb.h:836
bool isSwitchingTake() const
Definition: OP_Director.h:246
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
bool getIsMantra() const
Definition: OP_Director.h:237
void setOldCHOPOverrideFlag()
Definition: OP_Director.h:121
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
bool getOldCHOPOverrideFlag()
Definition: OP_Director.h:123
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
virtual void findInternalScriptOperators(const char *, OP_OTLDefinitionArray &)
Definition: OP_Director.h:307
virtual bool loadNodeSpareParms(OP_Parameters *, UT_IStream &, UT_String &) const
Definition: OP_Director.h:333
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:481
OP_BundleList * getBundles()
Definition: OP_Director.h:274
virtual int renameNode(OP_Node *node, const char *name, OP_RenameAction action=OP_RENAME_NORMAL)
virtual void clearHandleSettings(OP_Operator *)
Definition: OP_Director.h:527
virtual void deleteAllNodeSpareParms(OP_Parameters *) const
Definition: OP_Director.h:373
static void saveOTLBackupInformation(std::ostream &os, const OP_OperatorList &fallbackops, const OP_OperatorList &dummyops)
CH_Manager * getChannelManager()
Definition: OP_Director.h:97
struct _cl_event * event
Definition: glcorearb.h:2960
virtual OP_ERROR cookMe(OP_Context &)
Definition: OP_Director.h:518
OP_OTLManager & getOTLManager()
Definition: OP_Director.h:435
virtual OP_OpTypeId getChildTypeID() const
Definition: OP_Director.h:93
virtual void updateExportedParms(OP_Node *)
Definition: OP_Director.h:319
virtual const char * getFileExtension(int binary) const
Definition: OP_Director.h:520
friend class OP_Director
Definition: OP_Network.h:1043
virtual bool loadNodeCompiledDs(OP_Node *, UT_IStream &)
Definition: OP_Director.h:389
virtual bool loadNodeCompiledCode(OP_Node *, UT_IStream &, bool is_source_code=false)
Definition: OP_Director.h:384
OP_InterestType
Definition: OP_DataTypes.h:45
int cookEnabled() const
Definition: OP_Director.h:277
bool getIsDoingExplicitSave() const
Definition: OP_Director.h:233
void bumpSkipPlaybarBasedSimulationReset(int inc)
Definition: OP_Director.h:292
void clearOldCHOPOverrideFlag()
Definition: OP_Director.h:125
bool getIsQuitting() const
Definition: OP_Director.h:229
int getNShopClerks() const
Definition: OP_Director.h:297
int isLoading() const
Definition: OP_Director.h:224
bool getIsLoadingHip() const
Definition: OP_Director.h:227
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:264
OP_Node * getCwd()
Definition: OP_Director.h:131
OP_OpTypeId
Definition: OP_OpTypeId.h:15
virtual void * getCookedData(OP_Context &)
Definition: OP_Director.h:85
GLboolean * data
Definition: glcorearb.h:130
virtual OP_ERROR saveNodeSpareParms(OP_Parameters *, bool, std::ostream &) const
Definition: OP_Director.h:326
virtual bool removeNodeSpareParm(OP_Parameters *, const char *, UT_StringArray *=NULL, UT_StringArray *=NULL) const
Definition: OP_Director.h:348
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual OP_Node * linkInternalScriptOperator(const char *, OP_Operator *)
Definition: OP_Director.h:311
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:437
virtual void getInternalScriptDefinition(OP_Node *, UT_String &)
Definition: OP_Director.h:315
virtual void deleteNodeSpareParmLayout(OP_Parameters *) const
Definition: OP_Director.h:370
void setIsMantra(bool v)
Definition: OP_Director.h:239
unsigned int OP_ItemTypeMask
Definition: OP_ItemId.h:43
fpreal32 getVersion() const
Definition: OP_Director.h:99
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
virtual bool loadCookedData(UT_IStream &, const char *=0)
Definition: OP_Director.h:89
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)
Definition: OP_Node.h:1597
OP_Take * getTakeManager()
Definition: OP_Director.h:392
virtual void saveNodeSpareParmCommands(OP_Parameters *, std::ostream &, const char *, bool) const
Definition: OP_Director.h:363
OP_API OP_Director * OPgetDirector()
#define OP_API
Definition: OP_API.h:10
virtual void saveNodeCompiledDs(OP_Node *, std::ostream &)
Definition: OP_Director.h:387
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
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
void getCwd(UT_String &str)
Definition: OP_Director.h:133
virtual PRM_ScriptPage * allocateSpareScriptPage(OP_Operator *)
Definition: OP_Director.h:376
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:279
virtual OP_ERROR bypassMe(OP_Context &, int &)
Definition: OP_Director.h:519
virtual void definitionsAdded(int, UT_IntArray &)
virtual void saveNodeCompiledCode(OP_Node *, std::ostream &, bool is_source_code=false)
Definition: OP_Director.h:381
virtual void changeNodeSpareParms(OP_Parameters *, PI_EditScriptedParms &, UT_String &) const
Definition: OP_Director.h:357
int simulationEnabled() const
Definition: OP_Director.h:283
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
OP_RenameAction
Definition: OP_Network.h:67
float fpreal32
Definition: SYS_Types.h:191
virtual bool changeSpareParms(UT_IStream &, UT_String &errors)
Definition: OP_Director.h:530
void setSimulationEnabled(int state)
Definition: OP_Director.h:285
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:265
UT_NonCopyable & operator=(const UT_NonCopyable &)=delete
bool skipPlaybarBasedSimulationReset() const
Definition: OP_Director.h:290