HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_ProximityCapture.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 namespace SOP_ProximityCaptureEnums
24 {
25  enum class Captureregionsop
26  {
27  DISPLAY = 0,
28  RENDER,
29  CAPTURE
30  };
31 
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Captureregionsop::DISPLAY: return "display"_sh;
38  case Captureregionsop::RENDER: return "render"_sh;
39  case Captureregionsop::CAPTURE: return "capture"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Cookat
45  {
46  CAPTUREFRAME = 0,
48  };
49 
51  getToken(Cookat enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case Cookat::CAPTUREFRAME: return "captureframe"_sh;
56  case Cookat::EVERYFRAME: return "everyframe"_sh;
57  default: UT_ASSERT(false); return ""_sh;
58  }
59  }
60 
61  enum class Weightmethod
62  {
65  };
66 
68  getToken(Weightmethod enum_value)
69  {
70  using namespace UT::Literal;
71  switch (enum_value) {
72  case Weightmethod::WEIGHTCLOSESTREGIONOBJECT: return "weightClosestRegionObject"_sh;
73  case Weightmethod::WEIGHTCLOSESTCONNECTINGREGIONOBJECT: return "weightClosestConnectingRegionObject"_sh;
74  default: UT_ASSERT(false); return ""_sh;
75  }
76  }
77 
78  enum class Weightfrom
79  {
80  CV = 0,
81  SURFACE
82  };
83 
85  getToken(Weightfrom enum_value)
86  {
87  using namespace UT::Literal;
88  switch (enum_value) {
89  case Weightfrom::CV: return "cv"_sh;
90  case Weightfrom::SURFACE: return "surface"_sh;
91  default: UT_ASSERT(false); return ""_sh;
92  }
93  }
94 
95  enum class Color
96  {
97  COLDEFAULT = 0,
98  COLREGION
99  };
100 
102  getToken(Color enum_value)
103  {
104  using namespace UT::Literal;
105  switch (enum_value) {
106  case Color::COLDEFAULT: return "colDefault"_sh;
107  case Color::COLREGION: return "colRegion"_sh;
108  default: UT_ASSERT(false); return ""_sh;
109  }
110  }
111 
112 }
113 
114 
116 {
117 public:
118  static int version() { return 1; }
119 
121  {
122  myGroup = ""_UTsh;
123  myCapturegroup = ""_UTsh;
124  myRootpath = ""_UTsh;
125  myExtraregions = ""_UTsh;
126  myCaptureregionsop = 2;
127  myDosubnets = false;
128  myRelativeskel = true;
129  myUsecaptpose = false;
130  myCookat = 0;
131  myCaptframe = 0;
132  myWeightmethod = 0;
133  myWeightfrom = 0;
134  myDropoff = 1;
135  myMaxinfluences = 2;
136  myNormweights = true;
137  myDestroyweights = true;
138  myBlendfactor = 1;
139  myColor = 0;
140  myZeroweightcolor = UT_Vector3D(1,1,1);
141 
142  }
143 
144  explicit SOP_ProximityCaptureParms(const SOP_ProximityCaptureParms &) = default;
147  SOP_ProximityCaptureParms &operator=(SOP_ProximityCaptureParms &&) noexcept = default;
148 
150 
152  {
153  if (myGroup != src.myGroup) return false;
154  if (myCapturegroup != src.myCapturegroup) return false;
155  if (myRootpath != src.myRootpath) return false;
156  if (myExtraregions != src.myExtraregions) return false;
157  if (myCaptureregionsop != src.myCaptureregionsop) return false;
158  if (myDosubnets != src.myDosubnets) return false;
159  if (myRelativeskel != src.myRelativeskel) return false;
160  if (myUsecaptpose != src.myUsecaptpose) return false;
161  if (myCookat != src.myCookat) return false;
162  if (myCaptframe != src.myCaptframe) return false;
163  if (myWeightmethod != src.myWeightmethod) return false;
164  if (myWeightfrom != src.myWeightfrom) return false;
165  if (myDropoff != src.myDropoff) return false;
166  if (myMaxinfluences != src.myMaxinfluences) return false;
167  if (myNormweights != src.myNormweights) return false;
168  if (myDestroyweights != src.myDestroyweights) return false;
169  if (myBlendfactor != src.myBlendfactor) return false;
170  if (myColor != src.myColor) return false;
171  if (myZeroweightcolor != src.myZeroweightcolor) return false;
172 
173 
174  if (baseGetSignature() != src.baseGetSignature()) return false;
175 
176  return true;
177  }
179  {
180  return !operator==(src);
181  }
187 
188 
189 
190  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
191  {
192  myGroup = ""_UTsh;
193  if (true)
194  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
195  myCapturegroup = ""_UTsh;
196  if (true)
197  graph->evalOpParm(myCapturegroup, nodeidx, "capturegroup", time, graph->isDirect()?nullptr:depnode);
198  myRootpath = ""_UTsh;
199  if (true)
200  graph->evalOpParm(myRootpath, nodeidx, "rootpath", time, graph->isDirect()?nullptr:depnode);
201  myExtraregions = ""_UTsh;
202  if (true)
203  graph->evalOpParm(myExtraregions, nodeidx, "extraregions", time, graph->isDirect()?nullptr:depnode);
204  myCaptureregionsop = 2;
205  if (true)
206  graph->evalOpParm(myCaptureregionsop, nodeidx, "captureregionsop", time, graph->isDirect()?nullptr:depnode);
207  myDosubnets = false;
208  if (true)
209  graph->evalOpParm(myDosubnets, nodeidx, "dosubnets", time, graph->isDirect()?nullptr:depnode);
210  myRelativeskel = true;
211  if (true)
212  graph->evalOpParm(myRelativeskel, nodeidx, "relativeskel", time, graph->isDirect()?nullptr:depnode);
213  myUsecaptpose = false;
214  if (true)
215  graph->evalOpParm(myUsecaptpose, nodeidx, "usecaptpose", time, graph->isDirect()?nullptr:depnode);
216  myCookat = 0;
217  if (true && ( (true&&!(((getUsecaptpose()!=0)))) ) )
218  graph->evalOpParm(myCookat, nodeidx, "cookat", time, graph->isDirect()?nullptr:depnode);
219  myCaptframe = 0;
220  if (true && ( (true&&!(((getUsecaptpose()!=0))||((int64(getCookat())==1)))) ) )
221  graph->evalOpParm(myCaptframe, nodeidx, "captframe", time, graph->isDirect()?nullptr:depnode);
222  myWeightmethod = 0;
223  if (true)
224  graph->evalOpParm(myWeightmethod, nodeidx, "weightmethod", time, graph->isDirect()?nullptr:depnode);
225  myWeightfrom = 0;
226  if (true)
227  graph->evalOpParm(myWeightfrom, nodeidx, "weightFrom", time, graph->isDirect()?nullptr:depnode);
228  myDropoff = 1;
229  if (true)
230  graph->evalOpParm(myDropoff, nodeidx, "dropoff", time, graph->isDirect()?nullptr:depnode);
231  myMaxinfluences = 2;
232  if (true)
233  graph->evalOpParm(myMaxinfluences, nodeidx, "maxinfluences", time, graph->isDirect()?nullptr:depnode);
234  myNormweights = true;
235  if (true)
236  graph->evalOpParm(myNormweights, nodeidx, "normweights", time, graph->isDirect()?nullptr:depnode);
237  myDestroyweights = true;
238  if (true)
239  graph->evalOpParm(myDestroyweights, nodeidx, "destroyweights", time, graph->isDirect()?nullptr:depnode);
240  myBlendfactor = 1;
241  if (true && ( (true&&!(((getDestroyweights()!=0)))) ) )
242  graph->evalOpParm(myBlendfactor, nodeidx, "blendfactor", time, graph->isDirect()?nullptr:depnode);
243  myColor = 0;
244  if (true)
245  graph->evalOpParm(myColor, nodeidx, "color", time, graph->isDirect()?nullptr:depnode);
246  myZeroweightcolor = UT_Vector3D(1,1,1);
247  if (true)
248  graph->evalOpParm(myZeroweightcolor, nodeidx, "zeroweightcolor", time, graph->isDirect()?nullptr:depnode);
249 
250  }
251 
252 
253  void loadFromOpSubclass(const LoadParms &loadparms) override
254  {
255  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
256  }
257 
258 
259  void copyFrom(const OP_NodeParms *src) override
260  {
261  *this = *((const SOP_ProximityCaptureParms *)src);
262  }
263 
264  template <typename T>
265  void
266  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
267  {
268  if (idx.size() < 1)
269  return;
270  UT_ASSERT(idx.size() == instance.size()+1);
271  if (idx.size() != instance.size()+1)
272  return;
273  switch (idx[0])
274  {
275  case 0:
276  coerceValue(value, myGroup);
277  break;
278  case 1:
279  coerceValue(value, myCapturegroup);
280  break;
281  case 2:
282  coerceValue(value, myRootpath);
283  break;
284  case 3:
285  coerceValue(value, myExtraregions);
286  break;
287  case 4:
288  coerceValue(value, myCaptureregionsop);
289  break;
290  case 5:
291  coerceValue(value, myDosubnets);
292  break;
293  case 6:
294  coerceValue(value, myRelativeskel);
295  break;
296  case 7:
297  coerceValue(value, myUsecaptpose);
298  break;
299  case 8:
300  coerceValue(value, myCookat);
301  break;
302  case 9:
303  coerceValue(value, myCaptframe);
304  break;
305  case 10:
306  coerceValue(value, myWeightmethod);
307  break;
308  case 11:
309  coerceValue(value, myWeightfrom);
310  break;
311  case 12:
312  coerceValue(value, myDropoff);
313  break;
314  case 13:
315  coerceValue(value, myMaxinfluences);
316  break;
317  case 14:
318  coerceValue(value, myNormweights);
319  break;
320  case 15:
321  coerceValue(value, myDestroyweights);
322  break;
323  case 16:
324  coerceValue(value, myBlendfactor);
325  break;
326  case 17:
327  coerceValue(value, myColor);
328  break;
329  case 18:
330  coerceValue(value, myZeroweightcolor);
331  break;
332 
333  }
334  }
335 
336  bool isParmColorRamp(exint idx) const override
337  {
338  switch (idx)
339  {
340 
341  }
342  return false;
343  }
344 
345  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
346  { doGetParmValue(idx, instance, value); }
347  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
348  { doGetParmValue(idx, instance, value); }
349  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
350  { doGetParmValue(idx, instance, value); }
351  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
352  { doGetParmValue(idx, instance, value); }
353  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
354  { doGetParmValue(idx, instance, value); }
355  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
356  { doGetParmValue(idx, instance, value); }
357  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
358  { doGetParmValue(idx, instance, value); }
359  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
360  { doGetParmValue(idx, instance, value); }
361  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
362  { doGetParmValue(idx, instance, value); }
363  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
364  { doGetParmValue(idx, instance, value); }
365  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
366  { doGetParmValue(idx, instance, value); }
367 
368  template <typename T>
369  void
370  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
371  {
372  if (idx.size() < 1)
373  return;
374  UT_ASSERT(idx.size() == instance.size()+1);
375  if (idx.size() != instance.size()+1)
376  return;
377  switch (idx[0])
378  {
379  case 0:
380  coerceValue(myGroup, ( ( value ) ));
381  break;
382  case 1:
383  coerceValue(myCapturegroup, ( ( value ) ));
384  break;
385  case 2:
386  coerceValue(myRootpath, ( ( value ) ));
387  break;
388  case 3:
389  coerceValue(myExtraregions, ( ( value ) ));
390  break;
391  case 4:
392  coerceValue(myCaptureregionsop, clampMinValue(0, clampMaxValue(2, value ) ));
393  break;
394  case 5:
395  coerceValue(myDosubnets, ( ( value ) ));
396  break;
397  case 6:
398  coerceValue(myRelativeskel, ( ( value ) ));
399  break;
400  case 7:
401  coerceValue(myUsecaptpose, ( ( value ) ));
402  break;
403  case 8:
404  coerceValue(myCookat, clampMinValue(0, clampMaxValue(1, value ) ));
405  break;
406  case 9:
407  coerceValue(myCaptframe, ( ( value ) ));
408  break;
409  case 10:
410  coerceValue(myWeightmethod, clampMinValue(0, clampMaxValue(1, value ) ));
411  break;
412  case 11:
413  coerceValue(myWeightfrom, clampMinValue(0, clampMaxValue(1, value ) ));
414  break;
415  case 12:
416  coerceValue(myDropoff, clampMinValue(0.001, ( value ) ));
417  break;
418  case 13:
419  coerceValue(myMaxinfluences, clampMinValue(1, ( value ) ));
420  break;
421  case 14:
422  coerceValue(myNormweights, ( ( value ) ));
423  break;
424  case 15:
425  coerceValue(myDestroyweights, ( ( value ) ));
426  break;
427  case 16:
428  coerceValue(myBlendfactor, ( ( value ) ));
429  break;
430  case 17:
431  coerceValue(myColor, clampMinValue(0, clampMaxValue(1, value ) ));
432  break;
433  case 18:
434  coerceValue(myZeroweightcolor, ( ( value ) ));
435  break;
436 
437  }
438  }
439 
440  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
441  { doSetParmValue(idx, instance, value); }
442  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
443  { doSetParmValue(idx, instance, value); }
444  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
445  { doSetParmValue(idx, instance, value); }
446  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
447  { doSetParmValue(idx, instance, value); }
448  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
449  { doSetParmValue(idx, instance, value); }
450  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
451  { doSetParmValue(idx, instance, value); }
452  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
453  { doSetParmValue(idx, instance, value); }
454  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
455  { doSetParmValue(idx, instance, value); }
456  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
457  { doSetParmValue(idx, instance, value); }
458  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
459  { doSetParmValue(idx, instance, value); }
460  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
461  { doSetParmValue(idx, instance, value); }
462 
463  exint getNestNumParms(TempIndex idx) const override
464  {
465  if (idx.size() == 0)
466  return 19;
467  switch (idx[0])
468  {
469 
470  }
471  // Invalid
472  return 0;
473  }
474 
475  const char *getNestParmName(TempIndex fieldnum) const override
476  {
477  if (fieldnum.size() < 1)
478  return 0;
479  switch (fieldnum[0])
480  {
481  case 0:
482  return "group";
483  case 1:
484  return "capturegroup";
485  case 2:
486  return "rootpath";
487  case 3:
488  return "extraregions";
489  case 4:
490  return "captureregionsop";
491  case 5:
492  return "dosubnets";
493  case 6:
494  return "relativeskel";
495  case 7:
496  return "usecaptpose";
497  case 8:
498  return "cookat";
499  case 9:
500  return "captframe";
501  case 10:
502  return "weightmethod";
503  case 11:
504  return "weightFrom";
505  case 12:
506  return "dropoff";
507  case 13:
508  return "maxinfluences";
509  case 14:
510  return "normweights";
511  case 15:
512  return "destroyweights";
513  case 16:
514  return "blendfactor";
515  case 17:
516  return "color";
517  case 18:
518  return "zeroweightcolor";
519 
520  }
521  return 0;
522  }
523 
524  ParmType getNestParmType(TempIndex fieldnum) const override
525  {
526  if (fieldnum.size() < 1)
527  return PARM_UNSUPPORTED;
528  switch (fieldnum[0])
529  {
530  case 0:
531  return PARM_STRING;
532  case 1:
533  return PARM_STRING;
534  case 2:
535  return PARM_STRING;
536  case 3:
537  return PARM_STRING;
538  case 4:
539  return PARM_INTEGER;
540  case 5:
541  return PARM_INTEGER;
542  case 6:
543  return PARM_INTEGER;
544  case 7:
545  return PARM_INTEGER;
546  case 8:
547  return PARM_INTEGER;
548  case 9:
549  return PARM_FLOAT;
550  case 10:
551  return PARM_INTEGER;
552  case 11:
553  return PARM_INTEGER;
554  case 12:
555  return PARM_FLOAT;
556  case 13:
557  return PARM_INTEGER;
558  case 14:
559  return PARM_INTEGER;
560  case 15:
561  return PARM_INTEGER;
562  case 16:
563  return PARM_FLOAT;
564  case 17:
565  return PARM_INTEGER;
566  case 18:
567  return PARM_VECTOR3;
568 
569  }
570  return PARM_UNSUPPORTED;
571  }
572 
573  // Boiler plate to load individual types.
574  static void loadData(UT_IStream &is, int64 &v)
575  { is.bread(&v, 1); }
576  static void loadData(UT_IStream &is, bool &v)
577  { int64 iv; is.bread(&iv, 1); v = iv; }
578  static void loadData(UT_IStream &is, fpreal64 &v)
579  { is.bread<fpreal64>(&v, 1); }
580  static void loadData(UT_IStream &is, UT_Vector2D &v)
581  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
582  static void loadData(UT_IStream &is, UT_Vector3D &v)
583  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
584  is.bread<fpreal64>(&v.z(), 1); }
585  static void loadData(UT_IStream &is, UT_Vector4D &v)
586  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
587  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
588  static void loadData(UT_IStream &is, UT_Matrix2D &v)
589  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
590  static void loadData(UT_IStream &is, UT_Matrix3D &v)
591  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
592  static void loadData(UT_IStream &is, UT_Matrix4D &v)
593  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
594  static void loadData(UT_IStream &is, UT_Vector2I &v)
595  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
596  static void loadData(UT_IStream &is, UT_Vector3I &v)
597  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
598  is.bread<int64>(&v.z(), 1); }
599  static void loadData(UT_IStream &is, UT_Vector4I &v)
600  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
601  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
603  { is.bread(v); }
605  { UT_StringHolder rampdata;
606  loadData(is, rampdata);
607  if (rampdata.isstring())
608  {
609  v.reset(new UT_Ramp());
610  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
611  v->load(istr);
612  }
613  else v.reset();
614  }
617  loadData(is, data);
618  if (data.isstring())
619  {
620  // Find the data type.
621  const char *colon = UT_StringWrap(data).findChar(':');
622  if (colon)
623  {
624  int typelen = colon - data.buffer();
626  type.strncpy(data.buffer(), typelen);
627  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
628 
629  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
630  }
631  }
632  else v.reset();
633  }
634 
635  static void saveData(std::ostream &os, int64 v)
636  { UTwrite(os, &v); }
637  static void saveData(std::ostream &os, bool v)
638  { int64 iv = v; UTwrite(os, &iv); }
639  static void saveData(std::ostream &os, fpreal64 v)
640  { UTwrite<fpreal64>(os, &v); }
641  static void saveData(std::ostream &os, UT_Vector2D v)
642  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
643  static void saveData(std::ostream &os, UT_Vector3D v)
644  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
645  UTwrite<fpreal64>(os, &v.z()); }
646  static void saveData(std::ostream &os, UT_Vector4D v)
647  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
648  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
649  static void saveData(std::ostream &os, UT_Matrix2D v)
651  static void saveData(std::ostream &os, UT_Matrix3D v)
653  static void saveData(std::ostream &os, UT_Matrix4D v)
655  static void saveData(std::ostream &os, UT_StringHolder s)
656  { UT_StringWrap(s).saveBinary(os); }
657  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
659  UT_OStringStream ostr;
660  if (s) s->save(ostr);
661  result = ostr.str();
662  saveData(os, result);
663  }
664  static void saveData(std::ostream &os, PRM_DataItemHandle s)
666  UT_OStringStream ostr;
667  if (s)
668  {
669  ostr << s->getDataTypeToken();
670  ostr << ":";
671  s->saveBinary(ostr);
672  }
673  result = ostr.str();
674  saveData(os, result);
675  }
676 
677 
678  void save(std::ostream &os) const
679  {
680  int32 v = version();
681  UTwrite(os, &v);
682  saveData(os, myGroup);
683  saveData(os, myCapturegroup);
684  saveData(os, myRootpath);
685  saveData(os, myExtraregions);
686  saveData(os, myCaptureregionsop);
687  saveData(os, myDosubnets);
688  saveData(os, myRelativeskel);
689  saveData(os, myUsecaptpose);
690  saveData(os, myCookat);
691  saveData(os, myCaptframe);
692  saveData(os, myWeightmethod);
693  saveData(os, myWeightfrom);
694  saveData(os, myDropoff);
695  saveData(os, myMaxinfluences);
696  saveData(os, myNormweights);
697  saveData(os, myDestroyweights);
698  saveData(os, myBlendfactor);
699  saveData(os, myColor);
700  saveData(os, myZeroweightcolor);
701 
702  }
703 
704  bool load(UT_IStream &is)
705  {
706  int32 v;
707  is.bread(&v, 1);
708  if (version() != v)
709  {
710  // Fail incompatible versions
711  return false;
712  }
713  loadData(is, myGroup);
714  loadData(is, myCapturegroup);
715  loadData(is, myRootpath);
716  loadData(is, myExtraregions);
717  loadData(is, myCaptureregionsop);
718  loadData(is, myDosubnets);
719  loadData(is, myRelativeskel);
720  loadData(is, myUsecaptpose);
721  loadData(is, myCookat);
722  loadData(is, myCaptframe);
723  loadData(is, myWeightmethod);
724  loadData(is, myWeightfrom);
725  loadData(is, myDropoff);
726  loadData(is, myMaxinfluences);
727  loadData(is, myNormweights);
728  loadData(is, myDestroyweights);
729  loadData(is, myBlendfactor);
730  loadData(is, myColor);
731  loadData(is, myZeroweightcolor);
732 
733  return true;
734  }
735 
736  const UT_StringHolder & getGroup() const { return myGroup; }
737  void setGroup(const UT_StringHolder & val) { myGroup = val; }
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getGroup();
743  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
744  return result;
745  }
746  const UT_StringHolder & getCapturegroup() const { return myCapturegroup; }
747  void setCapturegroup(const UT_StringHolder & val) { myCapturegroup = val; }
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getCapturegroup();
753  OP_Utils::evalOpParm(result, thissop, "capturegroup", cookparms.getCookTime(), 0);
754  return result;
755  }
756  const UT_StringHolder & getRootpath() const { return myRootpath; }
757  void setRootpath(const UT_StringHolder & val) { myRootpath = val; }
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getRootpath();
763  OP_Utils::evalOpParm(result, thissop, "rootpath", cookparms.getCookTime(), 0);
764  return result;
765  }
766  const UT_StringHolder & getExtraregions() const { return myExtraregions; }
767  void setExtraregions(const UT_StringHolder & val) { myExtraregions = val; }
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getExtraregions();
773  OP_Utils::evalOpParm(result, thissop, "extraregions", cookparms.getCookTime(), 0);
774  return result;
775  }
776  Captureregionsop getCaptureregionsop() const { return Captureregionsop(myCaptureregionsop); }
777  void setCaptureregionsop(Captureregionsop val) { myCaptureregionsop = int64(val); }
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getCaptureregionsop();
782  int64 result;
783  OP_Utils::evalOpParm(result, thissop, "captureregionsop", cookparms.getCookTime(), 0);
784  return Captureregionsop(result);
785  }
786  bool getDosubnets() const { return myDosubnets; }
787  void setDosubnets(bool val) { myDosubnets = val; }
788  bool opDosubnets(const SOP_NodeVerb::CookParms &cookparms) const
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getDosubnets();
792  bool result;
793  OP_Utils::evalOpParm(result, thissop, "dosubnets", cookparms.getCookTime(), 0);
794  return result;
795  }
796  bool getRelativeskel() const { return myRelativeskel; }
797  void setRelativeskel(bool val) { myRelativeskel = val; }
798  bool opRelativeskel(const SOP_NodeVerb::CookParms &cookparms) const
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getRelativeskel();
802  bool result;
803  OP_Utils::evalOpParm(result, thissop, "relativeskel", cookparms.getCookTime(), 0);
804  return result;
805  }
806  bool getUsecaptpose() const { return myUsecaptpose; }
807  void setUsecaptpose(bool val) { myUsecaptpose = val; }
808  bool opUsecaptpose(const SOP_NodeVerb::CookParms &cookparms) const
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return getUsecaptpose();
812  bool result;
813  OP_Utils::evalOpParm(result, thissop, "usecaptpose", cookparms.getCookTime(), 0);
814  return result;
815  }
816  Cookat getCookat() const { return Cookat(myCookat); }
817  void setCookat(Cookat val) { myCookat = int64(val); }
818  Cookat opCookat(const SOP_NodeVerb::CookParms &cookparms) const
819  {
820  SOP_Node *thissop = cookparms.getNode();
821  if (!thissop) return getCookat();
822  int64 result;
823  OP_Utils::evalOpParm(result, thissop, "cookat", cookparms.getCookTime(), 0);
824  return Cookat(result);
825  }
826  fpreal64 getCaptframe() const { return myCaptframe; }
827  void setCaptframe(fpreal64 val) { myCaptframe = val; }
829  {
830  SOP_Node *thissop = cookparms.getNode();
831  if (!thissop) return getCaptframe();
833  OP_Utils::evalOpParm(result, thissop, "captframe", cookparms.getCookTime(), 0);
834  return result;
835  }
836  Weightmethod getWeightmethod() const { return Weightmethod(myWeightmethod); }
837  void setWeightmethod(Weightmethod val) { myWeightmethod = int64(val); }
839  {
840  SOP_Node *thissop = cookparms.getNode();
841  if (!thissop) return getWeightmethod();
842  int64 result;
843  OP_Utils::evalOpParm(result, thissop, "weightmethod", cookparms.getCookTime(), 0);
844  return Weightmethod(result);
845  }
846  Weightfrom getWeightfrom() const { return Weightfrom(myWeightfrom); }
847  void setWeightfrom(Weightfrom val) { myWeightfrom = int64(val); }
849  {
850  SOP_Node *thissop = cookparms.getNode();
851  if (!thissop) return getWeightfrom();
852  int64 result;
853  OP_Utils::evalOpParm(result, thissop, "weightFrom", cookparms.getCookTime(), 0);
854  return Weightfrom(result);
855  }
856  fpreal64 getDropoff() const { return myDropoff; }
857  void setDropoff(fpreal64 val) { myDropoff = val; }
859  {
860  SOP_Node *thissop = cookparms.getNode();
861  if (!thissop) return getDropoff();
863  OP_Utils::evalOpParm(result, thissop, "dropoff", cookparms.getCookTime(), 0);
864  return result;
865  }
866  int64 getMaxinfluences() const { return myMaxinfluences; }
867  void setMaxinfluences(int64 val) { myMaxinfluences = val; }
869  {
870  SOP_Node *thissop = cookparms.getNode();
871  if (!thissop) return getMaxinfluences();
872  int64 result;
873  OP_Utils::evalOpParm(result, thissop, "maxinfluences", cookparms.getCookTime(), 0);
874  return result;
875  }
876  bool getNormweights() const { return myNormweights; }
877  void setNormweights(bool val) { myNormweights = val; }
878  bool opNormweights(const SOP_NodeVerb::CookParms &cookparms) const
879  {
880  SOP_Node *thissop = cookparms.getNode();
881  if (!thissop) return getNormweights();
882  bool result;
883  OP_Utils::evalOpParm(result, thissop, "normweights", cookparms.getCookTime(), 0);
884  return result;
885  }
886  bool getDestroyweights() const { return myDestroyweights; }
887  void setDestroyweights(bool val) { myDestroyweights = val; }
888  bool opDestroyweights(const SOP_NodeVerb::CookParms &cookparms) const
889  {
890  SOP_Node *thissop = cookparms.getNode();
891  if (!thissop) return getDestroyweights();
892  bool result;
893  OP_Utils::evalOpParm(result, thissop, "destroyweights", cookparms.getCookTime(), 0);
894  return result;
895  }
896  fpreal64 getBlendfactor() const { return myBlendfactor; }
897  void setBlendfactor(fpreal64 val) { myBlendfactor = val; }
899  {
900  SOP_Node *thissop = cookparms.getNode();
901  if (!thissop) return getBlendfactor();
903  OP_Utils::evalOpParm(result, thissop, "blendfactor", cookparms.getCookTime(), 0);
904  return result;
905  }
906  Color getColor() const { return Color(myColor); }
907  void setColor(Color val) { myColor = int64(val); }
908  Color opColor(const SOP_NodeVerb::CookParms &cookparms) const
909  {
910  SOP_Node *thissop = cookparms.getNode();
911  if (!thissop) return getColor();
912  int64 result;
913  OP_Utils::evalOpParm(result, thissop, "color", cookparms.getCookTime(), 0);
914  return Color(result);
915  }
916  UT_Vector3D getZeroweightcolor() const { return myZeroweightcolor; }
917  void setZeroweightcolor(UT_Vector3D val) { myZeroweightcolor = val; }
919  {
920  SOP_Node *thissop = cookparms.getNode();
921  if (!thissop) return getZeroweightcolor();
923  OP_Utils::evalOpParm(result, thissop, "zeroweightcolor", cookparms.getCookTime(), 0);
924  return result;
925  }
926 
927 private:
928  UT_StringHolder myGroup;
929  UT_StringHolder myCapturegroup;
930  UT_StringHolder myRootpath;
931  UT_StringHolder myExtraregions;
932  int64 myCaptureregionsop;
933  bool myDosubnets;
934  bool myRelativeskel;
935  bool myUsecaptpose;
936  int64 myCookat;
937  fpreal64 myCaptframe;
938  int64 myWeightmethod;
939  int64 myWeightfrom;
940  fpreal64 myDropoff;
941  int64 myMaxinfluences;
942  bool myNormweights;
943  bool myDestroyweights;
944  fpreal64 myBlendfactor;
945  int64 myColor;
946  UT_Vector3D myZeroweightcolor;
947 
948 };
UT_StringHolder opRootpath(const SOP_NodeVerb::CookParms &cookparms) const
bool opUsecaptpose(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
type
Definition: core.h:556
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, fpreal64 v)
int64 opMaxinfluences(const SOP_NodeVerb::CookParms &cookparms) const
void setExtraregions(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Color opColor(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setWeightmethod(Weightmethod val)
bool opNormweights(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
bool operator==(const SOP_ProximityCaptureParms &src) const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opCaptframe(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
Definition: glcorearb.h:824
fpreal64 opBlendfactor(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getExtraregions() const
GLdouble s
Definition: glad.h:3009
void setZeroweightcolor(UT_Vector3D val)
An output stream object that owns its own string buffer storage.
bool isParmColorRamp(exint idx) const override
void setGroup(const UT_StringHolder &val)
**But if you need a result
Definition: thread.h:622
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
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.
void setCaptureregionsop(Captureregionsop val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
void loadFromOpSubclass(const LoadParms &loadparms) override
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
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_Vector3D opZeroweightcolor(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Vector2D v)
void save(std::ostream &os) const
const UT_StringHolder & getRootpath() const
static void saveData(std::ostream &os, UT_Vector3D v)
UT_StringHolder opExtraregions(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint length() const
Captureregionsop getCaptureregionsop() const
SYS_FORCE_INLINE const char * buffer() const
bool opDosubnets(const SOP_NodeVerb::CookParms &cookparms) 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
Captureregionsop opCaptureregionsop(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
void setRootpath(const UT_StringHolder &val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
static void saveData(std::ostream &os, bool v)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
Cookat opCookat(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
UT_Vector3T< fpreal64 > UT_Vector3D
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
GT_API const UT_StringHolder version
const UT_StringHolder & getCapturegroup() const
void setCapturegroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Vector4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
SYS_FORCE_INLINE UT_StringHolder getToken(Captureregionsop enum_value)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
Weightfrom opWeightfrom(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
bool opDestroyweights(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
bool operator!=(const SOP_ProximityCaptureParms &src) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
fpreal64 opDropoff(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
Weightmethod opWeightmethod(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GLboolean r
Definition: glcorearb.h:1222
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
UT_StringHolder opCapturegroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
exint getNestNumParms(TempIndex idx) const override
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool opRelativeskel(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override