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