HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribTransfer.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_AttribTransferEnums
24 {
25  enum class Srcgrouptype
26  {
27  PRIMITIVE = 0,
28  POINT
29  };
30  enum class Dstgrouptype
31  {
32  PRIMITIVE = 0,
33  POINT
34  };
35 }
36 
37 
39 {
40 public:
41  static int version() { return 1; }
42 
44  {
45  mySrcgroups = ""_UTsh;
46  mySrcgrouptype = 0;
47  myDstgroups = ""_UTsh;
48  myDstgrouptype = 0;
49  myDetailattribs = false;
50  myDetailattriblist = ""_UTsh;
51  myPrimitiveattribs = true;
52  myPrimattriblist = ""_UTsh;
53  myPointattribs = true;
54  myPointattriblist = ""_UTsh;
55  myVertexattribs = false;
56  myVertexattriblist = ""_UTsh;
57  myCopyvariable = true;
58  myMatchpattrib = false;
59  myKernel = "elendt"_UTsh;
60  myKernelradius = 10;
61  myMaxsamplecount = 1;
62  myThreshold = true;
63  myThresholddist = 10;
64  myBlendwidth = 0;
65  myUniformbias = 0.5;
66 
67  }
68 
69  explicit SOP_AttribTransferParms(const SOP_AttribTransferParms &) = default;
71  SOP_AttribTransferParms(SOP_AttribTransferParms &&) noexcept = default;
72  SOP_AttribTransferParms &operator=(SOP_AttribTransferParms &&) noexcept = default;
73 
74  ~SOP_AttribTransferParms() override {}
75 
77  {
78  if (mySrcgroups != src.mySrcgroups) return false;
79  if (mySrcgrouptype != src.mySrcgrouptype) return false;
80  if (myDstgroups != src.myDstgroups) return false;
81  if (myDstgrouptype != src.myDstgrouptype) return false;
82  if (myDetailattribs != src.myDetailattribs) return false;
83  if (myDetailattriblist != src.myDetailattriblist) return false;
84  if (myPrimitiveattribs != src.myPrimitiveattribs) return false;
85  if (myPrimattriblist != src.myPrimattriblist) return false;
86  if (myPointattribs != src.myPointattribs) return false;
87  if (myPointattriblist != src.myPointattriblist) return false;
88  if (myVertexattribs != src.myVertexattribs) return false;
89  if (myVertexattriblist != src.myVertexattriblist) return false;
90  if (myCopyvariable != src.myCopyvariable) return false;
91  if (myMatchpattrib != src.myMatchpattrib) return false;
92  if (myKernel != src.myKernel) return false;
93  if (myKernelradius != src.myKernelradius) return false;
94  if (myMaxsamplecount != src.myMaxsamplecount) return false;
95  if (myThreshold != src.myThreshold) return false;
96  if (myThresholddist != src.myThresholddist) return false;
97  if (myBlendwidth != src.myBlendwidth) return false;
98  if (myUniformbias != src.myUniformbias) return false;
99 
100  return true;
101  }
103  {
104  return !operator==(src);
105  }
108 
109 
110 
111  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
112  {
113  mySrcgroups = ""_UTsh;
114  if (true)
115  graph->evalOpParm(mySrcgroups, nodeidx, "srcgroups", time, 0);
116  mySrcgrouptype = 0;
117  if (true)
118  graph->evalOpParm(mySrcgrouptype, nodeidx, "srcgrouptype", time, 0);
119  myDstgroups = ""_UTsh;
120  if (true)
121  graph->evalOpParm(myDstgroups, nodeidx, "dstgroups", time, 0);
122  myDstgrouptype = 0;
123  if (true)
124  graph->evalOpParm(myDstgrouptype, nodeidx, "dstgrouptype", time, 0);
125  myDetailattribs = false;
126  if (true)
127  graph->evalOpParm(myDetailattribs, nodeidx, "detailattribs", time, 0);
128  myDetailattriblist = ""_UTsh;
129  if (true && ( (true&&!(((getDetailattribs()==0)))) ) )
130  graph->evalOpParm(myDetailattriblist, nodeidx, "detailattriblist", time, 0);
131  myPrimitiveattribs = true;
132  if (true)
133  graph->evalOpParm(myPrimitiveattribs, nodeidx, "primitiveattribs", time, 0);
134  myPrimattriblist = ""_UTsh;
135  if (true && ( (true&&!(((getPrimitiveattribs()==0)))) ) )
136  graph->evalOpParm(myPrimattriblist, nodeidx, "primattriblist", time, 0);
137  myPointattribs = true;
138  if (true)
139  graph->evalOpParm(myPointattribs, nodeidx, "pointattribs", time, 0);
140  myPointattriblist = ""_UTsh;
141  if (true && ( (true&&!(((getPointattribs()==0)))) ) )
142  graph->evalOpParm(myPointattriblist, nodeidx, "pointattriblist", time, 0);
143  myVertexattribs = false;
144  if (true)
145  graph->evalOpParm(myVertexattribs, nodeidx, "vertexattribs", time, 0);
146  myVertexattriblist = ""_UTsh;
147  if (true && ( (true&&!(((getVertexattribs()==0)))) ) )
148  graph->evalOpParm(myVertexattriblist, nodeidx, "vertexattriblist", time, 0);
149  myCopyvariable = true;
150  if (true)
151  graph->evalOpParm(myCopyvariable, nodeidx, "copyvariable", time, 0);
152  myMatchpattrib = false;
153  if (true)
154  graph->evalOpParm(myMatchpattrib, nodeidx, "matchpattrib", time, 0);
155  myKernel = "elendt"_UTsh;
156  if (true)
157  graph->evalOpParm(myKernel, nodeidx, "kernel", time, 0);
158  myKernelradius = 10;
159  if (true && ( (true&&!(((getKernel()=="uniform")))) ) )
160  graph->evalOpParm(myKernelradius, nodeidx, "kernelradius", time, 0);
161  myMaxsamplecount = 1;
162  if (true)
163  graph->evalOpParm(myMaxsamplecount, nodeidx, "maxsamplecount", time, 0);
164  myThreshold = true;
165  if (true)
166  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
167  myThresholddist = 10;
168  if (true && ( (true&&!(((getThreshold()==0)))) ) )
169  graph->evalOpParm(myThresholddist, nodeidx, "thresholddist", time, 0);
170  myBlendwidth = 0;
171  if (true && ( (true&&!(((getThreshold()==0)))) ) )
172  graph->evalOpParm(myBlendwidth, nodeidx, "blendwidth", time, 0);
173  myUniformbias = 0.5;
174  if (true && ( (true&&!(((getThreshold()==0))||((getKernel()!="uniform")))) ) )
175  graph->evalOpParm(myUniformbias, nodeidx, "uniformbias", time, 0);
176 
177  }
178 
179 
180  void loadFromOpSubclass(const LoadParms &loadparms) override
181  {
182  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
183  }
184 
185 
186  void copyFrom(const OP_NodeParms *src) override
187  {
188  *this = *((const SOP_AttribTransferParms *)src);
189  }
190 
191  template <typename T>
192  void
193  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
194  {
195  if (idx.size() < 1)
196  return;
197  UT_ASSERT(idx.size() == instance.size()+1);
198  if (idx.size() != instance.size()+1)
199  return;
200  switch (idx[0])
201  {
202  case 0:
203  coerceValue(value, mySrcgroups);
204  break;
205  case 1:
206  coerceValue(value, mySrcgrouptype);
207  break;
208  case 2:
209  coerceValue(value, myDstgroups);
210  break;
211  case 3:
212  coerceValue(value, myDstgrouptype);
213  break;
214  case 4:
215  coerceValue(value, myDetailattribs);
216  break;
217  case 5:
218  coerceValue(value, myDetailattriblist);
219  break;
220  case 6:
221  coerceValue(value, myPrimitiveattribs);
222  break;
223  case 7:
224  coerceValue(value, myPrimattriblist);
225  break;
226  case 8:
227  coerceValue(value, myPointattribs);
228  break;
229  case 9:
230  coerceValue(value, myPointattriblist);
231  break;
232  case 10:
233  coerceValue(value, myVertexattribs);
234  break;
235  case 11:
236  coerceValue(value, myVertexattriblist);
237  break;
238  case 12:
239  coerceValue(value, myCopyvariable);
240  break;
241  case 13:
242  coerceValue(value, myMatchpattrib);
243  break;
244  case 14:
245  coerceValue(value, myKernel);
246  break;
247  case 15:
248  coerceValue(value, myKernelradius);
249  break;
250  case 16:
251  coerceValue(value, myMaxsamplecount);
252  break;
253  case 17:
254  coerceValue(value, myThreshold);
255  break;
256  case 18:
257  coerceValue(value, myThresholddist);
258  break;
259  case 19:
260  coerceValue(value, myBlendwidth);
261  break;
262  case 20:
263  coerceValue(value, myUniformbias);
264  break;
265 
266  }
267  }
268 
269  bool isParmColorRamp(exint idx) const override
270  {
271  switch (idx)
272  {
273 
274  }
275  return false;
276  }
277 
278  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
299  { doGetParmValue(idx, instance, value); }
300 
301  template <typename T>
302  void
303  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
304  {
305  if (idx.size() < 1)
306  return;
307  UT_ASSERT(idx.size() == instance.size()+1);
308  if (idx.size() != instance.size()+1)
309  return;
310  switch (idx[0])
311  {
312  case 0:
313  coerceValue(mySrcgroups, ( ( value ) ));
314  break;
315  case 1:
316  coerceValue(mySrcgrouptype, clampMinValue(0, clampMaxValue(1, value ) ));
317  break;
318  case 2:
319  coerceValue(myDstgroups, ( ( value ) ));
320  break;
321  case 3:
322  coerceValue(myDstgrouptype, clampMinValue(0, clampMaxValue(1, value ) ));
323  break;
324  case 4:
325  coerceValue(myDetailattribs, ( ( value ) ));
326  break;
327  case 5:
328  coerceValue(myDetailattriblist, ( ( value ) ));
329  break;
330  case 6:
331  coerceValue(myPrimitiveattribs, ( ( value ) ));
332  break;
333  case 7:
334  coerceValue(myPrimattriblist, ( ( value ) ));
335  break;
336  case 8:
337  coerceValue(myPointattribs, ( ( value ) ));
338  break;
339  case 9:
340  coerceValue(myPointattriblist, ( ( value ) ));
341  break;
342  case 10:
343  coerceValue(myVertexattribs, ( ( value ) ));
344  break;
345  case 11:
346  coerceValue(myVertexattriblist, ( ( value ) ));
347  break;
348  case 12:
349  coerceValue(myCopyvariable, ( ( value ) ));
350  break;
351  case 13:
352  coerceValue(myMatchpattrib, ( ( value ) ));
353  break;
354  case 14:
355  coerceValue(myKernel, ( ( value ) ));
356  break;
357  case 15:
358  coerceValue(myKernelradius, ( ( value ) ));
359  break;
360  case 16:
361  coerceValue(myMaxsamplecount, clampMinValue(1, ( value ) ));
362  break;
363  case 17:
364  coerceValue(myThreshold, ( ( value ) ));
365  break;
366  case 18:
367  coerceValue(myThresholddist, ( ( value ) ));
368  break;
369  case 19:
370  coerceValue(myBlendwidth, ( ( value ) ));
371  break;
372  case 20:
373  coerceValue(myUniformbias, ( ( value ) ));
374  break;
375 
376  }
377  }
378 
379  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
380  { doSetParmValue(idx, instance, value); }
381  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
382  { doSetParmValue(idx, instance, value); }
383  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
384  { doSetParmValue(idx, instance, value); }
385  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
386  { doSetParmValue(idx, instance, value); }
387  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
388  { doSetParmValue(idx, instance, value); }
389  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
390  { doSetParmValue(idx, instance, value); }
391  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
392  { doSetParmValue(idx, instance, value); }
393  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
394  { doSetParmValue(idx, instance, value); }
395  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
396  { doSetParmValue(idx, instance, value); }
397  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
400  { doSetParmValue(idx, instance, value); }
401 
402  exint getNestNumParms(TempIndex idx) const override
403  {
404  if (idx.size() == 0)
405  return 21;
406  switch (idx[0])
407  {
408 
409  }
410  // Invalid
411  return 0;
412  }
413 
414  const char *getNestParmName(TempIndex fieldnum) const override
415  {
416  if (fieldnum.size() < 1)
417  return 0;
418  switch (fieldnum[0])
419  {
420  case 0:
421  return "srcgroups";
422  case 1:
423  return "srcgrouptype";
424  case 2:
425  return "dstgroups";
426  case 3:
427  return "dstgrouptype";
428  case 4:
429  return "detailattribs";
430  case 5:
431  return "detailattriblist";
432  case 6:
433  return "primitiveattribs";
434  case 7:
435  return "primattriblist";
436  case 8:
437  return "pointattribs";
438  case 9:
439  return "pointattriblist";
440  case 10:
441  return "vertexattribs";
442  case 11:
443  return "vertexattriblist";
444  case 12:
445  return "copyvariable";
446  case 13:
447  return "matchpattrib";
448  case 14:
449  return "kernel";
450  case 15:
451  return "kernelradius";
452  case 16:
453  return "maxsamplecount";
454  case 17:
455  return "threshold";
456  case 18:
457  return "thresholddist";
458  case 19:
459  return "blendwidth";
460  case 20:
461  return "uniformbias";
462 
463  }
464  return 0;
465  }
466 
467  ParmType getNestParmType(TempIndex fieldnum) const override
468  {
469  if (fieldnum.size() < 1)
470  return PARM_UNSUPPORTED;
471  switch (fieldnum[0])
472  {
473  case 0:
474  return PARM_STRING;
475  case 1:
476  return PARM_INTEGER;
477  case 2:
478  return PARM_STRING;
479  case 3:
480  return PARM_INTEGER;
481  case 4:
482  return PARM_INTEGER;
483  case 5:
484  return PARM_STRING;
485  case 6:
486  return PARM_INTEGER;
487  case 7:
488  return PARM_STRING;
489  case 8:
490  return PARM_INTEGER;
491  case 9:
492  return PARM_STRING;
493  case 10:
494  return PARM_INTEGER;
495  case 11:
496  return PARM_STRING;
497  case 12:
498  return PARM_INTEGER;
499  case 13:
500  return PARM_INTEGER;
501  case 14:
502  return PARM_STRING;
503  case 15:
504  return PARM_FLOAT;
505  case 16:
506  return PARM_INTEGER;
507  case 17:
508  return PARM_INTEGER;
509  case 18:
510  return PARM_FLOAT;
511  case 19:
512  return PARM_FLOAT;
513  case 20:
514  return PARM_FLOAT;
515 
516  }
517  return PARM_UNSUPPORTED;
518  }
519 
520  // Boiler plate to load individual types.
521  static void loadData(UT_IStream &is, int64 &v)
522  { is.bread(&v, 1); }
523  static void loadData(UT_IStream &is, bool &v)
524  { int64 iv; is.bread(&iv, 1); v = iv; }
525  static void loadData(UT_IStream &is, fpreal64 &v)
526  { is.bread<fpreal64>(&v, 1); }
527  static void loadData(UT_IStream &is, UT_Vector2D &v)
528  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
529  static void loadData(UT_IStream &is, UT_Vector3D &v)
530  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
531  is.bread<fpreal64>(&v.z(), 1); }
532  static void loadData(UT_IStream &is, UT_Vector4D &v)
533  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
534  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
535  static void loadData(UT_IStream &is, UT_Matrix2D &v)
536  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
537  static void loadData(UT_IStream &is, UT_Matrix3D &v)
538  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
539  static void loadData(UT_IStream &is, UT_Matrix4D &v)
540  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
541  static void loadData(UT_IStream &is, UT_Vector2I &v)
542  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
543  static void loadData(UT_IStream &is, UT_Vector3I &v)
544  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
545  is.bread<int64>(&v.z(), 1); }
546  static void loadData(UT_IStream &is, UT_Vector4I &v)
547  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
548  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
550  { is.bread(v); }
552  { UT_StringHolder rampdata;
553  loadData(is, rampdata);
554  if (rampdata.isstring())
555  {
556  v.reset(new UT_Ramp());
557  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
558  v->load(istr);
559  }
560  else v.reset();
561  }
564  loadData(is, data);
565  if (data.isstring())
566  {
567  // Find the data type.
568  const char *colon = UT_StringWrap(data).findChar(':');
569  if (colon)
570  {
571  int typelen = colon - data.buffer();
573  type.strncpy(data.buffer(), typelen);
574  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
575 
576  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
577  }
578  }
579  else v.reset();
580  }
581 
582  static void saveData(std::ostream &os, int64 v)
583  { UTwrite(os, &v); }
584  static void saveData(std::ostream &os, bool v)
585  { int64 iv = v; UTwrite(os, &iv); }
586  static void saveData(std::ostream &os, fpreal64 v)
587  { UTwrite<fpreal64>(os, &v); }
588  static void saveData(std::ostream &os, UT_Vector2D v)
589  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
590  static void saveData(std::ostream &os, UT_Vector3D v)
591  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
592  UTwrite<fpreal64>(os, &v.z()); }
593  static void saveData(std::ostream &os, UT_Vector4D v)
594  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
595  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
596  static void saveData(std::ostream &os, UT_Matrix2D v)
598  static void saveData(std::ostream &os, UT_Matrix3D v)
600  static void saveData(std::ostream &os, UT_Matrix4D v)
602  static void saveData(std::ostream &os, UT_StringHolder s)
603  { UT_StringWrap(s).saveBinary(os); }
604  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
606  UT_OStringStream ostr;
607  if (s) s->save(ostr);
608  result = ostr.str();
609  saveData(os, result);
610  }
611  static void saveData(std::ostream &os, PRM_DataItemHandle s)
613  UT_OStringStream ostr;
614  if (s)
615  {
616  ostr << s->getDataTypeToken();
617  ostr << ":";
618  s->saveBinary(ostr);
619  }
620  result = ostr.str();
621  saveData(os, result);
622  }
623 
624 
625  void save(std::ostream &os) const
626  {
627  int32 v = version();
628  UTwrite(os, &v);
629  saveData(os, mySrcgroups);
630  saveData(os, mySrcgrouptype);
631  saveData(os, myDstgroups);
632  saveData(os, myDstgrouptype);
633  saveData(os, myDetailattribs);
634  saveData(os, myDetailattriblist);
635  saveData(os, myPrimitiveattribs);
636  saveData(os, myPrimattriblist);
637  saveData(os, myPointattribs);
638  saveData(os, myPointattriblist);
639  saveData(os, myVertexattribs);
640  saveData(os, myVertexattriblist);
641  saveData(os, myCopyvariable);
642  saveData(os, myMatchpattrib);
643  saveData(os, myKernel);
644  saveData(os, myKernelradius);
645  saveData(os, myMaxsamplecount);
646  saveData(os, myThreshold);
647  saveData(os, myThresholddist);
648  saveData(os, myBlendwidth);
649  saveData(os, myUniformbias);
650 
651  }
652 
653  bool load(UT_IStream &is)
654  {
655  int32 v;
656  is.bread(&v, 1);
657  if (version() != v)
658  {
659  // Fail incompatible versions
660  return false;
661  }
662  loadData(is, mySrcgroups);
663  loadData(is, mySrcgrouptype);
664  loadData(is, myDstgroups);
665  loadData(is, myDstgrouptype);
666  loadData(is, myDetailattribs);
667  loadData(is, myDetailattriblist);
668  loadData(is, myPrimitiveattribs);
669  loadData(is, myPrimattriblist);
670  loadData(is, myPointattribs);
671  loadData(is, myPointattriblist);
672  loadData(is, myVertexattribs);
673  loadData(is, myVertexattriblist);
674  loadData(is, myCopyvariable);
675  loadData(is, myMatchpattrib);
676  loadData(is, myKernel);
677  loadData(is, myKernelradius);
678  loadData(is, myMaxsamplecount);
679  loadData(is, myThreshold);
680  loadData(is, myThresholddist);
681  loadData(is, myBlendwidth);
682  loadData(is, myUniformbias);
683 
684  return true;
685  }
686 
687  const UT_StringHolder & getSrcgroups() const { return mySrcgroups; }
688  void setSrcgroups(const UT_StringHolder & val) { mySrcgroups = val; }
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getSrcgroups();
694  OP_Utils::evalOpParm(result, thissop, "srcgroups", cookparms.getCookTime(), 0);
695  return result;
696  }
697  Srcgrouptype getSrcgrouptype() const { return Srcgrouptype(mySrcgrouptype); }
698  void setSrcgrouptype(Srcgrouptype val) { mySrcgrouptype = int64(val); }
700  {
701  SOP_Node *thissop = cookparms.getNode();
702  if (!thissop) return getSrcgrouptype();
703  int64 result;
704  OP_Utils::evalOpParm(result, thissop, "srcgrouptype", cookparms.getCookTime(), 0);
705  return Srcgrouptype(result);
706  }
707  const UT_StringHolder & getDstgroups() const { return myDstgroups; }
708  void setDstgroups(const UT_StringHolder & val) { myDstgroups = val; }
710  {
711  SOP_Node *thissop = cookparms.getNode();
712  if (!thissop) return getDstgroups();
714  OP_Utils::evalOpParm(result, thissop, "dstgroups", cookparms.getCookTime(), 0);
715  return result;
716  }
717  Dstgrouptype getDstgrouptype() const { return Dstgrouptype(myDstgrouptype); }
718  void setDstgrouptype(Dstgrouptype val) { myDstgrouptype = int64(val); }
720  {
721  SOP_Node *thissop = cookparms.getNode();
722  if (!thissop) return getDstgrouptype();
723  int64 result;
724  OP_Utils::evalOpParm(result, thissop, "dstgrouptype", cookparms.getCookTime(), 0);
725  return Dstgrouptype(result);
726  }
727  bool getDetailattribs() const { return myDetailattribs; }
728  void setDetailattribs(bool val) { myDetailattribs = val; }
729  bool opDetailattribs(const SOP_NodeVerb::CookParms &cookparms) const
730  {
731  SOP_Node *thissop = cookparms.getNode();
732  if (!thissop) return getDetailattribs();
733  bool result;
734  OP_Utils::evalOpParm(result, thissop, "detailattribs", cookparms.getCookTime(), 0);
735  return result;
736  }
737  const UT_StringHolder & getDetailattriblist() const { return myDetailattriblist; }
738  void setDetailattriblist(const UT_StringHolder & val) { myDetailattriblist = val; }
740  {
741  SOP_Node *thissop = cookparms.getNode();
742  if (!thissop) return getDetailattriblist();
744  OP_Utils::evalOpParm(result, thissop, "detailattriblist", cookparms.getCookTime(), 0);
745  return result;
746  }
747  bool getPrimitiveattribs() const { return myPrimitiveattribs; }
748  void setPrimitiveattribs(bool val) { myPrimitiveattribs = val; }
749  bool opPrimitiveattribs(const SOP_NodeVerb::CookParms &cookparms) const
750  {
751  SOP_Node *thissop = cookparms.getNode();
752  if (!thissop) return getPrimitiveattribs();
753  bool result;
754  OP_Utils::evalOpParm(result, thissop, "primitiveattribs", cookparms.getCookTime(), 0);
755  return result;
756  }
757  const UT_StringHolder & getPrimattriblist() const { return myPrimattriblist; }
758  void setPrimattriblist(const UT_StringHolder & val) { myPrimattriblist = val; }
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getPrimattriblist();
764  OP_Utils::evalOpParm(result, thissop, "primattriblist", cookparms.getCookTime(), 0);
765  return result;
766  }
767  bool getPointattribs() const { return myPointattribs; }
768  void setPointattribs(bool val) { myPointattribs = val; }
769  bool opPointattribs(const SOP_NodeVerb::CookParms &cookparms) const
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getPointattribs();
773  bool result;
774  OP_Utils::evalOpParm(result, thissop, "pointattribs", cookparms.getCookTime(), 0);
775  return result;
776  }
777  const UT_StringHolder & getPointattriblist() const { return myPointattriblist; }
778  void setPointattriblist(const UT_StringHolder & val) { myPointattriblist = val; }
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return getPointattriblist();
784  OP_Utils::evalOpParm(result, thissop, "pointattriblist", cookparms.getCookTime(), 0);
785  return result;
786  }
787  bool getVertexattribs() const { return myVertexattribs; }
788  void setVertexattribs(bool val) { myVertexattribs = val; }
789  bool opVertexattribs(const SOP_NodeVerb::CookParms &cookparms) const
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getVertexattribs();
793  bool result;
794  OP_Utils::evalOpParm(result, thissop, "vertexattribs", cookparms.getCookTime(), 0);
795  return result;
796  }
797  const UT_StringHolder & getVertexattriblist() const { return myVertexattriblist; }
798  void setVertexattriblist(const UT_StringHolder & val) { myVertexattriblist = val; }
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getVertexattriblist();
804  OP_Utils::evalOpParm(result, thissop, "vertexattriblist", cookparms.getCookTime(), 0);
805  return result;
806  }
807  bool getCopyvariable() const { return myCopyvariable; }
808  void setCopyvariable(bool val) { myCopyvariable = val; }
809  bool opCopyvariable(const SOP_NodeVerb::CookParms &cookparms) const
810  {
811  SOP_Node *thissop = cookparms.getNode();
812  if (!thissop) return getCopyvariable();
813  bool result;
814  OP_Utils::evalOpParm(result, thissop, "copyvariable", cookparms.getCookTime(), 0);
815  return result;
816  }
817  bool getMatchpattrib() const { return myMatchpattrib; }
818  void setMatchpattrib(bool val) { myMatchpattrib = val; }
819  bool opMatchpattrib(const SOP_NodeVerb::CookParms &cookparms) const
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getMatchpattrib();
823  bool result;
824  OP_Utils::evalOpParm(result, thissop, "matchpattrib", cookparms.getCookTime(), 0);
825  return result;
826  }
827  const UT_StringHolder & getKernel() const { return myKernel; }
828  void setKernel(const UT_StringHolder & val) { myKernel = val; }
830  {
831  SOP_Node *thissop = cookparms.getNode();
832  if (!thissop) return getKernel();
834  OP_Utils::evalOpParm(result, thissop, "kernel", cookparms.getCookTime(), 0);
835  return result;
836  }
837  fpreal64 getKernelradius() const { return myKernelradius; }
838  void setKernelradius(fpreal64 val) { myKernelradius = val; }
840  {
841  SOP_Node *thissop = cookparms.getNode();
842  if (!thissop) return getKernelradius();
844  OP_Utils::evalOpParm(result, thissop, "kernelradius", cookparms.getCookTime(), 0);
845  return result;
846  }
847  int64 getMaxsamplecount() const { return myMaxsamplecount; }
848  void setMaxsamplecount(int64 val) { myMaxsamplecount = val; }
850  {
851  SOP_Node *thissop = cookparms.getNode();
852  if (!thissop) return getMaxsamplecount();
853  int64 result;
854  OP_Utils::evalOpParm(result, thissop, "maxsamplecount", cookparms.getCookTime(), 0);
855  return result;
856  }
857  bool getThreshold() const { return myThreshold; }
858  void setThreshold(bool val) { myThreshold = val; }
859  bool opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
860  {
861  SOP_Node *thissop = cookparms.getNode();
862  if (!thissop) return getThreshold();
863  bool result;
864  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
865  return result;
866  }
867  fpreal64 getThresholddist() const { return myThresholddist; }
868  void setThresholddist(fpreal64 val) { myThresholddist = val; }
870  {
871  SOP_Node *thissop = cookparms.getNode();
872  if (!thissop) return getThresholddist();
874  OP_Utils::evalOpParm(result, thissop, "thresholddist", cookparms.getCookTime(), 0);
875  return result;
876  }
877  fpreal64 getBlendwidth() const { return myBlendwidth; }
878  void setBlendwidth(fpreal64 val) { myBlendwidth = val; }
880  {
881  SOP_Node *thissop = cookparms.getNode();
882  if (!thissop) return getBlendwidth();
884  OP_Utils::evalOpParm(result, thissop, "blendwidth", cookparms.getCookTime(), 0);
885  return result;
886  }
887  fpreal64 getUniformbias() const { return myUniformbias; }
888  void setUniformbias(fpreal64 val) { myUniformbias = val; }
890  {
891  SOP_Node *thissop = cookparms.getNode();
892  if (!thissop) return getUniformbias();
894  OP_Utils::evalOpParm(result, thissop, "uniformbias", cookparms.getCookTime(), 0);
895  return result;
896  }
897 
898 private:
899  UT_StringHolder mySrcgroups;
900  int64 mySrcgrouptype;
901  UT_StringHolder myDstgroups;
902  int64 myDstgrouptype;
903  bool myDetailattribs;
904  UT_StringHolder myDetailattriblist;
905  bool myPrimitiveattribs;
906  UT_StringHolder myPrimattriblist;
907  bool myPointattribs;
908  UT_StringHolder myPointattriblist;
909  bool myVertexattribs;
910  UT_StringHolder myVertexattriblist;
911  bool myCopyvariable;
912  bool myMatchpattrib;
913  UT_StringHolder myKernel;
914  fpreal64 myKernelradius;
915  int64 myMaxsamplecount;
916  bool myThreshold;
917  fpreal64 myThresholddist;
918  fpreal64 myBlendwidth;
919  fpreal64 myUniformbias;
920 
921 };
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setDstgrouptype(Dstgrouptype val)
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setPointattriblist(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opVertexattriblist(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
void setSrcgrouptype(Srcgrouptype val)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool operator==(const SOP_AttribTransferParms &src) const
bool opCopyvariable(const SOP_NodeVerb::CookParms &cookparms) const
void setDstgroups(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opDstgroups(const SOP_NodeVerb::CookParms &cookparms) const
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
bool opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GT_API const UT_StringHolder time
Srcgrouptype getSrcgrouptype() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const UT_StringHolder & getSrcgroups() const
const GLdouble * v
Definition: glcorearb.h:837
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal getTime() const
Definition: OP_Context.h:62
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void saveData(std::ostream &os, int64 v)
bool isParmColorRamp(exint idx) const override
const UT_StringHolder & getDetailattriblist() const
static void loadData(UT_IStream &is, fpreal64 &v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLdouble s
Definition: glad.h:3009
An output stream object that owns its own string buffer storage.
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
**But if you need a result
Definition: thread.h:613
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
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.
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void loadData(UT_IStream &is, UT_Vector2I &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
double fpreal64
Definition: SYS_Types.h:201
UT_StringHolder opKernel(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Matrix3D &v)
Srcgrouptype opSrcgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
exint length() const
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 saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getKernel() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
Dstgrouptype getDstgrouptype() const
int64 opMaxsamplecount(const SOP_NodeVerb::CookParms &cookparms) const
bool opMatchpattrib(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
UT_StringHolder opPointattriblist(const SOP_NodeVerb::CookParms &cookparms) const
void setDetailattriblist(const UT_StringHolder &val)
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 opKernelradius(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool opPointattribs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
GT_API const UT_StringHolder version
void setKernel(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getPrimattriblist() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
fpreal64 opThresholddist(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
ParmType getNestParmType(TempIndex fieldnum) const override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
void setSrcgroups(const UT_StringHolder &val)
bool opDetailattribs(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
const UT_StringHolder & getDstgroups() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void saveData(std::ostream &os, fpreal64 v)
Definition: core.h:1131
bool opVertexattribs(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
GLboolean r
Definition: glcorearb.h:1222
fpreal64 opUniformbias(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder opPrimattriblist(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
bool operator!=(const SOP_AttribTransferParms &src) const
type
Definition: core.h:1059
UT_StringHolder opDetailattriblist(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getPointattriblist() const
bool opPrimitiveattribs(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setPrimattriblist(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
fpreal64 opBlendwidth(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
void setVertexattriblist(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_StringHolder &v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opSrcgroups(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
const UT_StringHolder & getVertexattriblist() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
Dstgrouptype opDstgrouptype(const SOP_NodeVerb::CookParms &cookparms) const