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 <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 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  return true;
174  }
176  {
177  return !operator==(src);
178  }
184 
185 
186 
187  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
188  {
189  myGroup = ""_UTsh;
190  if (true)
191  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
192  myCapturegroup = ""_UTsh;
193  if (true)
194  graph->evalOpParm(myCapturegroup, nodeidx, "capturegroup", time, 0);
195  myRootpath = ""_UTsh;
196  if (true)
197  graph->evalOpParm(myRootpath, nodeidx, "rootpath", time, 0);
198  myExtraregions = ""_UTsh;
199  if (true)
200  graph->evalOpParm(myExtraregions, nodeidx, "extraregions", time, 0);
201  myCaptureregionsop = 2;
202  if (true)
203  graph->evalOpParm(myCaptureregionsop, nodeidx, "captureregionsop", time, 0);
204  myDosubnets = false;
205  if (true)
206  graph->evalOpParm(myDosubnets, nodeidx, "dosubnets", time, 0);
207  myRelativeskel = true;
208  if (true)
209  graph->evalOpParm(myRelativeskel, nodeidx, "relativeskel", time, 0);
210  myUsecaptpose = false;
211  if (true)
212  graph->evalOpParm(myUsecaptpose, nodeidx, "usecaptpose", time, 0);
213  myCookat = 0;
214  if (true && ( (true&&!(((getUsecaptpose()!=0)))) ) )
215  graph->evalOpParm(myCookat, nodeidx, "cookat", time, 0);
216  myCaptframe = 0;
217  if (true && ( (true&&!(((getUsecaptpose()!=0))||((int64(getCookat())==1)))) ) )
218  graph->evalOpParm(myCaptframe, nodeidx, "captframe", time, 0);
219  myWeightmethod = 0;
220  if (true)
221  graph->evalOpParm(myWeightmethod, nodeidx, "weightmethod", time, 0);
222  myWeightfrom = 0;
223  if (true)
224  graph->evalOpParm(myWeightfrom, nodeidx, "weightFrom", time, 0);
225  myDropoff = 1;
226  if (true)
227  graph->evalOpParm(myDropoff, nodeidx, "dropoff", time, 0);
228  myMaxinfluences = 2;
229  if (true)
230  graph->evalOpParm(myMaxinfluences, nodeidx, "maxinfluences", time, 0);
231  myNormweights = true;
232  if (true)
233  graph->evalOpParm(myNormweights, nodeidx, "normweights", time, 0);
234  myDestroyweights = true;
235  if (true)
236  graph->evalOpParm(myDestroyweights, nodeidx, "destroyweights", time, 0);
237  myBlendfactor = 1;
238  if (true && ( (true&&!(((getDestroyweights()!=0)))) ) )
239  graph->evalOpParm(myBlendfactor, nodeidx, "blendfactor", time, 0);
240  myColor = 0;
241  if (true)
242  graph->evalOpParm(myColor, nodeidx, "color", time, 0);
243  myZeroweightcolor = UT_Vector3D(1,1,1);
244  if (true)
245  graph->evalOpParm(myZeroweightcolor, nodeidx, "zeroweightcolor", time, 0);
246 
247  }
248 
249 
250  void loadFromOpSubclass(const LoadParms &loadparms) override
251  {
252  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
253  }
254 
255 
256  void copyFrom(const OP_NodeParms *src) override
257  {
258  *this = *((const SOP_ProximityCaptureParms *)src);
259  }
260 
261  template <typename T>
262  void
263  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
264  {
265  if (idx.size() < 1)
266  return;
267  UT_ASSERT(idx.size() == instance.size()+1);
268  if (idx.size() != instance.size()+1)
269  return;
270  switch (idx[0])
271  {
272  case 0:
273  coerceValue(value, myGroup);
274  break;
275  case 1:
276  coerceValue(value, myCapturegroup);
277  break;
278  case 2:
279  coerceValue(value, myRootpath);
280  break;
281  case 3:
282  coerceValue(value, myExtraregions);
283  break;
284  case 4:
285  coerceValue(value, myCaptureregionsop);
286  break;
287  case 5:
288  coerceValue(value, myDosubnets);
289  break;
290  case 6:
291  coerceValue(value, myRelativeskel);
292  break;
293  case 7:
294  coerceValue(value, myUsecaptpose);
295  break;
296  case 8:
297  coerceValue(value, myCookat);
298  break;
299  case 9:
300  coerceValue(value, myCaptframe);
301  break;
302  case 10:
303  coerceValue(value, myWeightmethod);
304  break;
305  case 11:
306  coerceValue(value, myWeightfrom);
307  break;
308  case 12:
309  coerceValue(value, myDropoff);
310  break;
311  case 13:
312  coerceValue(value, myMaxinfluences);
313  break;
314  case 14:
315  coerceValue(value, myNormweights);
316  break;
317  case 15:
318  coerceValue(value, myDestroyweights);
319  break;
320  case 16:
321  coerceValue(value, myBlendfactor);
322  break;
323  case 17:
324  coerceValue(value, myColor);
325  break;
326  case 18:
327  coerceValue(value, myZeroweightcolor);
328  break;
329 
330  }
331  }
332 
333  bool isParmColorRamp(exint idx) const override
334  {
335  switch (idx)
336  {
337 
338  }
339  return false;
340  }
341 
342  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
343  { doGetParmValue(idx, instance, value); }
344  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
345  { doGetParmValue(idx, instance, value); }
346  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
347  { doGetParmValue(idx, instance, value); }
348  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
349  { doGetParmValue(idx, instance, value); }
350  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
351  { doGetParmValue(idx, instance, value); }
352  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
353  { doGetParmValue(idx, instance, value); }
354  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
355  { doGetParmValue(idx, instance, value); }
356  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
357  { doGetParmValue(idx, instance, value); }
358  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
359  { doGetParmValue(idx, instance, value); }
360  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
361  { doGetParmValue(idx, instance, value); }
362  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
363  { doGetParmValue(idx, instance, value); }
364 
365  template <typename T>
366  void
367  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
368  {
369  if (idx.size() < 1)
370  return;
371  UT_ASSERT(idx.size() == instance.size()+1);
372  if (idx.size() != instance.size()+1)
373  return;
374  switch (idx[0])
375  {
376  case 0:
377  coerceValue(myGroup, ( ( value ) ));
378  break;
379  case 1:
380  coerceValue(myCapturegroup, ( ( value ) ));
381  break;
382  case 2:
383  coerceValue(myRootpath, ( ( value ) ));
384  break;
385  case 3:
386  coerceValue(myExtraregions, ( ( value ) ));
387  break;
388  case 4:
389  coerceValue(myCaptureregionsop, clampMinValue(0, clampMaxValue(2, value ) ));
390  break;
391  case 5:
392  coerceValue(myDosubnets, ( ( value ) ));
393  break;
394  case 6:
395  coerceValue(myRelativeskel, ( ( value ) ));
396  break;
397  case 7:
398  coerceValue(myUsecaptpose, ( ( value ) ));
399  break;
400  case 8:
401  coerceValue(myCookat, clampMinValue(0, clampMaxValue(1, value ) ));
402  break;
403  case 9:
404  coerceValue(myCaptframe, ( ( value ) ));
405  break;
406  case 10:
407  coerceValue(myWeightmethod, clampMinValue(0, clampMaxValue(1, value ) ));
408  break;
409  case 11:
410  coerceValue(myWeightfrom, clampMinValue(0, clampMaxValue(1, value ) ));
411  break;
412  case 12:
413  coerceValue(myDropoff, clampMinValue(0.001, ( value ) ));
414  break;
415  case 13:
416  coerceValue(myMaxinfluences, clampMinValue(1, ( value ) ));
417  break;
418  case 14:
419  coerceValue(myNormweights, ( ( value ) ));
420  break;
421  case 15:
422  coerceValue(myDestroyweights, ( ( value ) ));
423  break;
424  case 16:
425  coerceValue(myBlendfactor, ( ( value ) ));
426  break;
427  case 17:
428  coerceValue(myColor, clampMinValue(0, clampMaxValue(1, value ) ));
429  break;
430  case 18:
431  coerceValue(myZeroweightcolor, ( ( value ) ));
432  break;
433 
434  }
435  }
436 
437  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
438  { doSetParmValue(idx, instance, value); }
439  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
440  { doSetParmValue(idx, instance, value); }
441  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
442  { doSetParmValue(idx, instance, value); }
443  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
444  { doSetParmValue(idx, instance, value); }
445  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
446  { doSetParmValue(idx, instance, value); }
447  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
448  { doSetParmValue(idx, instance, value); }
449  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
450  { doSetParmValue(idx, instance, value); }
451  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
452  { doSetParmValue(idx, instance, value); }
453  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
454  { doSetParmValue(idx, instance, value); }
455  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
456  { doSetParmValue(idx, instance, value); }
457  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
458  { doSetParmValue(idx, instance, value); }
459 
460  exint getNestNumParms(TempIndex idx) const override
461  {
462  if (idx.size() == 0)
463  return 19;
464  switch (idx[0])
465  {
466 
467  }
468  // Invalid
469  return 0;
470  }
471 
472  const char *getNestParmName(TempIndex fieldnum) const override
473  {
474  if (fieldnum.size() < 1)
475  return 0;
476  switch (fieldnum[0])
477  {
478  case 0:
479  return "group";
480  case 1:
481  return "capturegroup";
482  case 2:
483  return "rootpath";
484  case 3:
485  return "extraregions";
486  case 4:
487  return "captureregionsop";
488  case 5:
489  return "dosubnets";
490  case 6:
491  return "relativeskel";
492  case 7:
493  return "usecaptpose";
494  case 8:
495  return "cookat";
496  case 9:
497  return "captframe";
498  case 10:
499  return "weightmethod";
500  case 11:
501  return "weightFrom";
502  case 12:
503  return "dropoff";
504  case 13:
505  return "maxinfluences";
506  case 14:
507  return "normweights";
508  case 15:
509  return "destroyweights";
510  case 16:
511  return "blendfactor";
512  case 17:
513  return "color";
514  case 18:
515  return "zeroweightcolor";
516 
517  }
518  return 0;
519  }
520 
521  ParmType getNestParmType(TempIndex fieldnum) const override
522  {
523  if (fieldnum.size() < 1)
524  return PARM_UNSUPPORTED;
525  switch (fieldnum[0])
526  {
527  case 0:
528  return PARM_STRING;
529  case 1:
530  return PARM_STRING;
531  case 2:
532  return PARM_STRING;
533  case 3:
534  return PARM_STRING;
535  case 4:
536  return PARM_INTEGER;
537  case 5:
538  return PARM_INTEGER;
539  case 6:
540  return PARM_INTEGER;
541  case 7:
542  return PARM_INTEGER;
543  case 8:
544  return PARM_INTEGER;
545  case 9:
546  return PARM_FLOAT;
547  case 10:
548  return PARM_INTEGER;
549  case 11:
550  return PARM_INTEGER;
551  case 12:
552  return PARM_FLOAT;
553  case 13:
554  return PARM_INTEGER;
555  case 14:
556  return PARM_INTEGER;
557  case 15:
558  return PARM_INTEGER;
559  case 16:
560  return PARM_FLOAT;
561  case 17:
562  return PARM_INTEGER;
563  case 18:
564  return PARM_VECTOR3;
565 
566  }
567  return PARM_UNSUPPORTED;
568  }
569 
570  // Boiler plate to load individual types.
571  static void loadData(UT_IStream &is, int64 &v)
572  { is.bread(&v, 1); }
573  static void loadData(UT_IStream &is, bool &v)
574  { int64 iv; is.bread(&iv, 1); v = iv; }
575  static void loadData(UT_IStream &is, fpreal64 &v)
576  { is.bread<fpreal64>(&v, 1); }
577  static void loadData(UT_IStream &is, UT_Vector2D &v)
578  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
579  static void loadData(UT_IStream &is, UT_Vector3D &v)
580  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
581  is.bread<fpreal64>(&v.z(), 1); }
582  static void loadData(UT_IStream &is, UT_Vector4D &v)
583  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
584  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
585  static void loadData(UT_IStream &is, UT_Matrix2D &v)
586  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
587  static void loadData(UT_IStream &is, UT_Matrix3D &v)
588  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
589  static void loadData(UT_IStream &is, UT_Matrix4D &v)
590  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
591  static void loadData(UT_IStream &is, UT_Vector2I &v)
592  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
593  static void loadData(UT_IStream &is, UT_Vector3I &v)
594  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
595  is.bread<int64>(&v.z(), 1); }
596  static void loadData(UT_IStream &is, UT_Vector4I &v)
597  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
598  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
600  { is.bread(v); }
602  { UT_StringHolder rampdata;
603  loadData(is, rampdata);
604  if (rampdata.isstring())
605  {
606  v.reset(new UT_Ramp());
607  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
608  v->load(istr);
609  }
610  else v.reset();
611  }
614  loadData(is, data);
615  if (data.isstring())
616  {
617  // Find the data type.
618  const char *colon = UT_StringWrap(data).findChar(':');
619  if (colon)
620  {
621  int typelen = colon - data.buffer();
623  type.strncpy(data.buffer(), typelen);
624  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
625 
626  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
627  }
628  }
629  else v.reset();
630  }
631 
632  static void saveData(std::ostream &os, int64 v)
633  { UTwrite(os, &v); }
634  static void saveData(std::ostream &os, bool v)
635  { int64 iv = v; UTwrite(os, &iv); }
636  static void saveData(std::ostream &os, fpreal64 v)
637  { UTwrite<fpreal64>(os, &v); }
638  static void saveData(std::ostream &os, UT_Vector2D v)
639  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
640  static void saveData(std::ostream &os, UT_Vector3D v)
641  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
642  UTwrite<fpreal64>(os, &v.z()); }
643  static void saveData(std::ostream &os, UT_Vector4D v)
644  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
645  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
646  static void saveData(std::ostream &os, UT_Matrix2D v)
648  static void saveData(std::ostream &os, UT_Matrix3D v)
650  static void saveData(std::ostream &os, UT_Matrix4D v)
652  static void saveData(std::ostream &os, UT_StringHolder s)
653  { UT_StringWrap(s).saveBinary(os); }
654  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
656  UT_OStringStream ostr;
657  if (s) s->save(ostr);
658  result = ostr.str();
659  saveData(os, result);
660  }
661  static void saveData(std::ostream &os, PRM_DataItemHandle s)
663  UT_OStringStream ostr;
664  if (s)
665  {
666  ostr << s->getDataTypeToken();
667  ostr << ":";
668  s->saveBinary(ostr);
669  }
670  result = ostr.str();
671  saveData(os, result);
672  }
673 
674 
675  void save(std::ostream &os) const
676  {
677  int32 v = version();
678  UTwrite(os, &v);
679  saveData(os, myGroup);
680  saveData(os, myCapturegroup);
681  saveData(os, myRootpath);
682  saveData(os, myExtraregions);
683  saveData(os, myCaptureregionsop);
684  saveData(os, myDosubnets);
685  saveData(os, myRelativeskel);
686  saveData(os, myUsecaptpose);
687  saveData(os, myCookat);
688  saveData(os, myCaptframe);
689  saveData(os, myWeightmethod);
690  saveData(os, myWeightfrom);
691  saveData(os, myDropoff);
692  saveData(os, myMaxinfluences);
693  saveData(os, myNormweights);
694  saveData(os, myDestroyweights);
695  saveData(os, myBlendfactor);
696  saveData(os, myColor);
697  saveData(os, myZeroweightcolor);
698 
699  }
700 
701  bool load(UT_IStream &is)
702  {
703  int32 v;
704  is.bread(&v, 1);
705  if (version() != v)
706  {
707  // Fail incompatible versions
708  return false;
709  }
710  loadData(is, myGroup);
711  loadData(is, myCapturegroup);
712  loadData(is, myRootpath);
713  loadData(is, myExtraregions);
714  loadData(is, myCaptureregionsop);
715  loadData(is, myDosubnets);
716  loadData(is, myRelativeskel);
717  loadData(is, myUsecaptpose);
718  loadData(is, myCookat);
719  loadData(is, myCaptframe);
720  loadData(is, myWeightmethod);
721  loadData(is, myWeightfrom);
722  loadData(is, myDropoff);
723  loadData(is, myMaxinfluences);
724  loadData(is, myNormweights);
725  loadData(is, myDestroyweights);
726  loadData(is, myBlendfactor);
727  loadData(is, myColor);
728  loadData(is, myZeroweightcolor);
729 
730  return true;
731  }
732 
733  const UT_StringHolder & getGroup() const { return myGroup; }
734  void setGroup(const UT_StringHolder & val) { myGroup = val; }
736  {
737  SOP_Node *thissop = cookparms.getNode();
738  if (!thissop) return getGroup();
740  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
741  return result;
742  }
743  const UT_StringHolder & getCapturegroup() const { return myCapturegroup; }
744  void setCapturegroup(const UT_StringHolder & val) { myCapturegroup = val; }
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return getCapturegroup();
750  OP_Utils::evalOpParm(result, thissop, "capturegroup", cookparms.getCookTime(), 0);
751  return result;
752  }
753  const UT_StringHolder & getRootpath() const { return myRootpath; }
754  void setRootpath(const UT_StringHolder & val) { myRootpath = val; }
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return getRootpath();
760  OP_Utils::evalOpParm(result, thissop, "rootpath", cookparms.getCookTime(), 0);
761  return result;
762  }
763  const UT_StringHolder & getExtraregions() const { return myExtraregions; }
764  void setExtraregions(const UT_StringHolder & val) { myExtraregions = val; }
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getExtraregions();
770  OP_Utils::evalOpParm(result, thissop, "extraregions", cookparms.getCookTime(), 0);
771  return result;
772  }
773  Captureregionsop getCaptureregionsop() const { return Captureregionsop(myCaptureregionsop); }
774  void setCaptureregionsop(Captureregionsop val) { myCaptureregionsop = int64(val); }
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getCaptureregionsop();
779  int64 result;
780  OP_Utils::evalOpParm(result, thissop, "captureregionsop", cookparms.getCookTime(), 0);
781  return Captureregionsop(result);
782  }
783  bool getDosubnets() const { return myDosubnets; }
784  void setDosubnets(bool val) { myDosubnets = val; }
785  bool opDosubnets(const SOP_NodeVerb::CookParms &cookparms) const
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getDosubnets();
789  bool result;
790  OP_Utils::evalOpParm(result, thissop, "dosubnets", cookparms.getCookTime(), 0);
791  return result;
792  }
793  bool getRelativeskel() const { return myRelativeskel; }
794  void setRelativeskel(bool val) { myRelativeskel = val; }
795  bool opRelativeskel(const SOP_NodeVerb::CookParms &cookparms) const
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getRelativeskel();
799  bool result;
800  OP_Utils::evalOpParm(result, thissop, "relativeskel", cookparms.getCookTime(), 0);
801  return result;
802  }
803  bool getUsecaptpose() const { return myUsecaptpose; }
804  void setUsecaptpose(bool val) { myUsecaptpose = val; }
805  bool opUsecaptpose(const SOP_NodeVerb::CookParms &cookparms) const
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getUsecaptpose();
809  bool result;
810  OP_Utils::evalOpParm(result, thissop, "usecaptpose", cookparms.getCookTime(), 0);
811  return result;
812  }
813  Cookat getCookat() const { return Cookat(myCookat); }
814  void setCookat(Cookat val) { myCookat = int64(val); }
815  Cookat opCookat(const SOP_NodeVerb::CookParms &cookparms) const
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getCookat();
819  int64 result;
820  OP_Utils::evalOpParm(result, thissop, "cookat", cookparms.getCookTime(), 0);
821  return Cookat(result);
822  }
823  fpreal64 getCaptframe() const { return myCaptframe; }
824  void setCaptframe(fpreal64 val) { myCaptframe = val; }
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getCaptframe();
830  OP_Utils::evalOpParm(result, thissop, "captframe", cookparms.getCookTime(), 0);
831  return result;
832  }
833  Weightmethod getWeightmethod() const { return Weightmethod(myWeightmethod); }
834  void setWeightmethod(Weightmethod val) { myWeightmethod = int64(val); }
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getWeightmethod();
839  int64 result;
840  OP_Utils::evalOpParm(result, thissop, "weightmethod", cookparms.getCookTime(), 0);
841  return Weightmethod(result);
842  }
843  Weightfrom getWeightfrom() const { return Weightfrom(myWeightfrom); }
844  void setWeightfrom(Weightfrom val) { myWeightfrom = int64(val); }
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getWeightfrom();
849  int64 result;
850  OP_Utils::evalOpParm(result, thissop, "weightFrom", cookparms.getCookTime(), 0);
851  return Weightfrom(result);
852  }
853  fpreal64 getDropoff() const { return myDropoff; }
854  void setDropoff(fpreal64 val) { myDropoff = val; }
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getDropoff();
860  OP_Utils::evalOpParm(result, thissop, "dropoff", cookparms.getCookTime(), 0);
861  return result;
862  }
863  int64 getMaxinfluences() const { return myMaxinfluences; }
864  void setMaxinfluences(int64 val) { myMaxinfluences = val; }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getMaxinfluences();
869  int64 result;
870  OP_Utils::evalOpParm(result, thissop, "maxinfluences", cookparms.getCookTime(), 0);
871  return result;
872  }
873  bool getNormweights() const { return myNormweights; }
874  void setNormweights(bool val) { myNormweights = val; }
875  bool opNormweights(const SOP_NodeVerb::CookParms &cookparms) const
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return getNormweights();
879  bool result;
880  OP_Utils::evalOpParm(result, thissop, "normweights", cookparms.getCookTime(), 0);
881  return result;
882  }
883  bool getDestroyweights() const { return myDestroyweights; }
884  void setDestroyweights(bool val) { myDestroyweights = val; }
885  bool opDestroyweights(const SOP_NodeVerb::CookParms &cookparms) const
886  {
887  SOP_Node *thissop = cookparms.getNode();
888  if (!thissop) return getDestroyweights();
889  bool result;
890  OP_Utils::evalOpParm(result, thissop, "destroyweights", cookparms.getCookTime(), 0);
891  return result;
892  }
893  fpreal64 getBlendfactor() const { return myBlendfactor; }
894  void setBlendfactor(fpreal64 val) { myBlendfactor = val; }
896  {
897  SOP_Node *thissop = cookparms.getNode();
898  if (!thissop) return getBlendfactor();
900  OP_Utils::evalOpParm(result, thissop, "blendfactor", cookparms.getCookTime(), 0);
901  return result;
902  }
903  Color getColor() const { return Color(myColor); }
904  void setColor(Color val) { myColor = int64(val); }
905  Color opColor(const SOP_NodeVerb::CookParms &cookparms) const
906  {
907  SOP_Node *thissop = cookparms.getNode();
908  if (!thissop) return getColor();
909  int64 result;
910  OP_Utils::evalOpParm(result, thissop, "color", cookparms.getCookTime(), 0);
911  return Color(result);
912  }
913  UT_Vector3D getZeroweightcolor() const { return myZeroweightcolor; }
914  void setZeroweightcolor(UT_Vector3D val) { myZeroweightcolor = val; }
916  {
917  SOP_Node *thissop = cookparms.getNode();
918  if (!thissop) return getZeroweightcolor();
920  OP_Utils::evalOpParm(result, thissop, "zeroweightcolor", cookparms.getCookTime(), 0);
921  return result;
922  }
923 
924 private:
925  UT_StringHolder myGroup;
926  UT_StringHolder myCapturegroup;
927  UT_StringHolder myRootpath;
928  UT_StringHolder myExtraregions;
929  int64 myCaptureregionsop;
930  bool myDosubnets;
931  bool myRelativeskel;
932  bool myUsecaptpose;
933  int64 myCookat;
934  fpreal64 myCaptframe;
935  int64 myWeightmethod;
936  int64 myWeightfrom;
937  fpreal64 myDropoff;
938  int64 myMaxinfluences;
939  bool myNormweights;
940  bool myDestroyweights;
941  fpreal64 myBlendfactor;
942  int64 myColor;
943  UT_Vector3D myZeroweightcolor;
944 
945 };
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
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:62
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opCaptframe(const SOP_NodeVerb::CookParms &cookparms) const
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:613
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
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:296
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:277
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:92
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
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:361
Weightmethod opWeightmethod(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
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
type
Definition: core.h:1059
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const char * getNestParmName(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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