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