HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_Detangle.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 <OP/OP_Utils.h>
8 #include <PRM/PRM_Parm.h>
9 #include <UT/UT_IStream.h>
10 #include <UT/UT_NTStreamUtil.h>
11 #include <UT/UT_Ramp.h>
12 #include <UT/UT_SharedPtr.h>
13 #include <UT/UT_StringHolder.h>
14 #include <UT/UT_StringStream.h>
15 #include <UT/UT_VectorTypes.h>
16 #include <SYS/SYS_Types.h>
17 
18 using namespace UT::Literal;
19 
20 class DEP_MicroNode;
21 namespace SOP_DetangleEnums
22 {
23  enum class RootFinder
24  {
25  NEWTON = 0,
26  CROSS
27  };
28 }
29 
30 
32 {
33 public:
34  static int version() { return 1; }
35 
37  {
38  myPrevpos = ""_sh;
39  myDisableSelfAttr = "disableself"_sh;
40  myDisableExternalAttr = "disableexternal"_sh;
41  myThickness = 0.05;
42  myDoSelf = false;
43  myDoSelfEdges = false;
44  myDoExternalEdges = false;
45  myUpdateDisable = false;
46  myResetDetangledPoints = false;
47  myDoresolve = false;
48  myUpdatehitnmls = false;
49  myRootFinder = 1;
50  myDojacobi = false;
51  myResolveScale = 1.0;
52  myMaxWeight = 1.0;
53  myGlobalAverage = false;
54  myGlobalAverageMax = 10;
55  myExternalFriction = 1.0;
56  mySelfFriction = 1.0;
57  myStaticThreshold = 0.5;
58  myKineticScale = 0.1;
59  myResetKey = 0;
60  myUpdateOverlap = false;
61 
62  }
63 
64  explicit SOP_DetangleParms(const SOP_DetangleParms &) = default;
65 
66  virtual ~SOP_DetangleParms() {}
67 
68  bool operator==(const SOP_DetangleParms &src) const
69  {
70  if (myPrevpos != src.myPrevpos) return false;
71  if (myDisableSelfAttr != src.myDisableSelfAttr) return false;
72  if (myDisableExternalAttr != src.myDisableExternalAttr) return false;
73  if (myThickness != src.myThickness) return false;
74  if (myDoSelf != src.myDoSelf) return false;
75  if (myDoSelfEdges != src.myDoSelfEdges) return false;
76  if (myDoExternalEdges != src.myDoExternalEdges) return false;
77  if (myUpdateDisable != src.myUpdateDisable) return false;
78  if (myResetDetangledPoints != src.myResetDetangledPoints) return false;
79  if (myDoresolve != src.myDoresolve) return false;
80  if (myUpdatehitnmls != src.myUpdatehitnmls) return false;
81  if (myRootFinder != src.myRootFinder) return false;
82  if (myDojacobi != src.myDojacobi) return false;
83  if (myResolveScale != src.myResolveScale) return false;
84  if (myMaxWeight != src.myMaxWeight) return false;
85  if (myGlobalAverage != src.myGlobalAverage) return false;
86  if (myGlobalAverageMax != src.myGlobalAverageMax) return false;
87  if (myExternalFriction != src.myExternalFriction) return false;
88  if (mySelfFriction != src.mySelfFriction) return false;
89  if (myStaticThreshold != src.myStaticThreshold) return false;
90  if (myKineticScale != src.myKineticScale) return false;
91  if (myResetKey != src.myResetKey) return false;
92  if (myUpdateOverlap != src.myUpdateOverlap) return false;
93 
94  return true;
95  }
97 
98 
99 
100  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
101  {
102  if (true)
103  OP_Utils::evalOpParm(myPrevpos, node, "prevpos", time, 0);
104  else myPrevpos = ""_sh;
105  if (true)
106  OP_Utils::evalOpParm(myDisableSelfAttr, node, "disableselfattr", time, 0);
107  else myDisableSelfAttr = "disableself"_sh;
108  if (true)
109  OP_Utils::evalOpParm(myDisableExternalAttr, node, "disableexternalattr", time, 0);
110  else myDisableExternalAttr = "disableexternal"_sh;
111  if (true)
112  OP_Utils::evalOpParm(myThickness, node, "thickness", time, 0);
113  else myThickness = 0.05;
114  if (true)
115  OP_Utils::evalOpParm(myDoSelf, node, "doself", time, 0);
116  else myDoSelf = false;
117  if (true)
118  OP_Utils::evalOpParm(myDoSelfEdges, node, "doselfedge", time, 0);
119  else myDoSelfEdges = false;
120  if (true && ( (!(((getDoSelfEdges()==0)))) ) )
121  OP_Utils::evalOpParm(myDoExternalEdges, node, "doexternaledge", time, 0);
122  else myDoExternalEdges = false;
123  if (true)
124  OP_Utils::evalOpParm(myUpdateDisable, node, "updatedisable", time, 0);
125  else myUpdateDisable = false;
126  if (true && ( (!(((getUpdateDisable()==0)))) ) )
127  OP_Utils::evalOpParm(myResetDetangledPoints, node, "resetdetangled", time, 0);
128  else myResetDetangledPoints = false;
129  if (true && ( (!(((getUpdateDisable()==1)))) ) )
130  OP_Utils::evalOpParm(myDoresolve, node, "doresolve", time, 0);
131  else myDoresolve = false;
132  if (true && ( (!(((getDoresolve()==0))||((getUpdateDisable()==1)))) ) )
133  OP_Utils::evalOpParm(myUpdatehitnmls, node, "updatehitnmls", time, 0);
134  else myUpdatehitnmls = false;
135  if (true)
136  OP_Utils::evalOpParm(myRootFinder, node, "rootfinder", time, 0);
137  else myRootFinder = 1;
138  if (true)
139  OP_Utils::evalOpParm(myDojacobi, node, "dojacobi", time, 0);
140  else myDojacobi = false;
141  if (true)
142  OP_Utils::evalOpParm(myResolveScale, node, "resolvescale", time, 0);
143  else myResolveScale = 1.0;
144  if (true && ( (!(((getDojacobi()==0)))) ) )
145  OP_Utils::evalOpParm(myMaxWeight, node, "maxweight", time, 0);
146  else myMaxWeight = 1.0;
147  if (true && ( (!(((getDojacobi()==0)))) ) )
148  OP_Utils::evalOpParm(myGlobalAverage, node, "globalaverage", time, 0);
149  else myGlobalAverage = false;
150  if (true && ( (!(((getDojacobi()==0))||((getGlobalAverage()==0)))) ) )
151  OP_Utils::evalOpParm(myGlobalAverageMax, node, "globalaveragemax", time, 0);
152  else myGlobalAverageMax = 10;
153  if (true && ( (!(((getDoresolve()==0)))) ) )
154  OP_Utils::evalOpParm(myExternalFriction, node, "externalfriction", time, 0);
155  else myExternalFriction = 1.0;
156  if (true && ( (!(((getDoresolve()==0)))) ) )
157  OP_Utils::evalOpParm(mySelfFriction, node, "selffriction", time, 0);
158  else mySelfFriction = 1.0;
159  if (true && ( (!(((getDoresolve()==0)))) ) )
160  OP_Utils::evalOpParm(myStaticThreshold, node, "static_threshold", time, 0);
161  else myStaticThreshold = 0.5;
162  if (true && ( (!(((getDoresolve()==0)))) ) )
163  OP_Utils::evalOpParm(myKineticScale, node, "kinetic_scale", time, 0);
164  else myKineticScale = 0.1;
165  if (true)
166  OP_Utils::evalOpParm(myResetKey, node, "resetkey", time, 0);
167  else myResetKey = 0;
168  if (true && ( (!(((getUpdateDisable()==0)&&(getDoresolve()==1)))) ) )
169  OP_Utils::evalOpParm(myUpdateOverlap, node, "updateoverlap", time, 0);
170  else myUpdateOverlap = false;
171 
172  }
173 
174 
175  virtual void loadFromOpSubclass(const LoadParms &loadparms)
176  {
177  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
178  }
179 
180 
181  virtual void copyFrom(const SOP_NodeParms *src)
182  {
183  *this = *((const SOP_DetangleParms *)src);
184  }
185 
186  template <typename T>
187  void
188  doGetParmValue(exint idx, T &value) const
189  {
190  switch (idx)
191  {
192  case 0:
193  coerceValue(value, myPrevpos);
194  break;
195  case 1:
196  coerceValue(value, myDisableSelfAttr);
197  break;
198  case 2:
199  coerceValue(value, myDisableExternalAttr);
200  break;
201  case 3:
202  coerceValue(value, myThickness);
203  break;
204  case 4:
205  coerceValue(value, myDoSelf);
206  break;
207  case 5:
208  coerceValue(value, myDoSelfEdges);
209  break;
210  case 6:
211  coerceValue(value, myDoExternalEdges);
212  break;
213  case 7:
214  coerceValue(value, myUpdateDisable);
215  break;
216  case 8:
217  coerceValue(value, myResetDetangledPoints);
218  break;
219  case 9:
220  coerceValue(value, myDoresolve);
221  break;
222  case 10:
223  coerceValue(value, myUpdatehitnmls);
224  break;
225  case 11:
226  coerceValue(value, myRootFinder);
227  break;
228  case 12:
229  coerceValue(value, myDojacobi);
230  break;
231  case 13:
232  coerceValue(value, myResolveScale);
233  break;
234  case 14:
235  coerceValue(value, myMaxWeight);
236  break;
237  case 15:
238  coerceValue(value, myGlobalAverage);
239  break;
240  case 16:
241  coerceValue(value, myGlobalAverageMax);
242  break;
243  case 17:
244  coerceValue(value, myExternalFriction);
245  break;
246  case 18:
247  coerceValue(value, mySelfFriction);
248  break;
249  case 19:
250  coerceValue(value, myStaticThreshold);
251  break;
252  case 20:
253  coerceValue(value, myKineticScale);
254  break;
255  case 21:
256  coerceValue(value, myResetKey);
257  break;
258  case 22:
259  coerceValue(value, myUpdateOverlap);
260  break;
261 
262  }
263  }
264 
265  void getParmValue(exint idx, exint &value) const
266  { doGetParmValue(idx, value); }
267  void getParmValue(exint idx, fpreal &value) const
268  { doGetParmValue(idx, value); }
270  { doGetParmValue(idx, value); }
272  { doGetParmValue(idx, value); }
274  { doGetParmValue(idx, value); }
276  { doGetParmValue(idx, value); }
278  { doGetParmValue(idx, value); }
280  { doGetParmValue(idx, value); }
282  { doGetParmValue(idx, value); }
284  { doGetParmValue(idx, value); }
286  { doGetParmValue(idx, value); }
287 
288  template <typename T>
289  void
290  doSetParmValue(exint idx, const T &value)
291  {
292  switch (idx)
293  {
294  case 0:
295  coerceValue(myPrevpos, value);
296  break;
297  case 1:
298  coerceValue(myDisableSelfAttr, value);
299  break;
300  case 2:
301  coerceValue(myDisableExternalAttr, value);
302  break;
303  case 3:
304  coerceValue(myThickness, value);
305  break;
306  case 4:
307  coerceValue(myDoSelf, value);
308  break;
309  case 5:
310  coerceValue(myDoSelfEdges, value);
311  break;
312  case 6:
313  coerceValue(myDoExternalEdges, value);
314  break;
315  case 7:
316  coerceValue(myUpdateDisable, value);
317  break;
318  case 8:
319  coerceValue(myResetDetangledPoints, value);
320  break;
321  case 9:
322  coerceValue(myDoresolve, value);
323  break;
324  case 10:
325  coerceValue(myUpdatehitnmls, value);
326  break;
327  case 11:
328  coerceValue(myRootFinder, value);
329  break;
330  case 12:
331  coerceValue(myDojacobi, value);
332  break;
333  case 13:
334  coerceValue(myResolveScale, value);
335  break;
336  case 14:
337  coerceValue(myMaxWeight, value);
338  break;
339  case 15:
340  coerceValue(myGlobalAverage, value);
341  break;
342  case 16:
343  coerceValue(myGlobalAverageMax, value);
344  break;
345  case 17:
346  coerceValue(myExternalFriction, value);
347  break;
348  case 18:
349  coerceValue(mySelfFriction, value);
350  break;
351  case 19:
352  coerceValue(myStaticThreshold, value);
353  break;
354  case 20:
355  coerceValue(myKineticScale, value);
356  break;
357  case 21:
358  coerceValue(myResetKey, value);
359  break;
360  case 22:
361  coerceValue(myUpdateOverlap, value);
362  break;
363 
364  }
365  }
366 
367  void setParmValue(exint idx, const exint &value)
368  { doSetParmValue(idx, value); }
369  void setParmValue(exint idx, const fpreal &value)
370  { doSetParmValue(idx, value); }
371  void setParmValue(exint idx, const UT_Vector2D &value)
372  { doSetParmValue(idx, value); }
373  void setParmValue(exint idx, const UT_Vector3D &value)
374  { doSetParmValue(idx, value); }
375  void setParmValue(exint idx, const UT_Vector4D &value)
376  { doSetParmValue(idx, value); }
377  void setParmValue(exint idx, const UT_Matrix2D &value)
378  { doSetParmValue(idx, value); }
379  void setParmValue(exint idx, const UT_Matrix3D &value)
380  { doSetParmValue(idx, value); }
381  void setParmValue(exint idx, const UT_Matrix4D &value)
382  { doSetParmValue(idx, value); }
384  { doSetParmValue(idx, value); }
386  { doSetParmValue(idx, value); }
388  { doSetParmValue(idx, value); }
389 
390  virtual exint getNumParms() const
391  {
392  return 23;
393  }
394 
395  virtual const char *getParmName(exint fieldnum) const
396  {
397  switch (fieldnum)
398  {
399  case 0:
400  return "prevpos";
401  case 1:
402  return "disableselfattr";
403  case 2:
404  return "disableexternalattr";
405  case 3:
406  return "thickness";
407  case 4:
408  return "doself";
409  case 5:
410  return "doselfedge";
411  case 6:
412  return "doexternaledge";
413  case 7:
414  return "updatedisable";
415  case 8:
416  return "resetdetangled";
417  case 9:
418  return "doresolve";
419  case 10:
420  return "updatehitnmls";
421  case 11:
422  return "rootfinder";
423  case 12:
424  return "dojacobi";
425  case 13:
426  return "resolvescale";
427  case 14:
428  return "maxweight";
429  case 15:
430  return "globalaverage";
431  case 16:
432  return "globalaveragemax";
433  case 17:
434  return "externalfriction";
435  case 18:
436  return "selffriction";
437  case 19:
438  return "static_threshold";
439  case 20:
440  return "kinetic_scale";
441  case 21:
442  return "resetkey";
443  case 22:
444  return "updateoverlap";
445 
446  }
447  return 0;
448  }
449 
450  virtual ParmType getParmType(exint fieldnum) const
451  {
452  switch (fieldnum)
453  {
454  case 0:
455  return PARM_STRING;
456  case 1:
457  return PARM_STRING;
458  case 2:
459  return PARM_STRING;
460  case 3:
461  return PARM_FLOAT;
462  case 4:
463  return PARM_INTEGER;
464  case 5:
465  return PARM_INTEGER;
466  case 6:
467  return PARM_INTEGER;
468  case 7:
469  return PARM_INTEGER;
470  case 8:
471  return PARM_INTEGER;
472  case 9:
473  return PARM_INTEGER;
474  case 10:
475  return PARM_INTEGER;
476  case 11:
477  return PARM_INTEGER;
478  case 12:
479  return PARM_INTEGER;
480  case 13:
481  return PARM_FLOAT;
482  case 14:
483  return PARM_FLOAT;
484  case 15:
485  return PARM_INTEGER;
486  case 16:
487  return PARM_INTEGER;
488  case 17:
489  return PARM_FLOAT;
490  case 18:
491  return PARM_FLOAT;
492  case 19:
493  return PARM_FLOAT;
494  case 20:
495  return PARM_FLOAT;
496  case 21:
497  return PARM_FLOAT;
498  case 22:
499  return PARM_INTEGER;
500 
501  }
502  return PARM_UNSUPPORTED;
503  }
504 
505  // Boiler plate to load individual types.
506  static void loadData(UT_IStream &is, int64 &v)
507  { is.bread(&v, 1); }
508  static void loadData(UT_IStream &is, bool &v)
509  { int64 iv; is.bread(&iv, 1); v = iv; }
510  static void loadData(UT_IStream &is, fpreal64 &v)
511  { is.bread<fpreal64>(&v, 1); }
512  static void loadData(UT_IStream &is, UT_Vector2D &v)
513  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
514  static void loadData(UT_IStream &is, UT_Vector3D &v)
515  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
516  is.bread<fpreal64>(&v.z(), 1); }
517  static void loadData(UT_IStream &is, UT_Vector4D &v)
518  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
519  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
520  static void loadData(UT_IStream &is, UT_Matrix2D &v)
521  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
522  static void loadData(UT_IStream &is, UT_Matrix3D &v)
523  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
524  static void loadData(UT_IStream &is, UT_Matrix4D &v)
525  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
526  static void loadData(UT_IStream &is, UT_Vector2I &v)
527  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
528  static void loadData(UT_IStream &is, UT_Vector3I &v)
529  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
530  is.bread<int64>(&v.z(), 1); }
531  static void loadData(UT_IStream &is, UT_Vector4I &v)
532  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
533  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
535  { is.bread(v); }
537  { UT_StringHolder rampdata;
538  loadData(is, rampdata);
539  if (rampdata.isstring())
540  {
541  v.reset(new UT_Ramp());
542  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
543  v->load(istr);
544  }
545  else v.reset();
546  }
549  loadData(is, data);
550  if (data.isstring())
551  {
552  // Find the data type.
553  char *colon = UT_StringWrap(data).findChar(':');
554  if (colon)
555  {
556  int typelen = colon - data.buffer();
558  type.strncpy(data.buffer(), typelen);
559  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
560 
561  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
562  }
563  }
564  else v.reset();
565  }
566 
567  static void saveData(std::ostream &os, int64 v)
568  { UTwrite(os, &v); }
569  static void saveData(std::ostream &os, bool v)
570  { int64 iv = v; UTwrite(os, &iv); }
571  static void saveData(std::ostream &os, fpreal64 v)
572  { UTwrite<fpreal64>(os, &v); }
573  static void saveData(std::ostream &os, UT_Vector2D v)
574  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
575  static void saveData(std::ostream &os, UT_Vector3D v)
576  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
577  UTwrite<fpreal64>(os, &v.z()); }
578  static void saveData(std::ostream &os, UT_Vector4D v)
579  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
580  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
581  static void saveData(std::ostream &os, UT_Matrix2D v)
583  static void saveData(std::ostream &os, UT_Matrix3D v)
585  static void saveData(std::ostream &os, UT_Matrix4D v)
587  static void saveData(std::ostream &os, UT_StringHolder s)
588  { UT_StringWrap(s).saveBinary(os); }
589  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
590  { UT_StringHolder result;
591  UT_OStringStream ostr;
592  if (s) s->save(ostr);
593  result = ostr.str();
594  saveData(os, result);
595  }
596  static void saveData(std::ostream &os, PRM_DataItemHandle s)
597  { UT_StringHolder result;
598  UT_OStringStream ostr;
599  if (s)
600  {
601  ostr << s->getDataTypeToken();
602  ostr << ":";
603  s->saveBinary(ostr);
604  }
605  result = ostr.str();
606  saveData(os, result);
607  }
608 
609 
610  void save(std::ostream &os) const
611  {
612  int32 v = version();
613  UTwrite(os, &v);
614  saveData(os, myPrevpos);
615  saveData(os, myDisableSelfAttr);
616  saveData(os, myDisableExternalAttr);
617  saveData(os, myThickness);
618  saveData(os, myDoSelf);
619  saveData(os, myDoSelfEdges);
620  saveData(os, myDoExternalEdges);
621  saveData(os, myUpdateDisable);
622  saveData(os, myResetDetangledPoints);
623  saveData(os, myDoresolve);
624  saveData(os, myUpdatehitnmls);
625  saveData(os, myRootFinder);
626  saveData(os, myDojacobi);
627  saveData(os, myResolveScale);
628  saveData(os, myMaxWeight);
629  saveData(os, myGlobalAverage);
630  saveData(os, myGlobalAverageMax);
631  saveData(os, myExternalFriction);
632  saveData(os, mySelfFriction);
633  saveData(os, myStaticThreshold);
634  saveData(os, myKineticScale);
635  saveData(os, myResetKey);
636  saveData(os, myUpdateOverlap);
637 
638  }
639 
640  bool load(UT_IStream &is)
641  {
642  int32 v;
643  is.bread(&v, 1);
644  if (version() != v)
645  {
646  // Fail incompatible versions
647  return false;
648  }
649  loadData(is, myPrevpos);
650  loadData(is, myDisableSelfAttr);
651  loadData(is, myDisableExternalAttr);
652  loadData(is, myThickness);
653  loadData(is, myDoSelf);
654  loadData(is, myDoSelfEdges);
655  loadData(is, myDoExternalEdges);
656  loadData(is, myUpdateDisable);
657  loadData(is, myResetDetangledPoints);
658  loadData(is, myDoresolve);
659  loadData(is, myUpdatehitnmls);
660  loadData(is, myRootFinder);
661  loadData(is, myDojacobi);
662  loadData(is, myResolveScale);
663  loadData(is, myMaxWeight);
664  loadData(is, myGlobalAverage);
665  loadData(is, myGlobalAverageMax);
666  loadData(is, myExternalFriction);
667  loadData(is, mySelfFriction);
668  loadData(is, myStaticThreshold);
669  loadData(is, myKineticScale);
670  loadData(is, myResetKey);
671  loadData(is, myUpdateOverlap);
672 
673  return true;
674  }
675 
676  const UT_StringHolder & getPrevpos() const { return myPrevpos; }
677  void setPrevpos(const UT_StringHolder & val) { myPrevpos = val; }
679  {
680  SOP_Node *thissop = cookparms.getNode();
681  if (!thissop) return getPrevpos();
682  UT_StringHolder result;
683  OP_Utils::evalOpParm(result, thissop, "prevpos", cookparms.getCookTime(), 0);
684  return result;
685  }
686  const UT_StringHolder & getDisableSelfAttr() const { return myDisableSelfAttr; }
687  void setDisableSelfAttr(const UT_StringHolder & val) { myDisableSelfAttr = val; }
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getDisableSelfAttr();
692  UT_StringHolder result;
693  OP_Utils::evalOpParm(result, thissop, "disableselfattr", cookparms.getCookTime(), 0);
694  return result;
695  }
696  const UT_StringHolder & getDisableExternalAttr() const { return myDisableExternalAttr; }
697  void setDisableExternalAttr(const UT_StringHolder & val) { myDisableExternalAttr = val; }
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getDisableExternalAttr();
702  UT_StringHolder result;
703  OP_Utils::evalOpParm(result, thissop, "disableexternalattr", cookparms.getCookTime(), 0);
704  return result;
705  }
706  fpreal64 getThickness() const { return myThickness; }
707  void setThickness(fpreal64 val) { myThickness = val; }
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getThickness();
712  fpreal64 result;
713  OP_Utils::evalOpParm(result, thissop, "thickness", cookparms.getCookTime(), 0);
714  return result;
715  }
716  bool getDoSelf() const { return myDoSelf; }
717  void setDoSelf(bool val) { myDoSelf = val; }
718  bool opDoSelf(const SOP_NodeVerb::CookParms &cookparms) const
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getDoSelf();
722  bool result;
723  OP_Utils::evalOpParm(result, thissop, "doself", cookparms.getCookTime(), 0);
724  return result;
725  }
726  bool getDoSelfEdges() const { return myDoSelfEdges; }
727  void setDoSelfEdges(bool val) { myDoSelfEdges = val; }
728  bool opDoSelfEdges(const SOP_NodeVerb::CookParms &cookparms) const
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getDoSelfEdges();
732  bool result;
733  OP_Utils::evalOpParm(result, thissop, "doselfedge", cookparms.getCookTime(), 0);
734  return result;
735  }
736  bool getDoExternalEdges() const { return myDoExternalEdges; }
737  void setDoExternalEdges(bool val) { myDoExternalEdges = val; }
738  bool opDoExternalEdges(const SOP_NodeVerb::CookParms &cookparms) const
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getDoExternalEdges();
742  bool result;
743  OP_Utils::evalOpParm(result, thissop, "doexternaledge", cookparms.getCookTime(), 0);
744  return result;
745  }
746  bool getUpdateDisable() const { return myUpdateDisable; }
747  void setUpdateDisable(bool val) { myUpdateDisable = val; }
748  bool opUpdateDisable(const SOP_NodeVerb::CookParms &cookparms) const
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getUpdateDisable();
752  bool result;
753  OP_Utils::evalOpParm(result, thissop, "updatedisable", cookparms.getCookTime(), 0);
754  return result;
755  }
756  bool getResetDetangledPoints() const { return myResetDetangledPoints; }
757  void setResetDetangledPoints(bool val) { myResetDetangledPoints = val; }
758  bool opResetDetangledPoints(const SOP_NodeVerb::CookParms &cookparms) const
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getResetDetangledPoints();
762  bool result;
763  OP_Utils::evalOpParm(result, thissop, "resetdetangled", cookparms.getCookTime(), 0);
764  return result;
765  }
766  bool getDoresolve() const { return myDoresolve; }
767  void setDoresolve(bool val) { myDoresolve = val; }
768  bool opDoresolve(const SOP_NodeVerb::CookParms &cookparms) const
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getDoresolve();
772  bool result;
773  OP_Utils::evalOpParm(result, thissop, "doresolve", cookparms.getCookTime(), 0);
774  return result;
775  }
776  bool getUpdatehitnmls() const { return myUpdatehitnmls; }
777  void setUpdatehitnmls(bool val) { myUpdatehitnmls = val; }
778  bool opUpdatehitnmls(const SOP_NodeVerb::CookParms &cookparms) const
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getUpdatehitnmls();
782  bool result;
783  OP_Utils::evalOpParm(result, thissop, "updatehitnmls", cookparms.getCookTime(), 0);
784  return result;
785  }
786  RootFinder getRootFinder() const { return RootFinder(myRootFinder); }
787  void setRootFinder(RootFinder val) { myRootFinder = int64(val); }
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getRootFinder();
792  int64 result;
793  OP_Utils::evalOpParm(result, thissop, "rootfinder", cookparms.getCookTime(), 0);
794  return RootFinder(result);
795  }
796  bool getDojacobi() const { return myDojacobi; }
797  void setDojacobi(bool val) { myDojacobi = val; }
798  bool opDojacobi(const SOP_NodeVerb::CookParms &cookparms) const
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getDojacobi();
802  bool result;
803  OP_Utils::evalOpParm(result, thissop, "dojacobi", cookparms.getCookTime(), 0);
804  return result;
805  }
806  fpreal64 getResolveScale() const { return myResolveScale; }
807  void setResolveScale(fpreal64 val) { myResolveScale = val; }
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return getResolveScale();
812  fpreal64 result;
813  OP_Utils::evalOpParm(result, thissop, "resolvescale", cookparms.getCookTime(), 0);
814  return result;
815  }
816  fpreal64 getMaxWeight() const { return myMaxWeight; }
817  void setMaxWeight(fpreal64 val) { myMaxWeight = val; }
819  {
820  SOP_Node *thissop = cookparms.getNode();
821  if (!thissop) return getMaxWeight();
822  fpreal64 result;
823  OP_Utils::evalOpParm(result, thissop, "maxweight", cookparms.getCookTime(), 0);
824  return result;
825  }
826  bool getGlobalAverage() const { return myGlobalAverage; }
827  void setGlobalAverage(bool val) { myGlobalAverage = val; }
828  bool opGlobalAverage(const SOP_NodeVerb::CookParms &cookparms) const
829  {
830  SOP_Node *thissop = cookparms.getNode();
831  if (!thissop) return getGlobalAverage();
832  bool result;
833  OP_Utils::evalOpParm(result, thissop, "globalaverage", cookparms.getCookTime(), 0);
834  return result;
835  }
836  int64 getGlobalAverageMax() const { return myGlobalAverageMax; }
837  void setGlobalAverageMax(int64 val) { myGlobalAverageMax = val; }
839  {
840  SOP_Node *thissop = cookparms.getNode();
841  if (!thissop) return getGlobalAverageMax();
842  int64 result;
843  OP_Utils::evalOpParm(result, thissop, "globalaveragemax", cookparms.getCookTime(), 0);
844  return result;
845  }
846  fpreal64 getExternalFriction() const { return myExternalFriction; }
847  void setExternalFriction(fpreal64 val) { myExternalFriction = val; }
849  {
850  SOP_Node *thissop = cookparms.getNode();
851  if (!thissop) return getExternalFriction();
852  fpreal64 result;
853  OP_Utils::evalOpParm(result, thissop, "externalfriction", cookparms.getCookTime(), 0);
854  return result;
855  }
856  fpreal64 getSelfFriction() const { return mySelfFriction; }
857  void setSelfFriction(fpreal64 val) { mySelfFriction = val; }
859  {
860  SOP_Node *thissop = cookparms.getNode();
861  if (!thissop) return getSelfFriction();
862  fpreal64 result;
863  OP_Utils::evalOpParm(result, thissop, "selffriction", cookparms.getCookTime(), 0);
864  return result;
865  }
866  fpreal64 getStaticThreshold() const { return myStaticThreshold; }
867  void setStaticThreshold(fpreal64 val) { myStaticThreshold = val; }
869  {
870  SOP_Node *thissop = cookparms.getNode();
871  if (!thissop) return getStaticThreshold();
872  fpreal64 result;
873  OP_Utils::evalOpParm(result, thissop, "static_threshold", cookparms.getCookTime(), 0);
874  return result;
875  }
876  fpreal64 getKineticScale() const { return myKineticScale; }
877  void setKineticScale(fpreal64 val) { myKineticScale = val; }
879  {
880  SOP_Node *thissop = cookparms.getNode();
881  if (!thissop) return getKineticScale();
882  fpreal64 result;
883  OP_Utils::evalOpParm(result, thissop, "kinetic_scale", cookparms.getCookTime(), 0);
884  return result;
885  }
886  fpreal64 getResetKey() const { return myResetKey; }
887  void setResetKey(fpreal64 val) { myResetKey = val; }
889  {
890  SOP_Node *thissop = cookparms.getNode();
891  if (!thissop) return getResetKey();
892  fpreal64 result;
893  OP_Utils::evalOpParm(result, thissop, "resetkey", cookparms.getCookTime(), 0);
894  return result;
895  }
896  bool getUpdateOverlap() const { return myUpdateOverlap; }
897  void setUpdateOverlap(bool val) { myUpdateOverlap = val; }
898  bool opUpdateOverlap(const SOP_NodeVerb::CookParms &cookparms) const
899  {
900  SOP_Node *thissop = cookparms.getNode();
901  if (!thissop) return getUpdateOverlap();
902  bool result;
903  OP_Utils::evalOpParm(result, thissop, "updateoverlap", cookparms.getCookTime(), 0);
904  return result;
905  }
906 
907 private:
908  UT_StringHolder myPrevpos;
909  UT_StringHolder myDisableSelfAttr;
910  UT_StringHolder myDisableExternalAttr;
911  fpreal64 myThickness;
912  bool myDoSelf;
913  bool myDoSelfEdges;
914  bool myDoExternalEdges;
915  bool myUpdateDisable;
916  bool myResetDetangledPoints;
917  bool myDoresolve;
918  bool myUpdatehitnmls;
919  int64 myRootFinder;
920  bool myDojacobi;
921  fpreal64 myResolveScale;
922  fpreal64 myMaxWeight;
923  bool myGlobalAverage;
924  int64 myGlobalAverageMax;
925  fpreal64 myExternalFriction;
926  fpreal64 mySelfFriction;
927  fpreal64 myStaticThreshold;
928  fpreal64 myKineticScale;
929  fpreal64 myResetKey;
930  bool myUpdateOverlap;
931 
932 };
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 getResetKey() const
void getParmValue(exint idx, UT_Matrix2D &value) const
void getParmValue(exint idx, UT_Vector2D &value) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getParmValue(exint idx, UT_Vector4D &value) const
static void saveData(std::ostream &os, int64 v)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:492
T & z(void)
Definition: UT_Vector4.h:372
void setSelfFriction(fpreal64 val)
bool opDoExternalEdges(const SOP_NodeVerb::CookParms &cookparms) const
bool getDoSelf() const
bool operator==(const SOP_DetangleParms &src) const
static void saveData(std::ostream &os, fpreal64 v)
void setGlobalAverageMax(int64 val)
void getParmValue(exint idx, PRM_DataItemHandle &value) const
bool opUpdatehitnmls(const SOP_NodeVerb::CookParms &cookparms) const
int64 opGlobalAverageMax(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
fpreal getTime() const
Definition: OP_Context.h:34
void setThickness(fpreal64 val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const GLdouble * v
Definition: glcorearb.h:836
void setKineticScale(fpreal64 val)
fpreal64 getSelfFriction() const
static void saveData(std::ostream &os, UT_StringHolder s)
void getParmValue(exint idx, exint &value) const
bool getDoExternalEdges() const
fpreal64 getExternalFriction() const
T & x(void)
Definition: UT_Vector2.h:284
const UT_StringHolder & getPrevpos() const
An output stream object that owns its own string buffer storage.
fpreal64 opStaticThreshold(const SOP_NodeVerb::CookParms &cookparms) const
void setMaxWeight(fpreal64 val)
void setExternalFriction(fpreal64 val)
static void saveData(std::ostream &os, bool v)
UT_StringHolder opDisableSelfAttr(const SOP_NodeVerb::CookParms &cookparms) const
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
RootFinder getRootFinder() const
void getParmValue(exint idx, UT_Matrix4D &value) const
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:581
void getParmValue(exint idx, UT_Vector3D &value) const
void setDojacobi(bool val)
fpreal64 opResolveScale(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getKineticScale() const
fpreal64 getResolveScale() const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_StringHolder & getDisableSelfAttr() const
bool opDojacobi(const SOP_NodeVerb::CookParms &cookparms) const
bool getDoSelfEdges() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setDisableSelfAttr(const UT_StringHolder &val)
virtual void copyFrom(const SOP_NodeParms *src)
bool getUpdateOverlap() const
bool opDoresolve(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(exint idx, T &value) const
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:585
void doSetParmValue(exint idx, const T &value)
fpreal64 opExternalFriction(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:100
void setDoSelf(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setResetKey(fpreal64 val)
exint length() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
bool getDojacobi() const
SYS_FORCE_INLINE const char * buffer() const
void setUpdateDisable(bool val)
void setParmValue(exint idx, const UT_Matrix4D &value)
int64 exint
Definition: SYS_Types.h:109
void setResetDetangledPoints(bool val)
static void loadData(UT_IStream &is, int64 &v)
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:185
void setPrevpos(const UT_StringHolder &val)
fpreal64 getStaticThreshold() const
void setParmValue(exint idx, const UT_StringHolder &value)
virtual ~SOP_DetangleParms()
fpreal64 opKineticScale(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Vector2D &value)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setUpdatehitnmls(bool val)
fpreal64 opThickness(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void getParmValue(exint idx, fpreal &value) const
GLboolean * data
Definition: glcorearb.h:130
void setDoresolve(bool val)
bool getResetDetangledPoints() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
int int32
Definition: SYS_Types.h:28
T & y(void)
Definition: UT_Vector4.h:370
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
fpreal64 getThickness() const
void setUpdateOverlap(bool val)
bool getUpdatehitnmls() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
UT_StringHolder opPrevpos(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
void setParmValue(exint idx, const exint &value)
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void save(std::ostream &os) const
bool opDoSelfEdges(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:583
virtual void loadFromOpSubclass(const LoadParms &loadparms)
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:263
void strncpy(const char *src, exint maxlen)
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
bool opGlobalAverage(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
fpreal64 opMaxWeight(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Vector4D &value)
fpreal64 opSelfFriction(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setParmValue(exint idx, const PRM_DataItemHandle &value)
bool getDoresolve() const
static void loadData(UT_IStream &is, fpreal64 &v)
void setParmValue(exint idx, const UT_Matrix2D &value)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void saveData(std::ostream &os, UT_Vector3D v)
GLuint GLfloat * val
Definition: glcorearb.h:1607
const UT_StringHolder & getDisableExternalAttr() const
bool getGlobalAverage() const
#define SOP_API
Definition: SOP_API.h:10
UT_StringHolder opDisableExternalAttr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool opUpdateDisable(const SOP_NodeVerb::CookParms &cookparms) const
const char * buffer() const
static void saveData(std::ostream &os, UT_Vector2D v)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:499
void getParmValue(exint idx, UT_StringHolder &value) const
T & x(void)
Definition: UT_Vector4.h:368
void setGlobalAverage(bool val)
void setDoExternalEdges(bool val)
bool opDoSelf(const SOP_NodeVerb::CookParms &cookparms) const
virtual exint getNumParms() const
T & y(void)
Definition: UT_Vector2.h:286
void getParmValue(exint idx, UT_Matrix3D &value) const
void setStaticThreshold(fpreal64 val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setParmValue(exint idx, const UT_Vector3D &value)
void setDoSelfEdges(bool val)
GLboolean r
Definition: glcorearb.h:1221
bool opResetDetangledPoints(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 getGlobalAverageMax() const
T & w(void)
Definition: UT_Vector4.h:374
void setResolveScale(fpreal64 val)
virtual ParmType getParmType(exint fieldnum) const
void setParmValue(exint idx, const fpreal &value)
bool load(UT_IStream &is)
fpreal64 opResetKey(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool getUpdateDisable() const
void setParmValue(exint idx, const UT_Matrix3D &value)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
virtual const char * getParmName(exint fieldnum) const
SYS_FORCE_INLINE bool isstring() const
void setRootFinder(RootFinder val)
bool opUpdateOverlap(const SOP_NodeVerb::CookParms &cookparms) const
void setDisableExternalAttr(const UT_StringHolder &val)
fpreal64 getMaxWeight() const
RootFinder opRootFinder(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1792