HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_TopoTransfer.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_TopoTransferEnums
24 {
26  {
27  AUTO = 0,
28  MANUAL
29  };
30 
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case ConstraintSelection::AUTO: return "auto"_sh;
37  case ConstraintSelection::MANUAL: return "manual"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class MaskMode
43  {
44  MASKOFF = 0,
45  MASKON
46  };
47 
49  getToken(MaskMode enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case MaskMode::MASKOFF: return "maskoff"_sh;
54  case MaskMode::MASKON: return "maskon"_sh;
55  default: UT_ASSERT(false); return ""_sh;
56  }
57  }
58 
59  enum class SolverType
60  {
61  NONLINEAR = 0,
62  LINEAR
63  };
64 
66  getToken(SolverType enum_value)
67  {
68  using namespace UT::Literal;
69  switch (enum_value) {
70  case SolverType::NONLINEAR: return "nonlinear"_sh;
71  case SolverType::LINEAR: return "linear"_sh;
72  default: UT_ASSERT(false); return ""_sh;
73  }
74  }
75 
76  enum class Debug_menu
77  {
78  SHOW_NONE = 0,
81  };
82 
84  getToken(Debug_menu enum_value)
85  {
86  using namespace UT::Literal;
87  switch (enum_value) {
88  case Debug_menu::SHOW_NONE: return "show_none"_sh;
89  case Debug_menu::SHOW_COARSE: return "show_coarse"_sh;
90  case Debug_menu::SHOW_DENSE: return "show_dense"_sh;
91  default: UT_ASSERT(false); return ""_sh;
92  }
93  }
94 
95 }
96 
97 
99 {
100 public:
101  static int version() { return 1; }
103  {
113 
114 
116  {
117  enablegroup = true;
118  pballcolor = UT_Vector3D(0,0,1);
119  pname = "group#"_UTsh;
120  usesourcepos = true;
121  sourcepos = ""_UTsh;
122  usetargetpos = true;
123  targetpos = ""_UTsh;
124  psourcegroup = ""_UTsh;
125  ptargetgroup = ""_UTsh;
126 
127  }
128 
129  bool operator==(const Numlandmarkgroups &src) const
130  {
131  if (enablegroup != src.enablegroup) return false;
132  if (pballcolor != src.pballcolor) return false;
133  if (pname != src.pname) return false;
134  if (usesourcepos != src.usesourcepos) return false;
135  if (sourcepos != src.sourcepos) return false;
136  if (usetargetpos != src.usetargetpos) return false;
137  if (targetpos != src.targetpos) return false;
138  if (psourcegroup != src.psourcegroup) return false;
139  if (ptargetgroup != src.ptargetgroup) return false;
140 
141  return true;
142  }
143  bool operator!=(const Numlandmarkgroups &src) const
144  {
145  return !operator==(src);
146  }
147 
148  };
149 
151  {
153 
154  buf.strcat("[ ");
155  for (int i = 0; i < list.entries(); i++)
156  {
157  if (i)
158  buf.strcat(", ");
159  buf.strcat("( ");
160  buf.append("");
161  buf.appendSprintf("%s", (list(i).enablegroup) ? "true" : "false");
162  buf.append(", ");
163  buf.appendSprintf("(%f, %f, %f)", list(i).pballcolor.x(), list(i).pballcolor.y(), list(i).pballcolor.z());
164  buf.append(", ");
165  { UT_String tmp; tmp = UT_StringWrap(list(i).pname).makeQuotedString('"'); buf.strcat(tmp); }
166  buf.append(", ");
167  buf.appendSprintf("%s", (list(i).usesourcepos) ? "true" : "false");
168  buf.append(", ");
169  { UT_String tmp; tmp = UT_StringWrap(list(i).sourcepos).makeQuotedString('"'); buf.strcat(tmp); }
170  buf.append(", ");
171  buf.appendSprintf("%s", (list(i).usetargetpos) ? "true" : "false");
172  buf.append(", ");
173  { UT_String tmp; tmp = UT_StringWrap(list(i).targetpos).makeQuotedString('"'); buf.strcat(tmp); }
174  buf.append(", ");
175  { UT_String tmp; tmp = UT_StringWrap(list(i).psourcegroup).makeQuotedString('"'); buf.strcat(tmp); }
176  buf.append(", ");
177  { UT_String tmp; tmp = UT_StringWrap(list(i).ptargetgroup).makeQuotedString('"'); buf.strcat(tmp); }
178 
179  buf.strcat(" )");
180  }
181  buf.strcat(" ]");
182 
184  return result;
185  }
186 
188  {
189  myEnableSolve = true;
190  myEnableGeometryConstraints = false;
191  myConstraintSelection = 0;
192  myConstraintSource = ""_UTsh;
193  myIterations = 15;
194  myReducedLevels = 3;
195  myReductionPercentage = UT_Vector2D(0.1,0.9);
196  myReductionPercentageSingle = 0.1;
197  myInitialReductionPercentage = 0.1;
198  myRigidWeights = UT_Vector2D(1,0.001);
199  myLandmarkWeights = UT_Vector2D(100,100);
200  myMaskMode = 0;
201  myMaskTolerance = 1e-6;
202  myRigidprimitives = ""_UTsh;
203  myDistTolerance = 0.2;
204  myNormTolerance = 45;
205  mySolverType = 0;
206  mySolverIterations = 20;
207  myGradientTolerance = UT_Vector2D(0.01,0.003);
208  myDebug_menu = 0;
209  myDebug_coarse_lvl = 0;
210  myDebug_coarse_iteration = 0;
211  myDebug_dense_lvl = 0;
212  myDebug_dense_iteration = 0;
213  myDebug_hessian_scaling = true;
214  myDebug_use_marquadt = true;
215  myParameter_tolerance = 0.0001;
216  myUse_tau = false;
217  myTau = 0.000001;
218  myInitial_damping = 0.0001;
219  myDebug_save_meshes = false;
220  myUseLandmarkLables = true;
221  myLandmarkAttribute = "landmark"_UTsh;
222  myEnableLandmarks = true;
223  myNumlandmarkgroups.setSize(0);
224  myRigidMask = "rigid_mask"_UTsh;
225 
226  }
227 
228  explicit SOP_TopoTransferParms(const SOP_TopoTransferParms &) = default;
230  SOP_TopoTransferParms(SOP_TopoTransferParms &&) noexcept = default;
231  SOP_TopoTransferParms &operator=(SOP_TopoTransferParms &&) noexcept = default;
232 
233  ~SOP_TopoTransferParms() override {}
234 
236  {
237  if (myEnableSolve != src.myEnableSolve) return false;
238  if (myEnableGeometryConstraints != src.myEnableGeometryConstraints) return false;
239  if (myConstraintSelection != src.myConstraintSelection) return false;
240  if (myConstraintSource != src.myConstraintSource) return false;
241  if (myIterations != src.myIterations) return false;
242  if (myReducedLevels != src.myReducedLevels) return false;
243  if (myReductionPercentage != src.myReductionPercentage) return false;
244  if (myReductionPercentageSingle != src.myReductionPercentageSingle) return false;
245  if (myInitialReductionPercentage != src.myInitialReductionPercentage) return false;
246  if (myRigidWeights != src.myRigidWeights) return false;
247  if (myLandmarkWeights != src.myLandmarkWeights) return false;
248  if (myMaskMode != src.myMaskMode) return false;
249  if (myMaskTolerance != src.myMaskTolerance) return false;
250  if (myRigidprimitives != src.myRigidprimitives) return false;
251  if (myDistTolerance != src.myDistTolerance) return false;
252  if (myNormTolerance != src.myNormTolerance) return false;
253  if (mySolverType != src.mySolverType) return false;
254  if (mySolverIterations != src.mySolverIterations) return false;
255  if (myGradientTolerance != src.myGradientTolerance) return false;
256  if (myDebug_menu != src.myDebug_menu) return false;
257  if (myDebug_coarse_lvl != src.myDebug_coarse_lvl) return false;
258  if (myDebug_coarse_iteration != src.myDebug_coarse_iteration) return false;
259  if (myDebug_dense_lvl != src.myDebug_dense_lvl) return false;
260  if (myDebug_dense_iteration != src.myDebug_dense_iteration) return false;
261  if (myDebug_hessian_scaling != src.myDebug_hessian_scaling) return false;
262  if (myDebug_use_marquadt != src.myDebug_use_marquadt) return false;
263  if (myParameter_tolerance != src.myParameter_tolerance) return false;
264  if (myUse_tau != src.myUse_tau) return false;
265  if (myTau != src.myTau) return false;
266  if (myInitial_damping != src.myInitial_damping) return false;
267  if (myDebug_save_meshes != src.myDebug_save_meshes) return false;
268  if (myUseLandmarkLables != src.myUseLandmarkLables) return false;
269  if (myLandmarkAttribute != src.myLandmarkAttribute) return false;
270  if (myEnableLandmarks != src.myEnableLandmarks) return false;
271  if (myNumlandmarkgroups != src.myNumlandmarkgroups) return false;
272  if (myRigidMask != src.myRigidMask) return false;
273 
274  return true;
275  }
277  {
278  return !operator==(src);
279  }
284 
285 
286 
287  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
288  {
289  myEnableSolve = true;
290  if (true)
291  graph->evalOpParm(myEnableSolve, nodeidx, "enablesolve", time, 0);
292  myEnableGeometryConstraints = false;
293  if (true)
294  graph->evalOpParm(myEnableGeometryConstraints, nodeidx, "enablegeometryconstraints", time, 0);
295  myConstraintSelection = 0;
296  if (true && ( (true&&!(((getEnableGeometryConstraints()==0)))) ) )
297  graph->evalOpParm(myConstraintSelection, nodeidx, "constraintselection", time, 0);
298  myConstraintSource = ""_UTsh;
299  if (true && ( (true&&!(((int64(getConstraintSelection())==0)))) ) )
300  graph->evalOpParm(myConstraintSource, nodeidx, "constraintsource", time, 0);
301  myIterations = 15;
302  if (true)
303  graph->evalOpParm(myIterations, nodeidx, "iterations", time, 0);
304  myReducedLevels = 3;
305  if (true)
306  graph->evalOpParm(myReducedLevels, nodeidx, "reducedlevels", time, 0);
307  myReductionPercentage = UT_Vector2D(0.1,0.9);
308  if (true && ( (true&&!(((int64(getReducedLevels())<=1))||((getEnableGeometryConstraints()==1)))) ) )
309  graph->evalOpParm(myReductionPercentage, nodeidx, "reductionpercentage", time, 0);
310  myReductionPercentageSingle = 0.1;
311  if (true && ( (true&&!(((int64(getReducedLevels())>1))||((getEnableGeometryConstraints()==1)))) ) )
312  graph->evalOpParm(myReductionPercentageSingle, nodeidx, "reductionpercentage_single", time, 0);
313  myInitialReductionPercentage = 0.1;
314  if (true && ( (true&&!(((int64(getReducedLevels())<=1))||((getEnableGeometryConstraints()==0)))) ) )
315  graph->evalOpParm(myInitialReductionPercentage, nodeidx, "initialreductionpercentage", time, 0);
316  myRigidWeights = UT_Vector2D(1,0.001);
317  if (true)
318  graph->evalOpParm(myRigidWeights, nodeidx, "rigidweights", time, 0);
319  myLandmarkWeights = UT_Vector2D(100,100);
320  if (true)
321  graph->evalOpParm(myLandmarkWeights, nodeidx, "landmarkweights", time, 0);
322  myMaskMode = 0;
323  if (true)
324  graph->evalOpParm(myMaskMode, nodeidx, "maskmode", time, 0);
325  myMaskTolerance = 1e-6;
326  if (true && ( (true&&!(((int64(getMaskMode())==0)))) ) )
327  graph->evalOpParm(myMaskTolerance, nodeidx, "masktolerance", time, 0);
328  myRigidprimitives = ""_UTsh;
329  if (true)
330  graph->evalOpParm(myRigidprimitives, nodeidx, "rigidprimitives", time, 0);
331  myDistTolerance = 0.2;
332  if (true)
333  graph->evalOpParm(myDistTolerance, nodeidx, "disttolerance", time, 0);
334  myNormTolerance = 45;
335  if (true)
336  graph->evalOpParm(myNormTolerance, nodeidx, "normtolerance", time, 0);
337  mySolverType = 0;
338  if (true)
339  graph->evalOpParm(mySolverType, nodeidx, "solvertype", time, 0);
340  mySolverIterations = 20;
341  if (true && ( (true&&!(((int64(getSolverType())!=0)))) ) )
342  graph->evalOpParm(mySolverIterations, nodeidx, "solveriterations", time, 0);
343  myGradientTolerance = UT_Vector2D(0.01,0.003);
344  if (true && ( (true&&!(((int64(getSolverType())!=0)))) ) )
345  graph->evalOpParm(myGradientTolerance, nodeidx, "gradienttolerance", time, 0);
346  myDebug_menu = 0;
347  if (true)
348  graph->evalOpParm(myDebug_menu, nodeidx, "debug_menu", time, 0);
349  myDebug_coarse_lvl = 0;
350  if (true && ( (true&&!(((int64(getDebug_menu())!=1)))) ) )
351  graph->evalOpParm(myDebug_coarse_lvl, nodeidx, "debug_coarse_lvl", time, 0);
352  myDebug_coarse_iteration = 0;
353  if (true && ( (true&&!(((int64(getDebug_menu())!=1)))) ) )
354  graph->evalOpParm(myDebug_coarse_iteration, nodeidx, "debug_coarse_iteration", time, 0);
355  myDebug_dense_lvl = 0;
356  if (true && ( (true&&!(((int64(getDebug_menu())!=2)))) ) )
357  graph->evalOpParm(myDebug_dense_lvl, nodeidx, "debug_dense_lvl", time, 0);
358  myDebug_dense_iteration = 0;
359  if (true && ( (true&&!(((int64(getDebug_menu())!=2)))) ) )
360  graph->evalOpParm(myDebug_dense_iteration, nodeidx, "debug_dense_iteration", time, 0);
361  myDebug_hessian_scaling = true;
362  if (true)
363  graph->evalOpParm(myDebug_hessian_scaling, nodeidx, "debug_hessian_scaling", time, 0);
364  myDebug_use_marquadt = true;
365  if (true)
366  graph->evalOpParm(myDebug_use_marquadt, nodeidx, "debug_use_marquadt", time, 0);
367  myParameter_tolerance = 0.0001;
368  if (true)
369  graph->evalOpParm(myParameter_tolerance, nodeidx, "parameter_tolerance", time, 0);
370  myUse_tau = false;
371  if (true)
372  graph->evalOpParm(myUse_tau, nodeidx, "use_tau", time, 0);
373  myTau = 0.000001;
374  if (true && ( (true&&!(((getUse_tau()!=1)))) ) )
375  graph->evalOpParm(myTau, nodeidx, "tau", time, 0);
376  myInitial_damping = 0.0001;
377  if (true && ( (true&&!(((getUse_tau()==1)))) ) )
378  graph->evalOpParm(myInitial_damping, nodeidx, "initial_damping", time, 0);
379  myDebug_save_meshes = false;
380  if (true)
381  graph->evalOpParm(myDebug_save_meshes, nodeidx, "debug_save_meshes", time, 0);
382  myUseLandmarkLables = true;
383  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0))||(((graph->getInput(nodeidx,3)>=0)==0)))) ) )
384  graph->evalOpParm(myUseLandmarkLables, nodeidx, "uselandmarklabels", time, 0);
385  myLandmarkAttribute = "landmark"_UTsh;
386  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0))||(((graph->getInput(nodeidx,3)>=0)==0))||((getUseLandmarkLables()==0)))) ) )
387  graph->evalOpParm(myLandmarkAttribute, nodeidx, "landmarkattrib", time, 0);
388  myEnableLandmarks = true;
389  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1)))) ) )
390  graph->evalOpParm(myEnableLandmarks, nodeidx, "enablelandmarks", time, 0);
391  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) )
392  {
393  int64 length = 0;
394  graph->evalOpParm(length, nodeidx, "numlandmarkgroups", time, 0);
395  if (length < 0) length = 0;
396  myNumlandmarkgroups.setSize(length);
397  for (exint i = 0; i < length; i++)
398  {
399  int parmidx[1];
400  int offsets[1];
401  parmidx[0] = i+1;
402  offsets[0] = 1;
403  auto && _curentry = myNumlandmarkgroups(i);
404  (void) _curentry;
405  _curentry.enablegroup = true;
406  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) )
407  graph->evalOpParmInst(_curentry.enablegroup, nodeidx, "enablegroup#", parmidx, offsets, time, 0, 2-1);
408  _curentry.pballcolor = UT_Vector3D(0,0,1);
409  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0)))) ) )
410  graph->evalOpParmInst(_curentry.pballcolor, nodeidx, "pballcolor#", parmidx, offsets, time, 0, 2-1);
411  _curentry.pname = "group#"_UTsh;
412  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0)))) ) )
413  graph->evalOpParmInst(_curentry.pname, nodeidx, "pname#", parmidx, offsets, time, 0, 2-1);
414  _curentry.usesourcepos = true;
415  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0)))) ) )
416  graph->evalOpParmInst(_curentry.usesourcepos, nodeidx, "usesourcepos#", parmidx, offsets, time, 0, 2-1);
417  _curentry.sourcepos = ""_UTsh;
418  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0))||((_curentry.usesourcepos==0)))) ) )
419  graph->evalOpParmInst(_curentry.sourcepos, nodeidx, "sourcepos#", parmidx, offsets, time, 0, 2-1);
420  _curentry.usetargetpos = true;
421  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0)))) ) )
422  graph->evalOpParmInst(_curentry.usetargetpos, nodeidx, "usetargetpos#", parmidx, offsets, time, 0, 2-1);
423  _curentry.targetpos = ""_UTsh;
424  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0))||((_curentry.usetargetpos==0)))) ) )
425  graph->evalOpParmInst(_curentry.targetpos, nodeidx, "targetpos#", parmidx, offsets, time, 0, 2-1);
426  _curentry.psourcegroup = ""_UTsh;
427  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0))||((_curentry.usesourcepos==1)))) ) )
428  graph->evalOpParmInst(_curentry.psourcegroup, nodeidx, "psourcegroup#", parmidx, offsets, time, 0, 2-1);
429  _curentry.ptargetgroup = ""_UTsh;
430  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0))||((_curentry.enablegroup==0))||((_curentry.usetargetpos==1)))) ) )
431  graph->evalOpParmInst(_curentry.ptargetgroup, nodeidx, "ptargetgroup#", parmidx, offsets, time, 0, 2-1);
432 
433  }
434  }
435  else
436  myNumlandmarkgroups.clear();
437  myRigidMask = "rigid_mask"_UTsh;
438  if (true && ( (true&&!(((int64(getMaskMode())==0)))) ) )
439  graph->evalOpParm(myRigidMask, nodeidx, "rigidmask", time, 0);
440 
441  }
442 
443 
444  void loadFromOpSubclass(const LoadParms &loadparms) override
445  {
446  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
447  }
448 
449 
450  void copyFrom(const OP_NodeParms *src) override
451  {
452  *this = *((const SOP_TopoTransferParms *)src);
453  }
454 
455  template <typename T>
456  void
457  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
458  {
459  if (idx.size() < 1)
460  return;
461  UT_ASSERT(idx.size() == instance.size()+1);
462  if (idx.size() != instance.size()+1)
463  return;
464  switch (idx[0])
465  {
466  case 0:
467  coerceValue(value, myEnableSolve);
468  break;
469  case 1:
470  coerceValue(value, myEnableGeometryConstraints);
471  break;
472  case 2:
473  coerceValue(value, myConstraintSelection);
474  break;
475  case 3:
476  coerceValue(value, myConstraintSource);
477  break;
478  case 4:
479  coerceValue(value, myIterations);
480  break;
481  case 5:
482  coerceValue(value, myReducedLevels);
483  break;
484  case 6:
485  coerceValue(value, myReductionPercentage);
486  break;
487  case 7:
488  coerceValue(value, myReductionPercentageSingle);
489  break;
490  case 8:
491  coerceValue(value, myInitialReductionPercentage);
492  break;
493  case 9:
494  coerceValue(value, myRigidWeights);
495  break;
496  case 10:
497  coerceValue(value, myLandmarkWeights);
498  break;
499  case 11:
500  coerceValue(value, myMaskMode);
501  break;
502  case 12:
503  coerceValue(value, myMaskTolerance);
504  break;
505  case 13:
506  coerceValue(value, myRigidprimitives);
507  break;
508  case 14:
509  coerceValue(value, myDistTolerance);
510  break;
511  case 15:
512  coerceValue(value, myNormTolerance);
513  break;
514  case 16:
515  coerceValue(value, mySolverType);
516  break;
517  case 17:
518  coerceValue(value, mySolverIterations);
519  break;
520  case 18:
521  coerceValue(value, myGradientTolerance);
522  break;
523  case 19:
524  coerceValue(value, myDebug_menu);
525  break;
526  case 20:
527  coerceValue(value, myDebug_coarse_lvl);
528  break;
529  case 21:
530  coerceValue(value, myDebug_coarse_iteration);
531  break;
532  case 22:
533  coerceValue(value, myDebug_dense_lvl);
534  break;
535  case 23:
536  coerceValue(value, myDebug_dense_iteration);
537  break;
538  case 24:
539  coerceValue(value, myDebug_hessian_scaling);
540  break;
541  case 25:
542  coerceValue(value, myDebug_use_marquadt);
543  break;
544  case 26:
545  coerceValue(value, myParameter_tolerance);
546  break;
547  case 27:
548  coerceValue(value, myUse_tau);
549  break;
550  case 28:
551  coerceValue(value, myTau);
552  break;
553  case 29:
554  coerceValue(value, myInitial_damping);
555  break;
556  case 30:
557  coerceValue(value, myDebug_save_meshes);
558  break;
559  case 31:
560  coerceValue(value, myUseLandmarkLables);
561  break;
562  case 32:
563  coerceValue(value, myLandmarkAttribute);
564  break;
565  case 33:
566  coerceValue(value, myEnableLandmarks);
567  break;
568  case 34:
569  if (idx.size() == 1)
570  coerceValue(value, myNumlandmarkgroups.entries());
571  else if (instance[0] < myNumlandmarkgroups.entries())
572  {
573  auto && _data = myNumlandmarkgroups(instance[0]);
574  switch (idx[1])
575  {
576  case 0:
577  coerceValue(value, _data.enablegroup);
578  break;
579  case 1:
580  coerceValue(value, _data.pballcolor);
581  break;
582  case 2:
583  coerceValue(value, _data.pname);
584  break;
585  case 3:
586  coerceValue(value, _data.usesourcepos);
587  break;
588  case 4:
589  coerceValue(value, _data.sourcepos);
590  break;
591  case 5:
592  coerceValue(value, _data.usetargetpos);
593  break;
594  case 6:
595  coerceValue(value, _data.targetpos);
596  break;
597  case 7:
598  coerceValue(value, _data.psourcegroup);
599  break;
600  case 8:
601  coerceValue(value, _data.ptargetgroup);
602  break;
603 
604  }
605  }
606  break;
607  case 35:
608  coerceValue(value, myRigidMask);
609  break;
610 
611  }
612  }
613 
614  bool isParmColorRamp(exint idx) const override
615  {
616  switch (idx)
617  {
618 
619  }
620  return false;
621  }
622 
623  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
624  { doGetParmValue(idx, instance, value); }
625  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
626  { doGetParmValue(idx, instance, value); }
627  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
628  { doGetParmValue(idx, instance, value); }
629  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
630  { doGetParmValue(idx, instance, value); }
631  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
632  { doGetParmValue(idx, instance, value); }
633  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
634  { doGetParmValue(idx, instance, value); }
635  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
636  { doGetParmValue(idx, instance, value); }
637  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
638  { doGetParmValue(idx, instance, value); }
639  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
640  { doGetParmValue(idx, instance, value); }
641  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
642  { doGetParmValue(idx, instance, value); }
643  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
644  { doGetParmValue(idx, instance, value); }
645 
646  template <typename T>
647  void
648  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
649  {
650  if (idx.size() < 1)
651  return;
652  UT_ASSERT(idx.size() == instance.size()+1);
653  if (idx.size() != instance.size()+1)
654  return;
655  switch (idx[0])
656  {
657  case 0:
658  coerceValue(myEnableSolve, ( ( value ) ));
659  break;
660  case 1:
661  coerceValue(myEnableGeometryConstraints, ( ( value ) ));
662  break;
663  case 2:
664  coerceValue(myConstraintSelection, clampMinValue(0, clampMaxValue(1, value ) ));
665  break;
666  case 3:
667  coerceValue(myConstraintSource, ( ( value ) ));
668  break;
669  case 4:
670  coerceValue(myIterations, clampMinValue(1, ( value ) ));
671  break;
672  case 5:
673  coerceValue(myReducedLevels, clampMinValue(1, ( value ) ));
674  break;
675  case 6:
676  coerceValue(myReductionPercentage, clampMinValue(0.05, clampMaxValue(1, value ) ));
677  break;
678  case 7:
679  coerceValue(myReductionPercentageSingle, clampMinValue(0.05, clampMaxValue(1, value ) ));
680  break;
681  case 8:
682  coerceValue(myInitialReductionPercentage, clampMinValue(0.05, clampMaxValue(1, value ) ));
683  break;
684  case 9:
685  coerceValue(myRigidWeights, clampMinValue(0, ( value ) ));
686  break;
687  case 10:
688  coerceValue(myLandmarkWeights, clampMinValue(0, ( value ) ));
689  break;
690  case 11:
691  coerceValue(myMaskMode, clampMinValue(0, clampMaxValue(1, value ) ));
692  break;
693  case 12:
694  coerceValue(myMaskTolerance, clampMinValue(0.0, clampMaxValue(1, value ) ));
695  break;
696  case 13:
697  coerceValue(myRigidprimitives, ( ( value ) ));
698  break;
699  case 14:
700  coerceValue(myDistTolerance, clampMinValue(0.0001, ( value ) ));
701  break;
702  case 15:
703  coerceValue(myNormTolerance, clampMinValue(1, clampMaxValue(180, value ) ));
704  break;
705  case 16:
706  coerceValue(mySolverType, clampMinValue(0, clampMaxValue(1, value ) ));
707  break;
708  case 17:
709  coerceValue(mySolverIterations, clampMinValue(1, ( value ) ));
710  break;
711  case 18:
712  coerceValue(myGradientTolerance, clampMinValue(0.00001, clampMaxValue(1.0, value ) ));
713  break;
714  case 19:
715  coerceValue(myDebug_menu, clampMinValue(0, clampMaxValue(2, value ) ));
716  break;
717  case 20:
718  coerceValue(myDebug_coarse_lvl, ( ( value ) ));
719  break;
720  case 21:
721  coerceValue(myDebug_coarse_iteration, ( ( value ) ));
722  break;
723  case 22:
724  coerceValue(myDebug_dense_lvl, ( ( value ) ));
725  break;
726  case 23:
727  coerceValue(myDebug_dense_iteration, ( ( value ) ));
728  break;
729  case 24:
730  coerceValue(myDebug_hessian_scaling, ( ( value ) ));
731  break;
732  case 25:
733  coerceValue(myDebug_use_marquadt, ( ( value ) ));
734  break;
735  case 26:
736  coerceValue(myParameter_tolerance, ( ( value ) ));
737  break;
738  case 27:
739  coerceValue(myUse_tau, ( ( value ) ));
740  break;
741  case 28:
742  coerceValue(myTau, ( ( value ) ));
743  break;
744  case 29:
745  coerceValue(myInitial_damping, ( ( value ) ));
746  break;
747  case 30:
748  coerceValue(myDebug_save_meshes, ( ( value ) ));
749  break;
750  case 31:
751  coerceValue(myUseLandmarkLables, ( ( value ) ));
752  break;
753  case 32:
754  coerceValue(myLandmarkAttribute, ( ( value ) ));
755  break;
756  case 33:
757  coerceValue(myEnableLandmarks, ( ( value ) ));
758  break;
759  case 34:
760  if (idx.size() == 1)
761  {
762  exint newsize;
763  coerceValue(newsize, value);
764  if (newsize < 0) newsize = 0;
765  myNumlandmarkgroups.setSize(newsize);
766  }
767  else
768  {
769  if (instance[0] < 0)
770  return;
771  myNumlandmarkgroups.setSizeIfNeeded(instance[0]+1);
772  auto && _data = myNumlandmarkgroups(instance[0]);
773  switch (idx[1])
774  {
775  case 0:
776  coerceValue(_data.enablegroup, value);
777  break;
778  case 1:
779  coerceValue(_data.pballcolor, value);
780  break;
781  case 2:
782  coerceValue(_data.pname, value);
783  break;
784  case 3:
785  coerceValue(_data.usesourcepos, value);
786  break;
787  case 4:
788  coerceValue(_data.sourcepos, value);
789  break;
790  case 5:
791  coerceValue(_data.usetargetpos, value);
792  break;
793  case 6:
794  coerceValue(_data.targetpos, value);
795  break;
796  case 7:
797  coerceValue(_data.psourcegroup, value);
798  break;
799  case 8:
800  coerceValue(_data.ptargetgroup, value);
801  break;
802 
803  }
804  }
805  break;
806  case 35:
807  coerceValue(myRigidMask, ( ( value ) ));
808  break;
809 
810  }
811  }
812 
813  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
814  { doSetParmValue(idx, instance, value); }
815  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
816  { doSetParmValue(idx, instance, value); }
817  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
818  { doSetParmValue(idx, instance, value); }
819  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
820  { doSetParmValue(idx, instance, value); }
821  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
822  { doSetParmValue(idx, instance, value); }
823  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
824  { doSetParmValue(idx, instance, value); }
825  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
826  { doSetParmValue(idx, instance, value); }
827  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
828  { doSetParmValue(idx, instance, value); }
829  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
830  { doSetParmValue(idx, instance, value); }
831  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
832  { doSetParmValue(idx, instance, value); }
833  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
834  { doSetParmValue(idx, instance, value); }
835 
836  exint getNestNumParms(TempIndex idx) const override
837  {
838  if (idx.size() == 0)
839  return 36;
840  switch (idx[0])
841  {
842  case 34:
843  return 9;
844 
845  }
846  // Invalid
847  return 0;
848  }
849 
850  const char *getNestParmName(TempIndex fieldnum) const override
851  {
852  if (fieldnum.size() < 1)
853  return 0;
854  switch (fieldnum[0])
855  {
856  case 0:
857  return "enablesolve";
858  case 1:
859  return "enablegeometryconstraints";
860  case 2:
861  return "constraintselection";
862  case 3:
863  return "constraintsource";
864  case 4:
865  return "iterations";
866  case 5:
867  return "reducedlevels";
868  case 6:
869  return "reductionpercentage";
870  case 7:
871  return "reductionpercentage_single";
872  case 8:
873  return "initialreductionpercentage";
874  case 9:
875  return "rigidweights";
876  case 10:
877  return "landmarkweights";
878  case 11:
879  return "maskmode";
880  case 12:
881  return "masktolerance";
882  case 13:
883  return "rigidprimitives";
884  case 14:
885  return "disttolerance";
886  case 15:
887  return "normtolerance";
888  case 16:
889  return "solvertype";
890  case 17:
891  return "solveriterations";
892  case 18:
893  return "gradienttolerance";
894  case 19:
895  return "debug_menu";
896  case 20:
897  return "debug_coarse_lvl";
898  case 21:
899  return "debug_coarse_iteration";
900  case 22:
901  return "debug_dense_lvl";
902  case 23:
903  return "debug_dense_iteration";
904  case 24:
905  return "debug_hessian_scaling";
906  case 25:
907  return "debug_use_marquadt";
908  case 26:
909  return "parameter_tolerance";
910  case 27:
911  return "use_tau";
912  case 28:
913  return "tau";
914  case 29:
915  return "initial_damping";
916  case 30:
917  return "debug_save_meshes";
918  case 31:
919  return "uselandmarklabels";
920  case 32:
921  return "landmarkattrib";
922  case 33:
923  return "enablelandmarks";
924  case 34:
925  if (fieldnum.size() == 1)
926  return "numlandmarkgroups";
927  switch (fieldnum[1])
928  {
929  case 0:
930  return "enablegroup#";
931  case 1:
932  return "pballcolor#";
933  case 2:
934  return "pname#";
935  case 3:
936  return "usesourcepos#";
937  case 4:
938  return "sourcepos#";
939  case 5:
940  return "usetargetpos#";
941  case 6:
942  return "targetpos#";
943  case 7:
944  return "psourcegroup#";
945  case 8:
946  return "ptargetgroup#";
947 
948  }
949  return 0;
950  case 35:
951  return "rigidmask";
952 
953  }
954  return 0;
955  }
956 
957  ParmType getNestParmType(TempIndex fieldnum) const override
958  {
959  if (fieldnum.size() < 1)
960  return PARM_UNSUPPORTED;
961  switch (fieldnum[0])
962  {
963  case 0:
964  return PARM_INTEGER;
965  case 1:
966  return PARM_INTEGER;
967  case 2:
968  return PARM_INTEGER;
969  case 3:
970  return PARM_STRING;
971  case 4:
972  return PARM_INTEGER;
973  case 5:
974  return PARM_INTEGER;
975  case 6:
976  return PARM_VECTOR2;
977  case 7:
978  return PARM_FLOAT;
979  case 8:
980  return PARM_FLOAT;
981  case 9:
982  return PARM_VECTOR2;
983  case 10:
984  return PARM_VECTOR2;
985  case 11:
986  return PARM_INTEGER;
987  case 12:
988  return PARM_FLOAT;
989  case 13:
990  return PARM_STRING;
991  case 14:
992  return PARM_FLOAT;
993  case 15:
994  return PARM_FLOAT;
995  case 16:
996  return PARM_INTEGER;
997  case 17:
998  return PARM_INTEGER;
999  case 18:
1000  return PARM_VECTOR2;
1001  case 19:
1002  return PARM_INTEGER;
1003  case 20:
1004  return PARM_INTEGER;
1005  case 21:
1006  return PARM_INTEGER;
1007  case 22:
1008  return PARM_INTEGER;
1009  case 23:
1010  return PARM_INTEGER;
1011  case 24:
1012  return PARM_INTEGER;
1013  case 25:
1014  return PARM_INTEGER;
1015  case 26:
1016  return PARM_FLOAT;
1017  case 27:
1018  return PARM_INTEGER;
1019  case 28:
1020  return PARM_FLOAT;
1021  case 29:
1022  return PARM_FLOAT;
1023  case 30:
1024  return PARM_INTEGER;
1025  case 31:
1026  return PARM_INTEGER;
1027  case 32:
1028  return PARM_STRING;
1029  case 33:
1030  return PARM_INTEGER;
1031  case 34:
1032  if (fieldnum.size() == 1)
1033  return PARM_MULTIPARM;
1034  switch (fieldnum[1])
1035  {
1036  case 0:
1037  return PARM_INTEGER;
1038  case 1:
1039  return PARM_VECTOR3;
1040  case 2:
1041  return PARM_STRING;
1042  case 3:
1043  return PARM_INTEGER;
1044  case 4:
1045  return PARM_STRING;
1046  case 5:
1047  return PARM_INTEGER;
1048  case 6:
1049  return PARM_STRING;
1050  case 7:
1051  return PARM_STRING;
1052  case 8:
1053  return PARM_STRING;
1054 
1055  }
1056  return PARM_UNSUPPORTED;
1057  case 35:
1058  return PARM_STRING;
1059 
1060  }
1061  return PARM_UNSUPPORTED;
1062  }
1063 
1064  // Boiler plate to load individual types.
1065  static void loadData(UT_IStream &is, int64 &v)
1066  { is.bread(&v, 1); }
1067  static void loadData(UT_IStream &is, bool &v)
1068  { int64 iv; is.bread(&iv, 1); v = iv; }
1069  static void loadData(UT_IStream &is, fpreal64 &v)
1070  { is.bread<fpreal64>(&v, 1); }
1071  static void loadData(UT_IStream &is, UT_Vector2D &v)
1072  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
1073  static void loadData(UT_IStream &is, UT_Vector3D &v)
1074  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
1075  is.bread<fpreal64>(&v.z(), 1); }
1076  static void loadData(UT_IStream &is, UT_Vector4D &v)
1077  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
1078  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
1079  static void loadData(UT_IStream &is, UT_Matrix2D &v)
1080  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
1081  static void loadData(UT_IStream &is, UT_Matrix3D &v)
1082  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
1083  static void loadData(UT_IStream &is, UT_Matrix4D &v)
1084  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
1085  static void loadData(UT_IStream &is, UT_Vector2I &v)
1086  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
1087  static void loadData(UT_IStream &is, UT_Vector3I &v)
1088  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
1089  is.bread<int64>(&v.z(), 1); }
1090  static void loadData(UT_IStream &is, UT_Vector4I &v)
1091  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
1092  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
1094  { is.bread(v); }
1096  { UT_StringHolder rampdata;
1097  loadData(is, rampdata);
1098  if (rampdata.isstring())
1099  {
1100  v.reset(new UT_Ramp());
1101  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
1102  v->load(istr);
1103  }
1104  else v.reset();
1105  }
1108  loadData(is, data);
1109  if (data.isstring())
1110  {
1111  // Find the data type.
1112  const char *colon = UT_StringWrap(data).findChar(':');
1113  if (colon)
1114  {
1115  int typelen = colon - data.buffer();
1117  type.strncpy(data.buffer(), typelen);
1118  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
1119 
1120  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
1121  }
1122  }
1123  else v.reset();
1124  }
1125 
1126  static void saveData(std::ostream &os, int64 v)
1127  { UTwrite(os, &v); }
1128  static void saveData(std::ostream &os, bool v)
1129  { int64 iv = v; UTwrite(os, &iv); }
1130  static void saveData(std::ostream &os, fpreal64 v)
1131  { UTwrite<fpreal64>(os, &v); }
1132  static void saveData(std::ostream &os, UT_Vector2D v)
1133  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
1134  static void saveData(std::ostream &os, UT_Vector3D v)
1135  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1136  UTwrite<fpreal64>(os, &v.z()); }
1137  static void saveData(std::ostream &os, UT_Vector4D v)
1138  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1139  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
1140  static void saveData(std::ostream &os, UT_Matrix2D v)
1142  static void saveData(std::ostream &os, UT_Matrix3D v)
1144  static void saveData(std::ostream &os, UT_Matrix4D v)
1146  static void saveData(std::ostream &os, UT_StringHolder s)
1147  { UT_StringWrap(s).saveBinary(os); }
1148  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
1150  UT_OStringStream ostr;
1151  if (s) s->save(ostr);
1152  result = ostr.str();
1153  saveData(os, result);
1154  }
1155  static void saveData(std::ostream &os, PRM_DataItemHandle s)
1157  UT_OStringStream ostr;
1158  if (s)
1159  {
1160  ostr << s->getDataTypeToken();
1161  ostr << ":";
1162  s->saveBinary(ostr);
1163  }
1164  result = ostr.str();
1165  saveData(os, result);
1166  }
1167 
1168 
1169  void save(std::ostream &os) const
1170  {
1171  int32 v = version();
1172  UTwrite(os, &v);
1173  saveData(os, myEnableSolve);
1174  saveData(os, myEnableGeometryConstraints);
1175  saveData(os, myConstraintSelection);
1176  saveData(os, myConstraintSource);
1177  saveData(os, myIterations);
1178  saveData(os, myReducedLevels);
1179  saveData(os, myReductionPercentage);
1180  saveData(os, myReductionPercentageSingle);
1181  saveData(os, myInitialReductionPercentage);
1182  saveData(os, myRigidWeights);
1183  saveData(os, myLandmarkWeights);
1184  saveData(os, myMaskMode);
1185  saveData(os, myMaskTolerance);
1186  saveData(os, myRigidprimitives);
1187  saveData(os, myDistTolerance);
1188  saveData(os, myNormTolerance);
1189  saveData(os, mySolverType);
1190  saveData(os, mySolverIterations);
1191  saveData(os, myGradientTolerance);
1192  saveData(os, myDebug_menu);
1193  saveData(os, myDebug_coarse_lvl);
1194  saveData(os, myDebug_coarse_iteration);
1195  saveData(os, myDebug_dense_lvl);
1196  saveData(os, myDebug_dense_iteration);
1197  saveData(os, myDebug_hessian_scaling);
1198  saveData(os, myDebug_use_marquadt);
1199  saveData(os, myParameter_tolerance);
1200  saveData(os, myUse_tau);
1201  saveData(os, myTau);
1202  saveData(os, myInitial_damping);
1203  saveData(os, myDebug_save_meshes);
1204  saveData(os, myUseLandmarkLables);
1205  saveData(os, myLandmarkAttribute);
1206  saveData(os, myEnableLandmarks);
1207  {
1208  int64 length = myNumlandmarkgroups.entries();
1209  UTwrite(os, &length);
1210  for (exint i = 0; i < length; i++)
1211  {
1212  auto && _curentry = myNumlandmarkgroups(i);
1213  (void) _curentry;
1214  saveData(os, _curentry.enablegroup);
1215  saveData(os, _curentry.pballcolor);
1216  saveData(os, _curentry.pname);
1217  saveData(os, _curentry.usesourcepos);
1218  saveData(os, _curentry.sourcepos);
1219  saveData(os, _curentry.usetargetpos);
1220  saveData(os, _curentry.targetpos);
1221  saveData(os, _curentry.psourcegroup);
1222  saveData(os, _curentry.ptargetgroup);
1223 
1224  }
1225  }
1226  saveData(os, myRigidMask);
1227 
1228  }
1229 
1230  bool load(UT_IStream &is)
1231  {
1232  int32 v;
1233  is.bread(&v, 1);
1234  if (version() != v)
1235  {
1236  // Fail incompatible versions
1237  return false;
1238  }
1239  loadData(is, myEnableSolve);
1240  loadData(is, myEnableGeometryConstraints);
1241  loadData(is, myConstraintSelection);
1242  loadData(is, myConstraintSource);
1243  loadData(is, myIterations);
1244  loadData(is, myReducedLevels);
1245  loadData(is, myReductionPercentage);
1246  loadData(is, myReductionPercentageSingle);
1247  loadData(is, myInitialReductionPercentage);
1248  loadData(is, myRigidWeights);
1249  loadData(is, myLandmarkWeights);
1250  loadData(is, myMaskMode);
1251  loadData(is, myMaskTolerance);
1252  loadData(is, myRigidprimitives);
1253  loadData(is, myDistTolerance);
1254  loadData(is, myNormTolerance);
1255  loadData(is, mySolverType);
1256  loadData(is, mySolverIterations);
1257  loadData(is, myGradientTolerance);
1258  loadData(is, myDebug_menu);
1259  loadData(is, myDebug_coarse_lvl);
1260  loadData(is, myDebug_coarse_iteration);
1261  loadData(is, myDebug_dense_lvl);
1262  loadData(is, myDebug_dense_iteration);
1263  loadData(is, myDebug_hessian_scaling);
1264  loadData(is, myDebug_use_marquadt);
1265  loadData(is, myParameter_tolerance);
1266  loadData(is, myUse_tau);
1267  loadData(is, myTau);
1268  loadData(is, myInitial_damping);
1269  loadData(is, myDebug_save_meshes);
1270  loadData(is, myUseLandmarkLables);
1271  loadData(is, myLandmarkAttribute);
1272  loadData(is, myEnableLandmarks);
1273  {
1274  int64 length;
1275  is.read(&length, 1);
1276  myNumlandmarkgroups.setSize(length);
1277  for (exint i = 0; i < length; i++)
1278  {
1279  auto && _curentry = myNumlandmarkgroups(i);
1280  (void) _curentry;
1281  loadData(is, _curentry.enablegroup);
1282  loadData(is, _curentry.pballcolor);
1283  loadData(is, _curentry.pname);
1284  loadData(is, _curentry.usesourcepos);
1285  loadData(is, _curentry.sourcepos);
1286  loadData(is, _curentry.usetargetpos);
1287  loadData(is, _curentry.targetpos);
1288  loadData(is, _curentry.psourcegroup);
1289  loadData(is, _curentry.ptargetgroup);
1290 
1291  }
1292  }
1293  loadData(is, myRigidMask);
1294 
1295  return true;
1296  }
1297 
1298  bool getEnableSolve() const { return myEnableSolve; }
1299  void setEnableSolve(bool val) { myEnableSolve = val; }
1300  bool opEnableSolve(const SOP_NodeVerb::CookParms &cookparms) const
1301  {
1302  SOP_Node *thissop = cookparms.getNode();
1303  if (!thissop) return getEnableSolve();
1304  bool result;
1305  OP_Utils::evalOpParm(result, thissop, "enablesolve", cookparms.getCookTime(), 0);
1306  return result;
1307  }
1308  bool getEnableGeometryConstraints() const { return myEnableGeometryConstraints; }
1309  void setEnableGeometryConstraints(bool val) { myEnableGeometryConstraints = val; }
1311  {
1312  SOP_Node *thissop = cookparms.getNode();
1313  if (!thissop) return getEnableGeometryConstraints();
1314  bool result;
1315  OP_Utils::evalOpParm(result, thissop, "enablegeometryconstraints", cookparms.getCookTime(), 0);
1316  return result;
1317  }
1318  ConstraintSelection getConstraintSelection() const { return ConstraintSelection(myConstraintSelection); }
1319  void setConstraintSelection(ConstraintSelection val) { myConstraintSelection = int64(val); }
1321  {
1322  SOP_Node *thissop = cookparms.getNode();
1323  if (!thissop) return getConstraintSelection();
1324  int64 result;
1325  OP_Utils::evalOpParm(result, thissop, "constraintselection", cookparms.getCookTime(), 0);
1326  return ConstraintSelection(result);
1327  }
1328  const UT_StringHolder & getConstraintSource() const { return myConstraintSource; }
1329  void setConstraintSource(const UT_StringHolder & val) { myConstraintSource = val; }
1331  {
1332  SOP_Node *thissop = cookparms.getNode();
1333  if (!thissop) return getConstraintSource();
1335  OP_Utils::evalOpParm(result, thissop, "constraintsource", cookparms.getCookTime(), 0);
1336  return result;
1337  }
1338  int64 getIterations() const { return myIterations; }
1339  void setIterations(int64 val) { myIterations = val; }
1341  {
1342  SOP_Node *thissop = cookparms.getNode();
1343  if (!thissop) return getIterations();
1344  int64 result;
1345  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
1346  return result;
1347  }
1348  int64 getReducedLevels() const { return myReducedLevels; }
1349  void setReducedLevels(int64 val) { myReducedLevels = val; }
1351  {
1352  SOP_Node *thissop = cookparms.getNode();
1353  if (!thissop) return getReducedLevels();
1354  int64 result;
1355  OP_Utils::evalOpParm(result, thissop, "reducedlevels", cookparms.getCookTime(), 0);
1356  return result;
1357  }
1358  UT_Vector2D getReductionPercentage() const { return myReductionPercentage; }
1359  void setReductionPercentage(UT_Vector2D val) { myReductionPercentage = val; }
1361  {
1362  SOP_Node *thissop = cookparms.getNode();
1363  if (!thissop) return getReductionPercentage();
1365  OP_Utils::evalOpParm(result, thissop, "reductionpercentage", cookparms.getCookTime(), 0);
1366  return result;
1367  }
1368  fpreal64 getReductionPercentageSingle() const { return myReductionPercentageSingle; }
1369  void setReductionPercentageSingle(fpreal64 val) { myReductionPercentageSingle = val; }
1371  {
1372  SOP_Node *thissop = cookparms.getNode();
1373  if (!thissop) return getReductionPercentageSingle();
1374  fpreal64 result;
1375  OP_Utils::evalOpParm(result, thissop, "reductionpercentage_single", cookparms.getCookTime(), 0);
1376  return result;
1377  }
1378  fpreal64 getInitialReductionPercentage() const { return myInitialReductionPercentage; }
1379  void setInitialReductionPercentage(fpreal64 val) { myInitialReductionPercentage = val; }
1381  {
1382  SOP_Node *thissop = cookparms.getNode();
1383  if (!thissop) return getInitialReductionPercentage();
1384  fpreal64 result;
1385  OP_Utils::evalOpParm(result, thissop, "initialreductionpercentage", cookparms.getCookTime(), 0);
1386  return result;
1387  }
1388  UT_Vector2D getRigidWeights() const { return myRigidWeights; }
1389  void setRigidWeights(UT_Vector2D val) { myRigidWeights = val; }
1391  {
1392  SOP_Node *thissop = cookparms.getNode();
1393  if (!thissop) return getRigidWeights();
1395  OP_Utils::evalOpParm(result, thissop, "rigidweights", cookparms.getCookTime(), 0);
1396  return result;
1397  }
1398  UT_Vector2D getLandmarkWeights() const { return myLandmarkWeights; }
1399  void setLandmarkWeights(UT_Vector2D val) { myLandmarkWeights = val; }
1401  {
1402  SOP_Node *thissop = cookparms.getNode();
1403  if (!thissop) return getLandmarkWeights();
1405  OP_Utils::evalOpParm(result, thissop, "landmarkweights", cookparms.getCookTime(), 0);
1406  return result;
1407  }
1408  MaskMode getMaskMode() const { return MaskMode(myMaskMode); }
1409  void setMaskMode(MaskMode val) { myMaskMode = int64(val); }
1411  {
1412  SOP_Node *thissop = cookparms.getNode();
1413  if (!thissop) return getMaskMode();
1414  int64 result;
1415  OP_Utils::evalOpParm(result, thissop, "maskmode", cookparms.getCookTime(), 0);
1416  return MaskMode(result);
1417  }
1418  fpreal64 getMaskTolerance() const { return myMaskTolerance; }
1419  void setMaskTolerance(fpreal64 val) { myMaskTolerance = val; }
1421  {
1422  SOP_Node *thissop = cookparms.getNode();
1423  if (!thissop) return getMaskTolerance();
1424  fpreal64 result;
1425  OP_Utils::evalOpParm(result, thissop, "masktolerance", cookparms.getCookTime(), 0);
1426  return result;
1427  }
1428  const UT_StringHolder & getRigidprimitives() const { return myRigidprimitives; }
1429  void setRigidprimitives(const UT_StringHolder & val) { myRigidprimitives = val; }
1431  {
1432  SOP_Node *thissop = cookparms.getNode();
1433  if (!thissop) return getRigidprimitives();
1435  OP_Utils::evalOpParm(result, thissop, "rigidprimitives", cookparms.getCookTime(), 0);
1436  return result;
1437  }
1438  fpreal64 getDistTolerance() const { return myDistTolerance; }
1439  void setDistTolerance(fpreal64 val) { myDistTolerance = val; }
1441  {
1442  SOP_Node *thissop = cookparms.getNode();
1443  if (!thissop) return getDistTolerance();
1444  fpreal64 result;
1445  OP_Utils::evalOpParm(result, thissop, "disttolerance", cookparms.getCookTime(), 0);
1446  return result;
1447  }
1448  fpreal64 getNormTolerance() const { return myNormTolerance; }
1449  void setNormTolerance(fpreal64 val) { myNormTolerance = val; }
1451  {
1452  SOP_Node *thissop = cookparms.getNode();
1453  if (!thissop) return getNormTolerance();
1454  fpreal64 result;
1455  OP_Utils::evalOpParm(result, thissop, "normtolerance", cookparms.getCookTime(), 0);
1456  return result;
1457  }
1458  SolverType getSolverType() const { return SolverType(mySolverType); }
1459  void setSolverType(SolverType val) { mySolverType = int64(val); }
1461  {
1462  SOP_Node *thissop = cookparms.getNode();
1463  if (!thissop) return getSolverType();
1464  int64 result;
1465  OP_Utils::evalOpParm(result, thissop, "solvertype", cookparms.getCookTime(), 0);
1466  return SolverType(result);
1467  }
1468  int64 getSolverIterations() const { return mySolverIterations; }
1469  void setSolverIterations(int64 val) { mySolverIterations = val; }
1471  {
1472  SOP_Node *thissop = cookparms.getNode();
1473  if (!thissop) return getSolverIterations();
1474  int64 result;
1475  OP_Utils::evalOpParm(result, thissop, "solveriterations", cookparms.getCookTime(), 0);
1476  return result;
1477  }
1478  UT_Vector2D getGradientTolerance() const { return myGradientTolerance; }
1479  void setGradientTolerance(UT_Vector2D val) { myGradientTolerance = val; }
1481  {
1482  SOP_Node *thissop = cookparms.getNode();
1483  if (!thissop) return getGradientTolerance();
1485  OP_Utils::evalOpParm(result, thissop, "gradienttolerance", cookparms.getCookTime(), 0);
1486  return result;
1487  }
1488  Debug_menu getDebug_menu() const { return Debug_menu(myDebug_menu); }
1489  void setDebug_menu(Debug_menu val) { myDebug_menu = int64(val); }
1491  {
1492  SOP_Node *thissop = cookparms.getNode();
1493  if (!thissop) return getDebug_menu();
1494  int64 result;
1495  OP_Utils::evalOpParm(result, thissop, "debug_menu", cookparms.getCookTime(), 0);
1496  return Debug_menu(result);
1497  }
1498  int64 getDebug_coarse_lvl() const { return myDebug_coarse_lvl; }
1499  void setDebug_coarse_lvl(int64 val) { myDebug_coarse_lvl = val; }
1501  {
1502  SOP_Node *thissop = cookparms.getNode();
1503  if (!thissop) return getDebug_coarse_lvl();
1504  int64 result;
1505  OP_Utils::evalOpParm(result, thissop, "debug_coarse_lvl", cookparms.getCookTime(), 0);
1506  return result;
1507  }
1508  int64 getDebug_coarse_iteration() const { return myDebug_coarse_iteration; }
1509  void setDebug_coarse_iteration(int64 val) { myDebug_coarse_iteration = val; }
1511  {
1512  SOP_Node *thissop = cookparms.getNode();
1513  if (!thissop) return getDebug_coarse_iteration();
1514  int64 result;
1515  OP_Utils::evalOpParm(result, thissop, "debug_coarse_iteration", cookparms.getCookTime(), 0);
1516  return result;
1517  }
1518  int64 getDebug_dense_lvl() const { return myDebug_dense_lvl; }
1519  void setDebug_dense_lvl(int64 val) { myDebug_dense_lvl = val; }
1521  {
1522  SOP_Node *thissop = cookparms.getNode();
1523  if (!thissop) return getDebug_dense_lvl();
1524  int64 result;
1525  OP_Utils::evalOpParm(result, thissop, "debug_dense_lvl", cookparms.getCookTime(), 0);
1526  return result;
1527  }
1528  int64 getDebug_dense_iteration() const { return myDebug_dense_iteration; }
1529  void setDebug_dense_iteration(int64 val) { myDebug_dense_iteration = val; }
1531  {
1532  SOP_Node *thissop = cookparms.getNode();
1533  if (!thissop) return getDebug_dense_iteration();
1534  int64 result;
1535  OP_Utils::evalOpParm(result, thissop, "debug_dense_iteration", cookparms.getCookTime(), 0);
1536  return result;
1537  }
1538  bool getDebug_hessian_scaling() const { return myDebug_hessian_scaling; }
1539  void setDebug_hessian_scaling(bool val) { myDebug_hessian_scaling = val; }
1541  {
1542  SOP_Node *thissop = cookparms.getNode();
1543  if (!thissop) return getDebug_hessian_scaling();
1544  bool result;
1545  OP_Utils::evalOpParm(result, thissop, "debug_hessian_scaling", cookparms.getCookTime(), 0);
1546  return result;
1547  }
1548  bool getDebug_use_marquadt() const { return myDebug_use_marquadt; }
1549  void setDebug_use_marquadt(bool val) { myDebug_use_marquadt = val; }
1550  bool opDebug_use_marquadt(const SOP_NodeVerb::CookParms &cookparms) const
1551  {
1552  SOP_Node *thissop = cookparms.getNode();
1553  if (!thissop) return getDebug_use_marquadt();
1554  bool result;
1555  OP_Utils::evalOpParm(result, thissop, "debug_use_marquadt", cookparms.getCookTime(), 0);
1556  return result;
1557  }
1558  fpreal64 getParameter_tolerance() const { return myParameter_tolerance; }
1559  void setParameter_tolerance(fpreal64 val) { myParameter_tolerance = val; }
1561  {
1562  SOP_Node *thissop = cookparms.getNode();
1563  if (!thissop) return getParameter_tolerance();
1564  fpreal64 result;
1565  OP_Utils::evalOpParm(result, thissop, "parameter_tolerance", cookparms.getCookTime(), 0);
1566  return result;
1567  }
1568  bool getUse_tau() const { return myUse_tau; }
1569  void setUse_tau(bool val) { myUse_tau = val; }
1570  bool opUse_tau(const SOP_NodeVerb::CookParms &cookparms) const
1571  {
1572  SOP_Node *thissop = cookparms.getNode();
1573  if (!thissop) return getUse_tau();
1574  bool result;
1575  OP_Utils::evalOpParm(result, thissop, "use_tau", cookparms.getCookTime(), 0);
1576  return result;
1577  }
1578  fpreal64 getTau() const { return myTau; }
1579  void setTau(fpreal64 val) { myTau = val; }
1580  fpreal64 opTau(const SOP_NodeVerb::CookParms &cookparms) const
1581  {
1582  SOP_Node *thissop = cookparms.getNode();
1583  if (!thissop) return getTau();
1584  fpreal64 result;
1585  OP_Utils::evalOpParm(result, thissop, "tau", cookparms.getCookTime(), 0);
1586  return result;
1587  }
1588  fpreal64 getInitial_damping() const { return myInitial_damping; }
1589  void setInitial_damping(fpreal64 val) { myInitial_damping = val; }
1591  {
1592  SOP_Node *thissop = cookparms.getNode();
1593  if (!thissop) return getInitial_damping();
1594  fpreal64 result;
1595  OP_Utils::evalOpParm(result, thissop, "initial_damping", cookparms.getCookTime(), 0);
1596  return result;
1597  }
1598  bool getDebug_save_meshes() const { return myDebug_save_meshes; }
1599  void setDebug_save_meshes(bool val) { myDebug_save_meshes = val; }
1600  bool opDebug_save_meshes(const SOP_NodeVerb::CookParms &cookparms) const
1601  {
1602  SOP_Node *thissop = cookparms.getNode();
1603  if (!thissop) return getDebug_save_meshes();
1604  bool result;
1605  OP_Utils::evalOpParm(result, thissop, "debug_save_meshes", cookparms.getCookTime(), 0);
1606  return result;
1607  }
1608  bool getUseLandmarkLables() const { return myUseLandmarkLables; }
1609  void setUseLandmarkLables(bool val) { myUseLandmarkLables = val; }
1610  bool opUseLandmarkLables(const SOP_NodeVerb::CookParms &cookparms) const
1611  {
1612  SOP_Node *thissop = cookparms.getNode();
1613  if (!thissop) return getUseLandmarkLables();
1614  bool result;
1615  OP_Utils::evalOpParm(result, thissop, "uselandmarklabels", cookparms.getCookTime(), 0);
1616  return result;
1617  }
1618  const UT_StringHolder & getLandmarkAttribute() const { return myLandmarkAttribute; }
1619  void setLandmarkAttribute(const UT_StringHolder & val) { myLandmarkAttribute = val; }
1621  {
1622  SOP_Node *thissop = cookparms.getNode();
1623  if (!thissop) return getLandmarkAttribute();
1625  OP_Utils::evalOpParm(result, thissop, "landmarkattrib", cookparms.getCookTime(), 0);
1626  return result;
1627  }
1628  bool getEnableLandmarks() const { return myEnableLandmarks; }
1629  void setEnableLandmarks(bool val) { myEnableLandmarks = val; }
1630  bool opEnableLandmarks(const SOP_NodeVerb::CookParms &cookparms) const
1631  {
1632  SOP_Node *thissop = cookparms.getNode();
1633  if (!thissop) return getEnableLandmarks();
1634  bool result;
1635  OP_Utils::evalOpParm(result, thissop, "enablelandmarks", cookparms.getCookTime(), 0);
1636  return result;
1637  }
1638  const UT_Array<Numlandmarkgroups> &getNumlandmarkgroups() const { return myNumlandmarkgroups; }
1639 void setNumlandmarkgroups(const UT_Array<Numlandmarkgroups> &val) { myNumlandmarkgroups = val; }
1641  {
1642  SOP_Node *thissop = cookparms.getNode();
1643  if (!thissop) return getNumlandmarkgroups().entries();
1644  exint result;
1645  OP_Utils::evalOpParm(result, thissop, "numlandmarkgroups", cookparms.getCookTime(), 0);
1646  return result;
1647  }
1648  bool opNumlandmarkgroups_enablegroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1649  { return opinstNumlandmarkgroups_enablegroup(cookparms, &_idx); }
1650  bool opinstNumlandmarkgroups_enablegroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1651  {
1652  SOP_Node *thissop = cookparms.getNode();
1653  if (!thissop) return (myNumlandmarkgroups(_idx[0]).enablegroup);
1654  int _parmidx[2-1];
1655  _parmidx[1-1] = _idx[1-1] + 1;
1656 
1657  bool result;
1658  OP_Utils::evalOpParmInst(result, thissop, "enablegroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1659  return (result);
1660  }
1662  { return opinstNumlandmarkgroups_pballcolor(cookparms, &_idx); }
1664  {
1665  SOP_Node *thissop = cookparms.getNode();
1666  if (!thissop) return (myNumlandmarkgroups(_idx[0]).pballcolor);
1667  int _parmidx[2-1];
1668  _parmidx[1-1] = _idx[1-1] + 1;
1669 
1671  OP_Utils::evalOpParmInst(result, thissop, "pballcolor#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1672  return (result);
1673  }
1675  { return opinstNumlandmarkgroups_pname(cookparms, &_idx); }
1677  {
1678  SOP_Node *thissop = cookparms.getNode();
1679  if (!thissop) return (myNumlandmarkgroups(_idx[0]).pname);
1680  int _parmidx[2-1];
1681  _parmidx[1-1] = _idx[1-1] + 1;
1682 
1684  OP_Utils::evalOpParmInst(result, thissop, "pname#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1685  return (result);
1686  }
1687  bool opNumlandmarkgroups_usesourcepos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1688  { return opinstNumlandmarkgroups_usesourcepos(cookparms, &_idx); }
1689  bool opinstNumlandmarkgroups_usesourcepos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1690  {
1691  SOP_Node *thissop = cookparms.getNode();
1692  if (!thissop) return (myNumlandmarkgroups(_idx[0]).usesourcepos);
1693  int _parmidx[2-1];
1694  _parmidx[1-1] = _idx[1-1] + 1;
1695 
1696  bool result;
1697  OP_Utils::evalOpParmInst(result, thissop, "usesourcepos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1698  return (result);
1699  }
1701  { return opinstNumlandmarkgroups_sourcepos(cookparms, &_idx); }
1703  {
1704  SOP_Node *thissop = cookparms.getNode();
1705  if (!thissop) return (myNumlandmarkgroups(_idx[0]).sourcepos);
1706  int _parmidx[2-1];
1707  _parmidx[1-1] = _idx[1-1] + 1;
1708 
1710  OP_Utils::evalOpParmInst(result, thissop, "sourcepos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1711  return (result);
1712  }
1713  bool opNumlandmarkgroups_usetargetpos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1714  { return opinstNumlandmarkgroups_usetargetpos(cookparms, &_idx); }
1715  bool opinstNumlandmarkgroups_usetargetpos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1716  {
1717  SOP_Node *thissop = cookparms.getNode();
1718  if (!thissop) return (myNumlandmarkgroups(_idx[0]).usetargetpos);
1719  int _parmidx[2-1];
1720  _parmidx[1-1] = _idx[1-1] + 1;
1721 
1722  bool result;
1723  OP_Utils::evalOpParmInst(result, thissop, "usetargetpos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1724  return (result);
1725  }
1727  { return opinstNumlandmarkgroups_targetpos(cookparms, &_idx); }
1729  {
1730  SOP_Node *thissop = cookparms.getNode();
1731  if (!thissop) return (myNumlandmarkgroups(_idx[0]).targetpos);
1732  int _parmidx[2-1];
1733  _parmidx[1-1] = _idx[1-1] + 1;
1734 
1736  OP_Utils::evalOpParmInst(result, thissop, "targetpos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1737  return (result);
1738  }
1740  { return opinstNumlandmarkgroups_psourcegroup(cookparms, &_idx); }
1742  {
1743  SOP_Node *thissop = cookparms.getNode();
1744  if (!thissop) return (myNumlandmarkgroups(_idx[0]).psourcegroup);
1745  int _parmidx[2-1];
1746  _parmidx[1-1] = _idx[1-1] + 1;
1747 
1749  OP_Utils::evalOpParmInst(result, thissop, "psourcegroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1750  return (result);
1751  }
1753  { return opinstNumlandmarkgroups_ptargetgroup(cookparms, &_idx); }
1755  {
1756  SOP_Node *thissop = cookparms.getNode();
1757  if (!thissop) return (myNumlandmarkgroups(_idx[0]).ptargetgroup);
1758  int _parmidx[2-1];
1759  _parmidx[1-1] = _idx[1-1] + 1;
1760 
1762  OP_Utils::evalOpParmInst(result, thissop, "ptargetgroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1763  return (result);
1764  }
1765 
1766  const UT_StringHolder & getRigidMask() const { return myRigidMask; }
1767  void setRigidMask(const UT_StringHolder & val) { myRigidMask = val; }
1769  {
1770  SOP_Node *thissop = cookparms.getNode();
1771  if (!thissop) return getRigidMask();
1773  OP_Utils::evalOpParm(result, thissop, "rigidmask", cookparms.getCookTime(), 0);
1774  return result;
1775  }
1776 
1777 private:
1778  bool myEnableSolve;
1779  bool myEnableGeometryConstraints;
1780  int64 myConstraintSelection;
1781  UT_StringHolder myConstraintSource;
1782  int64 myIterations;
1783  int64 myReducedLevels;
1784  UT_Vector2D myReductionPercentage;
1785  fpreal64 myReductionPercentageSingle;
1786  fpreal64 myInitialReductionPercentage;
1787  UT_Vector2D myRigidWeights;
1788  UT_Vector2D myLandmarkWeights;
1789  int64 myMaskMode;
1790  fpreal64 myMaskTolerance;
1791  UT_StringHolder myRigidprimitives;
1792  fpreal64 myDistTolerance;
1793  fpreal64 myNormTolerance;
1794  int64 mySolverType;
1795  int64 mySolverIterations;
1796  UT_Vector2D myGradientTolerance;
1797  int64 myDebug_menu;
1798  int64 myDebug_coarse_lvl;
1799  int64 myDebug_coarse_iteration;
1800  int64 myDebug_dense_lvl;
1801  int64 myDebug_dense_iteration;
1802  bool myDebug_hessian_scaling;
1803  bool myDebug_use_marquadt;
1804  fpreal64 myParameter_tolerance;
1805  bool myUse_tau;
1806  fpreal64 myTau;
1807  fpreal64 myInitial_damping;
1808  bool myDebug_save_meshes;
1809  bool myUseLandmarkLables;
1810  UT_StringHolder myLandmarkAttribute;
1811  bool myEnableLandmarks;
1812  UT_Array<Numlandmarkgroups> myNumlandmarkgroups;
1813  UT_StringHolder myRigidMask;
1814 
1815 };
void setDistTolerance(fpreal64 val)
bool opNumlandmarkgroups_usetargetpos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, bool v)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setLandmarkAttribute(const UT_StringHolder &val)
static void saveData(std::ostream &os, int64 v)
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setMaskMode(MaskMode val)
MaskMode opMaskMode(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumlandmarkgroups_ptargetgroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder opinstNumlandmarkgroups_targetpos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool isParmColorRamp(exint idx) const override
fpreal64 opMaskTolerance(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getRigidWeights() const
const UT_StringHolder & getRigidMask() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void
Definition: png.h:1083
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
SolverType getSolverType() const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_Vector2T< fpreal64 > UT_Vector2D
fpreal64 getParameter_tolerance() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
void setDebug_dense_iteration(int64 val)
bool opinstNumlandmarkgroups_enablegroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
UT_StringHolder opNumlandmarkgroups_psourcegroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
bool operator!=(const SOP_TopoTransferParms &src) const
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
fpreal64 opNormTolerance(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
UT_Vector2D getLandmarkWeights() const
bool opinstNumlandmarkgroups_usesourcepos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool opDebug_hessian_scaling(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getInitialReductionPercentage() const
**But if you need a result
Definition: thread.h:613
void setSolverType(SolverType val)
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 opInitial_damping(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_StringHolder opRigidprimitives(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opLandmarkAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void setConstraintSource(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
Debug_menu opDebug_menu(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getReductionPercentageSingle() const
UT_StringHolder opNumlandmarkgroups_sourcepos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opNumlandmarkgroups_enablegroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
UT_StringHolder opConstraintSource(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_TopoTransferParms &src) const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool opDebug_save_meshes(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const UT_StringHolder & getRigidprimitives() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
fpreal64 opDistTolerance(const SOP_NodeVerb::CookParms &cookparms) const
void setRigidMask(const UT_StringHolder &val)
void setReductionPercentage(UT_Vector2D val)
bool opDebug_use_marquadt(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_Vector2D getReductionPercentage() const
UT_Vector3D opinstNumlandmarkgroups_pballcolor(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint length() const
fpreal64 opParameter_tolerance(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getConstraintSource() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal64 getNormTolerance() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
int64 opDebug_dense_iteration(const SOP_NodeVerb::CookParms &cookparms) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool opNumlandmarkgroups_usesourcepos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
UT_Vector2D opRigidWeights(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opGradientTolerance(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
int64 opDebug_dense_lvl(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool opinstNumlandmarkgroups_usetargetpos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
Debug_menu getDebug_menu() const
fpreal64 getInitial_damping() const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
fpreal64 opReductionPercentageSingle(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
fpreal64 getMaskTolerance() const
int64 opSolverIterations(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< Numlandmarkgroups > & getNumlandmarkgroups() const
int64 opDebug_coarse_iteration(const SOP_NodeVerb::CookParms &cookparms) const
int64 opDebug_coarse_lvl(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
bool operator!=(const Numlandmarkgroups &src) const
UT_StringHolder createString(const UT_Array< Numlandmarkgroups > &list) const
void setConstraintSelection(ConstraintSelection val)
SolverType opSolverType(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opRigidMask(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opinstNumlandmarkgroups_sourcepos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setLandmarkWeights(UT_Vector2D val)
ConstraintSelection getConstraintSelection() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool opEnableSolve(const SOP_NodeVerb::CookParms &cookparms) const
GLenum pname
Definition: glcorearb.h:104
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, bool &v)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector3I &v)
void save(std::ostream &os) const
ConstraintSelection opConstraintSelection(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
UT_Vector2D getGradientTolerance() const
void setInitial_damping(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_Vector3D opNumlandmarkgroups_pballcolor(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_Vector2D opLandmarkWeights(const SOP_NodeVerb::CookParms &cookparms) const
void setReductionPercentageSingle(fpreal64 val)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal64 opInitialReductionPercentage(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setDebug_coarse_iteration(int64 val)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
UT_StringHolder opinstNumlandmarkgroups_psourcegroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNormTolerance(fpreal64 val)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opEnableLandmarks(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
bool getEnableGeometryConstraints() const
void setGradientTolerance(UT_Vector2D val)
int64 getDebug_dense_iteration() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_Matrix3D v)
void setParameter_tolerance(fpreal64 val)
UT_Vector2D opReductionPercentage(const SOP_NodeVerb::CookParms &cookparms) const
void setEnableGeometryConstraints(bool val)
bool operator==(const Numlandmarkgroups &src) 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
exint opNumlandmarkgroups(const SOP_NodeVerb::CookParms &cookparms) const
GLboolean r
Definition: glcorearb.h:1222
bool opEnableGeometryConstraints(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getLandmarkAttribute() const
void setInitialReductionPercentage(fpreal64 val)
bool opUseLandmarkLables(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void setMaskTolerance(fpreal64 val)
type
Definition: core.h:1059
void setRigidprimitives(const UT_StringHolder &val)
fpreal64 opTau(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumlandmarkgroups_targetpos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setDebug_menu(Debug_menu val)
UT_StringHolder opinstNumlandmarkgroups_pname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Matrix2D v)
int64 opReducedLevels(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool opUse_tau(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumlandmarkgroups_pname(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void setNumlandmarkgroups(const UT_Array< Numlandmarkgroups > &val)
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Vector3D v)
void setDebug_hessian_scaling(bool val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opinstNumlandmarkgroups_ptargetgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE UT_StringHolder getToken(ConstraintSelection enum_value)
fpreal64 getDistTolerance() const
static void saveData(std::ostream &os, fpreal64 v)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
int64 getDebug_coarse_iteration() const
void setRigidWeights(UT_Vector2D val)