00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __OR_Manager__
00022 #define __OR_Manager__
00023
00024 #include "OP_API.h"
00025 #include <UT/UT_PtrArray.h>
00026 #include <UT/UT_IntArray.h>
00027 #include "OP_Node.h"
00028
00029 class PRM_Parm;
00030 class orData;
00031 class CL_Clip;
00032 class CH_Collection;
00033 class OR_Mapping;
00034
00035
00036
00037
00038
00039 class OP_API orPath
00040 {
00041
00042 public:
00043
00044 orPath(OP_Node *src);
00045 ~orPath();
00046
00047 void setExport(const UT_String &xport);
00048 int globNodes(OP_NodeList &globbed);
00049 void forceDirty() { myDirty = 1; }
00050
00051 private:
00052
00053 void reset();
00054
00055 UT_String myExport;
00056 OP_Node *mySource;
00057 int myDirty;
00058 int myArgc;
00059 char **myArgv;
00060 int myArgvSize;
00061 };
00062
00063
00064 class OP_API orUnit
00065 {
00066 public:
00067
00068 OP_Node *myDestOp;
00069 int myTrackIndex;
00070 int myParmIndex;
00071 int myVecIndex;
00072 const CL_Track *myEnableTrack;
00073 };
00074
00075
00076
00077
00078
00079 class OP_API orData
00080 {
00081 public:
00082 OP_Node *dest;
00083 int parm_idx;
00084 int vec_idx;
00085 OP_Node *source;
00086 OP_Node *conflict;
00087 int track_idx;
00088 int used;
00089 int current;
00090 const CL_Track *enable_track;
00091 };
00092
00093 typedef UT_PtrArray<orUnit *> orUnitList;
00094
00095 class OP_API OR_Manager
00096 {
00097
00098 public:
00099
00100 OR_Manager();
00101 ~OR_Manager();
00102
00103 int getConflicts(const OP_Node *src, OP_NodeList &list);
00104 const OP_Node *getFirstConflict(const OP_Node *src);
00105
00106 void removeDestination(OP_Node *dest);
00107 void removeDestination(OP_Node *dest, int parm_idx);
00108
00109 bool findDestination(UT_String &result,
00110 const OP_Node *, int idx)const;
00111
00112 void removeSource(OP_Node *src,
00113 OP_NodeList &affected,
00114 UT_IntArray &indices,
00115 int previous);
00116
00117 int override(OP_Node *src, const CL_Clip *clip,
00118 const UT_String &export_path,
00119 OP_NodeList &affected,
00120 UT_IntArray &indices,
00121 orPath &pathparm,
00122 OR_Mapping *mapping);
00123
00124 void override(OP_Node *src, const CL_Clip *clip,
00125 const orUnitList &units,
00126 OP_NodeList &affected,
00127 UT_IntArray &indices,
00128 orPath &pathparm,
00129 OR_Mapping *mapping);
00130
00131
00132
00133 int copy(OP_Node *src,
00134 const CL_Clip *clip,
00135 const CH_Collection *coll,
00136 const UT_String &export_path,
00137 OP_NodeList &affected,
00138 UT_IntArray &indices,
00139 orPath &pathparm);
00140
00141 void getTrackDestinations(
00142 const OP_Node *src,
00143 UT_IntArray &track_indices,
00144 OP_NodeList &nodes,
00145 UT_PtrArray<PRM_Parm *> &parm_list,
00146 UT_IntArray &vec_indices);
00147
00148 void getDestinations( const OP_Node *src,
00149 UT_PtrArray<OP_Node *> &op_list );
00150 void getSources( const OP_Node *dest,
00151 UT_PtrArray<OP_Node *> &op_list,
00152 bool append );
00153
00154 void unexportWithSameParmValues( float t, OP_Node *src );
00155
00156
00157
00158
00159
00160 int getNumExports() const
00161 { return myData.entries(); }
00162
00163 const orData *getData(int idx) const
00164 { return myData(idx); }
00165
00166 orData *getData(int idx)
00167 { return myData(idx); }
00168
00169 private:
00170
00171 UT_PtrArray<orData *> myData;
00172
00173 static float theCallback(int data_idx, float time, int *tdepend,
00174 int *enable, const float *newVal);
00175
00176
00177
00178
00179
00180
00181 int processDestNodes(OP_Node *src,
00182 const CL_Clip *clip,
00183 const CH_Collection *coll,
00184 OP_NodeList &dest_ops,
00185 OP_NodeList &affected,
00186 UT_IntArray &indices,
00187 OR_Mapping *mapping);
00188
00189 int processParmList(OP_Node *src,
00190 OP_Node *dest_op,
00191 const char *channel_name,
00192 int track_idx,
00193 OP_NodeList &affected,
00194 UT_IntArray &indices,
00195 const CL_Clip *clip,
00196 const CH_Collection *coll);
00197
00198 int processSingle(OP_Node *src,
00199 const CL_Clip *chop,
00200 int track_idx,
00201 OP_Node *dest_op,
00202 int parm_index,
00203 int vec_index,
00204 const CL_Track *enable_track,
00205 OP_NodeList &affected,
00206 UT_IntArray &indices
00207 );
00208
00209 int processMapping(OP_Node *src,
00210 const CL_Clip *clip,
00211 OP_NodeList &affected,
00212 UT_IntArray &indices,
00213 OR_Mapping *mapping);
00214
00215
00216 int getNextDataIndex(OP_Node *dest,
00217 int parm_index, int vec_idx);
00218
00219 int addData(OP_Node *dest, int parm_idx, int vec_idx,
00220 OP_Node *source, int track_idx,
00221 const CL_Track *enable_track);
00222
00223 int myAddedUndoLevel;
00224
00225 };
00226
00227 OP_API extern OR_Manager *ORgetManager();
00228
00229 #endif
00230