00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __MOT_Director_h__
00020 #define __MOT_Director_h__
00021
00022 #include "MOT_API.h"
00023 #include <OP/OP_Director.h>
00024
00025 class MGR_Node;
00026 class CHOP_Node;
00027 class CMD_Args;
00028 class UI_Window;
00029
00030 class MOT_API MOT_Director : public OP_Director
00031 {
00032 public:
00033 MOT_Director(const char *appname, bool alloptypes = true);
00034 virtual ~MOT_Director();
00035
00036 virtual OP_Node *getChild(const char *name, int *hint=0) const;
00037 virtual OP_Node *getChild(int index) const;
00038
00039 virtual void clearNetwork( int clear_aliases );
00040
00041 MGR_Node *getObjectManager() { return myObjects; }
00042 MGR_Node *getCopManager() { return myCop; }
00043 MGR_Node *getRenderManager() { return myRops; }
00044 MGR_Node *getParticleManager() { return myParticles; }
00045 MGR_Node *getChopNetManager() { return myChopNet; }
00046 MGR_Node *getShopManager() { return myShops; }
00047 MGR_Node *getVopManager() { return myVops; }
00048
00049 const UT_String &getFileName() const { return myFileName; }
00050 void setFileName(const char *nm);
00051 void bumpFileName();
00052 void setSaveTime();
00053
00054
00055
00056
00057
00058 bool moveFileNameToNumberedBackup(UT_String &errorstring,
00059 bool autosave);
00060
00061
00062 void resetForNewFile();
00063
00064
00065
00066
00067 virtual void findInternalScriptOperators(const char *indexPath,
00068 OP_OTLDefinitionArray &defs);
00069 virtual OP_Node *linkInternalScriptOperator(const char *definitionOp,
00070 OP_Operator *op);
00071 virtual void getInternalScriptDefinition(OP_Node *definitionOp,
00072 UT_String &definition);
00073
00074
00075
00076 virtual OP_ERROR saveNodeSpareParms(OP_Parameters *node,
00077 bool compiled,
00078 ostream &os) const;
00079 virtual bool loadNodeSpareParms(OP_Parameters *node,
00080 UT_IStream &is,
00081 UT_String &errors) const;
00082
00083
00084
00085 virtual bool addNodeSpareParm(OP_Parameters *node,
00086 PRM_Template *parmtemplate) const;
00087 virtual bool removeNodeSpareParm(OP_Parameters *node,
00088 const char *parmname,
00089 UT_StringArray *errs = NULL,
00090 UT_StringArray *warn = NULL) const;
00091
00092
00093 virtual void changeNodeSpareParms(OP_Parameters *node,
00094 PI_EditScriptedParms &parms,
00095 UT_String &errors) const;
00096
00097
00098 virtual void saveNodeSpareParmCommands(OP_Parameters *node,
00099 ostream &os,
00100 const char *nodename,
00101 bool saveempty) const;
00102
00103
00104 virtual void deleteNodeSpareParmLayout(OP_Parameters *node) const;
00105
00106 virtual void deleteAllNodeSpareParms(OP_Parameters *node) const;
00107
00108
00109
00110
00111 virtual PRM_ScriptPage *allocateSpareScriptPage(OP_Operator *op);
00112
00113
00114
00115 virtual void saveNodeCompiledCode(OP_Node *node, ostream &os);
00116 virtual bool loadNodeCompiledCode(OP_Node *node, UT_IStream &is);
00117 virtual void saveNodeCompiledDs(OP_Node *node, ostream &os);
00118 virtual bool loadNodeCompiledDs(OP_Node *node, UT_IStream &is);
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 static void installFullCVEX();
00132
00133
00134 static OP_Node *createNewOp(const OP_Network *net, const char *opname,
00135 const char *node_name=NULL);
00136
00137
00138
00139
00140 static const char *hasSubNetworks(OP_Network *net);
00141
00142
00143
00144
00145
00146
00147
00148
00149 static OP_Network *buildSubNetwork(OP_Network *net, UT_String &err,
00150 OP_NodeList *from_nodes = NULL,
00151 UT_PtrArray<OP_PostIt* > *from_postits = NULL,
00152 const char *preferred_subnet_name=NULL);
00153
00154
00155 static void extractSubNetwork(OP_Network *subnet, UT_String &err);
00156
00157
00158
00159
00160 virtual void opUpdateAllExports();
00161
00162
00163
00164
00165
00166 bool loadOrMergeHipFile(const char *file_name,
00167 bool merge, const char *pattern,
00168 bool overwrite,
00169 UT_String &warnings_or_errors);
00170
00171
00172
00173 void getCollisionsIfMerged(const char *file_name,
00174 OP_NodeList &node_collisions,
00175 UT_PtrArray<OP_NetworkBox *>
00176 &netbox_collisions,
00177 UT_PtrArray<OP_PostIt *>
00178 &pnote_collisions,
00179 const char *pattern,
00180 UT_String &errors);
00181
00182
00183 void saveHipFile(const char *file_name,
00184 bool channels_only, UT_String &errors);
00185
00186
00187
00188
00189
00190
00191 bool isBusy(UT_String &msgs);
00192
00193
00194
00195 void setMainWindow(UI_Window *window)
00196 { myMainWindow = window; };
00197
00198 protected:
00199
00200 virtual void clearHandleSettings(OP_Operator *op);
00201
00202 private:
00203 void findInternalScriptOperators(const char *indexPath,
00204 OP_OTLDefinitionArray &defs,
00205 OP_Network *net);
00206 void layoutManagers();
00207 void execPythonRCFiles();
00208 void installCommands();
00209 void loadOpCustomizeFile();
00210 void cacheChopnetOperators();
00211 bool forceChopnetToExport(OP_Node &chop_network);
00212
00213 MGR_Node *myObjects;
00214 MGR_Node *myCop;
00215 MGR_Node *myRops;
00216 MGR_Node *myParticles;
00217 MGR_Node *myChopNet;
00218 MGR_Node *myShops;
00219 MGR_Node *myVops;
00220
00221 UT_String myFileName;
00222
00223
00224
00225 OP_OperatorList myChopnetOperators;
00226
00227
00228
00229 UI_Window *myMainWindow;
00230 };
00231
00232 #endif