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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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 
275  if (baseGetSignature() != src.baseGetSignature()) return false;
276 
277  return true;
278  }
280  {
281  return !operator==(src);
282  }
287 
288 
289 
290  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
291  {
292  myEnableSolve = true;
293  if (true)
294  graph->evalOpParm(myEnableSolve, nodeidx, "enablesolve", time, graph->isDirect()?nullptr:depnode);
295  myEnableGeometryConstraints = false;
296  if (true)
297  graph->evalOpParm(myEnableGeometryConstraints, nodeidx, "enablegeometryconstraints", time, graph->isDirect()?nullptr:depnode);
298  myConstraintSelection = 0;
299  if (true && ( (true&&!(((getEnableGeometryConstraints()==0)))) ) )
300  graph->evalOpParm(myConstraintSelection, nodeidx, "constraintselection", time, graph->isDirect()?nullptr:depnode);
301  myConstraintSource = ""_UTsh;
302  if (true && ( (true&&!(((int64(getConstraintSelection())==0)))) ) )
303  graph->evalOpParm(myConstraintSource, nodeidx, "constraintsource", time, graph->isDirect()?nullptr:depnode);
304  myIterations = 15;
305  if (true)
306  graph->evalOpParm(myIterations, nodeidx, "iterations", time, graph->isDirect()?nullptr:depnode);
307  myReducedLevels = 3;
308  if (true)
309  graph->evalOpParm(myReducedLevels, nodeidx, "reducedlevels", time, graph->isDirect()?nullptr:depnode);
310  myReductionPercentage = UT_Vector2D(0.1,0.9);
311  if (true && ( (true&&!(((int64(getReducedLevels())<=1))||((getEnableGeometryConstraints()==1)))) ) )
312  graph->evalOpParm(myReductionPercentage, nodeidx, "reductionpercentage", time, graph->isDirect()?nullptr:depnode);
313  myReductionPercentageSingle = 0.1;
314  if (true && ( (true&&!(((int64(getReducedLevels())>1))||((getEnableGeometryConstraints()==1)))) ) )
315  graph->evalOpParm(myReductionPercentageSingle, nodeidx, "reductionpercentage_single", time, graph->isDirect()?nullptr:depnode);
316  myInitialReductionPercentage = 0.1;
317  if (true && ( (true&&!(((int64(getReducedLevels())<=1))||((getEnableGeometryConstraints()==0)))) ) )
318  graph->evalOpParm(myInitialReductionPercentage, nodeidx, "initialreductionpercentage", time, graph->isDirect()?nullptr:depnode);
319  myRigidWeights = UT_Vector2D(1,0.001);
320  if (true)
321  graph->evalOpParm(myRigidWeights, nodeidx, "rigidweights", time, graph->isDirect()?nullptr:depnode);
322  myLandmarkWeights = UT_Vector2D(100,100);
323  if (true)
324  graph->evalOpParm(myLandmarkWeights, nodeidx, "landmarkweights", time, graph->isDirect()?nullptr:depnode);
325  myMaskMode = 0;
326  if (true)
327  graph->evalOpParm(myMaskMode, nodeidx, "maskmode", time, graph->isDirect()?nullptr:depnode);
328  myMaskTolerance = 1e-6;
329  if (true && ( (true&&!(((int64(getMaskMode())==0)))) ) )
330  graph->evalOpParm(myMaskTolerance, nodeidx, "masktolerance", time, graph->isDirect()?nullptr:depnode);
331  myRigidprimitives = ""_UTsh;
332  if (true)
333  graph->evalOpParm(myRigidprimitives, nodeidx, "rigidprimitives", time, graph->isDirect()?nullptr:depnode);
334  myDistTolerance = 0.2;
335  if (true)
336  graph->evalOpParm(myDistTolerance, nodeidx, "disttolerance", time, graph->isDirect()?nullptr:depnode);
337  myNormTolerance = 45;
338  if (true)
339  graph->evalOpParm(myNormTolerance, nodeidx, "normtolerance", time, graph->isDirect()?nullptr:depnode);
340  mySolverType = 0;
341  if (true)
342  graph->evalOpParm(mySolverType, nodeidx, "solvertype", time, graph->isDirect()?nullptr:depnode);
343  mySolverIterations = 20;
344  if (true && ( (true&&!(((int64(getSolverType())!=0)))) ) )
345  graph->evalOpParm(mySolverIterations, nodeidx, "solveriterations", time, graph->isDirect()?nullptr:depnode);
346  myGradientTolerance = UT_Vector2D(0.01,0.003);
347  if (true && ( (true&&!(((int64(getSolverType())!=0)))) ) )
348  graph->evalOpParm(myGradientTolerance, nodeidx, "gradienttolerance", time, graph->isDirect()?nullptr:depnode);
349  myDebug_menu = 0;
350  if (true)
351  graph->evalOpParm(myDebug_menu, nodeidx, "debug_menu", time, graph->isDirect()?nullptr:depnode);
352  myDebug_coarse_lvl = 0;
353  if (true && ( (true&&!(((int64(getDebug_menu())!=1)))) ) )
354  graph->evalOpParm(myDebug_coarse_lvl, nodeidx, "debug_coarse_lvl", time, graph->isDirect()?nullptr:depnode);
355  myDebug_coarse_iteration = 0;
356  if (true && ( (true&&!(((int64(getDebug_menu())!=1)))) ) )
357  graph->evalOpParm(myDebug_coarse_iteration, nodeidx, "debug_coarse_iteration", time, graph->isDirect()?nullptr:depnode);
358  myDebug_dense_lvl = 0;
359  if (true && ( (true&&!(((int64(getDebug_menu())!=2)))) ) )
360  graph->evalOpParm(myDebug_dense_lvl, nodeidx, "debug_dense_lvl", time, graph->isDirect()?nullptr:depnode);
361  myDebug_dense_iteration = 0;
362  if (true && ( (true&&!(((int64(getDebug_menu())!=2)))) ) )
363  graph->evalOpParm(myDebug_dense_iteration, nodeidx, "debug_dense_iteration", time, graph->isDirect()?nullptr:depnode);
364  myDebug_hessian_scaling = true;
365  if (true)
366  graph->evalOpParm(myDebug_hessian_scaling, nodeidx, "debug_hessian_scaling", time, graph->isDirect()?nullptr:depnode);
367  myDebug_use_marquadt = true;
368  if (true)
369  graph->evalOpParm(myDebug_use_marquadt, nodeidx, "debug_use_marquadt", time, graph->isDirect()?nullptr:depnode);
370  myParameter_tolerance = 0.0001;
371  if (true)
372  graph->evalOpParm(myParameter_tolerance, nodeidx, "parameter_tolerance", time, graph->isDirect()?nullptr:depnode);
373  myUse_tau = false;
374  if (true)
375  graph->evalOpParm(myUse_tau, nodeidx, "use_tau", time, graph->isDirect()?nullptr:depnode);
376  myTau = 0.000001;
377  if (true && ( (true&&!(((getUse_tau()!=1)))) ) )
378  graph->evalOpParm(myTau, nodeidx, "tau", time, graph->isDirect()?nullptr:depnode);
379  myInitial_damping = 0.0001;
380  if (true && ( (true&&!(((getUse_tau()==1)))) ) )
381  graph->evalOpParm(myInitial_damping, nodeidx, "initial_damping", time, graph->isDirect()?nullptr:depnode);
382  myDebug_save_meshes = false;
383  if (true)
384  graph->evalOpParm(myDebug_save_meshes, nodeidx, "debug_save_meshes", time, graph->isDirect()?nullptr:depnode);
385  myUseLandmarkLables = true;
386  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0))||(((graph->getInput(nodeidx,3)>=0)==0)))) ) )
387  graph->evalOpParm(myUseLandmarkLables, nodeidx, "uselandmarklabels", time, graph->isDirect()?nullptr:depnode);
388  myLandmarkAttribute = "landmark"_UTsh;
389  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0))||(((graph->getInput(nodeidx,3)>=0)==0))||((getUseLandmarkLables()==0)))) ) )
390  graph->evalOpParm(myLandmarkAttribute, nodeidx, "landmarkattrib", time, graph->isDirect()?nullptr:depnode);
391  myEnableLandmarks = true;
392  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1)))) ) )
393  graph->evalOpParm(myEnableLandmarks, nodeidx, "enablelandmarks", time, graph->isDirect()?nullptr:depnode);
394  if (true && ( (!((((graph->getInput(nodeidx,2)>=0)==1)&&((graph->getInput(nodeidx,3)>=0)==1))||((getEnableLandmarks()==0)))) ) )
395  {
396  int64 length = 0;
397  graph->evalOpParm(length, nodeidx, "numlandmarkgroups", time, graph->isDirect()?nullptr:depnode);
398  if (length < 0) length = 0;
399  myNumlandmarkgroups.setSize(length);
400  for (exint i = 0; i < length; i++)
401  {
402  int parmidx[1];
403  int offsets[1];
404  parmidx[0] = i+1;
405  offsets[0] = 1;
406  auto && _curentry = myNumlandmarkgroups(i);
407  (void) _curentry;
408  _curentry.enablegroup = true;
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)))) ) )
410  graph->evalOpParmInst(_curentry.enablegroup, nodeidx, "enablegroup#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
411  _curentry.pballcolor = UT_Vector3D(0,0,1);
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.pballcolor, nodeidx, "pballcolor#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
414  _curentry.pname = "group#"_UTsh;
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.pname, nodeidx, "pname#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
417  _curentry.usesourcepos = true;
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)))) ) )
419  graph->evalOpParmInst(_curentry.usesourcepos, nodeidx, "usesourcepos#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
420  _curentry.sourcepos = ""_UTsh;
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))||((_curentry.usesourcepos==0)))) ) )
422  graph->evalOpParmInst(_curentry.sourcepos, nodeidx, "sourcepos#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
423  _curentry.usetargetpos = true;
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)))) ) )
425  graph->evalOpParmInst(_curentry.usetargetpos, nodeidx, "usetargetpos#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
426  _curentry.targetpos = ""_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.usetargetpos==0)))) ) )
428  graph->evalOpParmInst(_curentry.targetpos, nodeidx, "targetpos#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
429  _curentry.psourcegroup = ""_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.usesourcepos==1)))) ) )
431  graph->evalOpParmInst(_curentry.psourcegroup, nodeidx, "psourcegroup#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
432  _curentry.ptargetgroup = ""_UTsh;
433  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)))) ) )
434  graph->evalOpParmInst(_curentry.ptargetgroup, nodeidx, "ptargetgroup#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
435 
436  }
437  }
438  else
439  myNumlandmarkgroups.clear();
440  myRigidMask = "rigid_mask"_UTsh;
441  if (true && ( (true&&!(((int64(getMaskMode())==0)))) ) )
442  graph->evalOpParm(myRigidMask, nodeidx, "rigidmask", time, graph->isDirect()?nullptr:depnode);
443 
444  }
445 
446 
447  void loadFromOpSubclass(const LoadParms &loadparms) override
448  {
449  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
450  }
451 
452 
453  void copyFrom(const OP_NodeParms *src) override
454  {
455  *this = *((const SOP_TopoTransferParms *)src);
456  }
457 
458  template <typename T>
459  void
460  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
461  {
462  if (idx.size() < 1)
463  return;
464  UT_ASSERT(idx.size() == instance.size()+1);
465  if (idx.size() != instance.size()+1)
466  return;
467  switch (idx[0])
468  {
469  case 0:
470  coerceValue(value, myEnableSolve);
471  break;
472  case 1:
473  coerceValue(value, myEnableGeometryConstraints);
474  break;
475  case 2:
476  coerceValue(value, myConstraintSelection);
477  break;
478  case 3:
479  coerceValue(value, myConstraintSource);
480  break;
481  case 4:
482  coerceValue(value, myIterations);
483  break;
484  case 5:
485  coerceValue(value, myReducedLevels);
486  break;
487  case 6:
488  coerceValue(value, myReductionPercentage);
489  break;
490  case 7:
491  coerceValue(value, myReductionPercentageSingle);
492  break;
493  case 8:
494  coerceValue(value, myInitialReductionPercentage);
495  break;
496  case 9:
497  coerceValue(value, myRigidWeights);
498  break;
499  case 10:
500  coerceValue(value, myLandmarkWeights);
501  break;
502  case 11:
503  coerceValue(value, myMaskMode);
504  break;
505  case 12:
506  coerceValue(value, myMaskTolerance);
507  break;
508  case 13:
509  coerceValue(value, myRigidprimitives);
510  break;
511  case 14:
512  coerceValue(value, myDistTolerance);
513  break;
514  case 15:
515  coerceValue(value, myNormTolerance);
516  break;
517  case 16:
518  coerceValue(value, mySolverType);
519  break;
520  case 17:
521  coerceValue(value, mySolverIterations);
522  break;
523  case 18:
524  coerceValue(value, myGradientTolerance);
525  break;
526  case 19:
527  coerceValue(value, myDebug_menu);
528  break;
529  case 20:
530  coerceValue(value, myDebug_coarse_lvl);
531  break;
532  case 21:
533  coerceValue(value, myDebug_coarse_iteration);
534  break;
535  case 22:
536  coerceValue(value, myDebug_dense_lvl);
537  break;
538  case 23:
539  coerceValue(value, myDebug_dense_iteration);
540  break;
541  case 24:
542  coerceValue(value, myDebug_hessian_scaling);
543  break;
544  case 25:
545  coerceValue(value, myDebug_use_marquadt);
546  break;
547  case 26:
548  coerceValue(value, myParameter_tolerance);
549  break;
550  case 27:
551  coerceValue(value, myUse_tau);
552  break;
553  case 28:
554  coerceValue(value, myTau);
555  break;
556  case 29:
557  coerceValue(value, myInitial_damping);
558  break;
559  case 30:
560  coerceValue(value, myDebug_save_meshes);
561  break;
562  case 31:
563  coerceValue(value, myUseLandmarkLables);
564  break;
565  case 32:
566  coerceValue(value, myLandmarkAttribute);
567  break;
568  case 33:
569  coerceValue(value, myEnableLandmarks);
570  break;
571  case 34:
572  if (idx.size() == 1)
573  coerceValue(value, myNumlandmarkgroups.entries());
574  else if (instance[0] < myNumlandmarkgroups.entries())
575  {
576  auto && _data = myNumlandmarkgroups(instance[0]);
577  switch (idx[1])
578  {
579  case 0:
580  coerceValue(value, _data.enablegroup);
581  break;
582  case 1:
583  coerceValue(value, _data.pballcolor);
584  break;
585  case 2:
586  coerceValue(value, _data.pname);
587  break;
588  case 3:
589  coerceValue(value, _data.usesourcepos);
590  break;
591  case 4:
592  coerceValue(value, _data.sourcepos);
593  break;
594  case 5:
595  coerceValue(value, _data.usetargetpos);
596  break;
597  case 6:
598  coerceValue(value, _data.targetpos);
599  break;
600  case 7:
601  coerceValue(value, _data.psourcegroup);
602  break;
603  case 8:
604  coerceValue(value, _data.ptargetgroup);
605  break;
606 
607  }
608  }
609  break;
610  case 35:
611  coerceValue(value, myRigidMask);
612  break;
613 
614  }
615  }
616 
617  bool isParmColorRamp(exint idx) const override
618  {
619  switch (idx)
620  {
621 
622  }
623  return false;
624  }
625 
626  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
627  { doGetParmValue(idx, instance, value); }
628  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
629  { doGetParmValue(idx, instance, value); }
630  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
631  { doGetParmValue(idx, instance, value); }
632  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
633  { doGetParmValue(idx, instance, value); }
634  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
635  { doGetParmValue(idx, instance, value); }
636  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
637  { doGetParmValue(idx, instance, value); }
638  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
639  { doGetParmValue(idx, instance, value); }
640  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
641  { doGetParmValue(idx, instance, value); }
642  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
643  { doGetParmValue(idx, instance, value); }
644  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
645  { doGetParmValue(idx, instance, value); }
646  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
647  { doGetParmValue(idx, instance, value); }
648 
649  template <typename T>
650  void
651  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
652  {
653  if (idx.size() < 1)
654  return;
655  UT_ASSERT(idx.size() == instance.size()+1);
656  if (idx.size() != instance.size()+1)
657  return;
658  switch (idx[0])
659  {
660  case 0:
661  coerceValue(myEnableSolve, ( ( value ) ));
662  break;
663  case 1:
664  coerceValue(myEnableGeometryConstraints, ( ( value ) ));
665  break;
666  case 2:
667  coerceValue(myConstraintSelection, clampMinValue(0, clampMaxValue(1, value ) ));
668  break;
669  case 3:
670  coerceValue(myConstraintSource, ( ( value ) ));
671  break;
672  case 4:
673  coerceValue(myIterations, clampMinValue(1, ( value ) ));
674  break;
675  case 5:
676  coerceValue(myReducedLevels, clampMinValue(1, ( value ) ));
677  break;
678  case 6:
679  coerceValue(myReductionPercentage, clampMinValue(0.05, clampMaxValue(1, value ) ));
680  break;
681  case 7:
682  coerceValue(myReductionPercentageSingle, clampMinValue(0.05, clampMaxValue(1, value ) ));
683  break;
684  case 8:
685  coerceValue(myInitialReductionPercentage, clampMinValue(0.05, clampMaxValue(1, value ) ));
686  break;
687  case 9:
688  coerceValue(myRigidWeights, clampMinValue(0, ( value ) ));
689  break;
690  case 10:
691  coerceValue(myLandmarkWeights, clampMinValue(0, ( value ) ));
692  break;
693  case 11:
694  coerceValue(myMaskMode, clampMinValue(0, clampMaxValue(1, value ) ));
695  break;
696  case 12:
697  coerceValue(myMaskTolerance, clampMinValue(0.0, clampMaxValue(1, value ) ));
698  break;
699  case 13:
700  coerceValue(myRigidprimitives, ( ( value ) ));
701  break;
702  case 14:
703  coerceValue(myDistTolerance, clampMinValue(0.0001, ( value ) ));
704  break;
705  case 15:
706  coerceValue(myNormTolerance, clampMinValue(1, clampMaxValue(180, value ) ));
707  break;
708  case 16:
709  coerceValue(mySolverType, clampMinValue(0, clampMaxValue(1, value ) ));
710  break;
711  case 17:
712  coerceValue(mySolverIterations, clampMinValue(1, ( value ) ));
713  break;
714  case 18:
715  coerceValue(myGradientTolerance, clampMinValue(0.00001, clampMaxValue(1.0, value ) ));
716  break;
717  case 19:
718  coerceValue(myDebug_menu, clampMinValue(0, clampMaxValue(2, value ) ));
719  break;
720  case 20:
721  coerceValue(myDebug_coarse_lvl, ( ( value ) ));
722  break;
723  case 21:
724  coerceValue(myDebug_coarse_iteration, ( ( value ) ));
725  break;
726  case 22:
727  coerceValue(myDebug_dense_lvl, ( ( value ) ));
728  break;
729  case 23:
730  coerceValue(myDebug_dense_iteration, ( ( value ) ));
731  break;
732  case 24:
733  coerceValue(myDebug_hessian_scaling, ( ( value ) ));
734  break;
735  case 25:
736  coerceValue(myDebug_use_marquadt, ( ( value ) ));
737  break;
738  case 26:
739  coerceValue(myParameter_tolerance, ( ( value ) ));
740  break;
741  case 27:
742  coerceValue(myUse_tau, ( ( value ) ));
743  break;
744  case 28:
745  coerceValue(myTau, ( ( value ) ));
746  break;
747  case 29:
748  coerceValue(myInitial_damping, ( ( value ) ));
749  break;
750  case 30:
751  coerceValue(myDebug_save_meshes, ( ( value ) ));
752  break;
753  case 31:
754  coerceValue(myUseLandmarkLables, ( ( value ) ));
755  break;
756  case 32:
757  coerceValue(myLandmarkAttribute, ( ( value ) ));
758  break;
759  case 33:
760  coerceValue(myEnableLandmarks, ( ( value ) ));
761  break;
762  case 34:
763  if (idx.size() == 1)
764  {
765  exint newsize;
766  coerceValue(newsize, value);
767  if (newsize < 0) newsize = 0;
768  myNumlandmarkgroups.setSize(newsize);
769  }
770  else
771  {
772  if (instance[0] < 0)
773  return;
774  myNumlandmarkgroups.setSizeIfNeeded(instance[0]+1);
775  auto && _data = myNumlandmarkgroups(instance[0]);
776  switch (idx[1])
777  {
778  case 0:
779  coerceValue(_data.enablegroup, value);
780  break;
781  case 1:
782  coerceValue(_data.pballcolor, value);
783  break;
784  case 2:
785  coerceValue(_data.pname, value);
786  break;
787  case 3:
788  coerceValue(_data.usesourcepos, value);
789  break;
790  case 4:
791  coerceValue(_data.sourcepos, value);
792  break;
793  case 5:
794  coerceValue(_data.usetargetpos, value);
795  break;
796  case 6:
797  coerceValue(_data.targetpos, value);
798  break;
799  case 7:
800  coerceValue(_data.psourcegroup, value);
801  break;
802  case 8:
803  coerceValue(_data.ptargetgroup, value);
804  break;
805 
806  }
807  }
808  break;
809  case 35:
810  coerceValue(myRigidMask, ( ( value ) ));
811  break;
812 
813  }
814  }
815 
816  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
817  { doSetParmValue(idx, instance, value); }
818  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
819  { doSetParmValue(idx, instance, value); }
820  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
821  { doSetParmValue(idx, instance, value); }
822  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
823  { doSetParmValue(idx, instance, value); }
824  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
825  { doSetParmValue(idx, instance, value); }
826  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
827  { doSetParmValue(idx, instance, value); }
828  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
829  { doSetParmValue(idx, instance, value); }
830  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
831  { doSetParmValue(idx, instance, value); }
832  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
833  { doSetParmValue(idx, instance, value); }
834  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
835  { doSetParmValue(idx, instance, value); }
836  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
837  { doSetParmValue(idx, instance, value); }
838 
839  exint getNestNumParms(TempIndex idx) const override
840  {
841  if (idx.size() == 0)
842  return 36;
843  switch (idx[0])
844  {
845  case 34:
846  return 9;
847 
848  }
849  // Invalid
850  return 0;
851  }
852 
853  const char *getNestParmName(TempIndex fieldnum) const override
854  {
855  if (fieldnum.size() < 1)
856  return 0;
857  switch (fieldnum[0])
858  {
859  case 0:
860  return "enablesolve";
861  case 1:
862  return "enablegeometryconstraints";
863  case 2:
864  return "constraintselection";
865  case 3:
866  return "constraintsource";
867  case 4:
868  return "iterations";
869  case 5:
870  return "reducedlevels";
871  case 6:
872  return "reductionpercentage";
873  case 7:
874  return "reductionpercentage_single";
875  case 8:
876  return "initialreductionpercentage";
877  case 9:
878  return "rigidweights";
879  case 10:
880  return "landmarkweights";
881  case 11:
882  return "maskmode";
883  case 12:
884  return "masktolerance";
885  case 13:
886  return "rigidprimitives";
887  case 14:
888  return "disttolerance";
889  case 15:
890  return "normtolerance";
891  case 16:
892  return "solvertype";
893  case 17:
894  return "solveriterations";
895  case 18:
896  return "gradienttolerance";
897  case 19:
898  return "debug_menu";
899  case 20:
900  return "debug_coarse_lvl";
901  case 21:
902  return "debug_coarse_iteration";
903  case 22:
904  return "debug_dense_lvl";
905  case 23:
906  return "debug_dense_iteration";
907  case 24:
908  return "debug_hessian_scaling";
909  case 25:
910  return "debug_use_marquadt";
911  case 26:
912  return "parameter_tolerance";
913  case 27:
914  return "use_tau";
915  case 28:
916  return "tau";
917  case 29:
918  return "initial_damping";
919  case 30:
920  return "debug_save_meshes";
921  case 31:
922  return "uselandmarklabels";
923  case 32:
924  return "landmarkattrib";
925  case 33:
926  return "enablelandmarks";
927  case 34:
928  if (fieldnum.size() == 1)
929  return "numlandmarkgroups";
930  switch (fieldnum[1])
931  {
932  case 0:
933  return "enablegroup#";
934  case 1:
935  return "pballcolor#";
936  case 2:
937  return "pname#";
938  case 3:
939  return "usesourcepos#";
940  case 4:
941  return "sourcepos#";
942  case 5:
943  return "usetargetpos#";
944  case 6:
945  return "targetpos#";
946  case 7:
947  return "psourcegroup#";
948  case 8:
949  return "ptargetgroup#";
950 
951  }
952  return 0;
953  case 35:
954  return "rigidmask";
955 
956  }
957  return 0;
958  }
959 
960  ParmType getNestParmType(TempIndex fieldnum) const override
961  {
962  if (fieldnum.size() < 1)
963  return PARM_UNSUPPORTED;
964  switch (fieldnum[0])
965  {
966  case 0:
967  return PARM_INTEGER;
968  case 1:
969  return PARM_INTEGER;
970  case 2:
971  return PARM_INTEGER;
972  case 3:
973  return PARM_STRING;
974  case 4:
975  return PARM_INTEGER;
976  case 5:
977  return PARM_INTEGER;
978  case 6:
979  return PARM_VECTOR2;
980  case 7:
981  return PARM_FLOAT;
982  case 8:
983  return PARM_FLOAT;
984  case 9:
985  return PARM_VECTOR2;
986  case 10:
987  return PARM_VECTOR2;
988  case 11:
989  return PARM_INTEGER;
990  case 12:
991  return PARM_FLOAT;
992  case 13:
993  return PARM_STRING;
994  case 14:
995  return PARM_FLOAT;
996  case 15:
997  return PARM_FLOAT;
998  case 16:
999  return PARM_INTEGER;
1000  case 17:
1001  return PARM_INTEGER;
1002  case 18:
1003  return PARM_VECTOR2;
1004  case 19:
1005  return PARM_INTEGER;
1006  case 20:
1007  return PARM_INTEGER;
1008  case 21:
1009  return PARM_INTEGER;
1010  case 22:
1011  return PARM_INTEGER;
1012  case 23:
1013  return PARM_INTEGER;
1014  case 24:
1015  return PARM_INTEGER;
1016  case 25:
1017  return PARM_INTEGER;
1018  case 26:
1019  return PARM_FLOAT;
1020  case 27:
1021  return PARM_INTEGER;
1022  case 28:
1023  return PARM_FLOAT;
1024  case 29:
1025  return PARM_FLOAT;
1026  case 30:
1027  return PARM_INTEGER;
1028  case 31:
1029  return PARM_INTEGER;
1030  case 32:
1031  return PARM_STRING;
1032  case 33:
1033  return PARM_INTEGER;
1034  case 34:
1035  if (fieldnum.size() == 1)
1036  return PARM_MULTIPARM;
1037  switch (fieldnum[1])
1038  {
1039  case 0:
1040  return PARM_INTEGER;
1041  case 1:
1042  return PARM_VECTOR3;
1043  case 2:
1044  return PARM_STRING;
1045  case 3:
1046  return PARM_INTEGER;
1047  case 4:
1048  return PARM_STRING;
1049  case 5:
1050  return PARM_INTEGER;
1051  case 6:
1052  return PARM_STRING;
1053  case 7:
1054  return PARM_STRING;
1055  case 8:
1056  return PARM_STRING;
1057 
1058  }
1059  return PARM_UNSUPPORTED;
1060  case 35:
1061  return PARM_STRING;
1062 
1063  }
1064  return PARM_UNSUPPORTED;
1065  }
1066 
1067  // Boiler plate to load individual types.
1068  static void loadData(UT_IStream &is, int64 &v)
1069  { is.bread(&v, 1); }
1070  static void loadData(UT_IStream &is, bool &v)
1071  { int64 iv; is.bread(&iv, 1); v = iv; }
1072  static void loadData(UT_IStream &is, fpreal64 &v)
1073  { is.bread<fpreal64>(&v, 1); }
1074  static void loadData(UT_IStream &is, UT_Vector2D &v)
1075  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
1076  static void loadData(UT_IStream &is, UT_Vector3D &v)
1077  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
1078  is.bread<fpreal64>(&v.z(), 1); }
1079  static void loadData(UT_IStream &is, UT_Vector4D &v)
1080  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
1081  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
1082  static void loadData(UT_IStream &is, UT_Matrix2D &v)
1083  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
1084  static void loadData(UT_IStream &is, UT_Matrix3D &v)
1085  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
1086  static void loadData(UT_IStream &is, UT_Matrix4D &v)
1087  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
1088  static void loadData(UT_IStream &is, UT_Vector2I &v)
1089  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
1090  static void loadData(UT_IStream &is, UT_Vector3I &v)
1091  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
1092  is.bread<int64>(&v.z(), 1); }
1093  static void loadData(UT_IStream &is, UT_Vector4I &v)
1094  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
1095  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
1097  { is.bread(v); }
1099  { UT_StringHolder rampdata;
1100  loadData(is, rampdata);
1101  if (rampdata.isstring())
1102  {
1103  v.reset(new UT_Ramp());
1104  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
1105  v->load(istr);
1106  }
1107  else v.reset();
1108  }
1111  loadData(is, data);
1112  if (data.isstring())
1113  {
1114  // Find the data type.
1115  const char *colon = UT_StringWrap(data).findChar(':');
1116  if (colon)
1117  {
1118  int typelen = colon - data.buffer();
1120  type.strncpy(data.buffer(), typelen);
1121  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
1122 
1123  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
1124  }
1125  }
1126  else v.reset();
1127  }
1128 
1129  static void saveData(std::ostream &os, int64 v)
1130  { UTwrite(os, &v); }
1131  static void saveData(std::ostream &os, bool v)
1132  { int64 iv = v; UTwrite(os, &iv); }
1133  static void saveData(std::ostream &os, fpreal64 v)
1134  { UTwrite<fpreal64>(os, &v); }
1135  static void saveData(std::ostream &os, UT_Vector2D v)
1136  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
1137  static void saveData(std::ostream &os, UT_Vector3D v)
1138  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1139  UTwrite<fpreal64>(os, &v.z()); }
1140  static void saveData(std::ostream &os, UT_Vector4D v)
1141  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1142  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
1143  static void saveData(std::ostream &os, UT_Matrix2D v)
1145  static void saveData(std::ostream &os, UT_Matrix3D v)
1147  static void saveData(std::ostream &os, UT_Matrix4D v)
1149  static void saveData(std::ostream &os, UT_StringHolder s)
1150  { UT_StringWrap(s).saveBinary(os); }
1151  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
1153  UT_OStringStream ostr;
1154  if (s) s->save(ostr);
1155  result = ostr.str();
1156  saveData(os, result);
1157  }
1158  static void saveData(std::ostream &os, PRM_DataItemHandle s)
1160  UT_OStringStream ostr;
1161  if (s)
1162  {
1163  ostr << s->getDataTypeToken();
1164  ostr << ":";
1165  s->saveBinary(ostr);
1166  }
1167  result = ostr.str();
1168  saveData(os, result);
1169  }
1170 
1171 
1172  void save(std::ostream &os) const
1173  {
1174  int32 v = version();
1175  UTwrite(os, &v);
1176  saveData(os, myEnableSolve);
1177  saveData(os, myEnableGeometryConstraints);
1178  saveData(os, myConstraintSelection);
1179  saveData(os, myConstraintSource);
1180  saveData(os, myIterations);
1181  saveData(os, myReducedLevels);
1182  saveData(os, myReductionPercentage);
1183  saveData(os, myReductionPercentageSingle);
1184  saveData(os, myInitialReductionPercentage);
1185  saveData(os, myRigidWeights);
1186  saveData(os, myLandmarkWeights);
1187  saveData(os, myMaskMode);
1188  saveData(os, myMaskTolerance);
1189  saveData(os, myRigidprimitives);
1190  saveData(os, myDistTolerance);
1191  saveData(os, myNormTolerance);
1192  saveData(os, mySolverType);
1193  saveData(os, mySolverIterations);
1194  saveData(os, myGradientTolerance);
1195  saveData(os, myDebug_menu);
1196  saveData(os, myDebug_coarse_lvl);
1197  saveData(os, myDebug_coarse_iteration);
1198  saveData(os, myDebug_dense_lvl);
1199  saveData(os, myDebug_dense_iteration);
1200  saveData(os, myDebug_hessian_scaling);
1201  saveData(os, myDebug_use_marquadt);
1202  saveData(os, myParameter_tolerance);
1203  saveData(os, myUse_tau);
1204  saveData(os, myTau);
1205  saveData(os, myInitial_damping);
1206  saveData(os, myDebug_save_meshes);
1207  saveData(os, myUseLandmarkLables);
1208  saveData(os, myLandmarkAttribute);
1209  saveData(os, myEnableLandmarks);
1210  {
1211  int64 length = myNumlandmarkgroups.entries();
1212  UTwrite(os, &length);
1213  for (exint i = 0; i < length; i++)
1214  {
1215  auto && _curentry = myNumlandmarkgroups(i);
1216  (void) _curentry;
1217  saveData(os, _curentry.enablegroup);
1218  saveData(os, _curentry.pballcolor);
1219  saveData(os, _curentry.pname);
1220  saveData(os, _curentry.usesourcepos);
1221  saveData(os, _curentry.sourcepos);
1222  saveData(os, _curentry.usetargetpos);
1223  saveData(os, _curentry.targetpos);
1224  saveData(os, _curentry.psourcegroup);
1225  saveData(os, _curentry.ptargetgroup);
1226 
1227  }
1228  }
1229  saveData(os, myRigidMask);
1230 
1231  }
1232 
1233  bool load(UT_IStream &is)
1234  {
1235  int32 v;
1236  is.bread(&v, 1);
1237  if (version() != v)
1238  {
1239  // Fail incompatible versions
1240  return false;
1241  }
1242  loadData(is, myEnableSolve);
1243  loadData(is, myEnableGeometryConstraints);
1244  loadData(is, myConstraintSelection);
1245  loadData(is, myConstraintSource);
1246  loadData(is, myIterations);
1247  loadData(is, myReducedLevels);
1248  loadData(is, myReductionPercentage);
1249  loadData(is, myReductionPercentageSingle);
1250  loadData(is, myInitialReductionPercentage);
1251  loadData(is, myRigidWeights);
1252  loadData(is, myLandmarkWeights);
1253  loadData(is, myMaskMode);
1254  loadData(is, myMaskTolerance);
1255  loadData(is, myRigidprimitives);
1256  loadData(is, myDistTolerance);
1257  loadData(is, myNormTolerance);
1258  loadData(is, mySolverType);
1259  loadData(is, mySolverIterations);
1260  loadData(is, myGradientTolerance);
1261  loadData(is, myDebug_menu);
1262  loadData(is, myDebug_coarse_lvl);
1263  loadData(is, myDebug_coarse_iteration);
1264  loadData(is, myDebug_dense_lvl);
1265  loadData(is, myDebug_dense_iteration);
1266  loadData(is, myDebug_hessian_scaling);
1267  loadData(is, myDebug_use_marquadt);
1268  loadData(is, myParameter_tolerance);
1269  loadData(is, myUse_tau);
1270  loadData(is, myTau);
1271  loadData(is, myInitial_damping);
1272  loadData(is, myDebug_save_meshes);
1273  loadData(is, myUseLandmarkLables);
1274  loadData(is, myLandmarkAttribute);
1275  loadData(is, myEnableLandmarks);
1276  {
1277  int64 length;
1278  is.read(&length, 1);
1279  myNumlandmarkgroups.setSize(length);
1280  for (exint i = 0; i < length; i++)
1281  {
1282  auto && _curentry = myNumlandmarkgroups(i);
1283  (void) _curentry;
1284  loadData(is, _curentry.enablegroup);
1285  loadData(is, _curentry.pballcolor);
1286  loadData(is, _curentry.pname);
1287  loadData(is, _curentry.usesourcepos);
1288  loadData(is, _curentry.sourcepos);
1289  loadData(is, _curentry.usetargetpos);
1290  loadData(is, _curentry.targetpos);
1291  loadData(is, _curentry.psourcegroup);
1292  loadData(is, _curentry.ptargetgroup);
1293 
1294  }
1295  }
1296  loadData(is, myRigidMask);
1297 
1298  return true;
1299  }
1300 
1301  bool getEnableSolve() const { return myEnableSolve; }
1302  void setEnableSolve(bool val) { myEnableSolve = val; }
1303  bool opEnableSolve(const SOP_NodeVerb::CookParms &cookparms) const
1304  {
1305  SOP_Node *thissop = cookparms.getNode();
1306  if (!thissop) return getEnableSolve();
1307  bool result;
1308  OP_Utils::evalOpParm(result, thissop, "enablesolve", cookparms.getCookTime(), 0);
1309  return result;
1310  }
1311  bool getEnableGeometryConstraints() const { return myEnableGeometryConstraints; }
1312  void setEnableGeometryConstraints(bool val) { myEnableGeometryConstraints = val; }
1314  {
1315  SOP_Node *thissop = cookparms.getNode();
1316  if (!thissop) return getEnableGeometryConstraints();
1317  bool result;
1318  OP_Utils::evalOpParm(result, thissop, "enablegeometryconstraints", cookparms.getCookTime(), 0);
1319  return result;
1320  }
1321  ConstraintSelection getConstraintSelection() const { return ConstraintSelection(myConstraintSelection); }
1322  void setConstraintSelection(ConstraintSelection val) { myConstraintSelection = int64(val); }
1324  {
1325  SOP_Node *thissop = cookparms.getNode();
1326  if (!thissop) return getConstraintSelection();
1327  int64 result;
1328  OP_Utils::evalOpParm(result, thissop, "constraintselection", cookparms.getCookTime(), 0);
1329  return ConstraintSelection(result);
1330  }
1331  const UT_StringHolder & getConstraintSource() const { return myConstraintSource; }
1332  void setConstraintSource(const UT_StringHolder & val) { myConstraintSource = val; }
1334  {
1335  SOP_Node *thissop = cookparms.getNode();
1336  if (!thissop) return getConstraintSource();
1338  OP_Utils::evalOpParm(result, thissop, "constraintsource", cookparms.getCookTime(), 0);
1339  return result;
1340  }
1341  int64 getIterations() const { return myIterations; }
1342  void setIterations(int64 val) { myIterations = val; }
1344  {
1345  SOP_Node *thissop = cookparms.getNode();
1346  if (!thissop) return getIterations();
1347  int64 result;
1348  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
1349  return result;
1350  }
1351  int64 getReducedLevels() const { return myReducedLevels; }
1352  void setReducedLevels(int64 val) { myReducedLevels = val; }
1354  {
1355  SOP_Node *thissop = cookparms.getNode();
1356  if (!thissop) return getReducedLevels();
1357  int64 result;
1358  OP_Utils::evalOpParm(result, thissop, "reducedlevels", cookparms.getCookTime(), 0);
1359  return result;
1360  }
1361  UT_Vector2D getReductionPercentage() const { return myReductionPercentage; }
1362  void setReductionPercentage(UT_Vector2D val) { myReductionPercentage = val; }
1364  {
1365  SOP_Node *thissop = cookparms.getNode();
1366  if (!thissop) return getReductionPercentage();
1368  OP_Utils::evalOpParm(result, thissop, "reductionpercentage", cookparms.getCookTime(), 0);
1369  return result;
1370  }
1371  fpreal64 getReductionPercentageSingle() const { return myReductionPercentageSingle; }
1372  void setReductionPercentageSingle(fpreal64 val) { myReductionPercentageSingle = val; }
1374  {
1375  SOP_Node *thissop = cookparms.getNode();
1376  if (!thissop) return getReductionPercentageSingle();
1377  fpreal64 result;
1378  OP_Utils::evalOpParm(result, thissop, "reductionpercentage_single", cookparms.getCookTime(), 0);
1379  return result;
1380  }
1381  fpreal64 getInitialReductionPercentage() const { return myInitialReductionPercentage; }
1382  void setInitialReductionPercentage(fpreal64 val) { myInitialReductionPercentage = val; }
1384  {
1385  SOP_Node *thissop = cookparms.getNode();
1386  if (!thissop) return getInitialReductionPercentage();
1387  fpreal64 result;
1388  OP_Utils::evalOpParm(result, thissop, "initialreductionpercentage", cookparms.getCookTime(), 0);
1389  return result;
1390  }
1391  UT_Vector2D getRigidWeights() const { return myRigidWeights; }
1392  void setRigidWeights(UT_Vector2D val) { myRigidWeights = val; }
1394  {
1395  SOP_Node *thissop = cookparms.getNode();
1396  if (!thissop) return getRigidWeights();
1398  OP_Utils::evalOpParm(result, thissop, "rigidweights", cookparms.getCookTime(), 0);
1399  return result;
1400  }
1401  UT_Vector2D getLandmarkWeights() const { return myLandmarkWeights; }
1402  void setLandmarkWeights(UT_Vector2D val) { myLandmarkWeights = val; }
1404  {
1405  SOP_Node *thissop = cookparms.getNode();
1406  if (!thissop) return getLandmarkWeights();
1408  OP_Utils::evalOpParm(result, thissop, "landmarkweights", cookparms.getCookTime(), 0);
1409  return result;
1410  }
1411  MaskMode getMaskMode() const { return MaskMode(myMaskMode); }
1412  void setMaskMode(MaskMode val) { myMaskMode = int64(val); }
1414  {
1415  SOP_Node *thissop = cookparms.getNode();
1416  if (!thissop) return getMaskMode();
1417  int64 result;
1418  OP_Utils::evalOpParm(result, thissop, "maskmode", cookparms.getCookTime(), 0);
1419  return MaskMode(result);
1420  }
1421  fpreal64 getMaskTolerance() const { return myMaskTolerance; }
1422  void setMaskTolerance(fpreal64 val) { myMaskTolerance = val; }
1424  {
1425  SOP_Node *thissop = cookparms.getNode();
1426  if (!thissop) return getMaskTolerance();
1427  fpreal64 result;
1428  OP_Utils::evalOpParm(result, thissop, "masktolerance", cookparms.getCookTime(), 0);
1429  return result;
1430  }
1431  const UT_StringHolder & getRigidprimitives() const { return myRigidprimitives; }
1432  void setRigidprimitives(const UT_StringHolder & val) { myRigidprimitives = val; }
1434  {
1435  SOP_Node *thissop = cookparms.getNode();
1436  if (!thissop) return getRigidprimitives();
1438  OP_Utils::evalOpParm(result, thissop, "rigidprimitives", cookparms.getCookTime(), 0);
1439  return result;
1440  }
1441  fpreal64 getDistTolerance() const { return myDistTolerance; }
1442  void setDistTolerance(fpreal64 val) { myDistTolerance = val; }
1444  {
1445  SOP_Node *thissop = cookparms.getNode();
1446  if (!thissop) return getDistTolerance();
1447  fpreal64 result;
1448  OP_Utils::evalOpParm(result, thissop, "disttolerance", cookparms.getCookTime(), 0);
1449  return result;
1450  }
1451  fpreal64 getNormTolerance() const { return myNormTolerance; }
1452  void setNormTolerance(fpreal64 val) { myNormTolerance = val; }
1454  {
1455  SOP_Node *thissop = cookparms.getNode();
1456  if (!thissop) return getNormTolerance();
1457  fpreal64 result;
1458  OP_Utils::evalOpParm(result, thissop, "normtolerance", cookparms.getCookTime(), 0);
1459  return result;
1460  }
1461  SolverType getSolverType() const { return SolverType(mySolverType); }
1462  void setSolverType(SolverType val) { mySolverType = int64(val); }
1464  {
1465  SOP_Node *thissop = cookparms.getNode();
1466  if (!thissop) return getSolverType();
1467  int64 result;
1468  OP_Utils::evalOpParm(result, thissop, "solvertype", cookparms.getCookTime(), 0);
1469  return SolverType(result);
1470  }
1471  int64 getSolverIterations() const { return mySolverIterations; }
1472  void setSolverIterations(int64 val) { mySolverIterations = val; }
1474  {
1475  SOP_Node *thissop = cookparms.getNode();
1476  if (!thissop) return getSolverIterations();
1477  int64 result;
1478  OP_Utils::evalOpParm(result, thissop, "solveriterations", cookparms.getCookTime(), 0);
1479  return result;
1480  }
1481  UT_Vector2D getGradientTolerance() const { return myGradientTolerance; }
1482  void setGradientTolerance(UT_Vector2D val) { myGradientTolerance = val; }
1484  {
1485  SOP_Node *thissop = cookparms.getNode();
1486  if (!thissop) return getGradientTolerance();
1488  OP_Utils::evalOpParm(result, thissop, "gradienttolerance", cookparms.getCookTime(), 0);
1489  return result;
1490  }
1491  Debug_menu getDebug_menu() const { return Debug_menu(myDebug_menu); }
1492  void setDebug_menu(Debug_menu val) { myDebug_menu = int64(val); }
1494  {
1495  SOP_Node *thissop = cookparms.getNode();
1496  if (!thissop) return getDebug_menu();
1497  int64 result;
1498  OP_Utils::evalOpParm(result, thissop, "debug_menu", cookparms.getCookTime(), 0);
1499  return Debug_menu(result);
1500  }
1501  int64 getDebug_coarse_lvl() const { return myDebug_coarse_lvl; }
1502  void setDebug_coarse_lvl(int64 val) { myDebug_coarse_lvl = val; }
1504  {
1505  SOP_Node *thissop = cookparms.getNode();
1506  if (!thissop) return getDebug_coarse_lvl();
1507  int64 result;
1508  OP_Utils::evalOpParm(result, thissop, "debug_coarse_lvl", cookparms.getCookTime(), 0);
1509  return result;
1510  }
1511  int64 getDebug_coarse_iteration() const { return myDebug_coarse_iteration; }
1512  void setDebug_coarse_iteration(int64 val) { myDebug_coarse_iteration = val; }
1514  {
1515  SOP_Node *thissop = cookparms.getNode();
1516  if (!thissop) return getDebug_coarse_iteration();
1517  int64 result;
1518  OP_Utils::evalOpParm(result, thissop, "debug_coarse_iteration", cookparms.getCookTime(), 0);
1519  return result;
1520  }
1521  int64 getDebug_dense_lvl() const { return myDebug_dense_lvl; }
1522  void setDebug_dense_lvl(int64 val) { myDebug_dense_lvl = val; }
1524  {
1525  SOP_Node *thissop = cookparms.getNode();
1526  if (!thissop) return getDebug_dense_lvl();
1527  int64 result;
1528  OP_Utils::evalOpParm(result, thissop, "debug_dense_lvl", cookparms.getCookTime(), 0);
1529  return result;
1530  }
1531  int64 getDebug_dense_iteration() const { return myDebug_dense_iteration; }
1532  void setDebug_dense_iteration(int64 val) { myDebug_dense_iteration = val; }
1534  {
1535  SOP_Node *thissop = cookparms.getNode();
1536  if (!thissop) return getDebug_dense_iteration();
1537  int64 result;
1538  OP_Utils::evalOpParm(result, thissop, "debug_dense_iteration", cookparms.getCookTime(), 0);
1539  return result;
1540  }
1541  bool getDebug_hessian_scaling() const { return myDebug_hessian_scaling; }
1542  void setDebug_hessian_scaling(bool val) { myDebug_hessian_scaling = val; }
1544  {
1545  SOP_Node *thissop = cookparms.getNode();
1546  if (!thissop) return getDebug_hessian_scaling();
1547  bool result;
1548  OP_Utils::evalOpParm(result, thissop, "debug_hessian_scaling", cookparms.getCookTime(), 0);
1549  return result;
1550  }
1551  bool getDebug_use_marquadt() const { return myDebug_use_marquadt; }
1552  void setDebug_use_marquadt(bool val) { myDebug_use_marquadt = val; }
1553  bool opDebug_use_marquadt(const SOP_NodeVerb::CookParms &cookparms) const
1554  {
1555  SOP_Node *thissop = cookparms.getNode();
1556  if (!thissop) return getDebug_use_marquadt();
1557  bool result;
1558  OP_Utils::evalOpParm(result, thissop, "debug_use_marquadt", cookparms.getCookTime(), 0);
1559  return result;
1560  }
1561  fpreal64 getParameter_tolerance() const { return myParameter_tolerance; }
1562  void setParameter_tolerance(fpreal64 val) { myParameter_tolerance = val; }
1564  {
1565  SOP_Node *thissop = cookparms.getNode();
1566  if (!thissop) return getParameter_tolerance();
1567  fpreal64 result;
1568  OP_Utils::evalOpParm(result, thissop, "parameter_tolerance", cookparms.getCookTime(), 0);
1569  return result;
1570  }
1571  bool getUse_tau() const { return myUse_tau; }
1572  void setUse_tau(bool val) { myUse_tau = val; }
1573  bool opUse_tau(const SOP_NodeVerb::CookParms &cookparms) const
1574  {
1575  SOP_Node *thissop = cookparms.getNode();
1576  if (!thissop) return getUse_tau();
1577  bool result;
1578  OP_Utils::evalOpParm(result, thissop, "use_tau", cookparms.getCookTime(), 0);
1579  return result;
1580  }
1581  fpreal64 getTau() const { return myTau; }
1582  void setTau(fpreal64 val) { myTau = val; }
1583  fpreal64 opTau(const SOP_NodeVerb::CookParms &cookparms) const
1584  {
1585  SOP_Node *thissop = cookparms.getNode();
1586  if (!thissop) return getTau();
1587  fpreal64 result;
1588  OP_Utils::evalOpParm(result, thissop, "tau", cookparms.getCookTime(), 0);
1589  return result;
1590  }
1591  fpreal64 getInitial_damping() const { return myInitial_damping; }
1592  void setInitial_damping(fpreal64 val) { myInitial_damping = val; }
1594  {
1595  SOP_Node *thissop = cookparms.getNode();
1596  if (!thissop) return getInitial_damping();
1597  fpreal64 result;
1598  OP_Utils::evalOpParm(result, thissop, "initial_damping", cookparms.getCookTime(), 0);
1599  return result;
1600  }
1601  bool getDebug_save_meshes() const { return myDebug_save_meshes; }
1602  void setDebug_save_meshes(bool val) { myDebug_save_meshes = val; }
1603  bool opDebug_save_meshes(const SOP_NodeVerb::CookParms &cookparms) const
1604  {
1605  SOP_Node *thissop = cookparms.getNode();
1606  if (!thissop) return getDebug_save_meshes();
1607  bool result;
1608  OP_Utils::evalOpParm(result, thissop, "debug_save_meshes", cookparms.getCookTime(), 0);
1609  return result;
1610  }
1611  bool getUseLandmarkLables() const { return myUseLandmarkLables; }
1612  void setUseLandmarkLables(bool val) { myUseLandmarkLables = val; }
1613  bool opUseLandmarkLables(const SOP_NodeVerb::CookParms &cookparms) const
1614  {
1615  SOP_Node *thissop = cookparms.getNode();
1616  if (!thissop) return getUseLandmarkLables();
1617  bool result;
1618  OP_Utils::evalOpParm(result, thissop, "uselandmarklabels", cookparms.getCookTime(), 0);
1619  return result;
1620  }
1621  const UT_StringHolder & getLandmarkAttribute() const { return myLandmarkAttribute; }
1622  void setLandmarkAttribute(const UT_StringHolder & val) { myLandmarkAttribute = val; }
1624  {
1625  SOP_Node *thissop = cookparms.getNode();
1626  if (!thissop) return getLandmarkAttribute();
1628  OP_Utils::evalOpParm(result, thissop, "landmarkattrib", cookparms.getCookTime(), 0);
1629  return result;
1630  }
1631  bool getEnableLandmarks() const { return myEnableLandmarks; }
1632  void setEnableLandmarks(bool val) { myEnableLandmarks = val; }
1633  bool opEnableLandmarks(const SOP_NodeVerb::CookParms &cookparms) const
1634  {
1635  SOP_Node *thissop = cookparms.getNode();
1636  if (!thissop) return getEnableLandmarks();
1637  bool result;
1638  OP_Utils::evalOpParm(result, thissop, "enablelandmarks", cookparms.getCookTime(), 0);
1639  return result;
1640  }
1641  const UT_Array<Numlandmarkgroups> &getNumlandmarkgroups() const { return myNumlandmarkgroups; }
1642 void setNumlandmarkgroups(const UT_Array<Numlandmarkgroups> &val) { myNumlandmarkgroups = val; }
1644  {
1645  SOP_Node *thissop = cookparms.getNode();
1646  if (!thissop) return getNumlandmarkgroups().entries();
1647  exint result;
1648  OP_Utils::evalOpParm(result, thissop, "numlandmarkgroups", cookparms.getCookTime(), 0);
1649  return result;
1650  }
1651  bool opNumlandmarkgroups_enablegroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1652  { return opinstNumlandmarkgroups_enablegroup(cookparms, &_idx); }
1653  bool opinstNumlandmarkgroups_enablegroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1654  {
1655  SOP_Node *thissop = cookparms.getNode();
1656  if (!thissop) return (myNumlandmarkgroups(_idx[0]).enablegroup);
1657  int _parmidx[2-1];
1658  _parmidx[1-1] = _idx[1-1] + 1;
1659 
1660  bool result;
1661  OP_Utils::evalOpParmInst(result, thissop, "enablegroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1662  return (result);
1663  }
1665  { return opinstNumlandmarkgroups_pballcolor(cookparms, &_idx); }
1667  {
1668  SOP_Node *thissop = cookparms.getNode();
1669  if (!thissop) return (myNumlandmarkgroups(_idx[0]).pballcolor);
1670  int _parmidx[2-1];
1671  _parmidx[1-1] = _idx[1-1] + 1;
1672 
1674  OP_Utils::evalOpParmInst(result, thissop, "pballcolor#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1675  return (result);
1676  }
1678  { return opinstNumlandmarkgroups_pname(cookparms, &_idx); }
1680  {
1681  SOP_Node *thissop = cookparms.getNode();
1682  if (!thissop) return (myNumlandmarkgroups(_idx[0]).pname);
1683  int _parmidx[2-1];
1684  _parmidx[1-1] = _idx[1-1] + 1;
1685 
1687  OP_Utils::evalOpParmInst(result, thissop, "pname#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1688  return (result);
1689  }
1690  bool opNumlandmarkgroups_usesourcepos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1691  { return opinstNumlandmarkgroups_usesourcepos(cookparms, &_idx); }
1692  bool opinstNumlandmarkgroups_usesourcepos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1693  {
1694  SOP_Node *thissop = cookparms.getNode();
1695  if (!thissop) return (myNumlandmarkgroups(_idx[0]).usesourcepos);
1696  int _parmidx[2-1];
1697  _parmidx[1-1] = _idx[1-1] + 1;
1698 
1699  bool result;
1700  OP_Utils::evalOpParmInst(result, thissop, "usesourcepos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1701  return (result);
1702  }
1704  { return opinstNumlandmarkgroups_sourcepos(cookparms, &_idx); }
1706  {
1707  SOP_Node *thissop = cookparms.getNode();
1708  if (!thissop) return (myNumlandmarkgroups(_idx[0]).sourcepos);
1709  int _parmidx[2-1];
1710  _parmidx[1-1] = _idx[1-1] + 1;
1711 
1713  OP_Utils::evalOpParmInst(result, thissop, "sourcepos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1714  return (result);
1715  }
1716  bool opNumlandmarkgroups_usetargetpos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1717  { return opinstNumlandmarkgroups_usetargetpos(cookparms, &_idx); }
1718  bool opinstNumlandmarkgroups_usetargetpos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1719  {
1720  SOP_Node *thissop = cookparms.getNode();
1721  if (!thissop) return (myNumlandmarkgroups(_idx[0]).usetargetpos);
1722  int _parmidx[2-1];
1723  _parmidx[1-1] = _idx[1-1] + 1;
1724 
1725  bool result;
1726  OP_Utils::evalOpParmInst(result, thissop, "usetargetpos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1727  return (result);
1728  }
1730  { return opinstNumlandmarkgroups_targetpos(cookparms, &_idx); }
1732  {
1733  SOP_Node *thissop = cookparms.getNode();
1734  if (!thissop) return (myNumlandmarkgroups(_idx[0]).targetpos);
1735  int _parmidx[2-1];
1736  _parmidx[1-1] = _idx[1-1] + 1;
1737 
1739  OP_Utils::evalOpParmInst(result, thissop, "targetpos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1740  return (result);
1741  }
1743  { return opinstNumlandmarkgroups_psourcegroup(cookparms, &_idx); }
1745  {
1746  SOP_Node *thissop = cookparms.getNode();
1747  if (!thissop) return (myNumlandmarkgroups(_idx[0]).psourcegroup);
1748  int _parmidx[2-1];
1749  _parmidx[1-1] = _idx[1-1] + 1;
1750 
1752  OP_Utils::evalOpParmInst(result, thissop, "psourcegroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1753  return (result);
1754  }
1756  { return opinstNumlandmarkgroups_ptargetgroup(cookparms, &_idx); }
1758  {
1759  SOP_Node *thissop = cookparms.getNode();
1760  if (!thissop) return (myNumlandmarkgroups(_idx[0]).ptargetgroup);
1761  int _parmidx[2-1];
1762  _parmidx[1-1] = _idx[1-1] + 1;
1763 
1765  OP_Utils::evalOpParmInst(result, thissop, "ptargetgroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1766  return (result);
1767  }
1768 
1769  const UT_StringHolder & getRigidMask() const { return myRigidMask; }
1770  void setRigidMask(const UT_StringHolder & val) { myRigidMask = val; }
1772  {
1773  SOP_Node *thissop = cookparms.getNode();
1774  if (!thissop) return getRigidMask();
1776  OP_Utils::evalOpParm(result, thissop, "rigidmask", cookparms.getCookTime(), 0);
1777  return result;
1778  }
1779 
1780 private:
1781  bool myEnableSolve;
1782  bool myEnableGeometryConstraints;
1783  int64 myConstraintSelection;
1784  UT_StringHolder myConstraintSource;
1785  int64 myIterations;
1786  int64 myReducedLevels;
1787  UT_Vector2D myReductionPercentage;
1788  fpreal64 myReductionPercentageSingle;
1789  fpreal64 myInitialReductionPercentage;
1790  UT_Vector2D myRigidWeights;
1791  UT_Vector2D myLandmarkWeights;
1792  int64 myMaskMode;
1793  fpreal64 myMaskTolerance;
1794  UT_StringHolder myRigidprimitives;
1795  fpreal64 myDistTolerance;
1796  fpreal64 myNormTolerance;
1797  int64 mySolverType;
1798  int64 mySolverIterations;
1799  UT_Vector2D myGradientTolerance;
1800  int64 myDebug_menu;
1801  int64 myDebug_coarse_lvl;
1802  int64 myDebug_coarse_iteration;
1803  int64 myDebug_dense_lvl;
1804  int64 myDebug_dense_iteration;
1805  bool myDebug_hessian_scaling;
1806  bool myDebug_use_marquadt;
1807  fpreal64 myParameter_tolerance;
1808  bool myUse_tau;
1809  fpreal64 myTau;
1810  fpreal64 myInitial_damping;
1811  bool myDebug_save_meshes;
1812  bool myUseLandmarkLables;
1813  UT_StringHolder myLandmarkAttribute;
1814  bool myEnableLandmarks;
1815  UT_Array<Numlandmarkgroups> myNumlandmarkgroups;
1816  UT_StringHolder myRigidMask;
1817 
1818 };
void setDistTolerance(fpreal64 val)
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
type
Definition: core.h:556
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:63
UT_Vector2T< fpreal64 > UT_Vector2D
fpreal64 getParameter_tolerance() const
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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)
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:655
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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)
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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
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)