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