HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_ONNX.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_ONNXEnums
24 {
25  enum class Input_type
26  {
27  VOLUME = 0,
28  DETAIL,
29  POINT,
30  PRIM
31  };
32 
34  getToken(Input_type enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case Input_type::VOLUME: return "volume"_sh;
39  case Input_type::DETAIL: return "detail"_sh;
40  case Input_type::POINT: return "point"_sh;
41  case Input_type::PRIM: return "prim"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46  enum class Input_volorder
47  {
48  ZYX = 0,
49  XYZ
50  };
51 
53  getToken(Input_volorder enum_value)
54  {
55  using namespace UT::Literal;
56  switch (enum_value) {
57  case Input_volorder::ZYX: return "zyx"_sh;
58  case Input_volorder::XYZ: return "xyz"_sh;
59  default: UT_ASSERT(false); return ""_sh;
60  }
61  }
62 
63  enum class Output_type
64  {
65  VOLUME = 0,
66  DETAIL,
67  POINT
68  };
69 
71  getToken(Output_type enum_value)
72  {
73  using namespace UT::Literal;
74  switch (enum_value) {
75  case Output_type::VOLUME: return "volume"_sh;
76  case Output_type::DETAIL: return "detail"_sh;
77  case Output_type::POINT: return "point"_sh;
78  default: UT_ASSERT(false); return ""_sh;
79  }
80  }
81 
82  enum class Output_volorder
83  {
84  ZYX = 0,
85  XYZ
86  };
87 
90  {
91  using namespace UT::Literal;
92  switch (enum_value) {
93  case Output_volorder::ZYX: return "zyx"_sh;
94  case Output_volorder::XYZ: return "xyz"_sh;
95  default: UT_ASSERT(false); return ""_sh;
96  }
97  }
98 
99 }
100 
101 
103 {
104 public:
105  static int version() { return 1; }
106  struct Inputs
107  {
114 
115 
117  {
118  input_name = ""_UTsh;
119  input_shape = 1;
120  input_type = 0;
121  input_volorder = 0;
122  input_channelfirst = false;
123  input_data = ""_UTsh;
124 
125  }
126 
127  bool operator==(const Inputs &src) const
128  {
129  if (input_name != src.input_name) return false;
130  if (input_shape != src.input_shape) return false;
131  if (input_type != src.input_type) return false;
132  if (input_volorder != src.input_volorder) return false;
133  if (input_channelfirst != src.input_channelfirst) return false;
134  if (input_data != src.input_data) return false;
135 
136  return true;
137  }
138  bool operator!=(const Inputs &src) const
139  {
140  return !operator==(src);
141  }
142 
143  };
144 
146  {
148 
149  buf.strcat("[ ");
150  for (int i = 0; i < list.entries(); i++)
151  {
152  if (i)
153  buf.strcat(", ");
154  buf.strcat("( ");
155  buf.append("");
156  { UT_String tmp; tmp = UT_StringWrap(list(i).input_name).makeQuotedString('"'); buf.strcat(tmp); }
157  buf.append(", ");
158  buf.appendSprintf("((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", list(i).input_shape(0,0), list(i).input_shape(0, 1), list(i).input_shape(0, 2), list(i).input_shape(1, 0), list(i).input_shape(1, 1), list(i).input_shape(1, 2), list(i).input_shape(2, 0), list(i).input_shape(2, 1), list(i).input_shape(2, 2));
159  buf.append(", ");
160  buf.appendSprintf("%d", (int) list(i).input_type);
161  buf.append(", ");
162  buf.appendSprintf("%d", (int) list(i).input_volorder);
163  buf.append(", ");
164  buf.appendSprintf("%s", (list(i).input_channelfirst) ? "true" : "false");
165  buf.append(", ");
166  { UT_String tmp; tmp = UT_StringWrap(list(i).input_data).makeQuotedString('"'); buf.strcat(tmp); }
167 
168  buf.strcat(" )");
169  }
170  buf.strcat(" ]");
171 
173  return result;
174  }
175  struct Outputs
176  {
183 
184 
186  {
187  output_name = ""_UTsh;
188  output_shape = 1;
189  output_type = 0;
190  output_volorder = 0;
191  output_channelfirst = false;
192  output_data = ""_UTsh;
193 
194  }
195 
196  bool operator==(const Outputs &src) const
197  {
198  if (output_name != src.output_name) return false;
199  if (output_shape != src.output_shape) return false;
200  if (output_type != src.output_type) return false;
201  if (output_volorder != src.output_volorder) return false;
202  if (output_channelfirst != src.output_channelfirst) return false;
203  if (output_data != src.output_data) return false;
204 
205  return true;
206  }
207  bool operator!=(const Outputs &src) const
208  {
209  return !operator==(src);
210  }
211 
212  };
213 
215  {
217 
218  buf.strcat("[ ");
219  for (int i = 0; i < list.entries(); i++)
220  {
221  if (i)
222  buf.strcat(", ");
223  buf.strcat("( ");
224  buf.append("");
225  { UT_String tmp; tmp = UT_StringWrap(list(i).output_name).makeQuotedString('"'); buf.strcat(tmp); }
226  buf.append(", ");
227  buf.appendSprintf("((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", list(i).output_shape(0,0), list(i).output_shape(0, 1), list(i).output_shape(0, 2), list(i).output_shape(1, 0), list(i).output_shape(1, 1), list(i).output_shape(1, 2), list(i).output_shape(2, 0), list(i).output_shape(2, 1), list(i).output_shape(2, 2));
228  buf.append(", ");
229  buf.appendSprintf("%d", (int) list(i).output_type);
230  buf.append(", ");
231  buf.appendSprintf("%d", (int) list(i).output_volorder);
232  buf.append(", ");
233  buf.appendSprintf("%s", (list(i).output_channelfirst) ? "true" : "false");
234  buf.append(", ");
235  { UT_String tmp; tmp = UT_StringWrap(list(i).output_data).makeQuotedString('"'); buf.strcat(tmp); }
236 
237  buf.strcat(" )");
238  }
239  buf.strcat(" ]");
240 
242  return result;
243  }
244 
246  {
247  myModelFile = ""_UTsh;
248  raw_myModelFile = ""_UTsh;
249  myDoMaxBatch = false;
250  myMaxBatch = 65536;
251  myProvider = 0;
252  myKeepInput = false;
253  myInputs.setSize(1);
254  myOutputs.setSize(1);
255 
256  }
257 
258  explicit SOP_ONNXParms(const SOP_ONNXParms &) = default;
259  SOP_ONNXParms &operator=(const SOP_ONNXParms &) = default;
260  SOP_ONNXParms(SOP_ONNXParms &&) noexcept = default;
261  SOP_ONNXParms &operator=(SOP_ONNXParms &&) noexcept = default;
262 
263  ~SOP_ONNXParms() override {}
264 
265  bool operator==(const SOP_ONNXParms &src) const
266  {
267  if (myModelFile != src.myModelFile) return false;
268  if (raw_myModelFile != src.raw_myModelFile) return false;
269  if (myDoMaxBatch != src.myDoMaxBatch) return false;
270  if (myMaxBatch != src.myMaxBatch) return false;
271  if (myProvider != src.myProvider) return false;
272  if (myKeepInput != src.myKeepInput) return false;
273  if (myInputs != src.myInputs) return false;
274  if (myOutputs != src.myOutputs) return false;
275 
276 
277  if (baseGetSignature() != src.baseGetSignature()) return false;
278 
279  return true;
280  }
281  bool operator!=(const SOP_ONNXParms &src) const
282  {
283  return !operator==(src);
284  }
289 
290 
291 
292  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
293  {
294  myModelFile = ""_UTsh;
295  if (true)
296  graph->evalOpParm(myModelFile, nodeidx, "modelfile", time, graph->isDirect()?nullptr:depnode);
297  raw_myModelFile = ""_UTsh;
298  if (true)
299  graph->evalOpParmRaw(raw_myModelFile, nodeidx, "modelfile", time, graph->isDirect()?nullptr:depnode);
300  myDoMaxBatch = false;
301  if (true)
302  graph->evalOpParm(myDoMaxBatch, nodeidx, "domaxbatch", time, graph->isDirect()?nullptr:depnode);
303  myMaxBatch = 65536;
304  if (true && ( (true&&!(((getDoMaxBatch()==0)))) ) )
305  graph->evalOpParm(myMaxBatch, nodeidx, "maxbatch", time, graph->isDirect()?nullptr:depnode);
306  myProvider = 0;
307  if (true)
308  graph->evalOpParm(myProvider, nodeidx, "provider", time, graph->isDirect()?nullptr:depnode);
309  myKeepInput = false;
310  if (true)
311  graph->evalOpParm(myKeepInput, nodeidx, "keepinput", time, graph->isDirect()?nullptr:depnode);
312  if (true)
313  {
314  int64 length = 0;
315  graph->evalOpParm(length, nodeidx, "inputs", time, graph->isDirect()?nullptr:depnode);
316  if (length < 0) length = 0;
317  myInputs.setSize(length);
318  for (exint i = 0; i < length; i++)
319  {
320  int parmidx[1];
321  int offsets[1];
322  parmidx[0] = i+1;
323  offsets[0] = 1;
324  auto && _curentry = myInputs(i);
325  (void) _curentry;
326  _curentry.input_name = ""_UTsh;
327  if (true)
328  graph->evalOpParmInst(_curentry.input_name, nodeidx, "input_name#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
329  _curentry.input_shape = 1;
330  if (true)
331  graph->evalOpParmInst(_curentry.input_shape, nodeidx, "input_shape#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
332  _curentry.input_type = 0;
333  if (true)
334  graph->evalOpParmInst(_curentry.input_type, nodeidx, "input_type#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
335  _curentry.input_volorder = 0;
336  if (true && ( (true&&!(((_curentry.input_type!=0)))) ) )
337  graph->evalOpParmInst(_curentry.input_volorder, nodeidx, "input_volorder#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
338  _curentry.input_channelfirst = false;
339  if (true && ( (true&&!(((_curentry.input_type!=0)))) ) )
340  graph->evalOpParmInst(_curentry.input_channelfirst, nodeidx, "input_channelfirst#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
341  _curentry.input_data = ""_UTsh;
342  if (true)
343  graph->evalOpParmInst(_curentry.input_data, nodeidx, "input_data#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
344 
345  }
346  }
347  else
348  myInputs.clear();
349  if (true)
350  {
351  int64 length = 0;
352  graph->evalOpParm(length, nodeidx, "outputs", time, graph->isDirect()?nullptr:depnode);
353  if (length < 0) length = 0;
354  myOutputs.setSize(length);
355  for (exint i = 0; i < length; i++)
356  {
357  int parmidx[1];
358  int offsets[1];
359  parmidx[0] = i+1;
360  offsets[0] = 1;
361  auto && _curentry = myOutputs(i);
362  (void) _curentry;
363  _curentry.output_name = ""_UTsh;
364  if (true)
365  graph->evalOpParmInst(_curentry.output_name, nodeidx, "output_name#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
366  _curentry.output_shape = 1;
367  if (true)
368  graph->evalOpParmInst(_curentry.output_shape, nodeidx, "output_shape#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
369  _curentry.output_type = 0;
370  if (true)
371  graph->evalOpParmInst(_curentry.output_type, nodeidx, "output_type#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
372  _curentry.output_volorder = 0;
373  if (true && ( (true&&!(((_curentry.output_type!=0)))) ) )
374  graph->evalOpParmInst(_curentry.output_volorder, nodeidx, "output_volorder#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
375  _curentry.output_channelfirst = false;
376  if (true && ( (true&&!(((_curentry.output_type!=0)))) ) )
377  graph->evalOpParmInst(_curentry.output_channelfirst, nodeidx, "output_channelfirst#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
378  _curentry.output_data = ""_UTsh;
379  if (true)
380  graph->evalOpParmInst(_curentry.output_data, nodeidx, "output_data#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
381 
382  }
383  }
384  else
385  myOutputs.clear();
386 
387  }
388 
389 
390  void loadFromOpSubclass(const LoadParms &loadparms) override
391  {
392  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
393  }
394 
395 
396  void copyFrom(const OP_NodeParms *src) override
397  {
398  *this = *((const SOP_ONNXParms *)src);
399  }
400 
401  template <typename T>
402  void
403  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
404  {
405  if (idx.size() < 1)
406  return;
407  UT_ASSERT(idx.size() == instance.size()+1);
408  if (idx.size() != instance.size()+1)
409  return;
410  switch (idx[0])
411  {
412  case 0:
413  coerceValue(value, myModelFile);
414  break;
415  case 1:
416  coerceValue(value, myDoMaxBatch);
417  break;
418  case 2:
419  coerceValue(value, myMaxBatch);
420  break;
421  case 3:
422  coerceValue(value, myProvider);
423  break;
424  case 4:
425  coerceValue(value, myKeepInput);
426  break;
427  case 5:
428  if (idx.size() == 1)
429  coerceValue(value, myInputs.entries());
430  else if (instance[0] < myInputs.entries())
431  {
432  auto && _data = myInputs(instance[0]);
433  switch (idx[1])
434  {
435  case 0:
436  coerceValue(value, _data.input_name);
437  break;
438  case 1:
439  coerceValue(value, _data.input_shape);
440  break;
441  case 2:
442  coerceValue(value, _data.input_type);
443  break;
444  case 3:
445  coerceValue(value, _data.input_volorder);
446  break;
447  case 4:
448  coerceValue(value, _data.input_channelfirst);
449  break;
450  case 5:
451  coerceValue(value, _data.input_data);
452  break;
453 
454  }
455  }
456  break;
457  case 6:
458  if (idx.size() == 1)
459  coerceValue(value, myOutputs.entries());
460  else if (instance[0] < myOutputs.entries())
461  {
462  auto && _data = myOutputs(instance[0]);
463  switch (idx[1])
464  {
465  case 0:
466  coerceValue(value, _data.output_name);
467  break;
468  case 1:
469  coerceValue(value, _data.output_shape);
470  break;
471  case 2:
472  coerceValue(value, _data.output_type);
473  break;
474  case 3:
475  coerceValue(value, _data.output_volorder);
476  break;
477  case 4:
478  coerceValue(value, _data.output_channelfirst);
479  break;
480  case 5:
481  coerceValue(value, _data.output_data);
482  break;
483 
484  }
485  }
486  break;
487 
488  }
489  }
490 
491  bool isParmColorRamp(exint idx) const override
492  {
493  switch (idx)
494  {
495 
496  }
497  return false;
498  }
499 
500  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
501  { doGetParmValue(idx, instance, value); }
502  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
503  { doGetParmValue(idx, instance, value); }
504  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
505  { doGetParmValue(idx, instance, value); }
506  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
507  { doGetParmValue(idx, instance, value); }
508  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
509  { doGetParmValue(idx, instance, value); }
510  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
511  { doGetParmValue(idx, instance, value); }
512  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
513  { doGetParmValue(idx, instance, value); }
514  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
515  { doGetParmValue(idx, instance, value); }
516  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
517  { doGetParmValue(idx, instance, value); }
518  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
519  { doGetParmValue(idx, instance, value); }
520  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
521  { doGetParmValue(idx, instance, value); }
522 
523  template <typename T>
524  void
525  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
526  {
527  if (idx.size() < 1)
528  return;
529  UT_ASSERT(idx.size() == instance.size()+1);
530  if (idx.size() != instance.size()+1)
531  return;
532  switch (idx[0])
533  {
534  case 0:
535  coerceValue(myModelFile, ( ( value ) ));
536  break;
537  case 1:
538  coerceValue(myDoMaxBatch, ( ( value ) ));
539  break;
540  case 2:
541  coerceValue(myMaxBatch, ( ( value ) ));
542  break;
543  case 3:
544  coerceValue(myProvider, ( ( value ) ));
545  break;
546  case 4:
547  coerceValue(myKeepInput, ( ( value ) ));
548  break;
549  case 5:
550  if (idx.size() == 1)
551  {
552  exint newsize;
553  coerceValue(newsize, value);
554  if (newsize < 0) newsize = 0;
555  myInputs.setSize(newsize);
556  }
557  else
558  {
559  if (instance[0] < 0)
560  return;
561  myInputs.setSizeIfNeeded(instance[0]+1);
562  auto && _data = myInputs(instance[0]);
563  switch (idx[1])
564  {
565  case 0:
566  coerceValue(_data.input_name, value);
567  break;
568  case 1:
569  coerceValue(_data.input_shape, value);
570  break;
571  case 2:
572  coerceValue(_data.input_type, value);
573  break;
574  case 3:
575  coerceValue(_data.input_volorder, value);
576  break;
577  case 4:
578  coerceValue(_data.input_channelfirst, value);
579  break;
580  case 5:
581  coerceValue(_data.input_data, value);
582  break;
583 
584  }
585  }
586  break;
587  case 6:
588  if (idx.size() == 1)
589  {
590  exint newsize;
591  coerceValue(newsize, value);
592  if (newsize < 0) newsize = 0;
593  myOutputs.setSize(newsize);
594  }
595  else
596  {
597  if (instance[0] < 0)
598  return;
599  myOutputs.setSizeIfNeeded(instance[0]+1);
600  auto && _data = myOutputs(instance[0]);
601  switch (idx[1])
602  {
603  case 0:
604  coerceValue(_data.output_name, value);
605  break;
606  case 1:
607  coerceValue(_data.output_shape, value);
608  break;
609  case 2:
610  coerceValue(_data.output_type, value);
611  break;
612  case 3:
613  coerceValue(_data.output_volorder, value);
614  break;
615  case 4:
616  coerceValue(_data.output_channelfirst, value);
617  break;
618  case 5:
619  coerceValue(_data.output_data, value);
620  break;
621 
622  }
623  }
624  break;
625 
626  }
627  }
628 
629  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
630  { doSetParmValue(idx, instance, value); }
631  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
632  { doSetParmValue(idx, instance, value); }
633  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
634  { doSetParmValue(idx, instance, value); }
635  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
636  { doSetParmValue(idx, instance, value); }
637  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
638  { doSetParmValue(idx, instance, value); }
639  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
640  { doSetParmValue(idx, instance, value); }
641  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
642  { doSetParmValue(idx, instance, value); }
643  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
644  { doSetParmValue(idx, instance, value); }
645  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
646  { doSetParmValue(idx, instance, value); }
647  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
648  { doSetParmValue(idx, instance, value); }
649  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
650  { doSetParmValue(idx, instance, value); }
651 
652  exint getNestNumParms(TempIndex idx) const override
653  {
654  if (idx.size() == 0)
655  return 7;
656  switch (idx[0])
657  {
658  case 5:
659  return 6;
660  case 6:
661  return 6;
662 
663  }
664  // Invalid
665  return 0;
666  }
667 
668  const char *getNestParmName(TempIndex fieldnum) const override
669  {
670  if (fieldnum.size() < 1)
671  return 0;
672  switch (fieldnum[0])
673  {
674  case 0:
675  return "modelfile";
676  case 1:
677  return "domaxbatch";
678  case 2:
679  return "maxbatch";
680  case 3:
681  return "provider";
682  case 4:
683  return "keepinput";
684  case 5:
685  if (fieldnum.size() == 1)
686  return "inputs";
687  switch (fieldnum[1])
688  {
689  case 0:
690  return "input_name#";
691  case 1:
692  return "input_shape#";
693  case 2:
694  return "input_type#";
695  case 3:
696  return "input_volorder#";
697  case 4:
698  return "input_channelfirst#";
699  case 5:
700  return "input_data#";
701 
702  }
703  return 0;
704  case 6:
705  if (fieldnum.size() == 1)
706  return "outputs";
707  switch (fieldnum[1])
708  {
709  case 0:
710  return "output_name#";
711  case 1:
712  return "output_shape#";
713  case 2:
714  return "output_type#";
715  case 3:
716  return "output_volorder#";
717  case 4:
718  return "output_channelfirst#";
719  case 5:
720  return "output_data#";
721 
722  }
723  return 0;
724 
725  }
726  return 0;
727  }
728 
729  ParmType getNestParmType(TempIndex fieldnum) const override
730  {
731  if (fieldnum.size() < 1)
732  return PARM_UNSUPPORTED;
733  switch (fieldnum[0])
734  {
735  case 0:
736  return PARM_STRING;
737  case 1:
738  return PARM_INTEGER;
739  case 2:
740  return PARM_INTEGER;
741  case 3:
742  return PARM_INTEGER;
743  case 4:
744  return PARM_INTEGER;
745  case 5:
746  if (fieldnum.size() == 1)
747  return PARM_MULTIPARM;
748  switch (fieldnum[1])
749  {
750  case 0:
751  return PARM_STRING;
752  case 1:
753  return PARM_MATRIX3;
754  case 2:
755  return PARM_INTEGER;
756  case 3:
757  return PARM_INTEGER;
758  case 4:
759  return PARM_INTEGER;
760  case 5:
761  return PARM_STRING;
762 
763  }
764  return PARM_UNSUPPORTED;
765  case 6:
766  if (fieldnum.size() == 1)
767  return PARM_MULTIPARM;
768  switch (fieldnum[1])
769  {
770  case 0:
771  return PARM_STRING;
772  case 1:
773  return PARM_MATRIX3;
774  case 2:
775  return PARM_INTEGER;
776  case 3:
777  return PARM_INTEGER;
778  case 4:
779  return PARM_INTEGER;
780  case 5:
781  return PARM_STRING;
782 
783  }
784  return PARM_UNSUPPORTED;
785 
786  }
787  return PARM_UNSUPPORTED;
788  }
789 
790  // Boiler plate to load individual types.
791  static void loadData(UT_IStream &is, int64 &v)
792  { is.bread(&v, 1); }
793  static void loadData(UT_IStream &is, bool &v)
794  { int64 iv; is.bread(&iv, 1); v = iv; }
795  static void loadData(UT_IStream &is, fpreal64 &v)
796  { is.bread<fpreal64>(&v, 1); }
797  static void loadData(UT_IStream &is, UT_Vector2D &v)
798  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
799  static void loadData(UT_IStream &is, UT_Vector3D &v)
800  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
801  is.bread<fpreal64>(&v.z(), 1); }
802  static void loadData(UT_IStream &is, UT_Vector4D &v)
803  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
804  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
805  static void loadData(UT_IStream &is, UT_Matrix2D &v)
806  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
807  static void loadData(UT_IStream &is, UT_Matrix3D &v)
808  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
809  static void loadData(UT_IStream &is, UT_Matrix4D &v)
810  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
811  static void loadData(UT_IStream &is, UT_Vector2I &v)
812  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
813  static void loadData(UT_IStream &is, UT_Vector3I &v)
814  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
815  is.bread<int64>(&v.z(), 1); }
816  static void loadData(UT_IStream &is, UT_Vector4I &v)
817  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
818  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
820  { is.bread(v); }
822  { UT_StringHolder rampdata;
823  loadData(is, rampdata);
824  if (rampdata.isstring())
825  {
826  v.reset(new UT_Ramp());
827  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
828  v->load(istr);
829  }
830  else v.reset();
831  }
834  loadData(is, data);
835  if (data.isstring())
836  {
837  // Find the data type.
838  const char *colon = UT_StringWrap(data).findChar(':');
839  if (colon)
840  {
841  int typelen = colon - data.buffer();
843  type.strncpy(data.buffer(), typelen);
844  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
845 
846  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
847  }
848  }
849  else v.reset();
850  }
851 
852  static void saveData(std::ostream &os, int64 v)
853  { UTwrite(os, &v); }
854  static void saveData(std::ostream &os, bool v)
855  { int64 iv = v; UTwrite(os, &iv); }
856  static void saveData(std::ostream &os, fpreal64 v)
857  { UTwrite<fpreal64>(os, &v); }
858  static void saveData(std::ostream &os, UT_Vector2D v)
859  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
860  static void saveData(std::ostream &os, UT_Vector3D v)
861  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
862  UTwrite<fpreal64>(os, &v.z()); }
863  static void saveData(std::ostream &os, UT_Vector4D v)
864  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
865  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
866  static void saveData(std::ostream &os, UT_Matrix2D v)
868  static void saveData(std::ostream &os, UT_Matrix3D v)
870  static void saveData(std::ostream &os, UT_Matrix4D v)
872  static void saveData(std::ostream &os, UT_StringHolder s)
873  { UT_StringWrap(s).saveBinary(os); }
874  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
876  UT_OStringStream ostr;
877  if (s) s->save(ostr);
878  result = ostr.str();
879  saveData(os, result);
880  }
881  static void saveData(std::ostream &os, PRM_DataItemHandle s)
883  UT_OStringStream ostr;
884  if (s)
885  {
886  ostr << s->getDataTypeToken();
887  ostr << ":";
888  s->saveBinary(ostr);
889  }
890  result = ostr.str();
891  saveData(os, result);
892  }
893 
894 
895  void save(std::ostream &os) const
896  {
897  int32 v = version();
898  UTwrite(os, &v);
899  saveData(os, myModelFile);
900  saveData(os, raw_myModelFile);
901  saveData(os, myDoMaxBatch);
902  saveData(os, myMaxBatch);
903  saveData(os, myProvider);
904  saveData(os, myKeepInput);
905  {
906  int64 length = myInputs.entries();
907  UTwrite(os, &length);
908  for (exint i = 0; i < length; i++)
909  {
910  auto && _curentry = myInputs(i);
911  (void) _curentry;
912  saveData(os, _curentry.input_name);
913  saveData(os, _curentry.input_shape);
914  saveData(os, _curentry.input_type);
915  saveData(os, _curentry.input_volorder);
916  saveData(os, _curentry.input_channelfirst);
917  saveData(os, _curentry.input_data);
918 
919  }
920  }
921  {
922  int64 length = myOutputs.entries();
923  UTwrite(os, &length);
924  for (exint i = 0; i < length; i++)
925  {
926  auto && _curentry = myOutputs(i);
927  (void) _curentry;
928  saveData(os, _curentry.output_name);
929  saveData(os, _curentry.output_shape);
930  saveData(os, _curentry.output_type);
931  saveData(os, _curentry.output_volorder);
932  saveData(os, _curentry.output_channelfirst);
933  saveData(os, _curentry.output_data);
934 
935  }
936  }
937 
938  }
939 
940  bool load(UT_IStream &is)
941  {
942  int32 v;
943  is.bread(&v, 1);
944  if (version() != v)
945  {
946  // Fail incompatible versions
947  return false;
948  }
949  loadData(is, myModelFile);
950  loadData(is, raw_myModelFile);
951  loadData(is, myDoMaxBatch);
952  loadData(is, myMaxBatch);
953  loadData(is, myProvider);
954  loadData(is, myKeepInput);
955  {
956  int64 length;
957  is.read(&length, 1);
958  myInputs.setSize(length);
959  for (exint i = 0; i < length; i++)
960  {
961  auto && _curentry = myInputs(i);
962  (void) _curentry;
963  loadData(is, _curentry.input_name);
964  loadData(is, _curentry.input_shape);
965  loadData(is, _curentry.input_type);
966  loadData(is, _curentry.input_volorder);
967  loadData(is, _curentry.input_channelfirst);
968  loadData(is, _curentry.input_data);
969 
970  }
971  }
972  {
973  int64 length;
974  is.read(&length, 1);
975  myOutputs.setSize(length);
976  for (exint i = 0; i < length; i++)
977  {
978  auto && _curentry = myOutputs(i);
979  (void) _curentry;
980  loadData(is, _curentry.output_name);
981  loadData(is, _curentry.output_shape);
982  loadData(is, _curentry.output_type);
983  loadData(is, _curentry.output_volorder);
984  loadData(is, _curentry.output_channelfirst);
985  loadData(is, _curentry.output_data);
986 
987  }
988  }
989 
990  return true;
991  }
992 
993  const UT_StringHolder & getModelFile() const { return myModelFile; }
994  void setModelFile(const UT_StringHolder & val) { myModelFile = val; }
996  {
997  SOP_Node *thissop = cookparms.getNode();
998  if (!thissop) return getModelFile();
1000  OP_Utils::evalOpParm(result, thissop, "modelfile", cookparms.getCookTime(), 0);
1001  return result;
1002  }
1003  const UT_StringHolder & raw_getModelFile() const { return raw_myModelFile; }
1004  void raw_setModelFile(const UT_StringHolder & val) { raw_myModelFile = val; }
1006  {
1007  SOP_Node *thissop = cookparms.getNode();
1008  if (!thissop) return raw_getModelFile();
1010  OP_Utils::evalOpParmRaw(result, thissop, "modelfile", cookparms.getCookTime(), 0);
1011  return result;
1012  }
1013  bool getDoMaxBatch() const { return myDoMaxBatch; }
1014  void setDoMaxBatch(bool val) { myDoMaxBatch = val; }
1015  bool opDoMaxBatch(const SOP_NodeVerb::CookParms &cookparms) const
1016  {
1017  SOP_Node *thissop = cookparms.getNode();
1018  if (!thissop) return getDoMaxBatch();
1019  bool result;
1020  OP_Utils::evalOpParm(result, thissop, "domaxbatch", cookparms.getCookTime(), 0);
1021  return result;
1022  }
1023  int64 getMaxBatch() const { return myMaxBatch; }
1024  void setMaxBatch(int64 val) { myMaxBatch = val; }
1025  int64 opMaxBatch(const SOP_NodeVerb::CookParms &cookparms) const
1026  {
1027  SOP_Node *thissop = cookparms.getNode();
1028  if (!thissop) return getMaxBatch();
1029  int64 result;
1030  OP_Utils::evalOpParm(result, thissop, "maxbatch", cookparms.getCookTime(), 0);
1031  return result;
1032  }
1033  int64 getProvider() const { return myProvider; }
1034  void setProvider(int64 val) { myProvider = val; }
1035  int64 opProvider(const SOP_NodeVerb::CookParms &cookparms) const
1036  {
1037  SOP_Node *thissop = cookparms.getNode();
1038  if (!thissop) return getProvider();
1039  int64 result;
1040  OP_Utils::evalOpParm(result, thissop, "provider", cookparms.getCookTime(), 0);
1041  return result;
1042  }
1043  bool getKeepInput() const { return myKeepInput; }
1044  void setKeepInput(bool val) { myKeepInput = val; }
1045  bool opKeepInput(const SOP_NodeVerb::CookParms &cookparms) const
1046  {
1047  SOP_Node *thissop = cookparms.getNode();
1048  if (!thissop) return getKeepInput();
1049  bool result;
1050  OP_Utils::evalOpParm(result, thissop, "keepinput", cookparms.getCookTime(), 0);
1051  return result;
1052  }
1053  const UT_Array<Inputs> &getInputs() const { return myInputs; }
1054 void setInputs(const UT_Array<Inputs> &val) { myInputs = val; }
1055  exint opInputs(const SOP_NodeVerb::CookParms &cookparms) const
1056  {
1057  SOP_Node *thissop = cookparms.getNode();
1058  if (!thissop) return getInputs().entries();
1059  exint result;
1060  OP_Utils::evalOpParm(result, thissop, "inputs", cookparms.getCookTime(), 0);
1061  return result;
1062  }
1064  { return opinstInputs_input_name(cookparms, &_idx); }
1065  UT_StringHolder opinstInputs_input_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1066  {
1067  SOP_Node *thissop = cookparms.getNode();
1068  if (!thissop) return (myInputs(_idx[0]).input_name);
1069  int _parmidx[2-1];
1070  _parmidx[1-1] = _idx[1-1] + 1;
1071 
1073  OP_Utils::evalOpParmInst(result, thissop, "input_name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1074  return (result);
1075  }
1077  { return opinstInputs_input_shape(cookparms, &_idx); }
1078  UT_Matrix3D opinstInputs_input_shape(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1079  {
1080  SOP_Node *thissop = cookparms.getNode();
1081  if (!thissop) return (myInputs(_idx[0]).input_shape);
1082  int _parmidx[2-1];
1083  _parmidx[1-1] = _idx[1-1] + 1;
1084 
1086  OP_Utils::evalOpParmInst(result, thissop, "input_shape#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1087  return (result);
1088  }
1089  int64 opInputs_input_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1090  { return opinstInputs_input_type(cookparms, &_idx); }
1091  int64 opinstInputs_input_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1092  {
1093  SOP_Node *thissop = cookparms.getNode();
1094  if (!thissop) return (myInputs(_idx[0]).input_type);
1095  int _parmidx[2-1];
1096  _parmidx[1-1] = _idx[1-1] + 1;
1097 
1098  int64 result;
1099  OP_Utils::evalOpParmInst(result, thissop, "input_type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1100  return (result);
1101  }
1102  int64 opInputs_input_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1103  { return opinstInputs_input_volorder(cookparms, &_idx); }
1104  int64 opinstInputs_input_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1105  {
1106  SOP_Node *thissop = cookparms.getNode();
1107  if (!thissop) return (myInputs(_idx[0]).input_volorder);
1108  int _parmidx[2-1];
1109  _parmidx[1-1] = _idx[1-1] + 1;
1110 
1111  int64 result;
1112  OP_Utils::evalOpParmInst(result, thissop, "input_volorder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1113  return (result);
1114  }
1115  bool opInputs_input_channelfirst(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1116  { return opinstInputs_input_channelfirst(cookparms, &_idx); }
1117  bool opinstInputs_input_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1118  {
1119  SOP_Node *thissop = cookparms.getNode();
1120  if (!thissop) return (myInputs(_idx[0]).input_channelfirst);
1121  int _parmidx[2-1];
1122  _parmidx[1-1] = _idx[1-1] + 1;
1123 
1124  bool result;
1125  OP_Utils::evalOpParmInst(result, thissop, "input_channelfirst#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1126  return (result);
1127  }
1129  { return opinstInputs_input_data(cookparms, &_idx); }
1130  UT_StringHolder opinstInputs_input_data(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1131  {
1132  SOP_Node *thissop = cookparms.getNode();
1133  if (!thissop) return (myInputs(_idx[0]).input_data);
1134  int _parmidx[2-1];
1135  _parmidx[1-1] = _idx[1-1] + 1;
1136 
1138  OP_Utils::evalOpParmInst(result, thissop, "input_data#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1139  return (result);
1140  }
1141 
1142  const UT_Array<Outputs> &getOutputs() const { return myOutputs; }
1143 void setOutputs(const UT_Array<Outputs> &val) { myOutputs = val; }
1144  exint opOutputs(const SOP_NodeVerb::CookParms &cookparms) const
1145  {
1146  SOP_Node *thissop = cookparms.getNode();
1147  if (!thissop) return getOutputs().entries();
1148  exint result;
1149  OP_Utils::evalOpParm(result, thissop, "outputs", cookparms.getCookTime(), 0);
1150  return result;
1151  }
1153  { return opinstOutputs_output_name(cookparms, &_idx); }
1154  UT_StringHolder opinstOutputs_output_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1155  {
1156  SOP_Node *thissop = cookparms.getNode();
1157  if (!thissop) return (myOutputs(_idx[0]).output_name);
1158  int _parmidx[2-1];
1159  _parmidx[1-1] = _idx[1-1] + 1;
1160 
1162  OP_Utils::evalOpParmInst(result, thissop, "output_name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1163  return (result);
1164  }
1166  { return opinstOutputs_output_shape(cookparms, &_idx); }
1167  UT_Matrix3D opinstOutputs_output_shape(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1168  {
1169  SOP_Node *thissop = cookparms.getNode();
1170  if (!thissop) return (myOutputs(_idx[0]).output_shape);
1171  int _parmidx[2-1];
1172  _parmidx[1-1] = _idx[1-1] + 1;
1173 
1175  OP_Utils::evalOpParmInst(result, thissop, "output_shape#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1176  return (result);
1177  }
1178  int64 opOutputs_output_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1179  { return opinstOutputs_output_type(cookparms, &_idx); }
1180  int64 opinstOutputs_output_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1181  {
1182  SOP_Node *thissop = cookparms.getNode();
1183  if (!thissop) return (myOutputs(_idx[0]).output_type);
1184  int _parmidx[2-1];
1185  _parmidx[1-1] = _idx[1-1] + 1;
1186 
1187  int64 result;
1188  OP_Utils::evalOpParmInst(result, thissop, "output_type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1189  return (result);
1190  }
1191  int64 opOutputs_output_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1192  { return opinstOutputs_output_volorder(cookparms, &_idx); }
1193  int64 opinstOutputs_output_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1194  {
1195  SOP_Node *thissop = cookparms.getNode();
1196  if (!thissop) return (myOutputs(_idx[0]).output_volorder);
1197  int _parmidx[2-1];
1198  _parmidx[1-1] = _idx[1-1] + 1;
1199 
1200  int64 result;
1201  OP_Utils::evalOpParmInst(result, thissop, "output_volorder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1202  return (result);
1203  }
1204  bool opOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1205  { return opinstOutputs_output_channelfirst(cookparms, &_idx); }
1206  bool opinstOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1207  {
1208  SOP_Node *thissop = cookparms.getNode();
1209  if (!thissop) return (myOutputs(_idx[0]).output_channelfirst);
1210  int _parmidx[2-1];
1211  _parmidx[1-1] = _idx[1-1] + 1;
1212 
1213  bool result;
1214  OP_Utils::evalOpParmInst(result, thissop, "output_channelfirst#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1215  return (result);
1216  }
1218  { return opinstOutputs_output_data(cookparms, &_idx); }
1219  UT_StringHolder opinstOutputs_output_data(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1220  {
1221  SOP_Node *thissop = cookparms.getNode();
1222  if (!thissop) return (myOutputs(_idx[0]).output_data);
1223  int _parmidx[2-1];
1224  _parmidx[1-1] = _idx[1-1] + 1;
1225 
1227  OP_Utils::evalOpParmInst(result, thissop, "output_data#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1228  return (result);
1229  }
1230 
1231 
1232 private:
1233  UT_StringHolder myModelFile;
1234  UT_StringHolder raw_myModelFile;
1235  bool myDoMaxBatch;
1236  int64 myMaxBatch;
1237  int64 myProvider;
1238  bool myKeepInput;
1239  UT_Array<Inputs> myInputs;
1240  UT_Array<Outputs> myOutputs;
1241 
1242 };
type
Definition: core.h:556
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
UT_StringHolder opinstOutputs_output_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const char * getNestParmName(TempIndex fieldnum) const override
void setKeepInput(bool val)
int64 opinstInputs_input_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void save(std::ostream &os) const
bool opInputs_input_channelfirst(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
SYS_FORCE_INLINE UT_StringHolder getToken(Input_type enum_value)
int64 opProvider(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
bool opinstInputs_input_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opDoMaxBatch(const SOP_NodeVerb::CookParms &cookparms) const
void setOutputs(const UT_Array< Outputs > &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder raw_opModelFile(const SOP_NodeVerb::CookParms &cookparms) const
void
Definition: png.h:1083
bool operator==(const SOP_ONNXParms &src) const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
bool operator!=(const SOP_ONNXParms &src) const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void setInputs(const UT_Array< Inputs > &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_StringHolder opinstInputs_input_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setProvider(int64 val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
const UT_StringHolder & getModelFile() const
virtual void evalOpParmRaw(UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
UT_StringHolder opinstInputs_input_data(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE const char * buffer() const
bool isParmColorRamp(exint idx) const override
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
int64 opInputs_input_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
An output stream object that owns its own string buffer storage.
bool getDoMaxBatch() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, bool &v)
bool operator==(const Outputs &src) const
**But if you need a result
Definition: thread.h:622
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
int64 opOutputs_output_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 getMaxBatch() const
UT_StringHolder createString(const UT_Array< Outputs > &list) const
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
UT_StringHolder opModelFile(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const Inputs &src) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
int64 opInputs_input_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint opInputs(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opInputs_input_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, UT_Matrix3D v)
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
UT_StringHolder createString(const UT_Array< Inputs > &list) const
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setMaxBatch(int64 val)
int64 opinstInputs_input_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
UT_Matrix3D opOutputs_output_shape(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, int64 &v)
exint length() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_StringHolder opInputs_input_data(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_StringHolder input_data
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opOutputs_output_data(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool operator!=(const Outputs &src) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_StringHolder & raw_getModelFile() const
UT_StringHolder input_name
void setDoMaxBatch(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
int64 getProvider() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GT_API const UT_StringHolder version
bool opOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:655
UT_Matrix3D opInputs_input_shape(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opinstOutputs_output_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void copyFrom(const OP_NodeParms *src) override
UT_StringHolder output_name
UT_StringHolder opinstOutputs_output_data(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setModelFile(const UT_StringHolder &val)
const UT_Array< Outputs > & getOutputs() const
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
UT_StringHolder opOutputs_output_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void raw_setModelFile(const UT_StringHolder &val)
UT_Matrix3D opinstInputs_input_shape(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opMaxBatch(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool getKeepInput() const
GLuint GLfloat * val
Definition: glcorearb.h:1608
bool load(UT_IStream &is)
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
int64 opinstOutputs_output_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
ParmType getNestParmType(TempIndex fieldnum) const override
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void saveData(std::ostream &os, UT_Vector3D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
int64 opOutputs_output_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_Vector4D v)
GLboolean r
Definition: glcorearb.h:1222
UT_StringHolder output_data
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint opOutputs(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_Matrix3D opinstOutputs_output_shape(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, bool v)
const UT_Array< Inputs > & getInputs() const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, fpreal64 &v)
bool opinstOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
SYS_FORCE_INLINE bool isstring() const
bool operator==(const Inputs &src) const
bool opKeepInput(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static int version()