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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 
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 
115  if (baseGetSignature() != src.baseGetSignature()) return false;
116 
117  return true;
118  }
120  {
121  return !operator==(src);
122  }
123 
124 
125 
126  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
127  {
128  myGroup = ""_UTsh;
129  if (true)
130  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
131  mySelectionIdx = 0;
132  if (true)
133  graph->evalOpParm(mySelectionIdx, nodeidx, "selectionidx", time, graph->isDirect()?nullptr:depnode);
134  myDiff = true;
135  if (true)
136  graph->evalOpParm(myDiff, nodeidx, "diff", time, graph->isDirect()?nullptr:depnode);
137  myDoPos = true;
138  if (true)
139  graph->evalOpParm(myDoPos, nodeidx, "dopos", time, graph->isDirect()?nullptr:depnode);
140  myDoClr = false;
141  if (true)
142  graph->evalOpParm(myDoClr, nodeidx, "doclr", time, graph->isDirect()?nullptr:depnode);
143  myDoNml = false;
144  if (true)
145  graph->evalOpParm(myDoNml, nodeidx, "donml", time, graph->isDirect()?nullptr:depnode);
146  myDoUVW = false;
147  if (true)
148  graph->evalOpParm(myDoUVW, nodeidx, "douvw", time, graph->isDirect()?nullptr:depnode);
149  myDoVoxel = false;
150  if (true)
151  graph->evalOpParm(myDoVoxel, nodeidx, "dovoxel", time, graph->isDirect()?nullptr:depnode);
152  myDoSlerp = false;
153  if (true)
154  graph->evalOpParm(myDoSlerp, nodeidx, "doslerp", time, graph->isDirect()?nullptr:depnode);
155  myPtIDAttr = ""_UTsh;
156  if (true)
157  graph->evalOpParm(myPtIDAttr, nodeidx, "ptidattr", time, graph->isDirect()?nullptr:depnode);
158  myPrimIDAttr = ""_UTsh;
159  if (true)
160  graph->evalOpParm(myPrimIDAttr, nodeidx, "primidattr", time, graph->isDirect()?nullptr:depnode);
161  myMorph = false;
162  if (true)
163  graph->evalOpParm(myMorph, nodeidx, "morph", time, graph->isDirect()?nullptr:depnode);
164  if (true)
165  {
166  int64 length = 0;
167  graph->evalOpParm(length, nodeidx, "nblends", time, graph->isDirect()?nullptr:depnode);
168  if (length < 0) length = 0;
169  myNblends.setSize(length);
170  for (exint i = 0; i < length; i++)
171  {
172  int parmidx[1];
173  int offsets[1];
174  parmidx[0] = i+0;
175  offsets[0] = 0;
176  auto && _curentry = myNblends(i);
177  (void) _curentry;
178  _curentry.blend = 0;
179  if (true)
180  graph->evalOpParmInst(_curentry.blend, nodeidx, "blend#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
181 
182  }
183  }
184  else
185  myNblends.clear();
186 
187  }
188 
189 
190  void loadFromOpSubclass(const LoadParms &loadparms) override
191  {
192  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
193  }
194 
195 
196  void copyFrom(const OP_NodeParms *src) override
197  {
198  *this = *((const SOP_BlendShapesParms *)src);
199  }
200 
201  template <typename T>
202  void
203  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
204  {
205  if (idx.size() < 1)
206  return;
207  UT_ASSERT(idx.size() == instance.size()+1);
208  if (idx.size() != instance.size()+1)
209  return;
210  switch (idx[0])
211  {
212  case 0:
213  coerceValue(value, myGroup);
214  break;
215  case 1:
216  coerceValue(value, mySelectionIdx);
217  break;
218  case 2:
219  coerceValue(value, myDiff);
220  break;
221  case 3:
222  coerceValue(value, myDoPos);
223  break;
224  case 4:
225  coerceValue(value, myDoClr);
226  break;
227  case 5:
228  coerceValue(value, myDoNml);
229  break;
230  case 6:
231  coerceValue(value, myDoUVW);
232  break;
233  case 7:
234  coerceValue(value, myDoVoxel);
235  break;
236  case 8:
237  coerceValue(value, myDoSlerp);
238  break;
239  case 9:
240  coerceValue(value, myPtIDAttr);
241  break;
242  case 10:
243  coerceValue(value, myPrimIDAttr);
244  break;
245  case 11:
246  coerceValue(value, myMorph);
247  break;
248  case 12:
249  if (idx.size() == 1)
250  coerceValue(value, myNblends.entries());
251  else if (instance[0] < myNblends.entries())
252  {
253  auto && _data = myNblends(instance[0]);
254  switch (idx[1])
255  {
256  case 0:
257  coerceValue(value, _data.blend);
258  break;
259 
260  }
261  }
262  break;
263 
264  }
265  }
266 
267  bool isParmColorRamp(exint idx) const override
268  {
269  switch (idx)
270  {
271 
272  }
273  return false;
274  }
275 
276  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
297  { doGetParmValue(idx, instance, value); }
298 
299  template <typename T>
300  void
301  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
302  {
303  if (idx.size() < 1)
304  return;
305  UT_ASSERT(idx.size() == instance.size()+1);
306  if (idx.size() != instance.size()+1)
307  return;
308  switch (idx[0])
309  {
310  case 0:
311  coerceValue(myGroup, ( ( value ) ));
312  break;
313  case 1:
314  coerceValue(mySelectionIdx, ( ( value ) ));
315  break;
316  case 2:
317  coerceValue(myDiff, ( ( value ) ));
318  break;
319  case 3:
320  coerceValue(myDoPos, ( ( value ) ));
321  break;
322  case 4:
323  coerceValue(myDoClr, ( ( value ) ));
324  break;
325  case 5:
326  coerceValue(myDoNml, ( ( value ) ));
327  break;
328  case 6:
329  coerceValue(myDoUVW, ( ( value ) ));
330  break;
331  case 7:
332  coerceValue(myDoVoxel, ( ( value ) ));
333  break;
334  case 8:
335  coerceValue(myDoSlerp, ( ( value ) ));
336  break;
337  case 9:
338  coerceValue(myPtIDAttr, ( ( value ) ));
339  break;
340  case 10:
341  coerceValue(myPrimIDAttr, ( ( value ) ));
342  break;
343  case 11:
344  coerceValue(myMorph, ( ( value ) ));
345  break;
346  case 12:
347  if (idx.size() == 1)
348  {
349  exint newsize;
350  coerceValue(newsize, value);
351  if (newsize < 0) newsize = 0;
352  myNblends.setSize(newsize);
353  }
354  else
355  {
356  if (instance[0] < 0)
357  return;
358  myNblends.setSizeIfNeeded(instance[0]+1);
359  auto && _data = myNblends(instance[0]);
360  switch (idx[1])
361  {
362  case 0:
363  coerceValue(_data.blend, value);
364  break;
365 
366  }
367  }
368  break;
369 
370  }
371  }
372 
373  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
374  { doSetParmValue(idx, instance, value); }
375  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
376  { doSetParmValue(idx, instance, value); }
377  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
378  { doSetParmValue(idx, instance, value); }
379  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
380  { doSetParmValue(idx, instance, value); }
381  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
382  { doSetParmValue(idx, instance, value); }
383  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
384  { doSetParmValue(idx, instance, value); }
385  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
386  { doSetParmValue(idx, instance, value); }
387  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
388  { doSetParmValue(idx, instance, value); }
389  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
390  { doSetParmValue(idx, instance, value); }
391  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
392  { doSetParmValue(idx, instance, value); }
393  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
394  { doSetParmValue(idx, instance, value); }
395 
396  exint getNestNumParms(TempIndex idx) const override
397  {
398  if (idx.size() == 0)
399  return 13;
400  switch (idx[0])
401  {
402  case 12:
403  return 1;
404 
405  }
406  // Invalid
407  return 0;
408  }
409 
410  const char *getNestParmName(TempIndex fieldnum) const override
411  {
412  if (fieldnum.size() < 1)
413  return 0;
414  switch (fieldnum[0])
415  {
416  case 0:
417  return "group";
418  case 1:
419  return "selectionidx";
420  case 2:
421  return "diff";
422  case 3:
423  return "dopos";
424  case 4:
425  return "doclr";
426  case 5:
427  return "donml";
428  case 6:
429  return "douvw";
430  case 7:
431  return "dovoxel";
432  case 8:
433  return "doslerp";
434  case 9:
435  return "ptidattr";
436  case 10:
437  return "primidattr";
438  case 11:
439  return "morph";
440  case 12:
441  if (fieldnum.size() == 1)
442  return "nblends";
443  switch (fieldnum[1])
444  {
445  case 0:
446  return "blend#";
447 
448  }
449  return 0;
450 
451  }
452  return 0;
453  }
454 
455  ParmType getNestParmType(TempIndex fieldnum) const override
456  {
457  if (fieldnum.size() < 1)
458  return PARM_UNSUPPORTED;
459  switch (fieldnum[0])
460  {
461  case 0:
462  return PARM_STRING;
463  case 1:
464  return PARM_INTEGER;
465  case 2:
466  return PARM_INTEGER;
467  case 3:
468  return PARM_INTEGER;
469  case 4:
470  return PARM_INTEGER;
471  case 5:
472  return PARM_INTEGER;
473  case 6:
474  return PARM_INTEGER;
475  case 7:
476  return PARM_INTEGER;
477  case 8:
478  return PARM_INTEGER;
479  case 9:
480  return PARM_STRING;
481  case 10:
482  return PARM_STRING;
483  case 11:
484  return PARM_INTEGER;
485  case 12:
486  if (fieldnum.size() == 1)
487  return PARM_MULTIPARM;
488  switch (fieldnum[1])
489  {
490  case 0:
491  return PARM_FLOAT;
492 
493  }
494  return PARM_UNSUPPORTED;
495 
496  }
497  return PARM_UNSUPPORTED;
498  }
499 
500  // Boiler plate to load individual types.
501  static void loadData(UT_IStream &is, int64 &v)
502  { is.bread(&v, 1); }
503  static void loadData(UT_IStream &is, bool &v)
504  { int64 iv; is.bread(&iv, 1); v = iv; }
505  static void loadData(UT_IStream &is, fpreal64 &v)
506  { is.bread<fpreal64>(&v, 1); }
507  static void loadData(UT_IStream &is, UT_Vector2D &v)
508  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
509  static void loadData(UT_IStream &is, UT_Vector3D &v)
510  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
511  is.bread<fpreal64>(&v.z(), 1); }
512  static void loadData(UT_IStream &is, UT_Vector4D &v)
513  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
514  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
515  static void loadData(UT_IStream &is, UT_Matrix2D &v)
516  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
517  static void loadData(UT_IStream &is, UT_Matrix3D &v)
518  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
519  static void loadData(UT_IStream &is, UT_Matrix4D &v)
520  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
521  static void loadData(UT_IStream &is, UT_Vector2I &v)
522  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
523  static void loadData(UT_IStream &is, UT_Vector3I &v)
524  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
525  is.bread<int64>(&v.z(), 1); }
526  static void loadData(UT_IStream &is, UT_Vector4I &v)
527  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
528  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
530  { is.bread(v); }
532  { UT_StringHolder rampdata;
533  loadData(is, rampdata);
534  if (rampdata.isstring())
535  {
536  v.reset(new UT_Ramp());
537  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
538  v->load(istr);
539  }
540  else v.reset();
541  }
544  loadData(is, data);
545  if (data.isstring())
546  {
547  // Find the data type.
548  const char *colon = UT_StringWrap(data).findChar(':');
549  if (colon)
550  {
551  int typelen = colon - data.buffer();
553  type.strncpy(data.buffer(), typelen);
554  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
555 
556  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
557  }
558  }
559  else v.reset();
560  }
561 
562  static void saveData(std::ostream &os, int64 v)
563  { UTwrite(os, &v); }
564  static void saveData(std::ostream &os, bool v)
565  { int64 iv = v; UTwrite(os, &iv); }
566  static void saveData(std::ostream &os, fpreal64 v)
567  { UTwrite<fpreal64>(os, &v); }
568  static void saveData(std::ostream &os, UT_Vector2D v)
569  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
570  static void saveData(std::ostream &os, UT_Vector3D v)
571  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
572  UTwrite<fpreal64>(os, &v.z()); }
573  static void saveData(std::ostream &os, UT_Vector4D v)
574  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
575  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
576  static void saveData(std::ostream &os, UT_Matrix2D v)
578  static void saveData(std::ostream &os, UT_Matrix3D v)
580  static void saveData(std::ostream &os, UT_Matrix4D v)
582  static void saveData(std::ostream &os, UT_StringHolder s)
583  { UT_StringWrap(s).saveBinary(os); }
584  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
586  UT_OStringStream ostr;
587  if (s) s->save(ostr);
588  result = ostr.str();
589  saveData(os, result);
590  }
591  static void saveData(std::ostream &os, PRM_DataItemHandle s)
593  UT_OStringStream ostr;
594  if (s)
595  {
596  ostr << s->getDataTypeToken();
597  ostr << ":";
598  s->saveBinary(ostr);
599  }
600  result = ostr.str();
601  saveData(os, result);
602  }
603 
604 
605  void save(std::ostream &os) const
606  {
607  int32 v = version();
608  UTwrite(os, &v);
609  saveData(os, myGroup);
610  saveData(os, mySelectionIdx);
611  saveData(os, myDiff);
612  saveData(os, myDoPos);
613  saveData(os, myDoClr);
614  saveData(os, myDoNml);
615  saveData(os, myDoUVW);
616  saveData(os, myDoVoxel);
617  saveData(os, myDoSlerp);
618  saveData(os, myPtIDAttr);
619  saveData(os, myPrimIDAttr);
620  saveData(os, myMorph);
621  {
622  int64 length = myNblends.entries();
623  UTwrite(os, &length);
624  for (exint i = 0; i < length; i++)
625  {
626  auto && _curentry = myNblends(i);
627  (void) _curentry;
628  saveData(os, _curentry.blend);
629 
630  }
631  }
632 
633  }
634 
635  bool load(UT_IStream &is)
636  {
637  int32 v;
638  is.bread(&v, 1);
639  if (version() != v)
640  {
641  // Fail incompatible versions
642  return false;
643  }
644  loadData(is, myGroup);
645  loadData(is, mySelectionIdx);
646  loadData(is, myDiff);
647  loadData(is, myDoPos);
648  loadData(is, myDoClr);
649  loadData(is, myDoNml);
650  loadData(is, myDoUVW);
651  loadData(is, myDoVoxel);
652  loadData(is, myDoSlerp);
653  loadData(is, myPtIDAttr);
654  loadData(is, myPrimIDAttr);
655  loadData(is, myMorph);
656  {
657  int64 length;
658  is.read(&length, 1);
659  myNblends.setSize(length);
660  for (exint i = 0; i < length; i++)
661  {
662  auto && _curentry = myNblends(i);
663  (void) _curentry;
664  loadData(is, _curentry.blend);
665 
666  }
667  }
668 
669  return true;
670  }
671 
672  const UT_StringHolder & getGroup() const { return myGroup; }
673  void setGroup(const UT_StringHolder & val) { myGroup = val; }
675  {
676  SOP_Node *thissop = cookparms.getNode();
677  if (!thissop) return getGroup();
679  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
680  return result;
681  }
682  int64 getSelectionIdx() const { return mySelectionIdx; }
683  void setSelectionIdx(int64 val) { mySelectionIdx = val; }
685  {
686  SOP_Node *thissop = cookparms.getNode();
687  if (!thissop) return getSelectionIdx();
688  int64 result;
689  OP_Utils::evalOpParm(result, thissop, "selectionidx", cookparms.getCookTime(), 0);
690  return result;
691  }
692  bool getDiff() const { return myDiff; }
693  void setDiff(bool val) { myDiff = val; }
694  bool opDiff(const SOP_NodeVerb::CookParms &cookparms) const
695  {
696  SOP_Node *thissop = cookparms.getNode();
697  if (!thissop) return getDiff();
698  bool result;
699  OP_Utils::evalOpParm(result, thissop, "diff", cookparms.getCookTime(), 0);
700  return result;
701  }
702  bool getDoPos() const { return myDoPos; }
703  void setDoPos(bool val) { myDoPos = val; }
704  bool opDoPos(const SOP_NodeVerb::CookParms &cookparms) const
705  {
706  SOP_Node *thissop = cookparms.getNode();
707  if (!thissop) return getDoPos();
708  bool result;
709  OP_Utils::evalOpParm(result, thissop, "dopos", cookparms.getCookTime(), 0);
710  return result;
711  }
712  bool getDoClr() const { return myDoClr; }
713  void setDoClr(bool val) { myDoClr = val; }
714  bool opDoClr(const SOP_NodeVerb::CookParms &cookparms) const
715  {
716  SOP_Node *thissop = cookparms.getNode();
717  if (!thissop) return getDoClr();
718  bool result;
719  OP_Utils::evalOpParm(result, thissop, "doclr", cookparms.getCookTime(), 0);
720  return result;
721  }
722  bool getDoNml() const { return myDoNml; }
723  void setDoNml(bool val) { myDoNml = val; }
724  bool opDoNml(const SOP_NodeVerb::CookParms &cookparms) const
725  {
726  SOP_Node *thissop = cookparms.getNode();
727  if (!thissop) return getDoNml();
728  bool result;
729  OP_Utils::evalOpParm(result, thissop, "donml", cookparms.getCookTime(), 0);
730  return result;
731  }
732  bool getDoUVW() const { return myDoUVW; }
733  void setDoUVW(bool val) { myDoUVW = val; }
734  bool opDoUVW(const SOP_NodeVerb::CookParms &cookparms) const
735  {
736  SOP_Node *thissop = cookparms.getNode();
737  if (!thissop) return getDoUVW();
738  bool result;
739  OP_Utils::evalOpParm(result, thissop, "douvw", cookparms.getCookTime(), 0);
740  return result;
741  }
742  bool getDoVoxel() const { return myDoVoxel; }
743  void setDoVoxel(bool val) { myDoVoxel = val; }
744  bool opDoVoxel(const SOP_NodeVerb::CookParms &cookparms) const
745  {
746  SOP_Node *thissop = cookparms.getNode();
747  if (!thissop) return getDoVoxel();
748  bool result;
749  OP_Utils::evalOpParm(result, thissop, "dovoxel", cookparms.getCookTime(), 0);
750  return result;
751  }
752  bool getDoSlerp() const { return myDoSlerp; }
753  void setDoSlerp(bool val) { myDoSlerp = val; }
754  bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
755  {
756  SOP_Node *thissop = cookparms.getNode();
757  if (!thissop) return getDoSlerp();
758  bool result;
759  OP_Utils::evalOpParm(result, thissop, "doslerp", cookparms.getCookTime(), 0);
760  return result;
761  }
762  const UT_StringHolder & getPtIDAttr() const { return myPtIDAttr; }
763  void setPtIDAttr(const UT_StringHolder & val) { myPtIDAttr = val; }
765  {
766  SOP_Node *thissop = cookparms.getNode();
767  if (!thissop) return getPtIDAttr();
769  OP_Utils::evalOpParm(result, thissop, "ptidattr", cookparms.getCookTime(), 0);
770  return result;
771  }
772  const UT_StringHolder & getPrimIDAttr() const { return myPrimIDAttr; }
773  void setPrimIDAttr(const UT_StringHolder & val) { myPrimIDAttr = val; }
775  {
776  SOP_Node *thissop = cookparms.getNode();
777  if (!thissop) return getPrimIDAttr();
779  OP_Utils::evalOpParm(result, thissop, "primidattr", cookparms.getCookTime(), 0);
780  return result;
781  }
782  bool getMorph() const { return myMorph; }
783  void setMorph(bool val) { myMorph = val; }
784  bool opMorph(const SOP_NodeVerb::CookParms &cookparms) const
785  {
786  SOP_Node *thissop = cookparms.getNode();
787  if (!thissop) return getMorph();
788  bool result;
789  OP_Utils::evalOpParm(result, thissop, "morph", cookparms.getCookTime(), 0);
790  return result;
791  }
792  const UT_Array<Nblends> &getNblends() const { return myNblends; }
793 void setNblends(const UT_Array<Nblends> &val) { myNblends = val; }
794  exint opNblends(const SOP_NodeVerb::CookParms &cookparms) const
795  {
796  SOP_Node *thissop = cookparms.getNode();
797  if (!thissop) return getNblends().entries();
798  exint result;
799  OP_Utils::evalOpParm(result, thissop, "nblends", cookparms.getCookTime(), 0);
800  return result;
801  }
802  fpreal64 opNblends_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
803  { return opinstNblends_blend(cookparms, &_idx); }
804  fpreal64 opinstNblends_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
805  {
806  SOP_Node *thissop = cookparms.getNode();
807  if (!thissop) return (myNblends(_idx[0]).blend);
808  int _parmidx[2-1];
809  _parmidx[1-1] = _idx[1-1] + 0;
810 
812  OP_Utils::evalOpParmInst(result, thissop, "blend#", _parmidx, cookparms.getCookTime(), 0, 2-1);
813  return (result);
814  }
815 
816 
817 private:
818  UT_StringHolder myGroup;
819  int64 mySelectionIdx;
820  bool myDiff;
821  bool myDoPos;
822  bool myDoClr;
823  bool myDoNml;
824  bool myDoUVW;
825  bool myDoVoxel;
826  bool myDoSlerp;
827  UT_StringHolder myPtIDAttr;
828  UT_StringHolder myPrimIDAttr;
829  bool myMorph;
830  UT_Array<Nblends> myNblends;
831 
832 };
type
Definition: core.h:556
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:63
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:4949
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:303
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:655
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:310
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal64 fpreal
Definition: SYS_Types.h:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
ParmType getNestParmType(TempIndex fieldnum) const override
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
bool opDiff(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setPtIDAttr(const UT_StringHolder &val)
const UT_Array< Nblends > & getNblends() const
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