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