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