16 #ifndef __OP_Director_h__
17 #define __OP_Director_h__
37 #define OP_POSTLOAD_SCRIPT "456.cmd"
42 class OP_SaveCallback;
45 class op_ShopClerkInfo;
54 class OP_EventScriptPathCache;
57 void *
data,
void *cbdata);
82 typedef OP_ERROR (*SaveCallback)(std::ostream &,
void *);
99 std::ostream &,
OP_Context &,
int = 0)
override
117 bool loadChannelManagerOptions();
118 bool saveChannelManagerOptions();
120 virtual void enable(
int state);
122 OP_ERROR saveNetwork(std::ostream &os,
125 const char *mergePattern=0,
127 void initializeManagerWireStyles();
128 virtual void clearNetwork(
int clear_aliases );
133 virtual void opUpdateAllExports();
136 { myOldCHOPOverrideFlag =
true; }
138 {
return myOldCHOPOverrideFlag; }
140 { myOldCHOPOverrideFlag =
false; }
153 int eval_collection=-1);
163 return myCwdContext.getValueForThread(thread)
170 bool include_hidden=
false,
171 bool append_to_list=
false)
const;
173 bool include_hidden=
false)
const;
174 bool getPickedInputs(
179 void clearPickedItems();
191 void addPickedNode(
const OP_Node &node,
bool edit);
192 void removePickedNode(
const OP_Node &node,
bool edit);
193 void makePickedNodeLast(
const OP_Node &node,
bool edit);
217 void setNFrames(
fpreal nframes);
226 void setSaveCallback(SaveCallback cb,
void *cb_data);
227 void removeSaveCallback(SaveCallback cb,
void *cb_data);
231 void addEventCallback(EventType
type, EventCallback cb,
233 void removeEventCallback(EventType
type, EventCallback cb,
237 void setUserDisplayOptionSaveCallback(
238 OP_ERROR (*cb)(std::ostream &,
void *),
240 void setSceneFileVisualizersSaveCallback(
241 OP_ERROR (*cb)(std::ostream &,
void *),
243 void addBadLoadData(
char *str,
int len);
246 virtual void beginLoading();
247 virtual void endLoading();
249 {
return myIsLoadingHip; }
251 {
return myIsQuitting; }
253 { myIsDoingExplicitSave =
value; }
255 {
return myIsDoingExplicitSave; }
256 bool getIsAnyNodeCooking()
const;
259 {
return myIsMantra; }
263 void destroyFileResolver();
265 void beginTakeSwitch();
266 void endTakeSwitch();
268 {
return mySwitchingTake; }
274 void saveChannelGroups(std::ostream &os,
int binary);
276 void saveTimeGroups(std::ostream &os,
int binary);
278 void saveScriptedOpLibrary(std::ostream &os);
279 bool loadScriptedOpLibrary(
UT_IStream &is,
int modtime);
281 void saveInternalOpLibraries(std::ostream &os);
283 void saveLibraryPreferences(std::ostream &os);
285 bool loadHOMSessionModuleSource(
UT_IStream &is);
286 void saveUnselectedFilePatterns(std::ostream &os);
287 bool loadUnselectedFilePatterns(
UT_IStream &is);
292 void saveExprFunctions(std::ostream &os);
299 {
return myCookEnabled; }
301 { myCookEnabled = state; }
305 {
return mySimulationEnabled; }
307 { mySimulationEnabled = state; }
312 {
return mySkipPlaybarBasedSimulationReset > 0; }
314 { mySkipPlaybarBasedSimulationReset += inc; }
317 bool addShopClerk(
const char *
type);
319 {
return myShopInfo.entries(); }
320 const char *getShopClerkName(
int clerk)
const;
321 int getShopClerkVisibility(
int clerk)
const;
322 void setShopClerkVisibility(
int clerk,
int onoff);
349 std::ostream &)
const
403 bool is_source_code =
false)
406 bool is_source_code =
false)
433 static void globAllArgumentsAsArray(
OP_Node &relative_to_node,
453 void getTableAndOperator(
const char *
path,
456 const OP_Node *relativetonode = 0);
458 {
return myOTLManager; }
460 {
return myOTLManager; }
465 void runDeleteScriptsOnQuit();
469 void addGlobalOpChangedCallback(
471 void removeGlobalOpChangedCallback(
476 void globalOpChanged(
OP_Node *node,
484 static bool createBackupFile(
const char *
filename,
490 static void autoIncrementRename(
const char *
filename,
501 const char *startup_script,
502 const char *postload_script);
506 {
return myGlobalEventScriptPathCache; }
509 void clearGlobalEventScriptPathCache();
512 void getCachedGlobalEventScriptPaths(
515 bool only_nonempty)
const;
521 bool getSaveSceneAsText()
const;
522 void setSaveSceneAsText(
bool onOff);
523 bool getNewFileSaveSceneAsText()
const;
524 void setNewFileSaveSceneAsText(
bool onOff);
528 void notifyBeforeSceneSave(
534 void notifyAfterSceneSave(
542 {
return myOrientationMode; }
544 { myOrientationMode = axis; }
554 {
return binary ?
".bhip" :
".hip"; }
555 void clearUnsupportedCommands()
const;
566 errors +=
"Spare parameters are not alowed on ";
567 errors +=
"the root node.";
573 void runPostLoadScript();
581 void installCommands();
582 void installMoreCommands();
583 void installCHCommands();
584 void installOTLCommands();
585 void installOpRampResolver();
587 void savePreCommands(std::ostream &os);
588 void savePostCommands(std::ostream &os);
590 void notifyEventCallbacks(EventType
type);
594 void updateNewDefinition(
602 static void getFirstFoundStartupScriptFile(
604 const char *script_file_name);
611 static void getFirstFoundScriptFile(
613 const char *inputpath);
619 int myBadLoadDataLen;
626 CwdContext() : myCwdId(-1)
638 OP_SaveCallback *myCallbacks;
639 OP_SaveCallback *myUserDisplayOptionCallback;
640 OP_SaveCallback *mySceneFileVisualizersCallback;
648 int mySimulationEnabled;
649 int mySkipPlaybarBasedSimulationReset;
659 struct EventCallbackInfo
663 friend bool operator==(
const EventCallbackInfo &lhs,
const EventCallbackInfo &rhs)
665 return (lhs.cb == rhs.cb) && (lhs.data == rhs.data);
678 EventCallbackInfoList myEventCallbacks[NUM_NETWORK_EVENT_TYPES];
681 OP_EventScriptPathCache *myGlobalEventScriptPathCache;
686 bool myOldCHOPOverrideFlag;
691 bool mySwitchingTake;
695 bool myIsDoingExplicitSave;
704 bool mySaveSceneAsText;
705 bool myNewFileSaveSceneAsText;
707 OrientationMode myOrientationMode;
virtual bool addNodeSpareParm(OP_Parameters *, PRM_Template *) const
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)
void * getCookedData(OP_Context &) override
UT_ErrorSeverity OP_ERROR
UT_ValArray< OP_GlobalOpChangedCallback > OP_GlobalOpChangedCallbacks
GLenum GLenum GLenum input
GLuint GLsizei const void GLenum preserve
GT_API const UT_StringHolder filename
GLuint const GLchar * name
OP_StyleManager * getStyleManager()
void setIsDoingExplicitSave(bool value)
OP_API OP_Director * OPsetDirector(OP_Director *boss)
GT_API const UT_StringHolder time
UT_ColorTable & getGroupColorTable()
bool isSwitchingTake() const
void setOldCHOPOverrideFlag()
bool getOldCHOPOverrideFlag()
GLenum GLsizei GLenum GLenum const void * table
virtual void findInternalScriptOperators(const char *, OP_OTLDefinitionArray &)
virtual bool loadNodeSpareParms(OP_Parameters *, UT_IStream &, UT_String &) const
int saveCookedData(const char *, OP_Context &) override
virtual void definitionsRemoved(int, UT_IntArray &, OP_OTLLibrary *&)
std::tuple< Types...> UT_Tuple
OP_EventScriptPathCache * getGlobalEventScriptPathCache()
OP_BundleList * getBundles()
bool changeSpareParms(UT_IStream &, UT_String &errors) override
virtual int renameNode(OP_Node *node, const char *name, OP_RenameAction action=OP_RENAME_NORMAL)
virtual void clearHandleSettings(OP_Operator *)
virtual void deleteAllNodeSpareParms(OP_Parameters *) const
OrientationMode getOrientationMode() const
void setOrientationMode(OrientationMode axis)
int saveCookedData(std::ostream &, OP_Context &, int=0) override
static void saveOTLBackupInformation(std::ostream &os, const OP_OperatorList &fallbackops, const OP_OperatorList &dummyops)
CH_Manager * getChannelManager()
OP_OTLManager & getOTLManager()
const char * getOpType() const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
virtual void updateExportedParms(OP_Node *)
OP_OpTypeId getOpTypeID() const override
virtual bool loadNodeCompiledDs(OP_Node *, UT_IStream &)
OP_DataType getCookedDataType() const override
virtual bool loadNodeCompiledCode(OP_Node *, UT_IStream &, bool is_source_code=false)
int getCwdStackSize(int thread) const
OP_ERROR cookMe(OP_Context &) override
bool getIsDoingExplicitSave() const
void bumpSkipPlaybarBasedSimulationReset(int inc)
void clearOldCHOPOverrideFlag()
bool getIsQuitting() const
GLint GLenum GLsizei GLint GLsizei const void * data
int getNShopClerks() const
const GLuint GLenum const void * binary
bool getIsLoadingHip() const
void getPickedItems(OP_ItemTypeMask item_type_mask, OP_NetworkBoxItemList &picked, bool include_hidden=false, bool recurse_picked_netboxes=false) const
bool loadCookedData(UT_IStream &, const char *=0) override
void deleteCookedData() override
const char * getChildType() const override
*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 OP_ERROR saveNodeSpareParms(OP_Parameters *, bool, std::ostream &) const
virtual bool removeNodeSpareParm(OP_Parameters *, const char *, UT_StringArray *=NULL, UT_StringArray *=NULL) const
GLuint GLuint GLsizei GLenum type
virtual OP_Node * linkInternalScriptOperator(const char *, OP_Operator *)
GT_API const UT_StringHolder version
const OP_OTLManager & getOTLManager() const
GLsizei const GLchar *const * path
virtual void getInternalScriptDefinition(OP_Node *, UT_String &)
virtual void deleteNodeSpareParmLayout(OP_Parameters *) const
unsigned int OP_ItemTypeMask
fpreal32 getVersion() const
Create an evaluation context scope with a new node.
virtual void addExtraInput(OP_Node *op, OP_InterestType type)
OP_Take * getTakeManager()
const char * getFileExtension(int binary) const override
virtual void saveNodeSpareParmCommands(OP_Parameters *, std::ostream &, const char *, bool) const
OP_API OP_Director * OPgetDirector()
OIIO_API bool copy(string_view from, string_view to, std::string &err)
virtual void saveNodeCompiledDs(OP_Node *, std::ostream &)
OP_CommandManager * getCommandManager()
void getCwd(UT_String &str)
virtual PRM_ScriptPage * allocateSpareScriptPage(OP_Operator *)
void setCookEnabled(int state)
virtual void definitionsAdded(int, UT_IntArray &)
virtual void saveNodeCompiledCode(OP_Node *, std::ostream &, bool is_source_code=false)
virtual void changeNodeSpareParms(OP_Parameters *, PI_EditScriptedParms &, UT_String &) const
int simulationEnabled() const
OP_ERROR bypassMe(OP_Context &, int &) override
Cooks node data and makes it available through the reader.
GLsizei const GLfloat * value
OP_OpTypeId getChildTypeID() const override
void setSimulationEnabled(int state)
void(* OP_GlobalOpChangedCallback)(OP_Node *node, OP_EventType reason, void *data, void *cbdata)
UT_NonCopyable & operator=(const UT_NonCopyable &)=delete
GLenum const void * paths
bool skipPlaybarBasedSimulationReset() const