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 <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_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 
178  if (baseGetSignature() != src.baseGetSignature()) return false;
179 
180  return true;
181  }
182  bool operator!=(const SOP_AttribCopyParms &src) const
183  {
184  return !operator==(src);
185  }
191 
192 
193 
194  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
195  {
196  mySrcgroup = ""_UTsh;
197  if (true)
198  graph->evalOpParm(mySrcgroup, nodeidx, "srcgroup", time, graph->isDirect()?nullptr:depnode);
199  mySrcgrouptype = 1;
200  if (true)
201  graph->evalOpParm(mySrcgrouptype, nodeidx, "srcgrouptype", time, graph->isDirect()?nullptr:depnode);
202  myDestgroup = ""_UTsh;
203  if (true)
204  graph->evalOpParm(myDestgroup, nodeidx, "destgroup", time, graph->isDirect()?nullptr:depnode);
205  myDestgrouptype = 1;
206  if (true)
207  graph->evalOpParm(myDestgrouptype, nodeidx, "destgrouptype", time, graph->isDirect()?nullptr:depnode);
208  myMatchbyattribute = false;
209  if (true && ( (true&&!(((int64(getSrcgrouptype())==0)&&(int64(getDestgrouptype())!=0))||((int64(getSrcgrouptype())==1)&&(int64(getDestgrouptype())!=1))||((int64(getSrcgrouptype())==2)&&(int64(getDestgrouptype())!=2)))) ) )
210  graph->evalOpParm(myMatchbyattribute, nodeidx, "matchbyattribute", time, graph->isDirect()?nullptr:depnode);
211  myMatchbyattributemethod = 0;
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(myMatchbyattributemethod, nodeidx, "matchbyattributemethod", time, graph->isDirect()?nullptr:depnode);
214  myAttributetomatch = "piece"_UTsh;
215  if (true && ( (true&&!(((getMatchbyattribute()==0))||((int64(getSrcgrouptype())==0)&&(int64(getDestgrouptype())!=0))||((int64(getSrcgrouptype())==1)&&(int64(getDestgrouptype())!=1))||((int64(getSrcgrouptype())==2)&&(int64(getDestgrouptype())!=2)))) ) )
216  graph->evalOpParm(myAttributetomatch, nodeidx, "attributetomatch", time, graph->isDirect()?nullptr:depnode);
217  myAttrib = 2;
218  if (true)
219  graph->evalOpParm(myAttrib, nodeidx, "attrib", time, graph->isDirect()?nullptr:depnode);
220  myAttribname = "Cd"_UTsh;
221  if (true)
222  graph->evalOpParm(myAttribname, nodeidx, "attribname", time, graph->isDirect()?nullptr:depnode);
223  myCopyp = true;
224  if (true)
225  graph->evalOpParm(myCopyp, nodeidx, "copyp", time, graph->isDirect()?nullptr:depnode);
226  myUsenewname = false;
227  if (true)
228  graph->evalOpParm(myUsenewname, nodeidx, "usenewname", time, graph->isDirect()?nullptr:depnode);
229  myNewname = ""_UTsh;
230  if (true && ( (true&&!(((getUsenewname()==0)))) ) )
231  graph->evalOpParm(myNewname, nodeidx, "newname", time, graph->isDirect()?nullptr:depnode);
232  myClass = 0;
233  if (true)
234  graph->evalOpParm(myClass, nodeidx, "class", time, graph->isDirect()?nullptr:depnode);
235  myCopyvariable = true;
236  if (true && ( (true&&!(((getUsenewname()==1)))) ) )
237  graph->evalOpParm(myCopyvariable, nodeidx, "copyvariable", time, graph->isDirect()?nullptr:depnode);
238  myCopydata = true;
239  if (true)
240  graph->evalOpParm(myCopydata, nodeidx, "copydata", time, graph->isDirect()?nullptr:depnode);
241 
242  }
243 
244 
245  void loadFromOpSubclass(const LoadParms &loadparms) override
246  {
247  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
248  }
249 
250 
251  void copyFrom(const OP_NodeParms *src) override
252  {
253  *this = *((const SOP_AttribCopyParms *)src);
254  }
255 
256  template <typename T>
257  void
258  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
259  {
260  if (idx.size() < 1)
261  return;
262  UT_ASSERT(idx.size() == instance.size()+1);
263  if (idx.size() != instance.size()+1)
264  return;
265  switch (idx[0])
266  {
267  case 0:
268  coerceValue(value, mySrcgroup);
269  break;
270  case 1:
271  coerceValue(value, mySrcgrouptype);
272  break;
273  case 2:
274  coerceValue(value, myDestgroup);
275  break;
276  case 3:
277  coerceValue(value, myDestgrouptype);
278  break;
279  case 4:
280  coerceValue(value, myMatchbyattribute);
281  break;
282  case 5:
283  coerceValue(value, myMatchbyattributemethod);
284  break;
285  case 6:
286  coerceValue(value, myAttributetomatch);
287  break;
288  case 7:
289  coerceValue(value, myAttrib);
290  break;
291  case 8:
292  coerceValue(value, myAttribname);
293  break;
294  case 9:
295  coerceValue(value, myCopyp);
296  break;
297  case 10:
298  coerceValue(value, myUsenewname);
299  break;
300  case 11:
301  coerceValue(value, myNewname);
302  break;
303  case 12:
304  coerceValue(value, myClass);
305  break;
306  case 13:
307  coerceValue(value, myCopyvariable);
308  break;
309  case 14:
310  coerceValue(value, myCopydata);
311  break;
312 
313  }
314  }
315 
316  bool isParmColorRamp(exint idx) const override
317  {
318  switch (idx)
319  {
320 
321  }
322  return false;
323  }
324 
325  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
326  { doGetParmValue(idx, instance, value); }
327  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
328  { doGetParmValue(idx, instance, value); }
329  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
330  { doGetParmValue(idx, instance, value); }
331  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
332  { doGetParmValue(idx, instance, value); }
333  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
334  { doGetParmValue(idx, instance, value); }
335  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
336  { doGetParmValue(idx, instance, value); }
337  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
338  { doGetParmValue(idx, instance, value); }
339  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
340  { doGetParmValue(idx, instance, value); }
341  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
342  { doGetParmValue(idx, instance, value); }
343  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
344  { doGetParmValue(idx, instance, value); }
345  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
346  { doGetParmValue(idx, instance, value); }
347 
348  template <typename T>
349  void
350  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
351  {
352  if (idx.size() < 1)
353  return;
354  UT_ASSERT(idx.size() == instance.size()+1);
355  if (idx.size() != instance.size()+1)
356  return;
357  switch (idx[0])
358  {
359  case 0:
360  coerceValue(mySrcgroup, ( ( value ) ));
361  break;
362  case 1:
363  coerceValue(mySrcgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
364  break;
365  case 2:
366  coerceValue(myDestgroup, ( ( value ) ));
367  break;
368  case 3:
369  coerceValue(myDestgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
370  break;
371  case 4:
372  coerceValue(myMatchbyattribute, ( ( value ) ));
373  break;
374  case 5:
375  coerceValue(myMatchbyattributemethod, clampMinValue(0, clampMaxValue(1, value ) ));
376  break;
377  case 6:
378  coerceValue(myAttributetomatch, ( ( value ) ));
379  break;
380  case 7:
381  coerceValue(myAttrib, clampMinValue(0, clampMaxValue(2, value ) ));
382  break;
383  case 8:
384  coerceValue(myAttribname, ( ( value ) ));
385  break;
386  case 9:
387  coerceValue(myCopyp, ( ( value ) ));
388  break;
389  case 10:
390  coerceValue(myUsenewname, ( ( value ) ));
391  break;
392  case 11:
393  coerceValue(myNewname, ( ( value ) ));
394  break;
395  case 12:
396  coerceValue(myClass, clampMinValue(0, clampMaxValue(5, value ) ));
397  break;
398  case 13:
399  coerceValue(myCopyvariable, ( ( value ) ));
400  break;
401  case 14:
402  coerceValue(myCopydata, ( ( value ) ));
403  break;
404 
405  }
406  }
407 
408  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
409  { doSetParmValue(idx, instance, value); }
410  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
417  { doSetParmValue(idx, instance, value); }
418  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
419  { doSetParmValue(idx, instance, value); }
420  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
421  { doSetParmValue(idx, instance, value); }
422  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
423  { doSetParmValue(idx, instance, value); }
424  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
425  { doSetParmValue(idx, instance, value); }
426  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
427  { doSetParmValue(idx, instance, value); }
428  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
429  { doSetParmValue(idx, instance, value); }
430 
431  exint getNestNumParms(TempIndex idx) const override
432  {
433  if (idx.size() == 0)
434  return 15;
435  switch (idx[0])
436  {
437 
438  }
439  // Invalid
440  return 0;
441  }
442 
443  const char *getNestParmName(TempIndex fieldnum) const override
444  {
445  if (fieldnum.size() < 1)
446  return 0;
447  switch (fieldnum[0])
448  {
449  case 0:
450  return "srcgroup";
451  case 1:
452  return "srcgrouptype";
453  case 2:
454  return "destgroup";
455  case 3:
456  return "destgrouptype";
457  case 4:
458  return "matchbyattribute";
459  case 5:
460  return "matchbyattributemethod";
461  case 6:
462  return "attributetomatch";
463  case 7:
464  return "attrib";
465  case 8:
466  return "attribname";
467  case 9:
468  return "copyp";
469  case 10:
470  return "usenewname";
471  case 11:
472  return "newname";
473  case 12:
474  return "class";
475  case 13:
476  return "copyvariable";
477  case 14:
478  return "copydata";
479 
480  }
481  return 0;
482  }
483 
484  ParmType getNestParmType(TempIndex fieldnum) const override
485  {
486  if (fieldnum.size() < 1)
487  return PARM_UNSUPPORTED;
488  switch (fieldnum[0])
489  {
490  case 0:
491  return PARM_STRING;
492  case 1:
493  return PARM_INTEGER;
494  case 2:
495  return PARM_STRING;
496  case 3:
497  return PARM_INTEGER;
498  case 4:
499  return PARM_INTEGER;
500  case 5:
501  return PARM_INTEGER;
502  case 6:
503  return PARM_STRING;
504  case 7:
505  return PARM_INTEGER;
506  case 8:
507  return PARM_STRING;
508  case 9:
509  return PARM_INTEGER;
510  case 10:
511  return PARM_INTEGER;
512  case 11:
513  return PARM_STRING;
514  case 12:
515  return PARM_INTEGER;
516  case 13:
517  return PARM_INTEGER;
518  case 14:
519  return PARM_INTEGER;
520 
521  }
522  return PARM_UNSUPPORTED;
523  }
524 
525  // Boiler plate to load individual types.
526  static void loadData(UT_IStream &is, int64 &v)
527  { is.bread(&v, 1); }
528  static void loadData(UT_IStream &is, bool &v)
529  { int64 iv; is.bread(&iv, 1); v = iv; }
530  static void loadData(UT_IStream &is, fpreal64 &v)
531  { is.bread<fpreal64>(&v, 1); }
532  static void loadData(UT_IStream &is, UT_Vector2D &v)
533  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
534  static void loadData(UT_IStream &is, UT_Vector3D &v)
535  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
536  is.bread<fpreal64>(&v.z(), 1); }
537  static void loadData(UT_IStream &is, UT_Vector4D &v)
538  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
539  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
540  static void loadData(UT_IStream &is, UT_Matrix2D &v)
541  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
542  static void loadData(UT_IStream &is, UT_Matrix3D &v)
543  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
544  static void loadData(UT_IStream &is, UT_Matrix4D &v)
545  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
546  static void loadData(UT_IStream &is, UT_Vector2I &v)
547  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
548  static void loadData(UT_IStream &is, UT_Vector3I &v)
549  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
550  is.bread<int64>(&v.z(), 1); }
551  static void loadData(UT_IStream &is, UT_Vector4I &v)
552  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
553  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
555  { is.bread(v); }
557  { UT_StringHolder rampdata;
558  loadData(is, rampdata);
559  if (rampdata.isstring())
560  {
561  v.reset(new UT_Ramp());
562  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
563  v->load(istr);
564  }
565  else v.reset();
566  }
569  loadData(is, data);
570  if (data.isstring())
571  {
572  // Find the data type.
573  const char *colon = UT_StringWrap(data).findChar(':');
574  if (colon)
575  {
576  int typelen = colon - data.buffer();
578  type.strncpy(data.buffer(), typelen);
579  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
580 
581  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
582  }
583  }
584  else v.reset();
585  }
586 
587  static void saveData(std::ostream &os, int64 v)
588  { UTwrite(os, &v); }
589  static void saveData(std::ostream &os, bool v)
590  { int64 iv = v; UTwrite(os, &iv); }
591  static void saveData(std::ostream &os, fpreal64 v)
592  { UTwrite<fpreal64>(os, &v); }
593  static void saveData(std::ostream &os, UT_Vector2D v)
594  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
595  static void saveData(std::ostream &os, UT_Vector3D v)
596  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
597  UTwrite<fpreal64>(os, &v.z()); }
598  static void saveData(std::ostream &os, UT_Vector4D v)
599  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
600  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
601  static void saveData(std::ostream &os, UT_Matrix2D v)
603  static void saveData(std::ostream &os, UT_Matrix3D v)
605  static void saveData(std::ostream &os, UT_Matrix4D v)
607  static void saveData(std::ostream &os, UT_StringHolder s)
608  { UT_StringWrap(s).saveBinary(os); }
609  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
611  UT_OStringStream ostr;
612  if (s) s->save(ostr);
613  result = ostr.str();
614  saveData(os, result);
615  }
616  static void saveData(std::ostream &os, PRM_DataItemHandle s)
618  UT_OStringStream ostr;
619  if (s)
620  {
621  ostr << s->getDataTypeToken();
622  ostr << ":";
623  s->saveBinary(ostr);
624  }
625  result = ostr.str();
626  saveData(os, result);
627  }
628 
629 
630  void save(std::ostream &os) const
631  {
632  int32 v = version();
633  UTwrite(os, &v);
634  saveData(os, mySrcgroup);
635  saveData(os, mySrcgrouptype);
636  saveData(os, myDestgroup);
637  saveData(os, myDestgrouptype);
638  saveData(os, myMatchbyattribute);
639  saveData(os, myMatchbyattributemethod);
640  saveData(os, myAttributetomatch);
641  saveData(os, myAttrib);
642  saveData(os, myAttribname);
643  saveData(os, myCopyp);
644  saveData(os, myUsenewname);
645  saveData(os, myNewname);
646  saveData(os, myClass);
647  saveData(os, myCopyvariable);
648  saveData(os, myCopydata);
649 
650  }
651 
652  bool load(UT_IStream &is)
653  {
654  int32 v;
655  is.bread(&v, 1);
656  if (version() != v)
657  {
658  // Fail incompatible versions
659  return false;
660  }
661  loadData(is, mySrcgroup);
662  loadData(is, mySrcgrouptype);
663  loadData(is, myDestgroup);
664  loadData(is, myDestgrouptype);
665  loadData(is, myMatchbyattribute);
666  loadData(is, myMatchbyattributemethod);
667  loadData(is, myAttributetomatch);
668  loadData(is, myAttrib);
669  loadData(is, myAttribname);
670  loadData(is, myCopyp);
671  loadData(is, myUsenewname);
672  loadData(is, myNewname);
673  loadData(is, myClass);
674  loadData(is, myCopyvariable);
675  loadData(is, myCopydata);
676 
677  return true;
678  }
679 
680  const UT_StringHolder & getSrcgroup() const { return mySrcgroup; }
681  void setSrcgroup(const UT_StringHolder & val) { mySrcgroup = val; }
683  {
684  SOP_Node *thissop = cookparms.getNode();
685  if (!thissop) return getSrcgroup();
687  OP_Utils::evalOpParm(result, thissop, "srcgroup", cookparms.getCookTime(), 0);
688  return result;
689  }
690  Srcgrouptype getSrcgrouptype() const { return Srcgrouptype(mySrcgrouptype); }
691  void setSrcgrouptype(Srcgrouptype val) { mySrcgrouptype = int64(val); }
693  {
694  SOP_Node *thissop = cookparms.getNode();
695  if (!thissop) return getSrcgrouptype();
696  int64 result;
697  OP_Utils::evalOpParm(result, thissop, "srcgrouptype", cookparms.getCookTime(), 0);
698  return Srcgrouptype(result);
699  }
700  const UT_StringHolder & getDestgroup() const { return myDestgroup; }
701  void setDestgroup(const UT_StringHolder & val) { myDestgroup = val; }
703  {
704  SOP_Node *thissop = cookparms.getNode();
705  if (!thissop) return getDestgroup();
707  OP_Utils::evalOpParm(result, thissop, "destgroup", cookparms.getCookTime(), 0);
708  return result;
709  }
710  Destgrouptype getDestgrouptype() const { return Destgrouptype(myDestgrouptype); }
711  void setDestgrouptype(Destgrouptype val) { myDestgrouptype = int64(val); }
713  {
714  SOP_Node *thissop = cookparms.getNode();
715  if (!thissop) return getDestgrouptype();
716  int64 result;
717  OP_Utils::evalOpParm(result, thissop, "destgrouptype", cookparms.getCookTime(), 0);
718  return Destgrouptype(result);
719  }
720  bool getMatchbyattribute() const { return myMatchbyattribute; }
721  void setMatchbyattribute(bool val) { myMatchbyattribute = val; }
722  bool opMatchbyattribute(const SOP_NodeVerb::CookParms &cookparms) const
723  {
724  SOP_Node *thissop = cookparms.getNode();
725  if (!thissop) return getMatchbyattribute();
726  bool result;
727  OP_Utils::evalOpParm(result, thissop, "matchbyattribute", cookparms.getCookTime(), 0);
728  return result;
729  }
730  Matchbyattributemethod getMatchbyattributemethod() const { return Matchbyattributemethod(myMatchbyattributemethod); }
731  void setMatchbyattributemethod(Matchbyattributemethod val) { myMatchbyattributemethod = int64(val); }
733  {
734  SOP_Node *thissop = cookparms.getNode();
735  if (!thissop) return getMatchbyattributemethod();
736  int64 result;
737  OP_Utils::evalOpParm(result, thissop, "matchbyattributemethod", cookparms.getCookTime(), 0);
738  return Matchbyattributemethod(result);
739  }
740  const UT_StringHolder & getAttributetomatch() const { return myAttributetomatch; }
741  void setAttributetomatch(const UT_StringHolder & val) { myAttributetomatch = val; }
743  {
744  SOP_Node *thissop = cookparms.getNode();
745  if (!thissop) return getAttributetomatch();
747  OP_Utils::evalOpParm(result, thissop, "attributetomatch", cookparms.getCookTime(), 0);
748  return result;
749  }
750  Attrib getAttrib() const { return Attrib(myAttrib); }
751  void setAttrib(Attrib val) { myAttrib = int64(val); }
752  Attrib opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
753  {
754  SOP_Node *thissop = cookparms.getNode();
755  if (!thissop) return getAttrib();
756  int64 result;
757  OP_Utils::evalOpParm(result, thissop, "attrib", cookparms.getCookTime(), 0);
758  return Attrib(result);
759  }
760  const UT_StringHolder & getAttribname() const { return myAttribname; }
761  void setAttribname(const UT_StringHolder & val) { myAttribname = val; }
763  {
764  SOP_Node *thissop = cookparms.getNode();
765  if (!thissop) return getAttribname();
767  OP_Utils::evalOpParm(result, thissop, "attribname", cookparms.getCookTime(), 0);
768  return result;
769  }
770  bool getCopyp() const { return myCopyp; }
771  void setCopyp(bool val) { myCopyp = val; }
772  bool opCopyp(const SOP_NodeVerb::CookParms &cookparms) const
773  {
774  SOP_Node *thissop = cookparms.getNode();
775  if (!thissop) return getCopyp();
776  bool result;
777  OP_Utils::evalOpParm(result, thissop, "copyp", cookparms.getCookTime(), 0);
778  return result;
779  }
780  bool getUsenewname() const { return myUsenewname; }
781  void setUsenewname(bool val) { myUsenewname = val; }
782  bool opUsenewname(const SOP_NodeVerb::CookParms &cookparms) const
783  {
784  SOP_Node *thissop = cookparms.getNode();
785  if (!thissop) return getUsenewname();
786  bool result;
787  OP_Utils::evalOpParm(result, thissop, "usenewname", cookparms.getCookTime(), 0);
788  return result;
789  }
790  const UT_StringHolder & getNewname() const { return myNewname; }
791  void setNewname(const UT_StringHolder & val) { myNewname = val; }
793  {
794  SOP_Node *thissop = cookparms.getNode();
795  if (!thissop) return getNewname();
797  OP_Utils::evalOpParm(result, thissop, "newname", cookparms.getCookTime(), 0);
798  return result;
799  }
800  Class getClass() const { return Class(myClass); }
801  void setClass(Class val) { myClass = int64(val); }
802  Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
803  {
804  SOP_Node *thissop = cookparms.getNode();
805  if (!thissop) return getClass();
806  int64 result;
807  OP_Utils::evalOpParm(result, thissop, "class", cookparms.getCookTime(), 0);
808  return Class(result);
809  }
810  bool getCopyvariable() const { return myCopyvariable; }
811  void setCopyvariable(bool val) { myCopyvariable = val; }
812  bool opCopyvariable(const SOP_NodeVerb::CookParms &cookparms) const
813  {
814  SOP_Node *thissop = cookparms.getNode();
815  if (!thissop) return getCopyvariable();
816  bool result;
817  OP_Utils::evalOpParm(result, thissop, "copyvariable", cookparms.getCookTime(), 0);
818  return result;
819  }
820  bool getCopydata() const { return myCopydata; }
821  void setCopydata(bool val) { myCopydata = val; }
822  bool opCopydata(const SOP_NodeVerb::CookParms &cookparms) const
823  {
824  SOP_Node *thissop = cookparms.getNode();
825  if (!thissop) return getCopydata();
826  bool result;
827  OP_Utils::evalOpParm(result, thissop, "copydata", cookparms.getCookTime(), 0);
828  return result;
829  }
830 
831 private:
832  UT_StringHolder mySrcgroup;
833  int64 mySrcgrouptype;
834  UT_StringHolder myDestgroup;
835  int64 myDestgrouptype;
836  bool myMatchbyattribute;
837  int64 myMatchbyattributemethod;
838  UT_StringHolder myAttributetomatch;
839  int64 myAttrib;
840  UT_StringHolder myAttribname;
841  bool myCopyp;
842  bool myUsenewname;
843  UT_StringHolder myNewname;
844  int64 myClass;
845  bool myCopyvariable;
846  bool myCopydata;
847 
848 };
type
Definition: core.h:556
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:63
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
static void loadData(UT_IStream &is, UT_Vector4D &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
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