HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribSwap.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_AttribSwapEnums
24 {
25  enum class Method
26  {
27  SWAP = 0,
28  COPY,
29  MOVE
30  };
31  enum class Class
32  {
33  DETAIL = 0,
34  PRIMITIVE,
35  POINT,
36  VERTEX
37  };
38  enum class Typeinfo
39  {
40  SOURCE = 0,
41  DEST
42  };
43 }
44 
45 
47 {
48 public:
49  static int version() { return 1; }
50  struct Numswaps
51  {
52  bool enable;
58 
59 
61  {
62  enable = true;
63  method = 0;
64  _class = 2;
65  srcattribs = ""_UTsh;
66  dstattribs = ""_UTsh;
67  typeinfo = 1;
68 
69  }
70 
71  bool operator==(const Numswaps &src) const
72  {
73  if (enable != src.enable) return false;
74  if (method != src.method) return false;
75  if (_class != src._class) return false;
76  if (srcattribs != src.srcattribs) return false;
77  if (dstattribs != src.dstattribs) return false;
78  if (typeinfo != src.typeinfo) return false;
79 
80  return true;
81  }
82  bool operator!=(const Numswaps &src) const
83  {
84  return !operator==(src);
85  }
86 
87  };
88 
90  {
92 
93  buf.strcat("[ ");
94  for (int i = 0; i < list.entries(); i++)
95  {
96  if (i)
97  buf.strcat(", ");
98  buf.strcat("( ");
99  buf.append("");
100  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
101  buf.append(", ");
102  buf.appendSprintf("%d", (int) list(i).method);
103  buf.append(", ");
104  buf.appendSprintf("%d", (int) list(i)._class);
105  buf.append(", ");
106  { UT_String tmp; tmp = UT_StringWrap(list(i).srcattribs).makeQuotedString('"'); buf.strcat(tmp); }
107  buf.append(", ");
108  { UT_String tmp; tmp = UT_StringWrap(list(i).dstattribs).makeQuotedString('"'); buf.strcat(tmp); }
109  buf.append(", ");
110  buf.appendSprintf("%d", (int) list(i).typeinfo);
111 
112  buf.strcat(" )");
113  }
114  buf.strcat(" ]");
115 
117  return result;
118  }
119 
121  {
122  myNumswaps.setSize(1);
123 
124  }
125 
126  explicit SOP_AttribSwapParms(const SOP_AttribSwapParms &) = default;
128  SOP_AttribSwapParms(SOP_AttribSwapParms &&) noexcept = default;
129  SOP_AttribSwapParms &operator=(SOP_AttribSwapParms &&) noexcept = default;
130 
131  ~SOP_AttribSwapParms() override {}
132 
133  bool operator==(const SOP_AttribSwapParms &src) const
134  {
135  if (myNumswaps != src.myNumswaps) return false;
136 
137  return true;
138  }
139  bool operator!=(const SOP_AttribSwapParms &src) const
140  {
141  return !operator==(src);
142  }
146 
147 
148 
149  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
150  {
151  if (true)
152  {
153  int64 length = 0;
154  graph->evalOpParm(length, nodeidx, "numswaps", time, 0);
155  if (length < 0) length = 0;
156  myNumswaps.setSize(length);
157  for (exint i = 0; i < length; i++)
158  {
159  int parmidx[1];
160  int offsets[1];
161  parmidx[0] = i+1;
162  offsets[0] = 1;
163  auto && _curentry = myNumswaps(i);
164  (void) _curentry;
165  _curentry.enable = true;
166  if (true)
167  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, 0, 2-1);
168  _curentry.method = 0;
169  if (true)
170  graph->evalOpParmInst(_curentry.method, nodeidx, "method#", parmidx, offsets, time, 0, 2-1);
171  _curentry._class = 2;
172  if (true)
173  graph->evalOpParmInst(_curentry._class, nodeidx, "class#", parmidx, offsets, time, 0, 2-1);
174  _curentry.srcattribs = ""_UTsh;
175  if (true)
176  graph->evalOpParmInst(_curentry.srcattribs, nodeidx, "srcattribs#", parmidx, offsets, time, 0, 2-1);
177  _curentry.dstattribs = ""_UTsh;
178  if (true)
179  graph->evalOpParmInst(_curentry.dstattribs, nodeidx, "dstattribs#", parmidx, offsets, time, 0, 2-1);
180  _curentry.typeinfo = 1;
181  if (true)
182  graph->evalOpParmInst(_curentry.typeinfo, nodeidx, "typeinfo#", parmidx, offsets, time, 0, 2-1);
183 
184  }
185  }
186  else
187  myNumswaps.clear();
188 
189  }
190 
191 
192  void loadFromOpSubclass(const LoadParms &loadparms) override
193  {
194  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
195  }
196 
197 
198  void copyFrom(const OP_NodeParms *src) override
199  {
200  *this = *((const SOP_AttribSwapParms *)src);
201  }
202 
203  template <typename T>
204  void
205  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
206  {
207  if (idx.size() < 1)
208  return;
209  UT_ASSERT(idx.size() == instance.size()+1);
210  if (idx.size() != instance.size()+1)
211  return;
212  switch (idx[0])
213  {
214  case 0:
215  if (idx.size() == 1)
216  coerceValue(value, myNumswaps.entries());
217  else if (instance[0] < myNumswaps.entries())
218  {
219  auto && _data = myNumswaps(instance[0]);
220  switch (idx[1])
221  {
222  case 0:
223  coerceValue(value, _data.enable);
224  break;
225  case 1:
226  coerceValue(value, _data.method);
227  break;
228  case 2:
229  coerceValue(value, _data._class);
230  break;
231  case 3:
232  coerceValue(value, _data.srcattribs);
233  break;
234  case 4:
235  coerceValue(value, _data.dstattribs);
236  break;
237  case 5:
238  coerceValue(value, _data.typeinfo);
239  break;
240 
241  }
242  }
243  break;
244 
245  }
246  }
247 
248  bool isParmColorRamp(exint idx) const override
249  {
250  switch (idx)
251  {
252 
253  }
254  return false;
255  }
256 
257  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
258  { doGetParmValue(idx, instance, value); }
259  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
260  { doGetParmValue(idx, instance, value); }
261  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
262  { doGetParmValue(idx, instance, value); }
263  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
264  { doGetParmValue(idx, instance, value); }
265  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
266  { doGetParmValue(idx, instance, value); }
267  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
268  { doGetParmValue(idx, instance, value); }
269  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
270  { doGetParmValue(idx, instance, value); }
271  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
278  { doGetParmValue(idx, instance, value); }
279 
280  template <typename T>
281  void
282  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
283  {
284  if (idx.size() < 1)
285  return;
286  UT_ASSERT(idx.size() == instance.size()+1);
287  if (idx.size() != instance.size()+1)
288  return;
289  switch (idx[0])
290  {
291  case 0:
292  if (idx.size() == 1)
293  {
294  exint newsize;
295  coerceValue(newsize, value);
296  if (newsize < 0) newsize = 0;
297  myNumswaps.setSize(newsize);
298  }
299  else
300  {
301  if (instance[0] < 0)
302  return;
303  myNumswaps.setSizeIfNeeded(instance[0]+1);
304  auto && _data = myNumswaps(instance[0]);
305  switch (idx[1])
306  {
307  case 0:
308  coerceValue(_data.enable, value);
309  break;
310  case 1:
311  coerceValue(_data.method, value);
312  break;
313  case 2:
314  coerceValue(_data._class, value);
315  break;
316  case 3:
317  coerceValue(_data.srcattribs, value);
318  break;
319  case 4:
320  coerceValue(_data.dstattribs, value);
321  break;
322  case 5:
323  coerceValue(_data.typeinfo, value);
324  break;
325 
326  }
327  }
328  break;
329 
330  }
331  }
332 
333  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
334  { doSetParmValue(idx, instance, value); }
335  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
336  { doSetParmValue(idx, instance, value); }
337  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
338  { doSetParmValue(idx, instance, value); }
339  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
340  { doSetParmValue(idx, instance, value); }
341  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
342  { doSetParmValue(idx, instance, value); }
343  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
344  { doSetParmValue(idx, instance, value); }
345  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
346  { doSetParmValue(idx, instance, value); }
347  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
348  { doSetParmValue(idx, instance, value); }
349  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
354  { doSetParmValue(idx, instance, value); }
355 
356  exint getNestNumParms(TempIndex idx) const override
357  {
358  if (idx.size() == 0)
359  return 1;
360  switch (idx[0])
361  {
362  case 0:
363  return 6;
364 
365  }
366  // Invalid
367  return 0;
368  }
369 
370  const char *getNestParmName(TempIndex fieldnum) const override
371  {
372  if (fieldnum.size() < 1)
373  return 0;
374  switch (fieldnum[0])
375  {
376  case 0:
377  if (fieldnum.size() == 1)
378  return "numswaps";
379  switch (fieldnum[1])
380  {
381  case 0:
382  return "enable#";
383  case 1:
384  return "method#";
385  case 2:
386  return "class#";
387  case 3:
388  return "srcattribs#";
389  case 4:
390  return "dstattribs#";
391  case 5:
392  return "typeinfo#";
393 
394  }
395  return 0;
396 
397  }
398  return 0;
399  }
400 
401  ParmType getNestParmType(TempIndex fieldnum) const override
402  {
403  if (fieldnum.size() < 1)
404  return PARM_UNSUPPORTED;
405  switch (fieldnum[0])
406  {
407  case 0:
408  if (fieldnum.size() == 1)
409  return PARM_MULTIPARM;
410  switch (fieldnum[1])
411  {
412  case 0:
413  return PARM_INTEGER;
414  case 1:
415  return PARM_INTEGER;
416  case 2:
417  return PARM_INTEGER;
418  case 3:
419  return PARM_STRING;
420  case 4:
421  return PARM_STRING;
422  case 5:
423  return PARM_INTEGER;
424 
425  }
426  return PARM_UNSUPPORTED;
427 
428  }
429  return PARM_UNSUPPORTED;
430  }
431 
432  // Boiler plate to load individual types.
433  static void loadData(UT_IStream &is, int64 &v)
434  { is.bread(&v, 1); }
435  static void loadData(UT_IStream &is, bool &v)
436  { int64 iv; is.bread(&iv, 1); v = iv; }
437  static void loadData(UT_IStream &is, fpreal64 &v)
438  { is.bread<fpreal64>(&v, 1); }
439  static void loadData(UT_IStream &is, UT_Vector2D &v)
440  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
441  static void loadData(UT_IStream &is, UT_Vector3D &v)
442  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
443  is.bread<fpreal64>(&v.z(), 1); }
444  static void loadData(UT_IStream &is, UT_Vector4D &v)
445  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
446  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
447  static void loadData(UT_IStream &is, UT_Matrix2D &v)
448  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
449  static void loadData(UT_IStream &is, UT_Matrix3D &v)
450  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
451  static void loadData(UT_IStream &is, UT_Matrix4D &v)
452  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
453  static void loadData(UT_IStream &is, UT_Vector2I &v)
454  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
455  static void loadData(UT_IStream &is, UT_Vector3I &v)
456  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
457  is.bread<int64>(&v.z(), 1); }
458  static void loadData(UT_IStream &is, UT_Vector4I &v)
459  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
460  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
462  { is.bread(v); }
464  { UT_StringHolder rampdata;
465  loadData(is, rampdata);
466  if (rampdata.isstring())
467  {
468  v.reset(new UT_Ramp());
469  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
470  v->load(istr);
471  }
472  else v.reset();
473  }
476  loadData(is, data);
477  if (data.isstring())
478  {
479  // Find the data type.
480  const char *colon = UT_StringWrap(data).findChar(':');
481  if (colon)
482  {
483  int typelen = colon - data.buffer();
485  type.strncpy(data.buffer(), typelen);
486  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
487 
488  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
489  }
490  }
491  else v.reset();
492  }
493 
494  static void saveData(std::ostream &os, int64 v)
495  { UTwrite(os, &v); }
496  static void saveData(std::ostream &os, bool v)
497  { int64 iv = v; UTwrite(os, &iv); }
498  static void saveData(std::ostream &os, fpreal64 v)
499  { UTwrite<fpreal64>(os, &v); }
500  static void saveData(std::ostream &os, UT_Vector2D v)
501  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
502  static void saveData(std::ostream &os, UT_Vector3D v)
503  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
504  UTwrite<fpreal64>(os, &v.z()); }
505  static void saveData(std::ostream &os, UT_Vector4D v)
506  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
507  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
508  static void saveData(std::ostream &os, UT_Matrix2D v)
510  static void saveData(std::ostream &os, UT_Matrix3D v)
512  static void saveData(std::ostream &os, UT_Matrix4D v)
514  static void saveData(std::ostream &os, UT_StringHolder s)
515  { UT_StringWrap(s).saveBinary(os); }
516  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
518  UT_OStringStream ostr;
519  if (s) s->save(ostr);
520  result = ostr.str();
521  saveData(os, result);
522  }
523  static void saveData(std::ostream &os, PRM_DataItemHandle s)
525  UT_OStringStream ostr;
526  if (s)
527  {
528  ostr << s->getDataTypeToken();
529  ostr << ":";
530  s->saveBinary(ostr);
531  }
532  result = ostr.str();
533  saveData(os, result);
534  }
535 
536 
537  void save(std::ostream &os) const
538  {
539  int32 v = version();
540  UTwrite(os, &v);
541  {
542  int64 length = myNumswaps.entries();
543  UTwrite(os, &length);
544  for (exint i = 0; i < length; i++)
545  {
546  auto && _curentry = myNumswaps(i);
547  (void) _curentry;
548  saveData(os, _curentry.enable);
549  saveData(os, _curentry.method);
550  saveData(os, _curentry._class);
551  saveData(os, _curentry.srcattribs);
552  saveData(os, _curentry.dstattribs);
553  saveData(os, _curentry.typeinfo);
554 
555  }
556  }
557 
558  }
559 
560  bool load(UT_IStream &is)
561  {
562  int32 v;
563  is.bread(&v, 1);
564  if (version() != v)
565  {
566  // Fail incompatible versions
567  return false;
568  }
569  {
570  int64 length;
571  is.read(&length, 1);
572  myNumswaps.setSize(length);
573  for (exint i = 0; i < length; i++)
574  {
575  auto && _curentry = myNumswaps(i);
576  (void) _curentry;
577  loadData(is, _curentry.enable);
578  loadData(is, _curentry.method);
579  loadData(is, _curentry._class);
580  loadData(is, _curentry.srcattribs);
581  loadData(is, _curentry.dstattribs);
582  loadData(is, _curentry.typeinfo);
583 
584  }
585  }
586 
587  return true;
588  }
589 
590  const UT_Array<Numswaps> &getNumswaps() const { return myNumswaps; }
591 void setNumswaps(const UT_Array<Numswaps> &val) { myNumswaps = val; }
592  exint opNumswaps(const SOP_NodeVerb::CookParms &cookparms) const
593  {
594  SOP_Node *thissop = cookparms.getNode();
595  if (!thissop) return getNumswaps().entries();
596  exint result;
597  OP_Utils::evalOpParm(result, thissop, "numswaps", cookparms.getCookTime(), 0);
598  return result;
599  }
600  bool opNumswaps_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
601  { return opinstNumswaps_enable(cookparms, &_idx); }
602  bool opinstNumswaps_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
603  {
604  SOP_Node *thissop = cookparms.getNode();
605  if (!thissop) return (myNumswaps(_idx[0]).enable);
606  int _parmidx[2-1];
607  _parmidx[1-1] = _idx[1-1] + 1;
608 
609  bool result;
610  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
611  return (result);
612  }
613  int64 opNumswaps_method(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
614  { return opinstNumswaps_method(cookparms, &_idx); }
615  int64 opinstNumswaps_method(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
616  {
617  SOP_Node *thissop = cookparms.getNode();
618  if (!thissop) return (myNumswaps(_idx[0]).method);
619  int _parmidx[2-1];
620  _parmidx[1-1] = _idx[1-1] + 1;
621 
622  int64 result;
623  OP_Utils::evalOpParmInst(result, thissop, "method#", _parmidx, cookparms.getCookTime(), 0, 2-1);
624  return (result);
625  }
626  int64 opNumswaps__class(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
627  { return opinstNumswaps__class(cookparms, &_idx); }
628  int64 opinstNumswaps__class(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
629  {
630  SOP_Node *thissop = cookparms.getNode();
631  if (!thissop) return (myNumswaps(_idx[0])._class);
632  int _parmidx[2-1];
633  _parmidx[1-1] = _idx[1-1] + 1;
634 
635  int64 result;
636  OP_Utils::evalOpParmInst(result, thissop, "class#", _parmidx, cookparms.getCookTime(), 0, 2-1);
637  return (result);
638  }
640  { return opinstNumswaps_srcattribs(cookparms, &_idx); }
641  UT_StringHolder opinstNumswaps_srcattribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
642  {
643  SOP_Node *thissop = cookparms.getNode();
644  if (!thissop) return (myNumswaps(_idx[0]).srcattribs);
645  int _parmidx[2-1];
646  _parmidx[1-1] = _idx[1-1] + 1;
647 
649  OP_Utils::evalOpParmInst(result, thissop, "srcattribs#", _parmidx, cookparms.getCookTime(), 0, 2-1);
650  return (result);
651  }
653  { return opinstNumswaps_dstattribs(cookparms, &_idx); }
654  UT_StringHolder opinstNumswaps_dstattribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
655  {
656  SOP_Node *thissop = cookparms.getNode();
657  if (!thissop) return (myNumswaps(_idx[0]).dstattribs);
658  int _parmidx[2-1];
659  _parmidx[1-1] = _idx[1-1] + 1;
660 
662  OP_Utils::evalOpParmInst(result, thissop, "dstattribs#", _parmidx, cookparms.getCookTime(), 0, 2-1);
663  return (result);
664  }
665  int64 opNumswaps_typeinfo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
666  { return opinstNumswaps_typeinfo(cookparms, &_idx); }
667  int64 opinstNumswaps_typeinfo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
668  {
669  SOP_Node *thissop = cookparms.getNode();
670  if (!thissop) return (myNumswaps(_idx[0]).typeinfo);
671  int _parmidx[2-1];
672  _parmidx[1-1] = _idx[1-1] + 1;
673 
674  int64 result;
675  OP_Utils::evalOpParmInst(result, thissop, "typeinfo#", _parmidx, cookparms.getCookTime(), 0, 2-1);
676  return (result);
677  }
678 
679 
680 private:
681  UT_Array<Numswaps> myNumswaps;
682 
683 };
bool opNumswaps_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool load(UT_IStream &is)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void saveData(std::ostream &os, int64 v)
void
Definition: png.h:1083
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal getTime() const
Definition: OP_Context.h:62
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_StringHolder createString(const UT_Array< Numswaps > &list) const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
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
static void saveData(std::ostream &os, UT_Matrix4D v)
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Matrix3D &v)
**But if you need a result
Definition: thread.h:613
int64 opinstNumswaps_method(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const Numswaps &src) const
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.
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNumswaps(const UT_Array< Numswaps > &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const UT_Array< Numswaps > & getNumswaps() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator!=(const Numswaps &src) const
UT_StringHolder opinstNumswaps_srcattribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint length() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
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
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
const char * getNestParmName(TempIndex fieldnum) const override
void save(std::ostream &os) const
bool operator==(const SOP_AttribSwapParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int64 opinstNumswaps_typeinfo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, fpreal64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
exint getNestNumParms(TempIndex idx) const override
SYS_FORCE_INLINE void strcat(const char *src)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
ParmType getNestParmType(TempIndex fieldnum) const override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
bool operator!=(const SOP_AttribSwapParms &src) const
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool isParmColorRamp(exint idx) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
int64 opNumswaps__class(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void loadFromOpSubclass(const LoadParms &loadparms) override
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void loadData(UT_IStream &is, UT_Vector2I &v)
#define SOP_API
Definition: SOP_API.h:10
int64 opNumswaps_method(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_Vector2D v)
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
static void saveData(std::ostream &os, UT_Vector3D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
int64 opinstNumswaps__class(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opinstNumswaps_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opNumswaps_srcattribs(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
UT_StringHolder opinstNumswaps_dstattribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
type
Definition: core.h:1059
int64 opNumswaps_typeinfo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
static void loadData(UT_IStream &is, bool &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
exint opNumswaps(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumswaps_dstattribs(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663