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