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