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