HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribCopy.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_AttribCopyEnums
24 {
25  enum class Srcgrouptype
26  {
27  VERTICES = 0,
28  POINTS,
29  PRIMS
30  };
31 
33  getToken(Srcgrouptype enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Srcgrouptype::VERTICES: return "vertices"_sh;
38  case Srcgrouptype::POINTS: return "points"_sh;
39  case Srcgrouptype::PRIMS: return "prims"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Destgrouptype
45  {
46  VERTICES = 0,
47  POINTS,
48  PRIMS
49  };
50 
52  getToken(Destgrouptype enum_value)
53  {
54  using namespace UT::Literal;
55  switch (enum_value) {
56  case Destgrouptype::VERTICES: return "vertices"_sh;
57  case Destgrouptype::POINTS: return "points"_sh;
58  case Destgrouptype::PRIMS: return "prims"_sh;
59  default: UT_ASSERT(false); return ""_sh;
60  }
61  }
62 
64  {
65  BYVALUES = 0,
66  TOELEMENT
67  };
68 
71  {
72  using namespace UT::Literal;
73  switch (enum_value) {
74  case Matchbyattributemethod::BYVALUES: return "byvalues"_sh;
75  case Matchbyattributemethod::TOELEMENT: return "toelement"_sh;
76  default: UT_ASSERT(false); return ""_sh;
77  }
78  }
79 
80  enum class Attrib
81  {
82  COLORATTRIB = 0,
83  UVATTRIB,
85  };
86 
88  getToken(Attrib enum_value)
89  {
90  using namespace UT::Literal;
91  switch (enum_value) {
92  case Attrib::COLORATTRIB: return "colorattrib"_sh;
93  case Attrib::UVATTRIB: return "uvattrib"_sh;
94  case Attrib::OTHERATTRIB: return "otherattrib"_sh;
95  default: UT_ASSERT(false); return ""_sh;
96  }
97  }
98 
99  enum class Class
100  {
101  GUESS = 0,
102  SAMEASGROUP,
103  VERTICES,
104  POINTS,
105  PRIMS,
106  DETAIL
107  };
108 
110  getToken(Class enum_value)
111  {
112  using namespace UT::Literal;
113  switch (enum_value) {
114  case Class::GUESS: return "guess"_sh;
115  case Class::SAMEASGROUP: return "sameasgroup"_sh;
116  case Class::VERTICES: return "vertices"_sh;
117  case Class::POINTS: return "points"_sh;
118  case Class::PRIMS: return "prims"_sh;
119  case Class::DETAIL: return "detail"_sh;
120  default: UT_ASSERT(false); return ""_sh;
121  }
122  }
123 
124 }
125 
126 
128 {
129 public:
130  static int version() { return 1; }
131 
133  {
134  mySrcgroup = ""_UTsh;
135  mySrcgrouptype = 1;
136  myDestgroup = ""_UTsh;
137  myDestgrouptype = 1;
138  myMatchbyattribute = false;
139  myMatchbyattributemethod = 0;
140  myAttributetomatch = "piece"_UTsh;
141  myAttrib = 2;
142  myAttribname = "Cd"_UTsh;
143  myCopyp = true;
144  myUsenewname = false;
145  myNewname = ""_UTsh;
146  myClass = 0;
147  myCopyvariable = true;
148  myCopydata = true;
149 
150  }
151 
152  explicit SOP_AttribCopyParms(const SOP_AttribCopyParms &) = default;
154  SOP_AttribCopyParms(SOP_AttribCopyParms &&) noexcept = default;
155  SOP_AttribCopyParms &operator=(SOP_AttribCopyParms &&) noexcept = default;
156 
157  ~SOP_AttribCopyParms() override {}
158 
159  bool operator==(const SOP_AttribCopyParms &src) const
160  {
161  if (mySrcgroup != src.mySrcgroup) return false;
162  if (mySrcgrouptype != src.mySrcgrouptype) return false;
163  if (myDestgroup != src.myDestgroup) return false;
164  if (myDestgrouptype != src.myDestgrouptype) return false;
165  if (myMatchbyattribute != src.myMatchbyattribute) return false;
166  if (myMatchbyattributemethod != src.myMatchbyattributemethod) return false;
167  if (myAttributetomatch != src.myAttributetomatch) return false;
168  if (myAttrib != src.myAttrib) return false;
169  if (myAttribname != src.myAttribname) return false;
170  if (myCopyp != src.myCopyp) return false;
171  if (myUsenewname != src.myUsenewname) return false;
172  if (myNewname != src.myNewname) return false;
173  if (myClass != src.myClass) return false;
174  if (myCopyvariable != src.myCopyvariable) return false;
175  if (myCopydata != src.myCopydata) return false;
176 
177  return true;
178  }
179  bool operator!=(const SOP_AttribCopyParms &src) const
180  {
181  return !operator==(src);
182  }
188 
189 
190 
191  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
192  {
193  mySrcgroup = ""_UTsh;
194  if (true)
195  graph->evalOpParm(mySrcgroup, nodeidx, "srcgroup", time, 0);
196  mySrcgrouptype = 1;
197  if (true)
198  graph->evalOpParm(mySrcgrouptype, nodeidx, "srcgrouptype", time, 0);
199  myDestgroup = ""_UTsh;
200  if (true)
201  graph->evalOpParm(myDestgroup, nodeidx, "destgroup", time, 0);
202  myDestgrouptype = 1;
203  if (true)
204  graph->evalOpParm(myDestgrouptype, nodeidx, "destgrouptype", time, 0);
205  myMatchbyattribute = false;
206  if (true && ( (true&&!(((int64(getSrcgrouptype())==0)&&(int64(getDestgrouptype())!=0))||((int64(getSrcgrouptype())==1)&&(int64(getDestgrouptype())!=1))||((int64(getSrcgrouptype())==2)&&(int64(getDestgrouptype())!=2)))) ) )
207  graph->evalOpParm(myMatchbyattribute, nodeidx, "matchbyattribute", time, 0);
208  myMatchbyattributemethod = 0;
209  if (true && ( (true&&!(((getMatchbyattribute()==0))||((int64(getSrcgrouptype())==0)&&(int64(getDestgrouptype())!=0))||((int64(getSrcgrouptype())==1)&&(int64(getDestgrouptype())!=1))||((int64(getSrcgrouptype())==2)&&(int64(getDestgrouptype())!=2)))) ) )
210  graph->evalOpParm(myMatchbyattributemethod, nodeidx, "matchbyattributemethod", time, 0);
211  myAttributetomatch = "piece"_UTsh;
212  if (true && ( (true&&!(((getMatchbyattribute()==0))||((int64(getSrcgrouptype())==0)&&(int64(getDestgrouptype())!=0))||((int64(getSrcgrouptype())==1)&&(int64(getDestgrouptype())!=1))||((int64(getSrcgrouptype())==2)&&(int64(getDestgrouptype())!=2)))) ) )
213  graph->evalOpParm(myAttributetomatch, nodeidx, "attributetomatch", time, 0);
214  myAttrib = 2;
215  if (true)
216  graph->evalOpParm(myAttrib, nodeidx, "attrib", time, 0);
217  myAttribname = "Cd"_UTsh;
218  if (true)
219  graph->evalOpParm(myAttribname, nodeidx, "attribname", time, 0);
220  myCopyp = true;
221  if (true)
222  graph->evalOpParm(myCopyp, nodeidx, "copyp", time, 0);
223  myUsenewname = false;
224  if (true)
225  graph->evalOpParm(myUsenewname, nodeidx, "usenewname", time, 0);
226  myNewname = ""_UTsh;
227  if (true && ( (true&&!(((getUsenewname()==0)))) ) )
228  graph->evalOpParm(myNewname, nodeidx, "newname", time, 0);
229  myClass = 0;
230  if (true)
231  graph->evalOpParm(myClass, nodeidx, "class", time, 0);
232  myCopyvariable = true;
233  if (true && ( (true&&!(((getUsenewname()==1)))) ) )
234  graph->evalOpParm(myCopyvariable, nodeidx, "copyvariable", time, 0);
235  myCopydata = true;
236  if (true)
237  graph->evalOpParm(myCopydata, nodeidx, "copydata", time, 0);
238 
239  }
240 
241 
242  void loadFromOpSubclass(const LoadParms &loadparms) override
243  {
244  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
245  }
246 
247 
248  void copyFrom(const OP_NodeParms *src) override
249  {
250  *this = *((const SOP_AttribCopyParms *)src);
251  }
252 
253  template <typename T>
254  void
255  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
256  {
257  if (idx.size() < 1)
258  return;
259  UT_ASSERT(idx.size() == instance.size()+1);
260  if (idx.size() != instance.size()+1)
261  return;
262  switch (idx[0])
263  {
264  case 0:
265  coerceValue(value, mySrcgroup);
266  break;
267  case 1:
268  coerceValue(value, mySrcgrouptype);
269  break;
270  case 2:
271  coerceValue(value, myDestgroup);
272  break;
273  case 3:
274  coerceValue(value, myDestgrouptype);
275  break;
276  case 4:
277  coerceValue(value, myMatchbyattribute);
278  break;
279  case 5:
280  coerceValue(value, myMatchbyattributemethod);
281  break;
282  case 6:
283  coerceValue(value, myAttributetomatch);
284  break;
285  case 7:
286  coerceValue(value, myAttrib);
287  break;
288  case 8:
289  coerceValue(value, myAttribname);
290  break;
291  case 9:
292  coerceValue(value, myCopyp);
293  break;
294  case 10:
295  coerceValue(value, myUsenewname);
296  break;
297  case 11:
298  coerceValue(value, myNewname);
299  break;
300  case 12:
301  coerceValue(value, myClass);
302  break;
303  case 13:
304  coerceValue(value, myCopyvariable);
305  break;
306  case 14:
307  coerceValue(value, myCopydata);
308  break;
309 
310  }
311  }
312 
313  bool isParmColorRamp(exint idx) const override
314  {
315  switch (idx)
316  {
317 
318  }
319  return false;
320  }
321 
322  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
323  { doGetParmValue(idx, instance, value); }
324  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
325  { doGetParmValue(idx, instance, value); }
326  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
327  { doGetParmValue(idx, instance, value); }
328  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
329  { doGetParmValue(idx, instance, value); }
330  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
331  { doGetParmValue(idx, instance, value); }
332  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
333  { doGetParmValue(idx, instance, value); }
334  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
335  { doGetParmValue(idx, instance, value); }
336  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
337  { doGetParmValue(idx, instance, value); }
338  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
339  { doGetParmValue(idx, instance, value); }
340  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
341  { doGetParmValue(idx, instance, value); }
342  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
343  { doGetParmValue(idx, instance, value); }
344 
345  template <typename T>
346  void
347  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
348  {
349  if (idx.size() < 1)
350  return;
351  UT_ASSERT(idx.size() == instance.size()+1);
352  if (idx.size() != instance.size()+1)
353  return;
354  switch (idx[0])
355  {
356  case 0:
357  coerceValue(mySrcgroup, ( ( value ) ));
358  break;
359  case 1:
360  coerceValue(mySrcgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
361  break;
362  case 2:
363  coerceValue(myDestgroup, ( ( value ) ));
364  break;
365  case 3:
366  coerceValue(myDestgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
367  break;
368  case 4:
369  coerceValue(myMatchbyattribute, ( ( value ) ));
370  break;
371  case 5:
372  coerceValue(myMatchbyattributemethod, clampMinValue(0, clampMaxValue(1, value ) ));
373  break;
374  case 6:
375  coerceValue(myAttributetomatch, ( ( value ) ));
376  break;
377  case 7:
378  coerceValue(myAttrib, clampMinValue(0, clampMaxValue(2, value ) ));
379  break;
380  case 8:
381  coerceValue(myAttribname, ( ( value ) ));
382  break;
383  case 9:
384  coerceValue(myCopyp, ( ( value ) ));
385  break;
386  case 10:
387  coerceValue(myUsenewname, ( ( value ) ));
388  break;
389  case 11:
390  coerceValue(myNewname, ( ( value ) ));
391  break;
392  case 12:
393  coerceValue(myClass, clampMinValue(0, clampMaxValue(5, value ) ));
394  break;
395  case 13:
396  coerceValue(myCopyvariable, ( ( value ) ));
397  break;
398  case 14:
399  coerceValue(myCopydata, ( ( value ) ));
400  break;
401 
402  }
403  }
404 
405  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
418  { doSetParmValue(idx, instance, value); }
419  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
420  { doSetParmValue(idx, instance, value); }
421  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
422  { doSetParmValue(idx, instance, value); }
423  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
424  { doSetParmValue(idx, instance, value); }
425  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
426  { doSetParmValue(idx, instance, value); }
427 
428  exint getNestNumParms(TempIndex idx) const override
429  {
430  if (idx.size() == 0)
431  return 15;
432  switch (idx[0])
433  {
434 
435  }
436  // Invalid
437  return 0;
438  }
439 
440  const char *getNestParmName(TempIndex fieldnum) const override
441  {
442  if (fieldnum.size() < 1)
443  return 0;
444  switch (fieldnum[0])
445  {
446  case 0:
447  return "srcgroup";
448  case 1:
449  return "srcgrouptype";
450  case 2:
451  return "destgroup";
452  case 3:
453  return "destgrouptype";
454  case 4:
455  return "matchbyattribute";
456  case 5:
457  return "matchbyattributemethod";
458  case 6:
459  return "attributetomatch";
460  case 7:
461  return "attrib";
462  case 8:
463  return "attribname";
464  case 9:
465  return "copyp";
466  case 10:
467  return "usenewname";
468  case 11:
469  return "newname";
470  case 12:
471  return "class";
472  case 13:
473  return "copyvariable";
474  case 14:
475  return "copydata";
476 
477  }
478  return 0;
479  }
480 
481  ParmType getNestParmType(TempIndex fieldnum) const override
482  {
483  if (fieldnum.size() < 1)
484  return PARM_UNSUPPORTED;
485  switch (fieldnum[0])
486  {
487  case 0:
488  return PARM_STRING;
489  case 1:
490  return PARM_INTEGER;
491  case 2:
492  return PARM_STRING;
493  case 3:
494  return PARM_INTEGER;
495  case 4:
496  return PARM_INTEGER;
497  case 5:
498  return PARM_INTEGER;
499  case 6:
500  return PARM_STRING;
501  case 7:
502  return PARM_INTEGER;
503  case 8:
504  return PARM_STRING;
505  case 9:
506  return PARM_INTEGER;
507  case 10:
508  return PARM_INTEGER;
509  case 11:
510  return PARM_STRING;
511  case 12:
512  return PARM_INTEGER;
513  case 13:
514  return PARM_INTEGER;
515  case 14:
516  return PARM_INTEGER;
517 
518  }
519  return PARM_UNSUPPORTED;
520  }
521 
522  // Boiler plate to load individual types.
523  static void loadData(UT_IStream &is, int64 &v)
524  { is.bread(&v, 1); }
525  static void loadData(UT_IStream &is, bool &v)
526  { int64 iv; is.bread(&iv, 1); v = iv; }
527  static void loadData(UT_IStream &is, fpreal64 &v)
528  { is.bread<fpreal64>(&v, 1); }
529  static void loadData(UT_IStream &is, UT_Vector2D &v)
530  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
531  static void loadData(UT_IStream &is, UT_Vector3D &v)
532  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
533  is.bread<fpreal64>(&v.z(), 1); }
534  static void loadData(UT_IStream &is, UT_Vector4D &v)
535  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
536  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
537  static void loadData(UT_IStream &is, UT_Matrix2D &v)
538  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
539  static void loadData(UT_IStream &is, UT_Matrix3D &v)
540  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
541  static void loadData(UT_IStream &is, UT_Matrix4D &v)
542  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
543  static void loadData(UT_IStream &is, UT_Vector2I &v)
544  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
545  static void loadData(UT_IStream &is, UT_Vector3I &v)
546  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
547  is.bread<int64>(&v.z(), 1); }
548  static void loadData(UT_IStream &is, UT_Vector4I &v)
549  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
550  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
552  { is.bread(v); }
554  { UT_StringHolder rampdata;
555  loadData(is, rampdata);
556  if (rampdata.isstring())
557  {
558  v.reset(new UT_Ramp());
559  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
560  v->load(istr);
561  }
562  else v.reset();
563  }
566  loadData(is, data);
567  if (data.isstring())
568  {
569  // Find the data type.
570  const char *colon = UT_StringWrap(data).findChar(':');
571  if (colon)
572  {
573  int typelen = colon - data.buffer();
575  type.strncpy(data.buffer(), typelen);
576  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
577 
578  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
579  }
580  }
581  else v.reset();
582  }
583 
584  static void saveData(std::ostream &os, int64 v)
585  { UTwrite(os, &v); }
586  static void saveData(std::ostream &os, bool v)
587  { int64 iv = v; UTwrite(os, &iv); }
588  static void saveData(std::ostream &os, fpreal64 v)
589  { UTwrite<fpreal64>(os, &v); }
590  static void saveData(std::ostream &os, UT_Vector2D v)
591  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
592  static void saveData(std::ostream &os, UT_Vector3D v)
593  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
594  UTwrite<fpreal64>(os, &v.z()); }
595  static void saveData(std::ostream &os, UT_Vector4D v)
596  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
597  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
598  static void saveData(std::ostream &os, UT_Matrix2D v)
600  static void saveData(std::ostream &os, UT_Matrix3D v)
602  static void saveData(std::ostream &os, UT_Matrix4D v)
604  static void saveData(std::ostream &os, UT_StringHolder s)
605  { UT_StringWrap(s).saveBinary(os); }
606  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
608  UT_OStringStream ostr;
609  if (s) s->save(ostr);
610  result = ostr.str();
611  saveData(os, result);
612  }
613  static void saveData(std::ostream &os, PRM_DataItemHandle s)
615  UT_OStringStream ostr;
616  if (s)
617  {
618  ostr << s->getDataTypeToken();
619  ostr << ":";
620  s->saveBinary(ostr);
621  }
622  result = ostr.str();
623  saveData(os, result);
624  }
625 
626 
627  void save(std::ostream &os) const
628  {
629  int32 v = version();
630  UTwrite(os, &v);
631  saveData(os, mySrcgroup);
632  saveData(os, mySrcgrouptype);
633  saveData(os, myDestgroup);
634  saveData(os, myDestgrouptype);
635  saveData(os, myMatchbyattribute);
636  saveData(os, myMatchbyattributemethod);
637  saveData(os, myAttributetomatch);
638  saveData(os, myAttrib);
639  saveData(os, myAttribname);
640  saveData(os, myCopyp);
641  saveData(os, myUsenewname);
642  saveData(os, myNewname);
643  saveData(os, myClass);
644  saveData(os, myCopyvariable);
645  saveData(os, myCopydata);
646 
647  }
648 
649  bool load(UT_IStream &is)
650  {
651  int32 v;
652  is.bread(&v, 1);
653  if (version() != v)
654  {
655  // Fail incompatible versions
656  return false;
657  }
658  loadData(is, mySrcgroup);
659  loadData(is, mySrcgrouptype);
660  loadData(is, myDestgroup);
661  loadData(is, myDestgrouptype);
662  loadData(is, myMatchbyattribute);
663  loadData(is, myMatchbyattributemethod);
664  loadData(is, myAttributetomatch);
665  loadData(is, myAttrib);
666  loadData(is, myAttribname);
667  loadData(is, myCopyp);
668  loadData(is, myUsenewname);
669  loadData(is, myNewname);
670  loadData(is, myClass);
671  loadData(is, myCopyvariable);
672  loadData(is, myCopydata);
673 
674  return true;
675  }
676 
677  const UT_StringHolder & getSrcgroup() const { return mySrcgroup; }
678  void setSrcgroup(const UT_StringHolder & val) { mySrcgroup = val; }
680  {
681  SOP_Node *thissop = cookparms.getNode();
682  if (!thissop) return getSrcgroup();
684  OP_Utils::evalOpParm(result, thissop, "srcgroup", cookparms.getCookTime(), 0);
685  return result;
686  }
687  Srcgrouptype getSrcgrouptype() const { return Srcgrouptype(mySrcgrouptype); }
688  void setSrcgrouptype(Srcgrouptype val) { mySrcgrouptype = int64(val); }
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getSrcgrouptype();
693  int64 result;
694  OP_Utils::evalOpParm(result, thissop, "srcgrouptype", cookparms.getCookTime(), 0);
695  return Srcgrouptype(result);
696  }
697  const UT_StringHolder & getDestgroup() const { return myDestgroup; }
698  void setDestgroup(const UT_StringHolder & val) { myDestgroup = val; }
700  {
701  SOP_Node *thissop = cookparms.getNode();
702  if (!thissop) return getDestgroup();
704  OP_Utils::evalOpParm(result, thissop, "destgroup", cookparms.getCookTime(), 0);
705  return result;
706  }
707  Destgrouptype getDestgrouptype() const { return Destgrouptype(myDestgrouptype); }
708  void setDestgrouptype(Destgrouptype val) { myDestgrouptype = int64(val); }
710  {
711  SOP_Node *thissop = cookparms.getNode();
712  if (!thissop) return getDestgrouptype();
713  int64 result;
714  OP_Utils::evalOpParm(result, thissop, "destgrouptype", cookparms.getCookTime(), 0);
715  return Destgrouptype(result);
716  }
717  bool getMatchbyattribute() const { return myMatchbyattribute; }
718  void setMatchbyattribute(bool val) { myMatchbyattribute = val; }
719  bool opMatchbyattribute(const SOP_NodeVerb::CookParms &cookparms) const
720  {
721  SOP_Node *thissop = cookparms.getNode();
722  if (!thissop) return getMatchbyattribute();
723  bool result;
724  OP_Utils::evalOpParm(result, thissop, "matchbyattribute", cookparms.getCookTime(), 0);
725  return result;
726  }
727  Matchbyattributemethod getMatchbyattributemethod() const { return Matchbyattributemethod(myMatchbyattributemethod); }
728  void setMatchbyattributemethod(Matchbyattributemethod val) { myMatchbyattributemethod = int64(val); }
730  {
731  SOP_Node *thissop = cookparms.getNode();
732  if (!thissop) return getMatchbyattributemethod();
733  int64 result;
734  OP_Utils::evalOpParm(result, thissop, "matchbyattributemethod", cookparms.getCookTime(), 0);
735  return Matchbyattributemethod(result);
736  }
737  const UT_StringHolder & getAttributetomatch() const { return myAttributetomatch; }
738  void setAttributetomatch(const UT_StringHolder & val) { myAttributetomatch = val; }
740  {
741  SOP_Node *thissop = cookparms.getNode();
742  if (!thissop) return getAttributetomatch();
744  OP_Utils::evalOpParm(result, thissop, "attributetomatch", cookparms.getCookTime(), 0);
745  return result;
746  }
747  Attrib getAttrib() const { return Attrib(myAttrib); }
748  void setAttrib(Attrib val) { myAttrib = int64(val); }
749  Attrib opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
750  {
751  SOP_Node *thissop = cookparms.getNode();
752  if (!thissop) return getAttrib();
753  int64 result;
754  OP_Utils::evalOpParm(result, thissop, "attrib", cookparms.getCookTime(), 0);
755  return Attrib(result);
756  }
757  const UT_StringHolder & getAttribname() const { return myAttribname; }
758  void setAttribname(const UT_StringHolder & val) { myAttribname = val; }
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getAttribname();
764  OP_Utils::evalOpParm(result, thissop, "attribname", cookparms.getCookTime(), 0);
765  return result;
766  }
767  bool getCopyp() const { return myCopyp; }
768  void setCopyp(bool val) { myCopyp = val; }
769  bool opCopyp(const SOP_NodeVerb::CookParms &cookparms) const
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getCopyp();
773  bool result;
774  OP_Utils::evalOpParm(result, thissop, "copyp", cookparms.getCookTime(), 0);
775  return result;
776  }
777  bool getUsenewname() const { return myUsenewname; }
778  void setUsenewname(bool val) { myUsenewname = val; }
779  bool opUsenewname(const SOP_NodeVerb::CookParms &cookparms) const
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return getUsenewname();
783  bool result;
784  OP_Utils::evalOpParm(result, thissop, "usenewname", cookparms.getCookTime(), 0);
785  return result;
786  }
787  const UT_StringHolder & getNewname() const { return myNewname; }
788  void setNewname(const UT_StringHolder & val) { myNewname = val; }
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getNewname();
794  OP_Utils::evalOpParm(result, thissop, "newname", cookparms.getCookTime(), 0);
795  return result;
796  }
797  Class getClass() const { return Class(myClass); }
798  void setClass(Class val) { myClass = int64(val); }
799  Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getClass();
803  int64 result;
804  OP_Utils::evalOpParm(result, thissop, "class", cookparms.getCookTime(), 0);
805  return Class(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 getCopydata() const { return myCopydata; }
818  void setCopydata(bool val) { myCopydata = val; }
819  bool opCopydata(const SOP_NodeVerb::CookParms &cookparms) const
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getCopydata();
823  bool result;
824  OP_Utils::evalOpParm(result, thissop, "copydata", cookparms.getCookTime(), 0);
825  return result;
826  }
827 
828 private:
829  UT_StringHolder mySrcgroup;
830  int64 mySrcgrouptype;
831  UT_StringHolder myDestgroup;
832  int64 myDestgrouptype;
833  bool myMatchbyattribute;
834  int64 myMatchbyattributemethod;
835  UT_StringHolder myAttributetomatch;
836  int64 myAttrib;
837  UT_StringHolder myAttribname;
838  bool myCopyp;
839  bool myUsenewname;
840  UT_StringHolder myNewname;
841  int64 myClass;
842  bool myCopyvariable;
843  bool myCopydata;
844 
845 };
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool getMatchbyattribute() const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
UT_StringHolder opAttribname(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
bool load(UT_IStream &is)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void save(std::ostream &os) const
bool opMatchbyattribute(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder time
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
ParmType getNestParmType(TempIndex fieldnum) const override
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setCopyvariable(bool val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void setDestgrouptype(Destgrouptype val)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
bool opUsenewname(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
const UT_StringHolder & getSrcgroup() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setAttribname(const UT_StringHolder &val)
An output stream object that owns its own string buffer storage.
bool opCopyp(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
Definition: thread.h:613
static void saveData(std::ostream &os, fpreal64 v)
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 getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_StringHolder opAttributetomatch(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
exint getNestNumParms(TempIndex idx) const override
double fpreal64
Definition: SYS_Types.h:201
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setUsenewname(bool val)
bool operator==(const SOP_AttribCopyParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
Srcgrouptype opSrcgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setSrcgroup(const UT_StringHolder &val)
bool operator!=(const SOP_AttribCopyParms &src) const
bool opCopyvariable(const SOP_NodeVerb::CookParms &cookparms) 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
const UT_StringHolder & getAttribname() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setAttributetomatch(const UT_StringHolder &val)
void setMatchbyattributemethod(Matchbyattributemethod val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void saveData(std::ostream &os, UT_Matrix2D v)
Srcgrouptype getSrcgrouptype() const
Matchbyattributemethod getMatchbyattributemethod() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool opCopydata(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
long long int64
Definition: SYS_Types.h:116
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
Attrib opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setMatchbyattribute(bool val)
SYS_FORCE_INLINE UT_StringHolder getToken(Srcgrouptype enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, int64 &v)
Matchbyattributemethod opMatchbyattributemethod(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getNewname() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void loadData(UT_IStream &is, UT_Vector3D &v)
GT_API const UT_StringHolder version
UT_StringHolder opSrcgroup(const SOP_NodeVerb::CookParms &cookparms) const
void setSrcgrouptype(Srcgrouptype val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setAttrib(Attrib val)
const UT_StringHolder & getDestgroup() const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
Destgrouptype opDestgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
Destgrouptype getDestgrouptype() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const UT_StringHolder & getAttributetomatch() const
void loadFromOpSubclass(const LoadParms &loadparms) override
#define SOP_API
Definition: SOP_API.h:10
UT_StringHolder opDestgroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opNewname(const SOP_NodeVerb::CookParms &cookparms) const
void setDestgroup(const UT_StringHolder &val)
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void setNewname(const UT_StringHolder &val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663