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 <SOP/SOP_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  myKeepInput = false;
250  myInputs.setSize(1);
251  myOutputs.setSize(1);
252  myDoMaxBatch = false;
253  myMaxBatch = 65536;
254  myCuda = false;
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 (myKeepInput != src.myKeepInput) return false;
270  if (myInputs != src.myInputs) return false;
271  if (myOutputs != src.myOutputs) return false;
272  if (myDoMaxBatch != src.myDoMaxBatch) return false;
273  if (myMaxBatch != src.myMaxBatch) return false;
274  if (myCuda != src.myCuda) return false;
275 
276  return true;
277  }
278  bool operator!=(const SOP_ONNXParms &src) const
279  {
280  return !operator==(src);
281  }
286 
287 
288 
289  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
290  {
291  myModelFile = ""_UTsh;
292  if (true)
293  graph->evalOpParm(myModelFile, nodeidx, "modelfile", time, 0);
294  raw_myModelFile = ""_UTsh;
295  if (true)
296  graph->evalOpParmRaw(raw_myModelFile, nodeidx, "modelfile", time, 0);
297  myKeepInput = false;
298  if (true)
299  graph->evalOpParm(myKeepInput, nodeidx, "keepinput", time, 0);
300  if (true)
301  {
302  int64 length = 0;
303  graph->evalOpParm(length, nodeidx, "inputs", time, 0);
304  if (length < 0) length = 0;
305  myInputs.setSize(length);
306  for (exint i = 0; i < length; i++)
307  {
308  int parmidx[1];
309  int offsets[1];
310  parmidx[0] = i+1;
311  offsets[0] = 1;
312  auto && _curentry = myInputs(i);
313  (void) _curentry;
314  _curentry.input_name = ""_UTsh;
315  if (true)
316  graph->evalOpParmInst(_curentry.input_name, nodeidx, "input_name#", parmidx, offsets, time, 0, 2-1);
317  _curentry.input_shape = 1;
318  if (true)
319  graph->evalOpParmInst(_curentry.input_shape, nodeidx, "input_shape#", parmidx, offsets, time, 0, 2-1);
320  _curentry.input_type = 0;
321  if (true)
322  graph->evalOpParmInst(_curentry.input_type, nodeidx, "input_type#", parmidx, offsets, time, 0, 2-1);
323  _curentry.input_volorder = 0;
324  if (true && ( (true&&!(((_curentry.input_type!=0)))) ) )
325  graph->evalOpParmInst(_curentry.input_volorder, nodeidx, "input_volorder#", parmidx, offsets, time, 0, 2-1);
326  _curentry.input_channelfirst = false;
327  if (true && ( (true&&!(((_curentry.input_type!=0)))) ) )
328  graph->evalOpParmInst(_curentry.input_channelfirst, nodeidx, "input_channelfirst#", parmidx, offsets, time, 0, 2-1);
329  _curentry.input_data = ""_UTsh;
330  if (true)
331  graph->evalOpParmInst(_curentry.input_data, nodeidx, "input_data#", parmidx, offsets, time, 0, 2-1);
332 
333  }
334  }
335  else
336  myInputs.clear();
337  if (true)
338  {
339  int64 length = 0;
340  graph->evalOpParm(length, nodeidx, "outputs", time, 0);
341  if (length < 0) length = 0;
342  myOutputs.setSize(length);
343  for (exint i = 0; i < length; i++)
344  {
345  int parmidx[1];
346  int offsets[1];
347  parmidx[0] = i+1;
348  offsets[0] = 1;
349  auto && _curentry = myOutputs(i);
350  (void) _curentry;
351  _curentry.output_name = ""_UTsh;
352  if (true)
353  graph->evalOpParmInst(_curentry.output_name, nodeidx, "output_name#", parmidx, offsets, time, 0, 2-1);
354  _curentry.output_shape = 1;
355  if (true)
356  graph->evalOpParmInst(_curentry.output_shape, nodeidx, "output_shape#", parmidx, offsets, time, 0, 2-1);
357  _curentry.output_type = 0;
358  if (true)
359  graph->evalOpParmInst(_curentry.output_type, nodeidx, "output_type#", parmidx, offsets, time, 0, 2-1);
360  _curentry.output_volorder = 0;
361  if (true && ( (true&&!(((_curentry.output_type!=0)))) ) )
362  graph->evalOpParmInst(_curentry.output_volorder, nodeidx, "output_volorder#", parmidx, offsets, time, 0, 2-1);
363  _curentry.output_channelfirst = false;
364  if (true && ( (true&&!(((_curentry.output_type!=0)))) ) )
365  graph->evalOpParmInst(_curentry.output_channelfirst, nodeidx, "output_channelfirst#", parmidx, offsets, time, 0, 2-1);
366  _curentry.output_data = ""_UTsh;
367  if (true)
368  graph->evalOpParmInst(_curentry.output_data, nodeidx, "output_data#", parmidx, offsets, time, 0, 2-1);
369 
370  }
371  }
372  else
373  myOutputs.clear();
374  myDoMaxBatch = false;
375  if (true)
376  graph->evalOpParm(myDoMaxBatch, nodeidx, "domaxbatch", time, 0);
377  myMaxBatch = 65536;
378  if (true && ( (true&&!(((getDoMaxBatch()==0)))) ) )
379  graph->evalOpParm(myMaxBatch, nodeidx, "maxbatch", time, 0);
380  myCuda = false;
381  if (true)
382  graph->evalOpParm(myCuda, nodeidx, "cuda", time, 0);
383 
384  }
385 
386 
387  void loadFromOpSubclass(const LoadParms &loadparms) override
388  {
389  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
390  }
391 
392 
393  void copyFrom(const OP_NodeParms *src) override
394  {
395  *this = *((const SOP_ONNXParms *)src);
396  }
397 
398  template <typename T>
399  void
400  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
401  {
402  if (idx.size() < 1)
403  return;
404  UT_ASSERT(idx.size() == instance.size()+1);
405  if (idx.size() != instance.size()+1)
406  return;
407  switch (idx[0])
408  {
409  case 0:
410  coerceValue(value, myModelFile);
411  break;
412  case 1:
413  coerceValue(value, myKeepInput);
414  break;
415  case 2:
416  if (idx.size() == 1)
417  coerceValue(value, myInputs.entries());
418  else if (instance[0] < myInputs.entries())
419  {
420  auto && _data = myInputs(instance[0]);
421  switch (idx[1])
422  {
423  case 0:
424  coerceValue(value, _data.input_name);
425  break;
426  case 1:
427  coerceValue(value, _data.input_shape);
428  break;
429  case 2:
430  coerceValue(value, _data.input_type);
431  break;
432  case 3:
433  coerceValue(value, _data.input_volorder);
434  break;
435  case 4:
436  coerceValue(value, _data.input_channelfirst);
437  break;
438  case 5:
439  coerceValue(value, _data.input_data);
440  break;
441 
442  }
443  }
444  break;
445  case 3:
446  if (idx.size() == 1)
447  coerceValue(value, myOutputs.entries());
448  else if (instance[0] < myOutputs.entries())
449  {
450  auto && _data = myOutputs(instance[0]);
451  switch (idx[1])
452  {
453  case 0:
454  coerceValue(value, _data.output_name);
455  break;
456  case 1:
457  coerceValue(value, _data.output_shape);
458  break;
459  case 2:
460  coerceValue(value, _data.output_type);
461  break;
462  case 3:
463  coerceValue(value, _data.output_volorder);
464  break;
465  case 4:
466  coerceValue(value, _data.output_channelfirst);
467  break;
468  case 5:
469  coerceValue(value, _data.output_data);
470  break;
471 
472  }
473  }
474  break;
475  case 4:
476  coerceValue(value, myDoMaxBatch);
477  break;
478  case 5:
479  coerceValue(value, myMaxBatch);
480  break;
481  case 6:
482  coerceValue(value, myCuda);
483  break;
484 
485  }
486  }
487 
488  bool isParmColorRamp(exint idx) const override
489  {
490  switch (idx)
491  {
492 
493  }
494  return false;
495  }
496 
497  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
498  { doGetParmValue(idx, instance, value); }
499  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
500  { doGetParmValue(idx, instance, value); }
501  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
502  { doGetParmValue(idx, instance, value); }
503  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
504  { doGetParmValue(idx, instance, value); }
505  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
506  { doGetParmValue(idx, instance, value); }
507  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
508  { doGetParmValue(idx, instance, value); }
509  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
510  { doGetParmValue(idx, instance, value); }
511  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
512  { doGetParmValue(idx, instance, value); }
513  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
514  { doGetParmValue(idx, instance, value); }
515  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
516  { doGetParmValue(idx, instance, value); }
517  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
518  { doGetParmValue(idx, instance, value); }
519 
520  template <typename T>
521  void
522  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
523  {
524  if (idx.size() < 1)
525  return;
526  UT_ASSERT(idx.size() == instance.size()+1);
527  if (idx.size() != instance.size()+1)
528  return;
529  switch (idx[0])
530  {
531  case 0:
532  coerceValue(myModelFile, ( ( value ) ));
533  break;
534  case 1:
535  coerceValue(myKeepInput, ( ( value ) ));
536  break;
537  case 2:
538  if (idx.size() == 1)
539  {
540  exint newsize;
541  coerceValue(newsize, value);
542  if (newsize < 0) newsize = 0;
543  myInputs.setSize(newsize);
544  }
545  else
546  {
547  if (instance[0] < 0)
548  return;
549  myInputs.setSizeIfNeeded(instance[0]+1);
550  auto && _data = myInputs(instance[0]);
551  switch (idx[1])
552  {
553  case 0:
554  coerceValue(_data.input_name, value);
555  break;
556  case 1:
557  coerceValue(_data.input_shape, value);
558  break;
559  case 2:
560  coerceValue(_data.input_type, value);
561  break;
562  case 3:
563  coerceValue(_data.input_volorder, value);
564  break;
565  case 4:
566  coerceValue(_data.input_channelfirst, value);
567  break;
568  case 5:
569  coerceValue(_data.input_data, value);
570  break;
571 
572  }
573  }
574  break;
575  case 3:
576  if (idx.size() == 1)
577  {
578  exint newsize;
579  coerceValue(newsize, value);
580  if (newsize < 0) newsize = 0;
581  myOutputs.setSize(newsize);
582  }
583  else
584  {
585  if (instance[0] < 0)
586  return;
587  myOutputs.setSizeIfNeeded(instance[0]+1);
588  auto && _data = myOutputs(instance[0]);
589  switch (idx[1])
590  {
591  case 0:
592  coerceValue(_data.output_name, value);
593  break;
594  case 1:
595  coerceValue(_data.output_shape, value);
596  break;
597  case 2:
598  coerceValue(_data.output_type, value);
599  break;
600  case 3:
601  coerceValue(_data.output_volorder, value);
602  break;
603  case 4:
604  coerceValue(_data.output_channelfirst, value);
605  break;
606  case 5:
607  coerceValue(_data.output_data, value);
608  break;
609 
610  }
611  }
612  break;
613  case 4:
614  coerceValue(myDoMaxBatch, ( ( value ) ));
615  break;
616  case 5:
617  coerceValue(myMaxBatch, ( ( value ) ));
618  break;
619  case 6:
620  coerceValue(myCuda, ( ( value ) ));
621  break;
622 
623  }
624  }
625 
626  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
627  { doSetParmValue(idx, instance, value); }
628  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
629  { doSetParmValue(idx, instance, value); }
630  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
631  { doSetParmValue(idx, instance, value); }
632  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
633  { doSetParmValue(idx, instance, value); }
634  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
635  { doSetParmValue(idx, instance, value); }
636  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
637  { doSetParmValue(idx, instance, value); }
638  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
639  { doSetParmValue(idx, instance, value); }
640  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
641  { doSetParmValue(idx, instance, value); }
642  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
643  { doSetParmValue(idx, instance, value); }
644  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
645  { doSetParmValue(idx, instance, value); }
646  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
647  { doSetParmValue(idx, instance, value); }
648 
649  exint getNestNumParms(TempIndex idx) const override
650  {
651  if (idx.size() == 0)
652  return 7;
653  switch (idx[0])
654  {
655  case 2:
656  return 6;
657  case 3:
658  return 6;
659 
660  }
661  // Invalid
662  return 0;
663  }
664 
665  const char *getNestParmName(TempIndex fieldnum) const override
666  {
667  if (fieldnum.size() < 1)
668  return 0;
669  switch (fieldnum[0])
670  {
671  case 0:
672  return "modelfile";
673  case 1:
674  return "keepinput";
675  case 2:
676  if (fieldnum.size() == 1)
677  return "inputs";
678  switch (fieldnum[1])
679  {
680  case 0:
681  return "input_name#";
682  case 1:
683  return "input_shape#";
684  case 2:
685  return "input_type#";
686  case 3:
687  return "input_volorder#";
688  case 4:
689  return "input_channelfirst#";
690  case 5:
691  return "input_data#";
692 
693  }
694  return 0;
695  case 3:
696  if (fieldnum.size() == 1)
697  return "outputs";
698  switch (fieldnum[1])
699  {
700  case 0:
701  return "output_name#";
702  case 1:
703  return "output_shape#";
704  case 2:
705  return "output_type#";
706  case 3:
707  return "output_volorder#";
708  case 4:
709  return "output_channelfirst#";
710  case 5:
711  return "output_data#";
712 
713  }
714  return 0;
715  case 4:
716  return "domaxbatch";
717  case 5:
718  return "maxbatch";
719  case 6:
720  return "cuda";
721 
722  }
723  return 0;
724  }
725 
726  ParmType getNestParmType(TempIndex fieldnum) const override
727  {
728  if (fieldnum.size() < 1)
729  return PARM_UNSUPPORTED;
730  switch (fieldnum[0])
731  {
732  case 0:
733  return PARM_STRING;
734  case 1:
735  return PARM_INTEGER;
736  case 2:
737  if (fieldnum.size() == 1)
738  return PARM_MULTIPARM;
739  switch (fieldnum[1])
740  {
741  case 0:
742  return PARM_STRING;
743  case 1:
744  return PARM_MATRIX3;
745  case 2:
746  return PARM_INTEGER;
747  case 3:
748  return PARM_INTEGER;
749  case 4:
750  return PARM_INTEGER;
751  case 5:
752  return PARM_STRING;
753 
754  }
755  return PARM_UNSUPPORTED;
756  case 3:
757  if (fieldnum.size() == 1)
758  return PARM_MULTIPARM;
759  switch (fieldnum[1])
760  {
761  case 0:
762  return PARM_STRING;
763  case 1:
764  return PARM_MATRIX3;
765  case 2:
766  return PARM_INTEGER;
767  case 3:
768  return PARM_INTEGER;
769  case 4:
770  return PARM_INTEGER;
771  case 5:
772  return PARM_STRING;
773 
774  }
775  return PARM_UNSUPPORTED;
776  case 4:
777  return PARM_INTEGER;
778  case 5:
779  return PARM_INTEGER;
780  case 6:
781  return PARM_INTEGER;
782 
783  }
784  return PARM_UNSUPPORTED;
785  }
786 
787  // Boiler plate to load individual types.
788  static void loadData(UT_IStream &is, int64 &v)
789  { is.bread(&v, 1); }
790  static void loadData(UT_IStream &is, bool &v)
791  { int64 iv; is.bread(&iv, 1); v = iv; }
792  static void loadData(UT_IStream &is, fpreal64 &v)
793  { is.bread<fpreal64>(&v, 1); }
794  static void loadData(UT_IStream &is, UT_Vector2D &v)
795  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
796  static void loadData(UT_IStream &is, UT_Vector3D &v)
797  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
798  is.bread<fpreal64>(&v.z(), 1); }
799  static void loadData(UT_IStream &is, UT_Vector4D &v)
800  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
801  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
802  static void loadData(UT_IStream &is, UT_Matrix2D &v)
803  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
804  static void loadData(UT_IStream &is, UT_Matrix3D &v)
805  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
806  static void loadData(UT_IStream &is, UT_Matrix4D &v)
807  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
808  static void loadData(UT_IStream &is, UT_Vector2I &v)
809  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
810  static void loadData(UT_IStream &is, UT_Vector3I &v)
811  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
812  is.bread<int64>(&v.z(), 1); }
813  static void loadData(UT_IStream &is, UT_Vector4I &v)
814  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
815  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
817  { is.bread(v); }
819  { UT_StringHolder rampdata;
820  loadData(is, rampdata);
821  if (rampdata.isstring())
822  {
823  v.reset(new UT_Ramp());
824  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
825  v->load(istr);
826  }
827  else v.reset();
828  }
831  loadData(is, data);
832  if (data.isstring())
833  {
834  // Find the data type.
835  const char *colon = UT_StringWrap(data).findChar(':');
836  if (colon)
837  {
838  int typelen = colon - data.buffer();
840  type.strncpy(data.buffer(), typelen);
841  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
842 
843  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
844  }
845  }
846  else v.reset();
847  }
848 
849  static void saveData(std::ostream &os, int64 v)
850  { UTwrite(os, &v); }
851  static void saveData(std::ostream &os, bool v)
852  { int64 iv = v; UTwrite(os, &iv); }
853  static void saveData(std::ostream &os, fpreal64 v)
854  { UTwrite<fpreal64>(os, &v); }
855  static void saveData(std::ostream &os, UT_Vector2D v)
856  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
857  static void saveData(std::ostream &os, UT_Vector3D v)
858  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
859  UTwrite<fpreal64>(os, &v.z()); }
860  static void saveData(std::ostream &os, UT_Vector4D v)
861  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
862  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
863  static void saveData(std::ostream &os, UT_Matrix2D v)
865  static void saveData(std::ostream &os, UT_Matrix3D v)
867  static void saveData(std::ostream &os, UT_Matrix4D v)
869  static void saveData(std::ostream &os, UT_StringHolder s)
870  { UT_StringWrap(s).saveBinary(os); }
871  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
873  UT_OStringStream ostr;
874  if (s) s->save(ostr);
875  result = ostr.str();
876  saveData(os, result);
877  }
878  static void saveData(std::ostream &os, PRM_DataItemHandle s)
880  UT_OStringStream ostr;
881  if (s)
882  {
883  ostr << s->getDataTypeToken();
884  ostr << ":";
885  s->saveBinary(ostr);
886  }
887  result = ostr.str();
888  saveData(os, result);
889  }
890 
891 
892  void save(std::ostream &os) const
893  {
894  int32 v = version();
895  UTwrite(os, &v);
896  saveData(os, myModelFile);
897  saveData(os, raw_myModelFile);
898  saveData(os, myKeepInput);
899  {
900  int64 length = myInputs.entries();
901  UTwrite(os, &length);
902  for (exint i = 0; i < length; i++)
903  {
904  auto && _curentry = myInputs(i);
905  (void) _curentry;
906  saveData(os, _curentry.input_name);
907  saveData(os, _curentry.input_shape);
908  saveData(os, _curentry.input_type);
909  saveData(os, _curentry.input_volorder);
910  saveData(os, _curentry.input_channelfirst);
911  saveData(os, _curentry.input_data);
912 
913  }
914  }
915  {
916  int64 length = myOutputs.entries();
917  UTwrite(os, &length);
918  for (exint i = 0; i < length; i++)
919  {
920  auto && _curentry = myOutputs(i);
921  (void) _curentry;
922  saveData(os, _curentry.output_name);
923  saveData(os, _curentry.output_shape);
924  saveData(os, _curentry.output_type);
925  saveData(os, _curentry.output_volorder);
926  saveData(os, _curentry.output_channelfirst);
927  saveData(os, _curentry.output_data);
928 
929  }
930  }
931  saveData(os, myDoMaxBatch);
932  saveData(os, myMaxBatch);
933  saveData(os, myCuda);
934 
935  }
936 
937  bool load(UT_IStream &is)
938  {
939  int32 v;
940  is.bread(&v, 1);
941  if (version() != v)
942  {
943  // Fail incompatible versions
944  return false;
945  }
946  loadData(is, myModelFile);
947  loadData(is, raw_myModelFile);
948  loadData(is, myKeepInput);
949  {
950  int64 length;
951  is.read(&length, 1);
952  myInputs.setSize(length);
953  for (exint i = 0; i < length; i++)
954  {
955  auto && _curentry = myInputs(i);
956  (void) _curentry;
957  loadData(is, _curentry.input_name);
958  loadData(is, _curentry.input_shape);
959  loadData(is, _curentry.input_type);
960  loadData(is, _curentry.input_volorder);
961  loadData(is, _curentry.input_channelfirst);
962  loadData(is, _curentry.input_data);
963 
964  }
965  }
966  {
967  int64 length;
968  is.read(&length, 1);
969  myOutputs.setSize(length);
970  for (exint i = 0; i < length; i++)
971  {
972  auto && _curentry = myOutputs(i);
973  (void) _curentry;
974  loadData(is, _curentry.output_name);
975  loadData(is, _curentry.output_shape);
976  loadData(is, _curentry.output_type);
977  loadData(is, _curentry.output_volorder);
978  loadData(is, _curentry.output_channelfirst);
979  loadData(is, _curentry.output_data);
980 
981  }
982  }
983  loadData(is, myDoMaxBatch);
984  loadData(is, myMaxBatch);
985  loadData(is, myCuda);
986 
987  return true;
988  }
989 
990  const UT_StringHolder & getModelFile() const { return myModelFile; }
991  void setModelFile(const UT_StringHolder & val) { myModelFile = val; }
993  {
994  SOP_Node *thissop = cookparms.getNode();
995  if (!thissop) return getModelFile();
997  OP_Utils::evalOpParm(result, thissop, "modelfile", cookparms.getCookTime(), 0);
998  return result;
999  }
1000  const UT_StringHolder & raw_getModelFile() const { return raw_myModelFile; }
1001  void raw_setModelFile(const UT_StringHolder & val) { raw_myModelFile = val; }
1003  {
1004  SOP_Node *thissop = cookparms.getNode();
1005  if (!thissop) return raw_getModelFile();
1007  OP_Utils::evalOpParmRaw(result, thissop, "modelfile", cookparms.getCookTime(), 0);
1008  return result;
1009  }
1010  bool getKeepInput() const { return myKeepInput; }
1011  void setKeepInput(bool val) { myKeepInput = val; }
1012  bool opKeepInput(const SOP_NodeVerb::CookParms &cookparms) const
1013  {
1014  SOP_Node *thissop = cookparms.getNode();
1015  if (!thissop) return getKeepInput();
1016  bool result;
1017  OP_Utils::evalOpParm(result, thissop, "keepinput", cookparms.getCookTime(), 0);
1018  return result;
1019  }
1020  const UT_Array<Inputs> &getInputs() const { return myInputs; }
1021 void setInputs(const UT_Array<Inputs> &val) { myInputs = val; }
1022  exint opInputs(const SOP_NodeVerb::CookParms &cookparms) const
1023  {
1024  SOP_Node *thissop = cookparms.getNode();
1025  if (!thissop) return getInputs().entries();
1026  exint result;
1027  OP_Utils::evalOpParm(result, thissop, "inputs", cookparms.getCookTime(), 0);
1028  return result;
1029  }
1031  { return opinstInputs_input_name(cookparms, &_idx); }
1032  UT_StringHolder opinstInputs_input_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1033  {
1034  SOP_Node *thissop = cookparms.getNode();
1035  if (!thissop) return (myInputs(_idx[0]).input_name);
1036  int _parmidx[2-1];
1037  _parmidx[1-1] = _idx[1-1] + 1;
1038 
1040  OP_Utils::evalOpParmInst(result, thissop, "input_name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1041  return (result);
1042  }
1044  { return opinstInputs_input_shape(cookparms, &_idx); }
1045  UT_Matrix3D opinstInputs_input_shape(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1046  {
1047  SOP_Node *thissop = cookparms.getNode();
1048  if (!thissop) return (myInputs(_idx[0]).input_shape);
1049  int _parmidx[2-1];
1050  _parmidx[1-1] = _idx[1-1] + 1;
1051 
1053  OP_Utils::evalOpParmInst(result, thissop, "input_shape#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1054  return (result);
1055  }
1056  int64 opInputs_input_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1057  { return opinstInputs_input_type(cookparms, &_idx); }
1058  int64 opinstInputs_input_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1059  {
1060  SOP_Node *thissop = cookparms.getNode();
1061  if (!thissop) return (myInputs(_idx[0]).input_type);
1062  int _parmidx[2-1];
1063  _parmidx[1-1] = _idx[1-1] + 1;
1064 
1065  int64 result;
1066  OP_Utils::evalOpParmInst(result, thissop, "input_type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1067  return (result);
1068  }
1069  int64 opInputs_input_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1070  { return opinstInputs_input_volorder(cookparms, &_idx); }
1071  int64 opinstInputs_input_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1072  {
1073  SOP_Node *thissop = cookparms.getNode();
1074  if (!thissop) return (myInputs(_idx[0]).input_volorder);
1075  int _parmidx[2-1];
1076  _parmidx[1-1] = _idx[1-1] + 1;
1077 
1078  int64 result;
1079  OP_Utils::evalOpParmInst(result, thissop, "input_volorder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1080  return (result);
1081  }
1082  bool opInputs_input_channelfirst(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1083  { return opinstInputs_input_channelfirst(cookparms, &_idx); }
1084  bool opinstInputs_input_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1085  {
1086  SOP_Node *thissop = cookparms.getNode();
1087  if (!thissop) return (myInputs(_idx[0]).input_channelfirst);
1088  int _parmidx[2-1];
1089  _parmidx[1-1] = _idx[1-1] + 1;
1090 
1091  bool result;
1092  OP_Utils::evalOpParmInst(result, thissop, "input_channelfirst#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1093  return (result);
1094  }
1096  { return opinstInputs_input_data(cookparms, &_idx); }
1097  UT_StringHolder opinstInputs_input_data(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1098  {
1099  SOP_Node *thissop = cookparms.getNode();
1100  if (!thissop) return (myInputs(_idx[0]).input_data);
1101  int _parmidx[2-1];
1102  _parmidx[1-1] = _idx[1-1] + 1;
1103 
1105  OP_Utils::evalOpParmInst(result, thissop, "input_data#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1106  return (result);
1107  }
1108 
1109  const UT_Array<Outputs> &getOutputs() const { return myOutputs; }
1110 void setOutputs(const UT_Array<Outputs> &val) { myOutputs = val; }
1111  exint opOutputs(const SOP_NodeVerb::CookParms &cookparms) const
1112  {
1113  SOP_Node *thissop = cookparms.getNode();
1114  if (!thissop) return getOutputs().entries();
1115  exint result;
1116  OP_Utils::evalOpParm(result, thissop, "outputs", cookparms.getCookTime(), 0);
1117  return result;
1118  }
1120  { return opinstOutputs_output_name(cookparms, &_idx); }
1121  UT_StringHolder opinstOutputs_output_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1122  {
1123  SOP_Node *thissop = cookparms.getNode();
1124  if (!thissop) return (myOutputs(_idx[0]).output_name);
1125  int _parmidx[2-1];
1126  _parmidx[1-1] = _idx[1-1] + 1;
1127 
1129  OP_Utils::evalOpParmInst(result, thissop, "output_name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1130  return (result);
1131  }
1133  { return opinstOutputs_output_shape(cookparms, &_idx); }
1134  UT_Matrix3D opinstOutputs_output_shape(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1135  {
1136  SOP_Node *thissop = cookparms.getNode();
1137  if (!thissop) return (myOutputs(_idx[0]).output_shape);
1138  int _parmidx[2-1];
1139  _parmidx[1-1] = _idx[1-1] + 1;
1140 
1142  OP_Utils::evalOpParmInst(result, thissop, "output_shape#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1143  return (result);
1144  }
1145  int64 opOutputs_output_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1146  { return opinstOutputs_output_type(cookparms, &_idx); }
1147  int64 opinstOutputs_output_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1148  {
1149  SOP_Node *thissop = cookparms.getNode();
1150  if (!thissop) return (myOutputs(_idx[0]).output_type);
1151  int _parmidx[2-1];
1152  _parmidx[1-1] = _idx[1-1] + 1;
1153 
1154  int64 result;
1155  OP_Utils::evalOpParmInst(result, thissop, "output_type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1156  return (result);
1157  }
1158  int64 opOutputs_output_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1159  { return opinstOutputs_output_volorder(cookparms, &_idx); }
1160  int64 opinstOutputs_output_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1161  {
1162  SOP_Node *thissop = cookparms.getNode();
1163  if (!thissop) return (myOutputs(_idx[0]).output_volorder);
1164  int _parmidx[2-1];
1165  _parmidx[1-1] = _idx[1-1] + 1;
1166 
1167  int64 result;
1168  OP_Utils::evalOpParmInst(result, thissop, "output_volorder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1169  return (result);
1170  }
1171  bool opOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1172  { return opinstOutputs_output_channelfirst(cookparms, &_idx); }
1173  bool opinstOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1174  {
1175  SOP_Node *thissop = cookparms.getNode();
1176  if (!thissop) return (myOutputs(_idx[0]).output_channelfirst);
1177  int _parmidx[2-1];
1178  _parmidx[1-1] = _idx[1-1] + 1;
1179 
1180  bool result;
1181  OP_Utils::evalOpParmInst(result, thissop, "output_channelfirst#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1182  return (result);
1183  }
1185  { return opinstOutputs_output_data(cookparms, &_idx); }
1186  UT_StringHolder opinstOutputs_output_data(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1187  {
1188  SOP_Node *thissop = cookparms.getNode();
1189  if (!thissop) return (myOutputs(_idx[0]).output_data);
1190  int _parmidx[2-1];
1191  _parmidx[1-1] = _idx[1-1] + 1;
1192 
1194  OP_Utils::evalOpParmInst(result, thissop, "output_data#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1195  return (result);
1196  }
1197 
1198  bool getDoMaxBatch() const { return myDoMaxBatch; }
1199  void setDoMaxBatch(bool val) { myDoMaxBatch = val; }
1200  bool opDoMaxBatch(const SOP_NodeVerb::CookParms &cookparms) const
1201  {
1202  SOP_Node *thissop = cookparms.getNode();
1203  if (!thissop) return getDoMaxBatch();
1204  bool result;
1205  OP_Utils::evalOpParm(result, thissop, "domaxbatch", cookparms.getCookTime(), 0);
1206  return result;
1207  }
1208  int64 getMaxBatch() const { return myMaxBatch; }
1209  void setMaxBatch(int64 val) { myMaxBatch = val; }
1210  int64 opMaxBatch(const SOP_NodeVerb::CookParms &cookparms) const
1211  {
1212  SOP_Node *thissop = cookparms.getNode();
1213  if (!thissop) return getMaxBatch();
1214  int64 result;
1215  OP_Utils::evalOpParm(result, thissop, "maxbatch", cookparms.getCookTime(), 0);
1216  return result;
1217  }
1218  bool getCuda() const { return myCuda; }
1219  void setCuda(bool val) { myCuda = val; }
1220  bool opCuda(const SOP_NodeVerb::CookParms &cookparms) const
1221  {
1222  SOP_Node *thissop = cookparms.getNode();
1223  if (!thissop) return getCuda();
1224  bool result;
1225  OP_Utils::evalOpParm(result, thissop, "cuda", cookparms.getCookTime(), 0);
1226  return result;
1227  }
1228 
1229 private:
1230  UT_StringHolder myModelFile;
1231  UT_StringHolder raw_myModelFile;
1232  bool myKeepInput;
1233  UT_Array<Inputs> myInputs;
1234  UT_Array<Outputs> myOutputs;
1235  bool myDoMaxBatch;
1236  int64 myMaxBatch;
1237  bool myCuda;
1238 
1239 };
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)
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:62
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
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
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:613
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
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
bool getCuda() const
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
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:296
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:648
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
bool opCuda(const SOP_NodeVerb::CookParms &cookparms) const
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:277
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:92
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)
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:361
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:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void saveData(std::ostream &os, UT_Vector3D v)
Definition: core.h:1131
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
void setCuda(bool val)
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
type
Definition: core.h:1059
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
static void loadData(UT_IStream &is, fpreal64 &v)
bool opinstOutputs_output_channelfirst(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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()