HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_CopyToPoints-2.0.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_CopyToPoints_2_0Enums
24 {
25  enum class SourceGroupType
26  {
27  GUESS = 0,
28  PRIMS,
29  POINTS
30  };
31  enum class Pivot
32  {
33  ORIGIN = 0,
34  CENTROID
35  };
36  enum class ViewportLOD
37  {
38  FULL = 0,
39  POINTS,
40  BOX,
41  CENTROID,
42  HIDDEN
43  };
44  enum class Applyto
45  {
46  POINTS = 0,
47  VERTS,
48  PRIMS
49  };
50  enum class Applymethod
51  {
52  COPY = 0,
53  NONE,
54  MULT,
55  ADD,
56  SUB
57  };
58 }
59 
60 
62 {
63 public:
64  static int version() { return 1; }
66  {
67  bool useapply;
71 
72 
74  {
75  useapply = true;
76  applyto = 0;
77  applymethod = 0;
78  applyattribs = ""_UTsh;
79 
80  }
81 
82  bool operator==(const TargetAttribs &src) const
83  {
84  if (useapply != src.useapply) return false;
85  if (applyto != src.applyto) return false;
86  if (applymethod != src.applymethod) return false;
87  if (applyattribs != src.applyattribs) return false;
88 
89  return true;
90  }
91  bool operator!=(const TargetAttribs &src) const
92  {
93  return !operator==(src);
94  }
95 
96  };
97 
99  {
101 
102  buf.strcat("[ ");
103  for (int i = 0; i < list.entries(); i++)
104  {
105  if (i)
106  buf.strcat(", ");
107  buf.strcat("( ");
108  buf.append("");
109  buf.appendSprintf("%s", (list(i).useapply) ? "true" : "false");
110  buf.append(", ");
111  buf.appendSprintf("%d", (int) list(i).applyto);
112  buf.append(", ");
113  buf.appendSprintf("%d", (int) list(i).applymethod);
114  buf.append(", ");
115  { UT_String tmp; tmp = UT_StringWrap(list(i).applyattribs).makeQuotedString('"'); buf.strcat(tmp); }
116 
117  buf.strcat(" )");
118  }
119  buf.strcat(" ]");
120 
122  return result;
123  }
124 
126  {
127  mySourceGroup = ""_UTsh;
128  mySourceGroupType = 0;
129  myTargetGroup = ""_UTsh;
130  myUseIDAttrib = false;
131  myIDAttrib = "name"_UTsh;
132  myPack = false;
133  myPivot = 1;
134  myViewportLOD = 0;
135  myTransform = true;
136  myUseImplicitN = true;
137  myTargetAttribs.setSize(0);
138 
139  }
140 
141  explicit SOP_CopyToPoints_2_0Parms(const SOP_CopyToPoints_2_0Parms &) = default;
144  SOP_CopyToPoints_2_0Parms &operator=(SOP_CopyToPoints_2_0Parms &&) noexcept = default;
145 
147 
149  {
150  if (mySourceGroup != src.mySourceGroup) return false;
151  if (mySourceGroupType != src.mySourceGroupType) return false;
152  if (myTargetGroup != src.myTargetGroup) return false;
153  if (myUseIDAttrib != src.myUseIDAttrib) return false;
154  if (myIDAttrib != src.myIDAttrib) return false;
155  if (myPack != src.myPack) return false;
156  if (myPivot != src.myPivot) return false;
157  if (myViewportLOD != src.myViewportLOD) return false;
158  if (myTransform != src.myTransform) return false;
159  if (myUseImplicitN != src.myUseImplicitN) return false;
160  if (myTargetAttribs != src.myTargetAttribs) return false;
161 
162  return true;
163  }
165  {
166  return !operator==(src);
167  }
173 
174 
175 
176  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
177  {
178  mySourceGroup = ""_UTsh;
179  if (true)
180  graph->evalOpParm(mySourceGroup, nodeidx, "sourcegroup", time, 0);
181  mySourceGroupType = 0;
182  if (true)
183  graph->evalOpParm(mySourceGroupType, nodeidx, "sourcegrouptype", time, 0);
184  myTargetGroup = ""_UTsh;
185  if (true)
186  graph->evalOpParm(myTargetGroup, nodeidx, "targetgroup", time, 0);
187  myUseIDAttrib = false;
188  if (true)
189  graph->evalOpParm(myUseIDAttrib, nodeidx, "useidattrib", time, 0);
190  myIDAttrib = "name"_UTsh;
191  if (true && ( (true&&!(((getUseIDAttrib()==0)))) ) )
192  graph->evalOpParm(myIDAttrib, nodeidx, "idattrib", time, 0);
193  myPack = false;
194  if (true)
195  graph->evalOpParm(myPack, nodeidx, "pack", time, 0);
196  myPivot = 1;
197  if (true && ( (true&&!(((getPack()==0)))) ) )
198  graph->evalOpParm(myPivot, nodeidx, "pivot", time, 0);
199  myViewportLOD = 0;
200  if (true && ( (true&&!(((getPack()==0)))) ) )
201  graph->evalOpParm(myViewportLOD, nodeidx, "viewportlod", time, 0);
202  myTransform = true;
203  if (true)
204  graph->evalOpParm(myTransform, nodeidx, "transform", time, 0);
205  myUseImplicitN = true;
206  if (true && ( (true&&!(((getTransform()==0)))) ) )
207  graph->evalOpParm(myUseImplicitN, nodeidx, "useimplicitn", time, 0);
208  if (true)
209  {
210  int64 length = 0;
211  graph->evalOpParm(length, nodeidx, "targetattribs", time, 0);
212  if (length < 0) length = 0;
213  myTargetAttribs.setSize(length);
214  for (exint i = 0; i < length; i++)
215  {
216  int parmidx[1];
217  int offsets[1];
218  parmidx[0] = i+1;
219  offsets[0] = 1;
220  auto && _curentry = myTargetAttribs(i);
221  (void) _curentry;
222  _curentry.useapply = true;
223  if (true)
224  graph->evalOpParmInst(_curentry.useapply, nodeidx, "useapply#", parmidx, offsets, time, 0, 2-1);
225  _curentry.applyto = 0;
226  if (true)
227  graph->evalOpParmInst(_curentry.applyto, nodeidx, "applyto#", parmidx, offsets, time, 0, 2-1);
228  _curentry.applymethod = 0;
229  if (true)
230  graph->evalOpParmInst(_curentry.applymethod, nodeidx, "applymethod#", parmidx, offsets, time, 0, 2-1);
231  _curentry.applyattribs = ""_UTsh;
232  if (true)
233  graph->evalOpParmInst(_curentry.applyattribs, nodeidx, "applyattribs#", parmidx, offsets, time, 0, 2-1);
234 
235  }
236  }
237  else
238  myTargetAttribs.clear();
239 
240  }
241 
242 
243  void loadFromOpSubclass(const LoadParms &loadparms) override
244  {
245  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
246  }
247 
248 
249  void copyFrom(const OP_NodeParms *src) override
250  {
251  *this = *((const SOP_CopyToPoints_2_0Parms *)src);
252  }
253 
254  template <typename T>
255  void
256  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
257  {
258  if (idx.size() < 1)
259  return;
260  UT_ASSERT(idx.size() == instance.size()+1);
261  if (idx.size() != instance.size()+1)
262  return;
263  switch (idx[0])
264  {
265  case 0:
266  coerceValue(value, mySourceGroup);
267  break;
268  case 1:
269  coerceValue(value, mySourceGroupType);
270  break;
271  case 2:
272  coerceValue(value, myTargetGroup);
273  break;
274  case 3:
275  coerceValue(value, myUseIDAttrib);
276  break;
277  case 4:
278  coerceValue(value, myIDAttrib);
279  break;
280  case 5:
281  coerceValue(value, myPack);
282  break;
283  case 6:
284  coerceValue(value, myPivot);
285  break;
286  case 7:
287  coerceValue(value, myViewportLOD);
288  break;
289  case 8:
290  coerceValue(value, myTransform);
291  break;
292  case 9:
293  coerceValue(value, myUseImplicitN);
294  break;
295  case 10:
296  if (idx.size() == 1)
297  coerceValue(value, myTargetAttribs.entries());
298  else if (instance[0] < myTargetAttribs.entries())
299  {
300  auto && _data = myTargetAttribs(instance[0]);
301  switch (idx[1])
302  {
303  case 0:
304  coerceValue(value, _data.useapply);
305  break;
306  case 1:
307  coerceValue(value, _data.applyto);
308  break;
309  case 2:
310  coerceValue(value, _data.applymethod);
311  break;
312  case 3:
313  coerceValue(value, _data.applyattribs);
314  break;
315 
316  }
317  }
318  break;
319 
320  }
321  }
322 
323  bool isParmColorRamp(exint idx) const override
324  {
325  switch (idx)
326  {
327 
328  }
329  return false;
330  }
331 
332  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
333  { doGetParmValue(idx, instance, value); }
334  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
335  { doGetParmValue(idx, instance, value); }
336  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
337  { doGetParmValue(idx, instance, value); }
338  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
339  { doGetParmValue(idx, instance, value); }
340  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
341  { doGetParmValue(idx, instance, value); }
342  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
343  { doGetParmValue(idx, instance, value); }
344  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
345  { doGetParmValue(idx, instance, value); }
346  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
347  { doGetParmValue(idx, instance, value); }
348  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
349  { doGetParmValue(idx, instance, value); }
350  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
351  { doGetParmValue(idx, instance, value); }
352  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
353  { doGetParmValue(idx, instance, value); }
354 
355  template <typename T>
356  void
357  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
358  {
359  if (idx.size() < 1)
360  return;
361  UT_ASSERT(idx.size() == instance.size()+1);
362  if (idx.size() != instance.size()+1)
363  return;
364  switch (idx[0])
365  {
366  case 0:
367  coerceValue(mySourceGroup, ( ( value ) ));
368  break;
369  case 1:
370  coerceValue(mySourceGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
371  break;
372  case 2:
373  coerceValue(myTargetGroup, ( ( value ) ));
374  break;
375  case 3:
376  coerceValue(myUseIDAttrib, ( ( value ) ));
377  break;
378  case 4:
379  coerceValue(myIDAttrib, ( ( value ) ));
380  break;
381  case 5:
382  coerceValue(myPack, ( ( value ) ));
383  break;
384  case 6:
385  coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
386  break;
387  case 7:
388  coerceValue(myViewportLOD, clampMinValue(0, clampMaxValue(4, value ) ));
389  break;
390  case 8:
391  coerceValue(myTransform, ( ( value ) ));
392  break;
393  case 9:
394  coerceValue(myUseImplicitN, ( ( value ) ));
395  break;
396  case 10:
397  if (idx.size() == 1)
398  {
399  exint newsize;
400  coerceValue(newsize, value);
401  if (newsize < 0) newsize = 0;
402  myTargetAttribs.setSize(newsize);
403  }
404  else
405  {
406  if (instance[0] < 0)
407  return;
408  myTargetAttribs.setSizeIfNeeded(instance[0]+1);
409  auto && _data = myTargetAttribs(instance[0]);
410  switch (idx[1])
411  {
412  case 0:
413  coerceValue(_data.useapply, value);
414  break;
415  case 1:
416  coerceValue(_data.applyto, value);
417  break;
418  case 2:
419  coerceValue(_data.applymethod, value);
420  break;
421  case 3:
422  coerceValue(_data.applyattribs, value);
423  break;
424 
425  }
426  }
427  break;
428 
429  }
430  }
431 
432  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
433  { doSetParmValue(idx, instance, value); }
434  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
435  { doSetParmValue(idx, instance, value); }
436  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
437  { doSetParmValue(idx, instance, value); }
438  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
439  { doSetParmValue(idx, instance, value); }
440  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
441  { doSetParmValue(idx, instance, value); }
442  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
443  { doSetParmValue(idx, instance, value); }
444  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
445  { doSetParmValue(idx, instance, value); }
446  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
447  { doSetParmValue(idx, instance, value); }
448  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
449  { doSetParmValue(idx, instance, value); }
450  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
451  { doSetParmValue(idx, instance, value); }
452  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
453  { doSetParmValue(idx, instance, value); }
454 
455  exint getNestNumParms(TempIndex idx) const override
456  {
457  if (idx.size() == 0)
458  return 11;
459  switch (idx[0])
460  {
461  case 10:
462  return 4;
463 
464  }
465  // Invalid
466  return 0;
467  }
468 
469  const char *getNestParmName(TempIndex fieldnum) const override
470  {
471  if (fieldnum.size() < 1)
472  return 0;
473  switch (fieldnum[0])
474  {
475  case 0:
476  return "sourcegroup";
477  case 1:
478  return "sourcegrouptype";
479  case 2:
480  return "targetgroup";
481  case 3:
482  return "useidattrib";
483  case 4:
484  return "idattrib";
485  case 5:
486  return "pack";
487  case 6:
488  return "pivot";
489  case 7:
490  return "viewportlod";
491  case 8:
492  return "transform";
493  case 9:
494  return "useimplicitn";
495  case 10:
496  if (fieldnum.size() == 1)
497  return "targetattribs";
498  switch (fieldnum[1])
499  {
500  case 0:
501  return "useapply#";
502  case 1:
503  return "applyto#";
504  case 2:
505  return "applymethod#";
506  case 3:
507  return "applyattribs#";
508 
509  }
510  return 0;
511 
512  }
513  return 0;
514  }
515 
516  ParmType getNestParmType(TempIndex fieldnum) const override
517  {
518  if (fieldnum.size() < 1)
519  return PARM_UNSUPPORTED;
520  switch (fieldnum[0])
521  {
522  case 0:
523  return PARM_STRING;
524  case 1:
525  return PARM_INTEGER;
526  case 2:
527  return PARM_STRING;
528  case 3:
529  return PARM_INTEGER;
530  case 4:
531  return PARM_STRING;
532  case 5:
533  return PARM_INTEGER;
534  case 6:
535  return PARM_INTEGER;
536  case 7:
537  return PARM_INTEGER;
538  case 8:
539  return PARM_INTEGER;
540  case 9:
541  return PARM_INTEGER;
542  case 10:
543  if (fieldnum.size() == 1)
544  return PARM_MULTIPARM;
545  switch (fieldnum[1])
546  {
547  case 0:
548  return PARM_INTEGER;
549  case 1:
550  return PARM_INTEGER;
551  case 2:
552  return PARM_INTEGER;
553  case 3:
554  return PARM_STRING;
555 
556  }
557  return PARM_UNSUPPORTED;
558 
559  }
560  return PARM_UNSUPPORTED;
561  }
562 
563  // Boiler plate to load individual types.
564  static void loadData(UT_IStream &is, int64 &v)
565  { is.bread(&v, 1); }
566  static void loadData(UT_IStream &is, bool &v)
567  { int64 iv; is.bread(&iv, 1); v = iv; }
568  static void loadData(UT_IStream &is, fpreal64 &v)
569  { is.bread<fpreal64>(&v, 1); }
570  static void loadData(UT_IStream &is, UT_Vector2D &v)
571  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
572  static void loadData(UT_IStream &is, UT_Vector3D &v)
573  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
574  is.bread<fpreal64>(&v.z(), 1); }
575  static void loadData(UT_IStream &is, UT_Vector4D &v)
576  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
577  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
578  static void loadData(UT_IStream &is, UT_Matrix2D &v)
579  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
580  static void loadData(UT_IStream &is, UT_Matrix3D &v)
581  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
582  static void loadData(UT_IStream &is, UT_Matrix4D &v)
583  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
584  static void loadData(UT_IStream &is, UT_Vector2I &v)
585  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
586  static void loadData(UT_IStream &is, UT_Vector3I &v)
587  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
588  is.bread<int64>(&v.z(), 1); }
589  static void loadData(UT_IStream &is, UT_Vector4I &v)
590  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
591  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
593  { is.bread(v); }
595  { UT_StringHolder rampdata;
596  loadData(is, rampdata);
597  if (rampdata.isstring())
598  {
599  v.reset(new UT_Ramp());
600  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
601  v->load(istr);
602  }
603  else v.reset();
604  }
607  loadData(is, data);
608  if (data.isstring())
609  {
610  // Find the data type.
611  const char *colon = UT_StringWrap(data).findChar(':');
612  if (colon)
613  {
614  int typelen = colon - data.buffer();
616  type.strncpy(data.buffer(), typelen);
617  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
618 
619  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
620  }
621  }
622  else v.reset();
623  }
624 
625  static void saveData(std::ostream &os, int64 v)
626  { UTwrite(os, &v); }
627  static void saveData(std::ostream &os, bool v)
628  { int64 iv = v; UTwrite(os, &iv); }
629  static void saveData(std::ostream &os, fpreal64 v)
630  { UTwrite<fpreal64>(os, &v); }
631  static void saveData(std::ostream &os, UT_Vector2D v)
632  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
633  static void saveData(std::ostream &os, UT_Vector3D v)
634  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
635  UTwrite<fpreal64>(os, &v.z()); }
636  static void saveData(std::ostream &os, UT_Vector4D v)
637  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
638  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
639  static void saveData(std::ostream &os, UT_Matrix2D v)
641  static void saveData(std::ostream &os, UT_Matrix3D v)
643  static void saveData(std::ostream &os, UT_Matrix4D v)
645  static void saveData(std::ostream &os, UT_StringHolder s)
646  { UT_StringWrap(s).saveBinary(os); }
647  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
649  UT_OStringStream ostr;
650  if (s) s->save(ostr);
651  result = ostr.str();
652  saveData(os, result);
653  }
654  static void saveData(std::ostream &os, PRM_DataItemHandle s)
656  UT_OStringStream ostr;
657  if (s)
658  {
659  ostr << s->getDataTypeToken();
660  ostr << ":";
661  s->saveBinary(ostr);
662  }
663  result = ostr.str();
664  saveData(os, result);
665  }
666 
667 
668  void save(std::ostream &os) const
669  {
670  int32 v = version();
671  UTwrite(os, &v);
672  saveData(os, mySourceGroup);
673  saveData(os, mySourceGroupType);
674  saveData(os, myTargetGroup);
675  saveData(os, myUseIDAttrib);
676  saveData(os, myIDAttrib);
677  saveData(os, myPack);
678  saveData(os, myPivot);
679  saveData(os, myViewportLOD);
680  saveData(os, myTransform);
681  saveData(os, myUseImplicitN);
682  {
683  int64 length = myTargetAttribs.entries();
684  UTwrite(os, &length);
685  for (exint i = 0; i < length; i++)
686  {
687  auto && _curentry = myTargetAttribs(i);
688  (void) _curentry;
689  saveData(os, _curentry.useapply);
690  saveData(os, _curentry.applyto);
691  saveData(os, _curentry.applymethod);
692  saveData(os, _curentry.applyattribs);
693 
694  }
695  }
696 
697  }
698 
699  bool load(UT_IStream &is)
700  {
701  int32 v;
702  is.bread(&v, 1);
703  if (version() != v)
704  {
705  // Fail incompatible versions
706  return false;
707  }
708  loadData(is, mySourceGroup);
709  loadData(is, mySourceGroupType);
710  loadData(is, myTargetGroup);
711  loadData(is, myUseIDAttrib);
712  loadData(is, myIDAttrib);
713  loadData(is, myPack);
714  loadData(is, myPivot);
715  loadData(is, myViewportLOD);
716  loadData(is, myTransform);
717  loadData(is, myUseImplicitN);
718  {
719  int64 length;
720  is.read(&length, 1);
721  myTargetAttribs.setSize(length);
722  for (exint i = 0; i < length; i++)
723  {
724  auto && _curentry = myTargetAttribs(i);
725  (void) _curentry;
726  loadData(is, _curentry.useapply);
727  loadData(is, _curentry.applyto);
728  loadData(is, _curentry.applymethod);
729  loadData(is, _curentry.applyattribs);
730 
731  }
732  }
733 
734  return true;
735  }
736 
737  const UT_StringHolder & getSourceGroup() const { return mySourceGroup; }
738  void setSourceGroup(const UT_StringHolder & val) { mySourceGroup = val; }
740  {
741  SOP_Node *thissop = cookparms.getNode();
742  if (!thissop) return getSourceGroup();
744  OP_Utils::evalOpParm(result, thissop, "sourcegroup", cookparms.getCookTime(), 0);
745  return result;
746  }
747  SourceGroupType getSourceGroupType() const { return SourceGroupType(mySourceGroupType); }
748  void setSourceGroupType(SourceGroupType val) { mySourceGroupType = int64(val); }
750  {
751  SOP_Node *thissop = cookparms.getNode();
752  if (!thissop) return getSourceGroupType();
753  int64 result;
754  OP_Utils::evalOpParm(result, thissop, "sourcegrouptype", cookparms.getCookTime(), 0);
755  return SourceGroupType(result);
756  }
757  const UT_StringHolder & getTargetGroup() const { return myTargetGroup; }
758  void setTargetGroup(const UT_StringHolder & val) { myTargetGroup = val; }
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getTargetGroup();
764  OP_Utils::evalOpParm(result, thissop, "targetgroup", cookparms.getCookTime(), 0);
765  return result;
766  }
767  bool getUseIDAttrib() const { return myUseIDAttrib; }
768  void setUseIDAttrib(bool val) { myUseIDAttrib = val; }
769  bool opUseIDAttrib(const SOP_NodeVerb::CookParms &cookparms) const
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getUseIDAttrib();
773  bool result;
774  OP_Utils::evalOpParm(result, thissop, "useidattrib", cookparms.getCookTime(), 0);
775  return result;
776  }
777  const UT_StringHolder & getIDAttrib() const { return myIDAttrib; }
778  void setIDAttrib(const UT_StringHolder & val) { myIDAttrib = val; }
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return getIDAttrib();
784  OP_Utils::evalOpParm(result, thissop, "idattrib", cookparms.getCookTime(), 0);
785  return result;
786  }
787  bool getPack() const { return myPack; }
788  void setPack(bool val) { myPack = val; }
789  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getPack();
793  bool result;
794  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
795  return result;
796  }
797  Pivot getPivot() const { return Pivot(myPivot); }
798  void setPivot(Pivot val) { myPivot = int64(val); }
799  Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getPivot();
803  int64 result;
804  OP_Utils::evalOpParm(result, thissop, "pivot", cookparms.getCookTime(), 0);
805  return Pivot(result);
806  }
807  ViewportLOD getViewportLOD() const { return ViewportLOD(myViewportLOD); }
808  void setViewportLOD(ViewportLOD val) { myViewportLOD = int64(val); }
810  {
811  SOP_Node *thissop = cookparms.getNode();
812  if (!thissop) return getViewportLOD();
813  int64 result;
814  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
815  return ViewportLOD(result);
816  }
817  bool getTransform() const { return myTransform; }
818  void setTransform(bool val) { myTransform = val; }
819  bool opTransform(const SOP_NodeVerb::CookParms &cookparms) const
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getTransform();
823  bool result;
824  OP_Utils::evalOpParm(result, thissop, "transform", cookparms.getCookTime(), 0);
825  return result;
826  }
827  bool getUseImplicitN() const { return myUseImplicitN; }
828  void setUseImplicitN(bool val) { myUseImplicitN = val; }
829  bool opUseImplicitN(const SOP_NodeVerb::CookParms &cookparms) const
830  {
831  SOP_Node *thissop = cookparms.getNode();
832  if (!thissop) return getUseImplicitN();
833  bool result;
834  OP_Utils::evalOpParm(result, thissop, "useimplicitn", cookparms.getCookTime(), 0);
835  return result;
836  }
837  const UT_Array<TargetAttribs> &getTargetAttribs() const { return myTargetAttribs; }
838 void setTargetAttribs(const UT_Array<TargetAttribs> &val) { myTargetAttribs = val; }
840  {
841  SOP_Node *thissop = cookparms.getNode();
842  if (!thissop) return getTargetAttribs().entries();
843  exint result;
844  OP_Utils::evalOpParm(result, thissop, "targetattribs", cookparms.getCookTime(), 0);
845  return result;
846  }
847  bool opTargetAttribs_useapply(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
848  { return opinstTargetAttribs_useapply(cookparms, &_idx); }
849  bool opinstTargetAttribs_useapply(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
850  {
851  SOP_Node *thissop = cookparms.getNode();
852  if (!thissop) return (myTargetAttribs(_idx[0]).useapply);
853  int _parmidx[2-1];
854  _parmidx[1-1] = _idx[1-1] + 1;
855 
856  bool result;
857  OP_Utils::evalOpParmInst(result, thissop, "useapply#", _parmidx, cookparms.getCookTime(), 0, 2-1);
858  return (result);
859  }
860  int64 opTargetAttribs_applyto(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
861  { return opinstTargetAttribs_applyto(cookparms, &_idx); }
862  int64 opinstTargetAttribs_applyto(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
863  {
864  SOP_Node *thissop = cookparms.getNode();
865  if (!thissop) return (myTargetAttribs(_idx[0]).applyto);
866  int _parmidx[2-1];
867  _parmidx[1-1] = _idx[1-1] + 1;
868 
869  int64 result;
870  OP_Utils::evalOpParmInst(result, thissop, "applyto#", _parmidx, cookparms.getCookTime(), 0, 2-1);
871  return (result);
872  }
874  { return opinstTargetAttribs_applymethod(cookparms, &_idx); }
875  int64 opinstTargetAttribs_applymethod(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return (myTargetAttribs(_idx[0]).applymethod);
879  int _parmidx[2-1];
880  _parmidx[1-1] = _idx[1-1] + 1;
881 
882  int64 result;
883  OP_Utils::evalOpParmInst(result, thissop, "applymethod#", _parmidx, cookparms.getCookTime(), 0, 2-1);
884  return (result);
885  }
887  { return opinstTargetAttribs_applyattribs(cookparms, &_idx); }
889  {
890  SOP_Node *thissop = cookparms.getNode();
891  if (!thissop) return (myTargetAttribs(_idx[0]).applyattribs);
892  int _parmidx[2-1];
893  _parmidx[1-1] = _idx[1-1] + 1;
894 
896  OP_Utils::evalOpParmInst(result, thissop, "applyattribs#", _parmidx, cookparms.getCookTime(), 0, 2-1);
897  return (result);
898  }
899 
900 
901 private:
902  UT_StringHolder mySourceGroup;
903  int64 mySourceGroupType;
904  UT_StringHolder myTargetGroup;
905  bool myUseIDAttrib;
906  UT_StringHolder myIDAttrib;
907  bool myPack;
908  int64 myPivot;
909  int64 myViewportLOD;
910  bool myTransform;
911  bool myUseImplicitN;
912  UT_Array<TargetAttribs> myTargetAttribs;
913 
914 };
SourceGroupType opSourceGroupType(const SOP_NodeVerb::CookParms &cookparms) const
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
int64 opinstTargetAttribs_applymethod(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setTargetGroup(const UT_StringHolder &val)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector2D v)
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
UT_StringHolder createString(const UT_Array< TargetAttribs > &list) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void
Definition: png.h:1083
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
fpreal getTime() const
Definition: OP_Context.h:62
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setTargetAttribs(const UT_Array< TargetAttribs > &val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
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
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
static void loadData(UT_IStream &is, UT_Matrix2D &v)
An output stream object that owns its own string buffer storage.
bool opinstTargetAttribs_useapply(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opUseImplicitN(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, bool &v)
**But if you need a result
Definition: thread.h:613
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setSourceGroup(const UT_StringHolder &val)
void setSourceGroupType(SourceGroupType val)
UT_StringHolder opTargetGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
void setIDAttrib(const UT_StringHolder &val)
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.
bool operator!=(const SOP_CopyToPoints_2_0Parms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opIDAttrib(const SOP_NodeVerb::CookParms &cookparms) const
int64 opTargetAttribs_applymethod(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void copyFrom(const OP_NodeParms *src) override
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
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 opUseIDAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool operator==(const TargetAttribs &src) const
Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2D &v)
const UT_StringHolder & getTargetGroup() const
UT_StringHolder opTargetAttribs_applyattribs(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
int64 opTargetAttribs_applyto(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
exint opTargetAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< TargetAttribs > & getTargetAttribs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool opTargetAttribs_useapply(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
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
ViewportLOD opViewportLOD(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
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)
UT_StringHolder opinstTargetAttribs_applyattribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strcat(const char *src)
static void saveData(std::ostream &os, fpreal64 v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
bool operator!=(const TargetAttribs &src) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
fpreal64 fpreal
Definition: SYS_Types.h:277
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void saveData(std::ostream &os, UT_Vector4D v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
bool opTransform(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
int64 opinstTargetAttribs_applyto(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLboolean r
Definition: glcorearb.h:1222
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, bool v)
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opSourceGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool operator==(const SOP_CopyToPoints_2_0Parms &src) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
const UT_StringHolder & getSourceGroup() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Matrix4D v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
const UT_StringHolder & getIDAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SourceGroupType getSourceGroupType() const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override