HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_BlendShapes.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 
25 {
26 public:
27  static int version() { return 1; }
28  struct Nblends
29  {
31 
32 
34  {
35  blend = 0;
36 
37  }
38 
39  bool operator==(const Nblends &src) const
40  {
41  if (blend != src.blend) return false;
42 
43  return true;
44  }
45  bool operator!=(const Nblends &src) const
46  {
47  return !operator==(src);
48  }
49 
50  };
51 
53  {
55 
56  buf.strcat("[ ");
57  for (int i = 0; i < list.entries(); i++)
58  {
59  if (i)
60  buf.strcat(", ");
61  buf.strcat("( ");
62  buf.append("");
63  buf.appendSprintf("%f", (list(i).blend));
64 
65  buf.strcat(" )");
66  }
67  buf.strcat(" ]");
68 
70  return result;
71  }
72 
74  {
75  myGroup = ""_UTsh;
76  mySelectionIdx = 0;
77  myDiff = true;
78  myDoPos = true;
79  myDoClr = false;
80  myDoNml = false;
81  myDoUVW = false;
82  myDoVoxel = false;
83  myDoSlerp = false;
84  myPtIDAttr = ""_UTsh;
85  myPrimIDAttr = ""_UTsh;
86  myMorph = false;
87  myNblends.setSize(2);
88 
89  }
90 
91  explicit SOP_BlendShapesParms(const SOP_BlendShapesParms &) = default;
93  SOP_BlendShapesParms(SOP_BlendShapesParms &&) noexcept = default;
94  SOP_BlendShapesParms &operator=(SOP_BlendShapesParms &&) noexcept = default;
95 
96  ~SOP_BlendShapesParms() override {}
97 
98  bool operator==(const SOP_BlendShapesParms &src) const
99  {
100  if (myGroup != src.myGroup) return false;
101  if (mySelectionIdx != src.mySelectionIdx) return false;
102  if (myDiff != src.myDiff) return false;
103  if (myDoPos != src.myDoPos) return false;
104  if (myDoClr != src.myDoClr) return false;
105  if (myDoNml != src.myDoNml) return false;
106  if (myDoUVW != src.myDoUVW) return false;
107  if (myDoVoxel != src.myDoVoxel) return false;
108  if (myDoSlerp != src.myDoSlerp) return false;
109  if (myPtIDAttr != src.myPtIDAttr) return false;
110  if (myPrimIDAttr != src.myPrimIDAttr) return false;
111  if (myMorph != src.myMorph) return false;
112  if (myNblends != src.myNblends) return false;
113 
114  return true;
115  }
117  {
118  return !operator==(src);
119  }
120 
121 
122 
123  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
124  {
125  myGroup = ""_UTsh;
126  if (true)
127  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
128  mySelectionIdx = 0;
129  if (true)
130  graph->evalOpParm(mySelectionIdx, nodeidx, "selectionidx", time, 0);
131  myDiff = true;
132  if (true)
133  graph->evalOpParm(myDiff, nodeidx, "diff", time, 0);
134  myDoPos = true;
135  if (true)
136  graph->evalOpParm(myDoPos, nodeidx, "dopos", time, 0);
137  myDoClr = false;
138  if (true)
139  graph->evalOpParm(myDoClr, nodeidx, "doclr", time, 0);
140  myDoNml = false;
141  if (true)
142  graph->evalOpParm(myDoNml, nodeidx, "donml", time, 0);
143  myDoUVW = false;
144  if (true)
145  graph->evalOpParm(myDoUVW, nodeidx, "douvw", time, 0);
146  myDoVoxel = false;
147  if (true)
148  graph->evalOpParm(myDoVoxel, nodeidx, "dovoxel", time, 0);
149  myDoSlerp = false;
150  if (true)
151  graph->evalOpParm(myDoSlerp, nodeidx, "doslerp", time, 0);
152  myPtIDAttr = ""_UTsh;
153  if (true)
154  graph->evalOpParm(myPtIDAttr, nodeidx, "ptidattr", time, 0);
155  myPrimIDAttr = ""_UTsh;
156  if (true)
157  graph->evalOpParm(myPrimIDAttr, nodeidx, "primidattr", time, 0);
158  myMorph = false;
159  if (true)
160  graph->evalOpParm(myMorph, nodeidx, "morph", time, 0);
161  if (true)
162  {
163  int64 length = 0;
164  graph->evalOpParm(length, nodeidx, "nblends", time, 0);
165  if (length < 0) length = 0;
166  myNblends.setSize(length);
167  for (exint i = 0; i < length; i++)
168  {
169  int parmidx[1];
170  int offsets[1];
171  parmidx[0] = i+0;
172  offsets[0] = 0;
173  auto && _curentry = myNblends(i);
174  (void) _curentry;
175  _curentry.blend = 0;
176  if (true)
177  graph->evalOpParmInst(_curentry.blend, nodeidx, "blend#", parmidx, offsets, time, 0, 2-1);
178 
179  }
180  }
181  else
182  myNblends.clear();
183 
184  }
185 
186 
187  void loadFromOpSubclass(const LoadParms &loadparms) override
188  {
189  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
190  }
191 
192 
193  void copyFrom(const OP_NodeParms *src) override
194  {
195  *this = *((const SOP_BlendShapesParms *)src);
196  }
197 
198  template <typename T>
199  void
200  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
201  {
202  if (idx.size() < 1)
203  return;
204  UT_ASSERT(idx.size() == instance.size()+1);
205  if (idx.size() != instance.size()+1)
206  return;
207  switch (idx[0])
208  {
209  case 0:
210  coerceValue(value, myGroup);
211  break;
212  case 1:
213  coerceValue(value, mySelectionIdx);
214  break;
215  case 2:
216  coerceValue(value, myDiff);
217  break;
218  case 3:
219  coerceValue(value, myDoPos);
220  break;
221  case 4:
222  coerceValue(value, myDoClr);
223  break;
224  case 5:
225  coerceValue(value, myDoNml);
226  break;
227  case 6:
228  coerceValue(value, myDoUVW);
229  break;
230  case 7:
231  coerceValue(value, myDoVoxel);
232  break;
233  case 8:
234  coerceValue(value, myDoSlerp);
235  break;
236  case 9:
237  coerceValue(value, myPtIDAttr);
238  break;
239  case 10:
240  coerceValue(value, myPrimIDAttr);
241  break;
242  case 11:
243  coerceValue(value, myMorph);
244  break;
245  case 12:
246  if (idx.size() == 1)
247  coerceValue(value, myNblends.entries());
248  else if (instance[0] < myNblends.entries())
249  {
250  auto && _data = myNblends(instance[0]);
251  switch (idx[1])
252  {
253  case 0:
254  coerceValue(value, _data.blend);
255  break;
256 
257  }
258  }
259  break;
260 
261  }
262  }
263 
264  bool isParmColorRamp(exint idx) const override
265  {
266  switch (idx)
267  {
268 
269  }
270  return false;
271  }
272 
273  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
294  { doGetParmValue(idx, instance, value); }
295 
296  template <typename T>
297  void
298  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
299  {
300  if (idx.size() < 1)
301  return;
302  UT_ASSERT(idx.size() == instance.size()+1);
303  if (idx.size() != instance.size()+1)
304  return;
305  switch (idx[0])
306  {
307  case 0:
308  coerceValue(myGroup, ( ( value ) ));
309  break;
310  case 1:
311  coerceValue(mySelectionIdx, ( ( value ) ));
312  break;
313  case 2:
314  coerceValue(myDiff, ( ( value ) ));
315  break;
316  case 3:
317  coerceValue(myDoPos, ( ( value ) ));
318  break;
319  case 4:
320  coerceValue(myDoClr, ( ( value ) ));
321  break;
322  case 5:
323  coerceValue(myDoNml, ( ( value ) ));
324  break;
325  case 6:
326  coerceValue(myDoUVW, ( ( value ) ));
327  break;
328  case 7:
329  coerceValue(myDoVoxel, ( ( value ) ));
330  break;
331  case 8:
332  coerceValue(myDoSlerp, ( ( value ) ));
333  break;
334  case 9:
335  coerceValue(myPtIDAttr, ( ( value ) ));
336  break;
337  case 10:
338  coerceValue(myPrimIDAttr, ( ( value ) ));
339  break;
340  case 11:
341  coerceValue(myMorph, ( ( value ) ));
342  break;
343  case 12:
344  if (idx.size() == 1)
345  {
346  exint newsize;
347  coerceValue(newsize, value);
348  if (newsize < 0) newsize = 0;
349  myNblends.setSize(newsize);
350  }
351  else
352  {
353  if (instance[0] < 0)
354  return;
355  myNblends.setSizeIfNeeded(instance[0]+1);
356  auto && _data = myNblends(instance[0]);
357  switch (idx[1])
358  {
359  case 0:
360  coerceValue(_data.blend, value);
361  break;
362 
363  }
364  }
365  break;
366 
367  }
368  }
369 
370  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
371  { doSetParmValue(idx, instance, value); }
372  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
383  { doSetParmValue(idx, instance, value); }
384  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
385  { doSetParmValue(idx, instance, value); }
386  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
391  { doSetParmValue(idx, instance, value); }
392 
393  exint getNestNumParms(TempIndex idx) const override
394  {
395  if (idx.size() == 0)
396  return 13;
397  switch (idx[0])
398  {
399  case 12:
400  return 1;
401 
402  }
403  // Invalid
404  return 0;
405  }
406 
407  const char *getNestParmName(TempIndex fieldnum) const override
408  {
409  if (fieldnum.size() < 1)
410  return 0;
411  switch (fieldnum[0])
412  {
413  case 0:
414  return "group";
415  case 1:
416  return "selectionidx";
417  case 2:
418  return "diff";
419  case 3:
420  return "dopos";
421  case 4:
422  return "doclr";
423  case 5:
424  return "donml";
425  case 6:
426  return "douvw";
427  case 7:
428  return "dovoxel";
429  case 8:
430  return "doslerp";
431  case 9:
432  return "ptidattr";
433  case 10:
434  return "primidattr";
435  case 11:
436  return "morph";
437  case 12:
438  if (fieldnum.size() == 1)
439  return "nblends";
440  switch (fieldnum[1])
441  {
442  case 0:
443  return "blend#";
444 
445  }
446  return 0;
447 
448  }
449  return 0;
450  }
451 
452  ParmType getNestParmType(TempIndex fieldnum) const override
453  {
454  if (fieldnum.size() < 1)
455  return PARM_UNSUPPORTED;
456  switch (fieldnum[0])
457  {
458  case 0:
459  return PARM_STRING;
460  case 1:
461  return PARM_INTEGER;
462  case 2:
463  return PARM_INTEGER;
464  case 3:
465  return PARM_INTEGER;
466  case 4:
467  return PARM_INTEGER;
468  case 5:
469  return PARM_INTEGER;
470  case 6:
471  return PARM_INTEGER;
472  case 7:
473  return PARM_INTEGER;
474  case 8:
475  return PARM_INTEGER;
476  case 9:
477  return PARM_STRING;
478  case 10:
479  return PARM_STRING;
480  case 11:
481  return PARM_INTEGER;
482  case 12:
483  if (fieldnum.size() == 1)
484  return PARM_MULTIPARM;
485  switch (fieldnum[1])
486  {
487  case 0:
488  return PARM_FLOAT;
489 
490  }
491  return PARM_UNSUPPORTED;
492 
493  }
494  return PARM_UNSUPPORTED;
495  }
496 
497  // Boiler plate to load individual types.
498  static void loadData(UT_IStream &is, int64 &v)
499  { is.bread(&v, 1); }
500  static void loadData(UT_IStream &is, bool &v)
501  { int64 iv; is.bread(&iv, 1); v = iv; }
502  static void loadData(UT_IStream &is, fpreal64 &v)
503  { is.bread<fpreal64>(&v, 1); }
504  static void loadData(UT_IStream &is, UT_Vector2D &v)
505  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
506  static void loadData(UT_IStream &is, UT_Vector3D &v)
507  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
508  is.bread<fpreal64>(&v.z(), 1); }
509  static void loadData(UT_IStream &is, UT_Vector4D &v)
510  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
511  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
512  static void loadData(UT_IStream &is, UT_Matrix2D &v)
513  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
514  static void loadData(UT_IStream &is, UT_Matrix3D &v)
515  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
516  static void loadData(UT_IStream &is, UT_Matrix4D &v)
517  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
518  static void loadData(UT_IStream &is, UT_Vector2I &v)
519  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
520  static void loadData(UT_IStream &is, UT_Vector3I &v)
521  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
522  is.bread<int64>(&v.z(), 1); }
523  static void loadData(UT_IStream &is, UT_Vector4I &v)
524  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
525  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
527  { is.bread(v); }
529  { UT_StringHolder rampdata;
530  loadData(is, rampdata);
531  if (rampdata.isstring())
532  {
533  v.reset(new UT_Ramp());
534  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
535  v->load(istr);
536  }
537  else v.reset();
538  }
541  loadData(is, data);
542  if (data.isstring())
543  {
544  // Find the data type.
545  const char *colon = UT_StringWrap(data).findChar(':');
546  if (colon)
547  {
548  int typelen = colon - data.buffer();
550  type.strncpy(data.buffer(), typelen);
551  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
552 
553  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
554  }
555  }
556  else v.reset();
557  }
558 
559  static void saveData(std::ostream &os, int64 v)
560  { UTwrite(os, &v); }
561  static void saveData(std::ostream &os, bool v)
562  { int64 iv = v; UTwrite(os, &iv); }
563  static void saveData(std::ostream &os, fpreal64 v)
564  { UTwrite<fpreal64>(os, &v); }
565  static void saveData(std::ostream &os, UT_Vector2D v)
566  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
567  static void saveData(std::ostream &os, UT_Vector3D v)
568  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
569  UTwrite<fpreal64>(os, &v.z()); }
570  static void saveData(std::ostream &os, UT_Vector4D v)
571  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
572  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
573  static void saveData(std::ostream &os, UT_Matrix2D v)
575  static void saveData(std::ostream &os, UT_Matrix3D v)
577  static void saveData(std::ostream &os, UT_Matrix4D v)
579  static void saveData(std::ostream &os, UT_StringHolder s)
580  { UT_StringWrap(s).saveBinary(os); }
581  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
583  UT_OStringStream ostr;
584  if (s) s->save(ostr);
585  result = ostr.str();
586  saveData(os, result);
587  }
588  static void saveData(std::ostream &os, PRM_DataItemHandle s)
590  UT_OStringStream ostr;
591  if (s)
592  {
593  ostr << s->getDataTypeToken();
594  ostr << ":";
595  s->saveBinary(ostr);
596  }
597  result = ostr.str();
598  saveData(os, result);
599  }
600 
601 
602  void save(std::ostream &os) const
603  {
604  int32 v = version();
605  UTwrite(os, &v);
606  saveData(os, myGroup);
607  saveData(os, mySelectionIdx);
608  saveData(os, myDiff);
609  saveData(os, myDoPos);
610  saveData(os, myDoClr);
611  saveData(os, myDoNml);
612  saveData(os, myDoUVW);
613  saveData(os, myDoVoxel);
614  saveData(os, myDoSlerp);
615  saveData(os, myPtIDAttr);
616  saveData(os, myPrimIDAttr);
617  saveData(os, myMorph);
618  {
619  int64 length = myNblends.entries();
620  UTwrite(os, &length);
621  for (exint i = 0; i < length; i++)
622  {
623  auto && _curentry = myNblends(i);
624  (void) _curentry;
625  saveData(os, _curentry.blend);
626 
627  }
628  }
629 
630  }
631 
632  bool load(UT_IStream &is)
633  {
634  int32 v;
635  is.bread(&v, 1);
636  if (version() != v)
637  {
638  // Fail incompatible versions
639  return false;
640  }
641  loadData(is, myGroup);
642  loadData(is, mySelectionIdx);
643  loadData(is, myDiff);
644  loadData(is, myDoPos);
645  loadData(is, myDoClr);
646  loadData(is, myDoNml);
647  loadData(is, myDoUVW);
648  loadData(is, myDoVoxel);
649  loadData(is, myDoSlerp);
650  loadData(is, myPtIDAttr);
651  loadData(is, myPrimIDAttr);
652  loadData(is, myMorph);
653  {
654  int64 length;
655  is.read(&length, 1);
656  myNblends.setSize(length);
657  for (exint i = 0; i < length; i++)
658  {
659  auto && _curentry = myNblends(i);
660  (void) _curentry;
661  loadData(is, _curentry.blend);
662 
663  }
664  }
665 
666  return true;
667  }
668 
669  const UT_StringHolder & getGroup() const { return myGroup; }
670  void setGroup(const UT_StringHolder & val) { myGroup = val; }
672  {
673  SOP_Node *thissop = cookparms.getNode();
674  if (!thissop) return getGroup();
676  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
677  return result;
678  }
679  int64 getSelectionIdx() const { return mySelectionIdx; }
680  void setSelectionIdx(int64 val) { mySelectionIdx = val; }
682  {
683  SOP_Node *thissop = cookparms.getNode();
684  if (!thissop) return getSelectionIdx();
685  int64 result;
686  OP_Utils::evalOpParm(result, thissop, "selectionidx", cookparms.getCookTime(), 0);
687  return result;
688  }
689  bool getDiff() const { return myDiff; }
690  void setDiff(bool val) { myDiff = val; }
691  bool opDiff(const SOP_NodeVerb::CookParms &cookparms) const
692  {
693  SOP_Node *thissop = cookparms.getNode();
694  if (!thissop) return getDiff();
695  bool result;
696  OP_Utils::evalOpParm(result, thissop, "diff", cookparms.getCookTime(), 0);
697  return result;
698  }
699  bool getDoPos() const { return myDoPos; }
700  void setDoPos(bool val) { myDoPos = val; }
701  bool opDoPos(const SOP_NodeVerb::CookParms &cookparms) const
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return getDoPos();
705  bool result;
706  OP_Utils::evalOpParm(result, thissop, "dopos", cookparms.getCookTime(), 0);
707  return result;
708  }
709  bool getDoClr() const { return myDoClr; }
710  void setDoClr(bool val) { myDoClr = val; }
711  bool opDoClr(const SOP_NodeVerb::CookParms &cookparms) const
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return getDoClr();
715  bool result;
716  OP_Utils::evalOpParm(result, thissop, "doclr", cookparms.getCookTime(), 0);
717  return result;
718  }
719  bool getDoNml() const { return myDoNml; }
720  void setDoNml(bool val) { myDoNml = val; }
721  bool opDoNml(const SOP_NodeVerb::CookParms &cookparms) const
722  {
723  SOP_Node *thissop = cookparms.getNode();
724  if (!thissop) return getDoNml();
725  bool result;
726  OP_Utils::evalOpParm(result, thissop, "donml", cookparms.getCookTime(), 0);
727  return result;
728  }
729  bool getDoUVW() const { return myDoUVW; }
730  void setDoUVW(bool val) { myDoUVW = val; }
731  bool opDoUVW(const SOP_NodeVerb::CookParms &cookparms) const
732  {
733  SOP_Node *thissop = cookparms.getNode();
734  if (!thissop) return getDoUVW();
735  bool result;
736  OP_Utils::evalOpParm(result, thissop, "douvw", cookparms.getCookTime(), 0);
737  return result;
738  }
739  bool getDoVoxel() const { return myDoVoxel; }
740  void setDoVoxel(bool val) { myDoVoxel = val; }
741  bool opDoVoxel(const SOP_NodeVerb::CookParms &cookparms) const
742  {
743  SOP_Node *thissop = cookparms.getNode();
744  if (!thissop) return getDoVoxel();
745  bool result;
746  OP_Utils::evalOpParm(result, thissop, "dovoxel", cookparms.getCookTime(), 0);
747  return result;
748  }
749  bool getDoSlerp() const { return myDoSlerp; }
750  void setDoSlerp(bool val) { myDoSlerp = val; }
751  bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
752  {
753  SOP_Node *thissop = cookparms.getNode();
754  if (!thissop) return getDoSlerp();
755  bool result;
756  OP_Utils::evalOpParm(result, thissop, "doslerp", cookparms.getCookTime(), 0);
757  return result;
758  }
759  const UT_StringHolder & getPtIDAttr() const { return myPtIDAttr; }
760  void setPtIDAttr(const UT_StringHolder & val) { myPtIDAttr = val; }
762  {
763  SOP_Node *thissop = cookparms.getNode();
764  if (!thissop) return getPtIDAttr();
766  OP_Utils::evalOpParm(result, thissop, "ptidattr", cookparms.getCookTime(), 0);
767  return result;
768  }
769  const UT_StringHolder & getPrimIDAttr() const { return myPrimIDAttr; }
770  void setPrimIDAttr(const UT_StringHolder & val) { myPrimIDAttr = val; }
772  {
773  SOP_Node *thissop = cookparms.getNode();
774  if (!thissop) return getPrimIDAttr();
776  OP_Utils::evalOpParm(result, thissop, "primidattr", cookparms.getCookTime(), 0);
777  return result;
778  }
779  bool getMorph() const { return myMorph; }
780  void setMorph(bool val) { myMorph = val; }
781  bool opMorph(const SOP_NodeVerb::CookParms &cookparms) const
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return getMorph();
785  bool result;
786  OP_Utils::evalOpParm(result, thissop, "morph", cookparms.getCookTime(), 0);
787  return result;
788  }
789  const UT_Array<Nblends> &getNblends() const { return myNblends; }
790 void setNblends(const UT_Array<Nblends> &val) { myNblends = val; }
791  exint opNblends(const SOP_NodeVerb::CookParms &cookparms) const
792  {
793  SOP_Node *thissop = cookparms.getNode();
794  if (!thissop) return getNblends().entries();
795  exint result;
796  OP_Utils::evalOpParm(result, thissop, "nblends", cookparms.getCookTime(), 0);
797  return result;
798  }
799  fpreal64 opNblends_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
800  { return opinstNblends_blend(cookparms, &_idx); }
801  fpreal64 opinstNblends_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
802  {
803  SOP_Node *thissop = cookparms.getNode();
804  if (!thissop) return (myNblends(_idx[0]).blend);
805  int _parmidx[2-1];
806  _parmidx[1-1] = _idx[1-1] + 0;
807 
809  OP_Utils::evalOpParmInst(result, thissop, "blend#", _parmidx, cookparms.getCookTime(), 0, 2-1);
810  return (result);
811  }
812 
813 
814 private:
815  UT_StringHolder myGroup;
816  int64 mySelectionIdx;
817  bool myDiff;
818  bool myDoPos;
819  bool myDoClr;
820  bool myDoNml;
821  bool myDoUVW;
822  bool myDoVoxel;
823  bool myDoSlerp;
824  UT_StringHolder myPtIDAttr;
825  UT_StringHolder myPrimIDAttr;
826  bool myMorph;
827  UT_Array<Nblends> myNblends;
828 
829 };
void setGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
void setSelectionIdx(int64 val)
static void loadData(UT_IStream &is, bool &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
fpreal64 opNblends_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNblends(const UT_Array< Nblends > &val)
bool load(UT_IStream &is)
exint opNblends(const SOP_NodeVerb::CookParms &cookparms) const
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
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_StringHolder createString(const UT_Array< Nblends > &list) const
const UT_StringHolder & getPtIDAttr() 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
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
int64 opSelectionIdx(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
An output stream object that owns its own string buffer storage.
bool operator!=(const SOP_BlendShapesParms &src) const
bool operator==(const Nblends &src) const
**But if you need a result
Definition: thread.h:613
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opDoVoxel(const SOP_NodeVerb::CookParms &cookparms) 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.
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Vector2D v)
bool operator!=(const Nblends &src) const
bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
static void loadData(UT_IStream &is, UT_Vector2I &v)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4784
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_StringHolder opPtIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint length() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector4I &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
bool opMorph(const SOP_NodeVerb::CookParms &cookparms) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &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
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const UT_StringHolder & getPrimIDAttr() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, int64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Vector4D v)
bool opDoPos(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
fpreal64 opinstNblends_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opDoClr(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool opDoUVW(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_BlendShapesParms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
bool isParmColorRamp(exint idx) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &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
bool opDoNml(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
ParmType getNestParmType(TempIndex fieldnum) const override
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void setPrimIDAttr(const UT_StringHolder &val)
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
type
Definition: core.h:1059
bool opDiff(const SOP_NodeVerb::CookParms &cookparms) const
void setPtIDAttr(const UT_StringHolder &val)
const UT_Array< Nblends > & getNblends() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void copyFrom(const OP_NodeParms *src) override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opPrimIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663