HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OR_Manager.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: OR_Manager.h ( OP Library, C++)
7  *
8  * COMMENTS:
9  *
10  * manager to update/remove/add parameter override data
11  */
12 
13 #ifndef __OR_Manager__
14 #define __OR_Manager__
15 
16 #include "OP_API.h"
17 #include "OP_Node.h"
18 #include <UT/UT_Array.h>
19 #include <UT/UT_IntArray.h>
20 #include <UT/UT_ValArray.h>
21 #include <SYS/SYS_Types.h>
22 
23 class PRM_Parm;
24 class orData;
25 class CL_Clip;
26 class CH_Collection;
27 class OR_Mapping;
29 
30 //
31 // This class is used to minimize string parsing and node globbing
32 //
33 
35 {
36 
37 public:
38 
39  orPath(OP_Node *src);
40  ~orPath();
41 
42  void setExport(const UT_String &xport);
43  int globNodes(OP_NodeList &globbed);
44  void forceDirty() { myDirty = 1; }
45 
46  int64 getMemoryUsage(bool inclusive) const;
47 
48 private:
49 
50  void reset();
51 
52  UT_String myExport;
53  OP_Node *mySource;
54  int myDirty;
55  int myArgc;
56  char **myArgv;
57  int myArgvSize;
58 };
59 
60 
62 {
63 public:
64 
70 };
71 
73 
74 ///// an exported data unit
75 
77 {
78 public:
80  int parm_idx;
81  int vec_idx;
84  int track_idx;
85  int used;
86  int current;
88 };
89 
90 
92 {
93 
94 public:
95 
96  OR_Manager();
97  ~OR_Manager();
98 
99  int getConflicts(const OP_Node *src, OP_NodeList &list);
100  const OP_Node *getFirstConflict(const OP_Node *src);
101 
102  void removeDestination(OP_Node *dest);
103  void removeDestination(OP_Node *dest, int parm_idx);
104 
105  bool findDestination(UT_String &result,
106  const OP_Node *, int idx)const;
107 
108  void removeSource(OP_Node *src,
109  OP_NodeList &affected,
111  int previous);
112 
113  int override(OP_Node *src, const CL_Clip *clip,
114  const UT_String &export_path,
115  OP_NodeList &affected,
117  orPath &pathparm,
118  OR_Mapping *mapping);
119 
120  void override(OP_Node *src, const CL_Clip *clip,
121  const orUnitList &units,
122  OP_NodeList &affected,
124  orPath &pathparm,
125  OR_Mapping *mapping);
126 
127  /// Copy the channel collection corresponding to the given clip to the
128  /// export destination.
129  int copy(OP_Node *src,
130  const CL_Clip *clip,
131  const CH_Collection *coll,
132  const UT_String &export_path,
133  OP_NodeList &affected,
134  UT_IntArray &indices,
135  orPath &pathparm);
136 
137  void getTrackDestinations(
138  const OP_Node *src,
139  UT_IntArray &track_indices,
140  OP_NodeList &nodes,
141  UT_ValArray<PRM_Parm *> &parm_list,
142  UT_IntArray &vec_indices);
143 
144  void getDestinations( const OP_Node *src,
145  UT_ValArray<OP_Node *> &op_list );
146  void getSources( const OP_Node *dest,
147  UT_ValArray<OP_Node *> &op_list,
148  bool append );
149 
150  void unexportWithSameParmValues(fpreal t, OP_Node *src );
151 
152 
153  // these methods must be called with caution.
154  // ie, only called by the static callback
155 
156  int getNumExports() const
157  { return myData.entries(); }
158 
159  const orData *getData(int idx) const
160  { return myData(idx); }
161 
162  orData *getData(int idx)
163  { return myData(idx); }
164 
165  // Fills CH_ActiveLayerContrib with the layer contribution values from a Parm
166  void getActiveLayerContribution( CH_ActiveLayerContrib& c, PRM_Parm *p, int i, fpreal t );
167 
168 private:
169 
170  UT_ValArray<orData *> myData;
171 
172 
173  // Exactly one of clip/coll must be non-nil
174  // If clip is given, exporting is done
175  // If coll is given, copying is done
176 
177  int processDestNodes(OP_Node *src,
178  const CL_Clip *clip,
179  const CH_Collection *coll,
180  OP_NodeList &dest_ops,
181  OP_NodeList &affected,
182  UT_IntArray &indices,
183  OR_Mapping *mapping);
184 
185  int processParmList(OP_Node *src,
186  OP_Node *dest_op,
187  const char *channel_name,
188  int track_idx,
189  OP_NodeList &affected,
190  UT_IntArray &indices,
191  const CL_Clip *clip,
192  const CH_Collection *coll);
193 
194  int processSingle(OP_Node *src,
195  const CL_Clip *chop,
196  int track_idx,
197  OP_Node *dest_op,
198  int parm_index,
199  int vec_index,
200  const CL_Track *enable_track,
201  OP_NodeList &affected,
202  UT_IntArray &indices
203  );
204 
205  int processMapping(OP_Node *src,
206  const CL_Clip *clip,
207  OP_NodeList &affected,
208  UT_IntArray &indices,
209  OR_Mapping *mapping);
210 
211 
212  int getNextDataIndex(OP_Node *dest,
213  int parm_index, int vec_idx);
214 
215  int addData(OP_Node *dest, int parm_idx, int vec_idx,
216  OP_Node *source, int track_idx,
217  const CL_Track *enable_track);
218 
219  int getOverrideType( OP_Node *src ) const;
220 
221  int myAddedUndoLevel;
222 
223 };
224 
225 OP_API extern OR_Manager *ORgetManager();
226 
227 #endif
228 
GLsizei GLenum const void * indices
Definition: glcorearb.h:405
OP_API OR_Manager * ORgetManager()
const CL_Track * myEnableTrack
Definition: OR_Manager.h:69
int current
Definition: OR_Manager.h:86
int myTrackIndex
Definition: OR_Manager.h:66
png_uint_32 i
Definition: png.h:2877
int getNumExports() const
Definition: OR_Manager.h:156
OP_Node * myDestOp
Definition: OR_Manager.h:65
int parm_idx
Definition: OR_Manager.h:80
long long int64
Definition: SYS_Types.h:106
OP_Node * dest
Definition: OR_Manager.h:79
OP_Node * source
Definition: OR_Manager.h:82
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
orData * getData(int idx)
Definition: OR_Manager.h:162
const CL_Track * enable_track
Definition: OR_Manager.h:87
GLfloat units
Definition: glcorearb.h:407
OP_Node * conflict
Definition: OR_Manager.h:83
int myVecIndex
Definition: OR_Manager.h:68
double fpreal
Definition: SYS_Types.h:269
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
int myParmIndex
Definition: OR_Manager.h:67
int track_idx
Definition: OR_Manager.h:84
#define OP_API
Definition: OP_API.h:10
const orData * getData(int idx) const
Definition: OR_Manager.h:159
void forceDirty()
Definition: OR_Manager.h:44
int used
Definition: OR_Manager.h:85
int vec_idx
Definition: OR_Manager.h:81
UT_Array< orUnit * > orUnitList
Definition: OR_Manager.h:72
GLenum src
Definition: glcorearb.h:1792