HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_UVFlatten-2.0.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_UVFlatten_2_0Enums
24 {
25  enum class Method
26  {
27  SCP = 0,
28  ABF
29  };
30  enum class Align_axis
31  {
32  UAXIS = 0,
33  VAXIS
34  };
35  enum class Lalign_axis
36  {
37  UAXIS = 0,
38  VAXIS
39  };
40 }
41 
42 
44 {
45 public:
46  static int version() { return 1; }
47  struct Pins
48  {
49  bool usepin;
53 
54 
55  Pins()
56  {
57  usepin = true;
58  primvert = UT_Vector2D(0,0);
59  pinuv = UT_Vector2D(0,0);
60  pinrefuv = UT_Vector2D(0,0);
61 
62  }
63 
64  bool operator==(const Pins &src) const
65  {
66  if (usepin != src.usepin) return false;
67  if (primvert != src.primvert) return false;
68  if (pinuv != src.pinuv) return false;
69  if (pinrefuv != src.pinrefuv) return false;
70 
71  return true;
72  }
73  bool operator!=(const Pins &src) const
74  {
75  return !operator==(src);
76  }
77 
78  };
79 
81  {
83 
84  buf.strcat("[ ");
85  for (int i = 0; i < list.entries(); i++)
86  {
87  if (i)
88  buf.strcat(", ");
89  buf.strcat("( ");
90  buf.append("");
91  buf.appendSprintf("%s", (list(i).usepin) ? "true" : "false");
92  buf.append(", ");
93  buf.appendSprintf("(%f, %f)", list(i).primvert.x(), list(i).primvert.y());
94  buf.append(", ");
95  buf.appendSprintf("(%f, %f)", list(i).pinuv.x(), list(i).pinuv.y());
96  buf.append(", ");
97  buf.appendSprintf("(%f, %f)", list(i).pinrefuv.x(), list(i).pinrefuv.y());
98 
99  buf.strcat(" )");
100  }
101  buf.strcat(" ]");
102 
104  return result;
105  }
106  struct Alignments
107  {
111 
112 
114  {
115  align_enabled = true;
116  align_group = ""_UTsh;
117  align_axis = 0;
118 
119  }
120 
121  bool operator==(const Alignments &src) const
122  {
123  if (align_enabled != src.align_enabled) return false;
124  if (align_group != src.align_group) return false;
125  if (align_axis != src.align_axis) return false;
126 
127  return true;
128  }
129  bool operator!=(const Alignments &src) const
130  {
131  return !operator==(src);
132  }
133 
134  };
135 
137  {
139 
140  buf.strcat("[ ");
141  for (int i = 0; i < list.entries(); i++)
142  {
143  if (i)
144  buf.strcat(", ");
145  buf.strcat("( ");
146  buf.append("");
147  buf.appendSprintf("%s", (list(i).align_enabled) ? "true" : "false");
148  buf.append(", ");
149  { UT_String tmp; tmp = UT_StringWrap(list(i).align_group).makeQuotedString('"'); buf.strcat(tmp); }
150  buf.append(", ");
151  buf.appendSprintf("%d", (int) list(i).align_axis);
152 
153  buf.strcat(" )");
154  }
155  buf.strcat(" ]");
156 
158  return result;
159  }
161  {
164 
165 
167  {
168  straight_enabled = true;
169  straight_group = ""_UTsh;
170 
171  }
172 
173  bool operator==(const Straightenings &src) const
174  {
175  if (straight_enabled != src.straight_enabled) return false;
176  if (straight_group != src.straight_group) return false;
177 
178  return true;
179  }
180  bool operator!=(const Straightenings &src) const
181  {
182  return !operator==(src);
183  }
184 
185  };
186 
188  {
190 
191  buf.strcat("[ ");
192  for (int i = 0; i < list.entries(); i++)
193  {
194  if (i)
195  buf.strcat(", ");
196  buf.strcat("( ");
197  buf.append("");
198  buf.appendSprintf("%s", (list(i).straight_enabled) ? "true" : "false");
199  buf.append(", ");
200  { UT_String tmp; tmp = UT_StringWrap(list(i).straight_group).makeQuotedString('"'); buf.strcat(tmp); }
201 
202  buf.strcat(" )");
203  }
204  buf.strcat(" ]");
205 
207  return result;
208  }
209  struct Lpins
210  {
214 
215 
217  {
218  lprimvert = UT_Vector2D(0,0);
219  lpinuv = UT_Vector2D(0,0);
220  lpinrefuv = UT_Vector2D(0,0);
221 
222  }
223 
224  bool operator==(const Lpins &src) const
225  {
226  if (lprimvert != src.lprimvert) return false;
227  if (lpinuv != src.lpinuv) return false;
228  if (lpinrefuv != src.lpinrefuv) return false;
229 
230  return true;
231  }
232  bool operator!=(const Lpins &src) const
233  {
234  return !operator==(src);
235  }
236 
237  };
238 
240  {
242 
243  buf.strcat("[ ");
244  for (int i = 0; i < list.entries(); i++)
245  {
246  if (i)
247  buf.strcat(", ");
248  buf.strcat("( ");
249  buf.append("");
250  buf.appendSprintf("(%f, %f)", list(i).lprimvert.x(), list(i).lprimvert.y());
251  buf.append(", ");
252  buf.appendSprintf("(%f, %f)", list(i).lpinuv.x(), list(i).lpinuv.y());
253  buf.append(", ");
254  buf.appendSprintf("(%f, %f)", list(i).lpinrefuv.x(), list(i).lpinrefuv.y());
255 
256  buf.strcat(" )");
257  }
258  buf.strcat(" ]");
259 
261  return result;
262  }
263  struct Lalignments
264  {
267 
268 
270  {
271  lalign_group = ""_UTsh;
272  lalign_axis = 0;
273 
274  }
275 
276  bool operator==(const Lalignments &src) const
277  {
278  if (lalign_group != src.lalign_group) return false;
279  if (lalign_axis != src.lalign_axis) return false;
280 
281  return true;
282  }
283  bool operator!=(const Lalignments &src) const
284  {
285  return !operator==(src);
286  }
287 
288  };
289 
291  {
293 
294  buf.strcat("[ ");
295  for (int i = 0; i < list.entries(); i++)
296  {
297  if (i)
298  buf.strcat(", ");
299  buf.strcat("( ");
300  buf.append("");
301  { UT_String tmp; tmp = UT_StringWrap(list(i).lalign_group).makeQuotedString('"'); buf.strcat(tmp); }
302  buf.append(", ");
303  buf.appendSprintf("%d", (int) list(i).lalign_axis);
304 
305  buf.strcat(" )");
306  }
307  buf.strcat(" ]");
308 
310  return result;
311  }
313  {
315 
316 
318  {
319  lstraight_group = ""_UTsh;
320 
321  }
322 
323  bool operator==(const Lstraightenings &src) const
324  {
325  if (lstraight_group != src.lstraight_group) return false;
326 
327  return true;
328  }
329  bool operator!=(const Lstraightenings &src) const
330  {
331  return !operator==(src);
332  }
333 
334  };
335 
337  {
339 
340  buf.strcat("[ ");
341  for (int i = 0; i < list.entries(); i++)
342  {
343  if (i)
344  buf.strcat(", ");
345  buf.strcat("( ");
346  buf.append("");
347  { UT_String tmp; tmp = UT_StringWrap(list(i).lstraight_group).makeQuotedString('"'); buf.strcat(tmp); }
348 
349  buf.strcat(" )");
350  }
351  buf.strcat(" ]");
352 
354  return result;
355  }
356 
358  {
359  myGroup = ""_UTsh;
360  myUVAttrib = "uv"_UTsh;
361  myMethod = 0;
362  myKeepExistingSeams = false;
363  myKeepExistingLayout = false;
364  myPinBoundaries = false;
365  mySeams = ""_UTsh;
366  myUsePins = true;
367  myPins.setSize(0);
368  myUseAlignments = true;
369  myAlignments.setSize(0);
370  myUseStraightenings = true;
371  myStraightenings.setSize(0);
372  myManualLayout = true;
373  myLayoutSeams = ""_UTsh;
374  myLpins.setSize(0);
375  myLalignments.setSize(0);
376  myLstraightenings.setSize(0);
377  myUseOutputSeams = false;
378  myOutputSeams = "outputseams"_UTsh;
379  myUseOutputConstrIslands = false;
380  myOutputConstrIslands = "constrainedprims"_UTsh;
381  myBBoxCenter = UT_Vector2D(0.5,0.5);
382  myBBoxSize = UT_Vector2D(1,1);
383 
384  }
385 
386  explicit SOP_UVFlatten_2_0Parms(const SOP_UVFlatten_2_0Parms &) = default;
388  SOP_UVFlatten_2_0Parms(SOP_UVFlatten_2_0Parms &&) noexcept = default;
389  SOP_UVFlatten_2_0Parms &operator=(SOP_UVFlatten_2_0Parms &&) noexcept = default;
390 
391  ~SOP_UVFlatten_2_0Parms() override {}
392 
394  {
395  if (myGroup != src.myGroup) return false;
396  if (myUVAttrib != src.myUVAttrib) return false;
397  if (myMethod != src.myMethod) return false;
398  if (myKeepExistingSeams != src.myKeepExistingSeams) return false;
399  if (myKeepExistingLayout != src.myKeepExistingLayout) return false;
400  if (myPinBoundaries != src.myPinBoundaries) return false;
401  if (mySeams != src.mySeams) return false;
402  if (myUsePins != src.myUsePins) return false;
403  if (myPins != src.myPins) return false;
404  if (myUseAlignments != src.myUseAlignments) return false;
405  if (myAlignments != src.myAlignments) return false;
406  if (myUseStraightenings != src.myUseStraightenings) return false;
407  if (myStraightenings != src.myStraightenings) return false;
408  if (myManualLayout != src.myManualLayout) return false;
409  if (myLayoutSeams != src.myLayoutSeams) return false;
410  if (myLpins != src.myLpins) return false;
411  if (myLalignments != src.myLalignments) return false;
412  if (myLstraightenings != src.myLstraightenings) return false;
413  if (myUseOutputSeams != src.myUseOutputSeams) return false;
414  if (myOutputSeams != src.myOutputSeams) return false;
415  if (myUseOutputConstrIslands != src.myUseOutputConstrIslands) return false;
416  if (myOutputConstrIslands != src.myOutputConstrIslands) return false;
417  if (myBBoxCenter != src.myBBoxCenter) return false;
418  if (myBBoxSize != src.myBBoxSize) return false;
419 
420  return true;
421  }
423  {
424  return !operator==(src);
425  }
429 
430 
431 
432  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
433  {
434  myGroup = ""_UTsh;
435  if (true)
436  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
437  myUVAttrib = "uv"_UTsh;
438  if (true)
439  graph->evalOpParm(myUVAttrib, nodeidx, "uvattrib", time, 0);
440  myMethod = 0;
441  if (true)
442  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
443  myKeepExistingSeams = false;
444  if (true)
445  graph->evalOpParm(myKeepExistingSeams, nodeidx, "keepexistingseams", time, 0);
446  myKeepExistingLayout = false;
447  if (true && ( (true&&!(((getKeepExistingSeams()==0)))) ) )
448  graph->evalOpParm(myKeepExistingLayout, nodeidx, "keepexistinglayout", time, 0);
449  myPinBoundaries = false;
450  if (true && ( (true&&!(((getKeepExistingSeams()==0))||((int64(getMethod())!=0)))) ) )
451  graph->evalOpParm(myPinBoundaries, nodeidx, "pinboundaries", time, 0);
452  mySeams = ""_UTsh;
453  if (true)
454  graph->evalOpParm(mySeams, nodeidx, "seamgroup", time, 0);
455  myUsePins = true;
456  if (true)
457  graph->evalOpParm(myUsePins, nodeidx, "usepins", time, 0);
458  if (true && ( (!(((getUsePins()==0)))) ) )
459  {
460  int64 length = 0;
461  graph->evalOpParm(length, nodeidx, "pins", time, 0);
462  if (length < 0) length = 0;
463  myPins.setSize(length);
464  for (exint i = 0; i < length; i++)
465  {
466  int parmidx[1];
467  int offsets[1];
468  parmidx[0] = i+0;
469  offsets[0] = 0;
470  auto && _curentry = myPins(i);
471  (void) _curentry;
472  _curentry.usepin = true;
473  if (true && ( (!(((getUsePins()==0)))) ) )
474  graph->evalOpParmInst(_curentry.usepin, nodeidx, "usepin#", parmidx, offsets, time, 0, 2-1);
475  _curentry.primvert = UT_Vector2D(0,0);
476  if (true && ( (!(((getUsePins()==0)))) ) )
477  graph->evalOpParmInst(_curentry.primvert, nodeidx, "primvert#", parmidx, offsets, time, 0, 2-1);
478  _curentry.pinuv = UT_Vector2D(0,0);
479  if (true && ( (!(((getUsePins()==0)))) ) )
480  graph->evalOpParmInst(_curentry.pinuv, nodeidx, "pinuv#", parmidx, offsets, time, 0, 2-1);
481  _curentry.pinrefuv = UT_Vector2D(0,0);
482  if (true && ( (!(((getUsePins()==0)))) ) )
483  graph->evalOpParmInst(_curentry.pinrefuv, nodeidx, "pinrefuv#", parmidx, offsets, time, 0, 2-1);
484 
485  }
486  }
487  else
488  myPins.clear();
489  myUseAlignments = true;
490  if (true)
491  graph->evalOpParm(myUseAlignments, nodeidx, "usealignments", time, 0);
492  if (true && ( (!(((getUseAlignments()==0)))) ) )
493  {
494  int64 length = 0;
495  graph->evalOpParm(length, nodeidx, "alignments", time, 0);
496  if (length < 0) length = 0;
497  myAlignments.setSize(length);
498  for (exint i = 0; i < length; i++)
499  {
500  int parmidx[1];
501  int offsets[1];
502  parmidx[0] = i+0;
503  offsets[0] = 0;
504  auto && _curentry = myAlignments(i);
505  (void) _curentry;
506  _curentry.align_enabled = true;
507  if (true && ( (!(((getUseAlignments()==0)))) ) )
508  graph->evalOpParmInst(_curentry.align_enabled, nodeidx, "align_enabled#", parmidx, offsets, time, 0, 2-1);
509  _curentry.align_group = ""_UTsh;
510  if (true && ( (!(((getUseAlignments()==0)))) ) )
511  graph->evalOpParmInst(_curentry.align_group, nodeidx, "align_group#", parmidx, offsets, time, 0, 2-1);
512  _curentry.align_axis = 0;
513  if (true && ( (!(((getUseAlignments()==0)))) ) )
514  graph->evalOpParmInst(_curentry.align_axis, nodeidx, "align_axis#", parmidx, offsets, time, 0, 2-1);
515 
516  }
517  }
518  else
519  myAlignments.clear();
520  myUseStraightenings = true;
521  if (true)
522  graph->evalOpParm(myUseStraightenings, nodeidx, "usestraightenings", time, 0);
523  if (true && ( (!(((getUseStraightenings()==0)))) ) )
524  {
525  int64 length = 0;
526  graph->evalOpParm(length, nodeidx, "straightenings", time, 0);
527  if (length < 0) length = 0;
528  myStraightenings.setSize(length);
529  for (exint i = 0; i < length; i++)
530  {
531  int parmidx[1];
532  int offsets[1];
533  parmidx[0] = i+0;
534  offsets[0] = 0;
535  auto && _curentry = myStraightenings(i);
536  (void) _curentry;
537  _curentry.straight_enabled = true;
538  if (true && ( (!(((getUseStraightenings()==0)))) ) )
539  graph->evalOpParmInst(_curentry.straight_enabled, nodeidx, "straight_enabled#", parmidx, offsets, time, 0, 2-1);
540  _curentry.straight_group = ""_UTsh;
541  if (true && ( (!(((getUseStraightenings()==0)))) ) )
542  graph->evalOpParmInst(_curentry.straight_group, nodeidx, "straight_group#", parmidx, offsets, time, 0, 2-1);
543 
544  }
545  }
546  else
547  myStraightenings.clear();
548  myManualLayout = true;
549  if (true)
550  graph->evalOpParm(myManualLayout, nodeidx, "manuallayout", time, 0);
551  myLayoutSeams = ""_UTsh;
552  if (true && ( (true&&!(((getManualLayout()==0)))) ) )
553  graph->evalOpParm(myLayoutSeams, nodeidx, "layoutseamgroup", time, 0);
554  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) )
555  {
556  int64 length = 0;
557  graph->evalOpParm(length, nodeidx, "lpins", time, 0);
558  if (length < 0) length = 0;
559  myLpins.setSize(length);
560  for (exint i = 0; i < length; i++)
561  {
562  int parmidx[1];
563  int offsets[1];
564  parmidx[0] = i+0;
565  offsets[0] = 0;
566  auto && _curentry = myLpins(i);
567  (void) _curentry;
568  _curentry.lprimvert = UT_Vector2D(0,0);
569  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) && ( (true&&!(((getManualLayout()==0)))) ) )
570  graph->evalOpParmInst(_curentry.lprimvert, nodeidx, "lprimvert#", parmidx, offsets, time, 0, 2-1);
571  _curentry.lpinuv = UT_Vector2D(0,0);
572  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) && ( (true&&!(((getManualLayout()==0)))) ) )
573  graph->evalOpParmInst(_curentry.lpinuv, nodeidx, "lpinuv#", parmidx, offsets, time, 0, 2-1);
574  _curentry.lpinrefuv = UT_Vector2D(0,0);
575  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) && ( (true&&!(((getManualLayout()==0)))) ) )
576  graph->evalOpParmInst(_curentry.lpinrefuv, nodeidx, "lpinrefuv#", parmidx, offsets, time, 0, 2-1);
577 
578  }
579  }
580  else
581  myLpins.clear();
582  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) )
583  {
584  int64 length = 0;
585  graph->evalOpParm(length, nodeidx, "lalignments", time, 0);
586  if (length < 0) length = 0;
587  myLalignments.setSize(length);
588  for (exint i = 0; i < length; i++)
589  {
590  int parmidx[1];
591  int offsets[1];
592  parmidx[0] = i+0;
593  offsets[0] = 0;
594  auto && _curentry = myLalignments(i);
595  (void) _curentry;
596  _curentry.lalign_group = ""_UTsh;
597  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) && ( (true&&!(((getManualLayout()==0)))) ) )
598  graph->evalOpParmInst(_curentry.lalign_group, nodeidx, "lalign_group#", parmidx, offsets, time, 0, 2-1);
599  _curentry.lalign_axis = 0;
600  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) && ( (true&&!(((getManualLayout()==0)))) ) )
601  graph->evalOpParmInst(_curentry.lalign_axis, nodeidx, "lalign_axis#", parmidx, offsets, time, 0, 2-1);
602 
603  }
604  }
605  else
606  myLalignments.clear();
607  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) )
608  {
609  int64 length = 0;
610  graph->evalOpParm(length, nodeidx, "lstraightenings", time, 0);
611  if (length < 0) length = 0;
612  myLstraightenings.setSize(length);
613  for (exint i = 0; i < length; i++)
614  {
615  int parmidx[1];
616  int offsets[1];
617  parmidx[0] = i+0;
618  offsets[0] = 0;
619  auto && _curentry = myLstraightenings(i);
620  (void) _curentry;
621  _curentry.lstraight_group = ""_UTsh;
622  if (true && ( (!(((getManualLayout()==0))||((getManualLayout()==0)))) ) && ( (true&&!(((getManualLayout()==0)))) ) )
623  graph->evalOpParmInst(_curentry.lstraight_group, nodeidx, "lstraight_group#", parmidx, offsets, time, 0, 2-1);
624 
625  }
626  }
627  else
628  myLstraightenings.clear();
629  myUseOutputSeams = false;
630  if (true)
631  graph->evalOpParm(myUseOutputSeams, nodeidx, "useoutputseams", time, 0);
632  myOutputSeams = "outputseams"_UTsh;
633  if (true && ( (true&&!(((getUseOutputSeams()==0)))) ) )
634  graph->evalOpParm(myOutputSeams, nodeidx, "outputseams", time, 0);
635  myUseOutputConstrIslands = false;
636  if (true)
637  graph->evalOpParm(myUseOutputConstrIslands, nodeidx, "useoutputconstrislands", time, 0);
638  myOutputConstrIslands = "constrainedprims"_UTsh;
639  if (true && ( (true&&!(((getUseOutputConstrIslands()==0)))) ) )
640  graph->evalOpParm(myOutputConstrIslands, nodeidx, "outputconstrislands", time, 0);
641  myBBoxCenter = UT_Vector2D(0.5,0.5);
642  if (true)
643  graph->evalOpParm(myBBoxCenter, nodeidx, "bboxcenter", time, 0);
644  myBBoxSize = UT_Vector2D(1,1);
645  if (true)
646  graph->evalOpParm(myBBoxSize, nodeidx, "bboxsize", time, 0);
647 
648  }
649 
650 
651  void loadFromOpSubclass(const LoadParms &loadparms) override
652  {
653  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
654  }
655 
656 
657  void copyFrom(const OP_NodeParms *src) override
658  {
659  *this = *((const SOP_UVFlatten_2_0Parms *)src);
660  }
661 
662  template <typename T>
663  void
664  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
665  {
666  if (idx.size() < 1)
667  return;
668  UT_ASSERT(idx.size() == instance.size()+1);
669  if (idx.size() != instance.size()+1)
670  return;
671  switch (idx[0])
672  {
673  case 0:
674  coerceValue(value, myGroup);
675  break;
676  case 1:
677  coerceValue(value, myUVAttrib);
678  break;
679  case 2:
680  coerceValue(value, myMethod);
681  break;
682  case 3:
683  coerceValue(value, myKeepExistingSeams);
684  break;
685  case 4:
686  coerceValue(value, myKeepExistingLayout);
687  break;
688  case 5:
689  coerceValue(value, myPinBoundaries);
690  break;
691  case 6:
692  coerceValue(value, mySeams);
693  break;
694  case 7:
695  coerceValue(value, myUsePins);
696  break;
697  case 8:
698  if (idx.size() == 1)
699  coerceValue(value, myPins.entries());
700  else if (instance[0] < myPins.entries())
701  {
702  auto && _data = myPins(instance[0]);
703  switch (idx[1])
704  {
705  case 0:
706  coerceValue(value, _data.usepin);
707  break;
708  case 1:
709  coerceValue(value, _data.primvert);
710  break;
711  case 2:
712  coerceValue(value, _data.pinuv);
713  break;
714  case 3:
715  coerceValue(value, _data.pinrefuv);
716  break;
717 
718  }
719  }
720  break;
721  case 9:
722  coerceValue(value, myUseAlignments);
723  break;
724  case 10:
725  if (idx.size() == 1)
726  coerceValue(value, myAlignments.entries());
727  else if (instance[0] < myAlignments.entries())
728  {
729  auto && _data = myAlignments(instance[0]);
730  switch (idx[1])
731  {
732  case 0:
733  coerceValue(value, _data.align_enabled);
734  break;
735  case 1:
736  coerceValue(value, _data.align_group);
737  break;
738  case 2:
739  coerceValue(value, _data.align_axis);
740  break;
741 
742  }
743  }
744  break;
745  case 11:
746  coerceValue(value, myUseStraightenings);
747  break;
748  case 12:
749  if (idx.size() == 1)
750  coerceValue(value, myStraightenings.entries());
751  else if (instance[0] < myStraightenings.entries())
752  {
753  auto && _data = myStraightenings(instance[0]);
754  switch (idx[1])
755  {
756  case 0:
757  coerceValue(value, _data.straight_enabled);
758  break;
759  case 1:
760  coerceValue(value, _data.straight_group);
761  break;
762 
763  }
764  }
765  break;
766  case 13:
767  coerceValue(value, myManualLayout);
768  break;
769  case 14:
770  coerceValue(value, myLayoutSeams);
771  break;
772  case 15:
773  if (idx.size() == 1)
774  coerceValue(value, myLpins.entries());
775  else if (instance[0] < myLpins.entries())
776  {
777  auto && _data = myLpins(instance[0]);
778  switch (idx[1])
779  {
780  case 0:
781  coerceValue(value, _data.lprimvert);
782  break;
783  case 1:
784  coerceValue(value, _data.lpinuv);
785  break;
786  case 2:
787  coerceValue(value, _data.lpinrefuv);
788  break;
789 
790  }
791  }
792  break;
793  case 16:
794  if (idx.size() == 1)
795  coerceValue(value, myLalignments.entries());
796  else if (instance[0] < myLalignments.entries())
797  {
798  auto && _data = myLalignments(instance[0]);
799  switch (idx[1])
800  {
801  case 0:
802  coerceValue(value, _data.lalign_group);
803  break;
804  case 1:
805  coerceValue(value, _data.lalign_axis);
806  break;
807 
808  }
809  }
810  break;
811  case 17:
812  if (idx.size() == 1)
813  coerceValue(value, myLstraightenings.entries());
814  else if (instance[0] < myLstraightenings.entries())
815  {
816  auto && _data = myLstraightenings(instance[0]);
817  switch (idx[1])
818  {
819  case 0:
820  coerceValue(value, _data.lstraight_group);
821  break;
822 
823  }
824  }
825  break;
826  case 18:
827  coerceValue(value, myUseOutputSeams);
828  break;
829  case 19:
830  coerceValue(value, myOutputSeams);
831  break;
832  case 20:
833  coerceValue(value, myUseOutputConstrIslands);
834  break;
835  case 21:
836  coerceValue(value, myOutputConstrIslands);
837  break;
838  case 22:
839  coerceValue(value, myBBoxCenter);
840  break;
841  case 23:
842  coerceValue(value, myBBoxSize);
843  break;
844 
845  }
846  }
847 
848  bool isParmColorRamp(exint idx) const override
849  {
850  switch (idx)
851  {
852 
853  }
854  return false;
855  }
856 
857  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
858  { doGetParmValue(idx, instance, value); }
859  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
860  { doGetParmValue(idx, instance, value); }
861  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
862  { doGetParmValue(idx, instance, value); }
863  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
864  { doGetParmValue(idx, instance, value); }
865  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
866  { doGetParmValue(idx, instance, value); }
867  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
868  { doGetParmValue(idx, instance, value); }
869  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
870  { doGetParmValue(idx, instance, value); }
871  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
872  { doGetParmValue(idx, instance, value); }
873  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
874  { doGetParmValue(idx, instance, value); }
875  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
876  { doGetParmValue(idx, instance, value); }
877  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
878  { doGetParmValue(idx, instance, value); }
879 
880  template <typename T>
881  void
882  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
883  {
884  if (idx.size() < 1)
885  return;
886  UT_ASSERT(idx.size() == instance.size()+1);
887  if (idx.size() != instance.size()+1)
888  return;
889  switch (idx[0])
890  {
891  case 0:
892  coerceValue(myGroup, ( ( value ) ));
893  break;
894  case 1:
895  coerceValue(myUVAttrib, ( ( value ) ));
896  break;
897  case 2:
898  coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
899  break;
900  case 3:
901  coerceValue(myKeepExistingSeams, ( ( value ) ));
902  break;
903  case 4:
904  coerceValue(myKeepExistingLayout, ( ( value ) ));
905  break;
906  case 5:
907  coerceValue(myPinBoundaries, ( ( value ) ));
908  break;
909  case 6:
910  coerceValue(mySeams, ( ( value ) ));
911  break;
912  case 7:
913  coerceValue(myUsePins, ( ( value ) ));
914  break;
915  case 8:
916  if (idx.size() == 1)
917  {
918  exint newsize;
919  coerceValue(newsize, value);
920  if (newsize < 0) newsize = 0;
921  myPins.setSize(newsize);
922  }
923  else
924  {
925  if (instance[0] < 0)
926  return;
927  myPins.setSizeIfNeeded(instance[0]+1);
928  auto && _data = myPins(instance[0]);
929  switch (idx[1])
930  {
931  case 0:
932  coerceValue(_data.usepin, value);
933  break;
934  case 1:
935  coerceValue(_data.primvert, value);
936  break;
937  case 2:
938  coerceValue(_data.pinuv, value);
939  break;
940  case 3:
941  coerceValue(_data.pinrefuv, value);
942  break;
943 
944  }
945  }
946  break;
947  case 9:
948  coerceValue(myUseAlignments, ( ( value ) ));
949  break;
950  case 10:
951  if (idx.size() == 1)
952  {
953  exint newsize;
954  coerceValue(newsize, value);
955  if (newsize < 0) newsize = 0;
956  myAlignments.setSize(newsize);
957  }
958  else
959  {
960  if (instance[0] < 0)
961  return;
962  myAlignments.setSizeIfNeeded(instance[0]+1);
963  auto && _data = myAlignments(instance[0]);
964  switch (idx[1])
965  {
966  case 0:
967  coerceValue(_data.align_enabled, value);
968  break;
969  case 1:
970  coerceValue(_data.align_group, value);
971  break;
972  case 2:
973  coerceValue(_data.align_axis, value);
974  break;
975 
976  }
977  }
978  break;
979  case 11:
980  coerceValue(myUseStraightenings, ( ( value ) ));
981  break;
982  case 12:
983  if (idx.size() == 1)
984  {
985  exint newsize;
986  coerceValue(newsize, value);
987  if (newsize < 0) newsize = 0;
988  myStraightenings.setSize(newsize);
989  }
990  else
991  {
992  if (instance[0] < 0)
993  return;
994  myStraightenings.setSizeIfNeeded(instance[0]+1);
995  auto && _data = myStraightenings(instance[0]);
996  switch (idx[1])
997  {
998  case 0:
999  coerceValue(_data.straight_enabled, value);
1000  break;
1001  case 1:
1002  coerceValue(_data.straight_group, value);
1003  break;
1004 
1005  }
1006  }
1007  break;
1008  case 13:
1009  coerceValue(myManualLayout, ( ( value ) ));
1010  break;
1011  case 14:
1012  coerceValue(myLayoutSeams, ( ( value ) ));
1013  break;
1014  case 15:
1015  if (idx.size() == 1)
1016  {
1017  exint newsize;
1018  coerceValue(newsize, value);
1019  if (newsize < 0) newsize = 0;
1020  myLpins.setSize(newsize);
1021  }
1022  else
1023  {
1024  if (instance[0] < 0)
1025  return;
1026  myLpins.setSizeIfNeeded(instance[0]+1);
1027  auto && _data = myLpins(instance[0]);
1028  switch (idx[1])
1029  {
1030  case 0:
1031  coerceValue(_data.lprimvert, value);
1032  break;
1033  case 1:
1034  coerceValue(_data.lpinuv, value);
1035  break;
1036  case 2:
1037  coerceValue(_data.lpinrefuv, value);
1038  break;
1039 
1040  }
1041  }
1042  break;
1043  case 16:
1044  if (idx.size() == 1)
1045  {
1046  exint newsize;
1047  coerceValue(newsize, value);
1048  if (newsize < 0) newsize = 0;
1049  myLalignments.setSize(newsize);
1050  }
1051  else
1052  {
1053  if (instance[0] < 0)
1054  return;
1055  myLalignments.setSizeIfNeeded(instance[0]+1);
1056  auto && _data = myLalignments(instance[0]);
1057  switch (idx[1])
1058  {
1059  case 0:
1060  coerceValue(_data.lalign_group, value);
1061  break;
1062  case 1:
1063  coerceValue(_data.lalign_axis, value);
1064  break;
1065 
1066  }
1067  }
1068  break;
1069  case 17:
1070  if (idx.size() == 1)
1071  {
1072  exint newsize;
1073  coerceValue(newsize, value);
1074  if (newsize < 0) newsize = 0;
1075  myLstraightenings.setSize(newsize);
1076  }
1077  else
1078  {
1079  if (instance[0] < 0)
1080  return;
1081  myLstraightenings.setSizeIfNeeded(instance[0]+1);
1082  auto && _data = myLstraightenings(instance[0]);
1083  switch (idx[1])
1084  {
1085  case 0:
1086  coerceValue(_data.lstraight_group, value);
1087  break;
1088 
1089  }
1090  }
1091  break;
1092  case 18:
1093  coerceValue(myUseOutputSeams, ( ( value ) ));
1094  break;
1095  case 19:
1096  coerceValue(myOutputSeams, ( ( value ) ));
1097  break;
1098  case 20:
1099  coerceValue(myUseOutputConstrIslands, ( ( value ) ));
1100  break;
1101  case 21:
1102  coerceValue(myOutputConstrIslands, ( ( value ) ));
1103  break;
1104  case 22:
1105  coerceValue(myBBoxCenter, ( ( value ) ));
1106  break;
1107  case 23:
1108  coerceValue(myBBoxSize, clampMinValue(0, ( value ) ));
1109  break;
1110 
1111  }
1112  }
1113 
1114  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
1115  { doSetParmValue(idx, instance, value); }
1116  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
1117  { doSetParmValue(idx, instance, value); }
1118  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
1119  { doSetParmValue(idx, instance, value); }
1120  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
1121  { doSetParmValue(idx, instance, value); }
1122  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
1123  { doSetParmValue(idx, instance, value); }
1124  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
1125  { doSetParmValue(idx, instance, value); }
1126  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
1127  { doSetParmValue(idx, instance, value); }
1128  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
1129  { doSetParmValue(idx, instance, value); }
1130  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
1131  { doSetParmValue(idx, instance, value); }
1132  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
1133  { doSetParmValue(idx, instance, value); }
1134  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
1135  { doSetParmValue(idx, instance, value); }
1136 
1137  exint getNestNumParms(TempIndex idx) const override
1138  {
1139  if (idx.size() == 0)
1140  return 24;
1141  switch (idx[0])
1142  {
1143  case 8:
1144  return 4;
1145  case 10:
1146  return 3;
1147  case 12:
1148  return 2;
1149  case 15:
1150  return 3;
1151  case 16:
1152  return 2;
1153  case 17:
1154  return 1;
1155 
1156  }
1157  // Invalid
1158  return 0;
1159  }
1160 
1161  const char *getNestParmName(TempIndex fieldnum) const override
1162  {
1163  if (fieldnum.size() < 1)
1164  return 0;
1165  switch (fieldnum[0])
1166  {
1167  case 0:
1168  return "group";
1169  case 1:
1170  return "uvattrib";
1171  case 2:
1172  return "method";
1173  case 3:
1174  return "keepexistingseams";
1175  case 4:
1176  return "keepexistinglayout";
1177  case 5:
1178  return "pinboundaries";
1179  case 6:
1180  return "seamgroup";
1181  case 7:
1182  return "usepins";
1183  case 8:
1184  if (fieldnum.size() == 1)
1185  return "pins";
1186  switch (fieldnum[1])
1187  {
1188  case 0:
1189  return "usepin#";
1190  case 1:
1191  return "primvert#";
1192  case 2:
1193  return "pinuv#";
1194  case 3:
1195  return "pinrefuv#";
1196 
1197  }
1198  return 0;
1199  case 9:
1200  return "usealignments";
1201  case 10:
1202  if (fieldnum.size() == 1)
1203  return "alignments";
1204  switch (fieldnum[1])
1205  {
1206  case 0:
1207  return "align_enabled#";
1208  case 1:
1209  return "align_group#";
1210  case 2:
1211  return "align_axis#";
1212 
1213  }
1214  return 0;
1215  case 11:
1216  return "usestraightenings";
1217  case 12:
1218  if (fieldnum.size() == 1)
1219  return "straightenings";
1220  switch (fieldnum[1])
1221  {
1222  case 0:
1223  return "straight_enabled#";
1224  case 1:
1225  return "straight_group#";
1226 
1227  }
1228  return 0;
1229  case 13:
1230  return "manuallayout";
1231  case 14:
1232  return "layoutseamgroup";
1233  case 15:
1234  if (fieldnum.size() == 1)
1235  return "lpins";
1236  switch (fieldnum[1])
1237  {
1238  case 0:
1239  return "lprimvert#";
1240  case 1:
1241  return "lpinuv#";
1242  case 2:
1243  return "lpinrefuv#";
1244 
1245  }
1246  return 0;
1247  case 16:
1248  if (fieldnum.size() == 1)
1249  return "lalignments";
1250  switch (fieldnum[1])
1251  {
1252  case 0:
1253  return "lalign_group#";
1254  case 1:
1255  return "lalign_axis#";
1256 
1257  }
1258  return 0;
1259  case 17:
1260  if (fieldnum.size() == 1)
1261  return "lstraightenings";
1262  switch (fieldnum[1])
1263  {
1264  case 0:
1265  return "lstraight_group#";
1266 
1267  }
1268  return 0;
1269  case 18:
1270  return "useoutputseams";
1271  case 19:
1272  return "outputseams";
1273  case 20:
1274  return "useoutputconstrislands";
1275  case 21:
1276  return "outputconstrislands";
1277  case 22:
1278  return "bboxcenter";
1279  case 23:
1280  return "bboxsize";
1281 
1282  }
1283  return 0;
1284  }
1285 
1286  ParmType getNestParmType(TempIndex fieldnum) const override
1287  {
1288  if (fieldnum.size() < 1)
1289  return PARM_UNSUPPORTED;
1290  switch (fieldnum[0])
1291  {
1292  case 0:
1293  return PARM_STRING;
1294  case 1:
1295  return PARM_STRING;
1296  case 2:
1297  return PARM_INTEGER;
1298  case 3:
1299  return PARM_INTEGER;
1300  case 4:
1301  return PARM_INTEGER;
1302  case 5:
1303  return PARM_INTEGER;
1304  case 6:
1305  return PARM_STRING;
1306  case 7:
1307  return PARM_INTEGER;
1308  case 8:
1309  if (fieldnum.size() == 1)
1310  return PARM_MULTIPARM;
1311  switch (fieldnum[1])
1312  {
1313  case 0:
1314  return PARM_INTEGER;
1315  case 1:
1316  return PARM_VECTOR2;
1317  case 2:
1318  return PARM_VECTOR2;
1319  case 3:
1320  return PARM_VECTOR2;
1321 
1322  }
1323  return PARM_UNSUPPORTED;
1324  case 9:
1325  return PARM_INTEGER;
1326  case 10:
1327  if (fieldnum.size() == 1)
1328  return PARM_MULTIPARM;
1329  switch (fieldnum[1])
1330  {
1331  case 0:
1332  return PARM_INTEGER;
1333  case 1:
1334  return PARM_STRING;
1335  case 2:
1336  return PARM_INTEGER;
1337 
1338  }
1339  return PARM_UNSUPPORTED;
1340  case 11:
1341  return PARM_INTEGER;
1342  case 12:
1343  if (fieldnum.size() == 1)
1344  return PARM_MULTIPARM;
1345  switch (fieldnum[1])
1346  {
1347  case 0:
1348  return PARM_INTEGER;
1349  case 1:
1350  return PARM_STRING;
1351 
1352  }
1353  return PARM_UNSUPPORTED;
1354  case 13:
1355  return PARM_INTEGER;
1356  case 14:
1357  return PARM_STRING;
1358  case 15:
1359  if (fieldnum.size() == 1)
1360  return PARM_MULTIPARM;
1361  switch (fieldnum[1])
1362  {
1363  case 0:
1364  return PARM_VECTOR2;
1365  case 1:
1366  return PARM_VECTOR2;
1367  case 2:
1368  return PARM_VECTOR2;
1369 
1370  }
1371  return PARM_UNSUPPORTED;
1372  case 16:
1373  if (fieldnum.size() == 1)
1374  return PARM_MULTIPARM;
1375  switch (fieldnum[1])
1376  {
1377  case 0:
1378  return PARM_STRING;
1379  case 1:
1380  return PARM_INTEGER;
1381 
1382  }
1383  return PARM_UNSUPPORTED;
1384  case 17:
1385  if (fieldnum.size() == 1)
1386  return PARM_MULTIPARM;
1387  switch (fieldnum[1])
1388  {
1389  case 0:
1390  return PARM_STRING;
1391 
1392  }
1393  return PARM_UNSUPPORTED;
1394  case 18:
1395  return PARM_INTEGER;
1396  case 19:
1397  return PARM_STRING;
1398  case 20:
1399  return PARM_INTEGER;
1400  case 21:
1401  return PARM_STRING;
1402  case 22:
1403  return PARM_VECTOR2;
1404  case 23:
1405  return PARM_VECTOR2;
1406 
1407  }
1408  return PARM_UNSUPPORTED;
1409  }
1410 
1411  // Boiler plate to load individual types.
1412  static void loadData(UT_IStream &is, int64 &v)
1413  { is.bread(&v, 1); }
1414  static void loadData(UT_IStream &is, bool &v)
1415  { int64 iv; is.bread(&iv, 1); v = iv; }
1416  static void loadData(UT_IStream &is, fpreal64 &v)
1417  { is.bread<fpreal64>(&v, 1); }
1418  static void loadData(UT_IStream &is, UT_Vector2D &v)
1419  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
1420  static void loadData(UT_IStream &is, UT_Vector3D &v)
1421  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
1422  is.bread<fpreal64>(&v.z(), 1); }
1423  static void loadData(UT_IStream &is, UT_Vector4D &v)
1424  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
1425  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
1426  static void loadData(UT_IStream &is, UT_Matrix2D &v)
1427  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
1428  static void loadData(UT_IStream &is, UT_Matrix3D &v)
1429  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
1430  static void loadData(UT_IStream &is, UT_Matrix4D &v)
1431  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
1432  static void loadData(UT_IStream &is, UT_Vector2I &v)
1433  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
1434  static void loadData(UT_IStream &is, UT_Vector3I &v)
1435  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
1436  is.bread<int64>(&v.z(), 1); }
1437  static void loadData(UT_IStream &is, UT_Vector4I &v)
1438  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
1439  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
1441  { is.bread(v); }
1443  { UT_StringHolder rampdata;
1444  loadData(is, rampdata);
1445  if (rampdata.isstring())
1446  {
1447  v.reset(new UT_Ramp());
1448  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
1449  v->load(istr);
1450  }
1451  else v.reset();
1452  }
1455  loadData(is, data);
1456  if (data.isstring())
1457  {
1458  // Find the data type.
1459  const char *colon = UT_StringWrap(data).findChar(':');
1460  if (colon)
1461  {
1462  int typelen = colon - data.buffer();
1464  type.strncpy(data.buffer(), typelen);
1465  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
1466 
1467  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
1468  }
1469  }
1470  else v.reset();
1471  }
1472 
1473  static void saveData(std::ostream &os, int64 v)
1474  { UTwrite(os, &v); }
1475  static void saveData(std::ostream &os, bool v)
1476  { int64 iv = v; UTwrite(os, &iv); }
1477  static void saveData(std::ostream &os, fpreal64 v)
1478  { UTwrite<fpreal64>(os, &v); }
1479  static void saveData(std::ostream &os, UT_Vector2D v)
1480  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
1481  static void saveData(std::ostream &os, UT_Vector3D v)
1482  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1483  UTwrite<fpreal64>(os, &v.z()); }
1484  static void saveData(std::ostream &os, UT_Vector4D v)
1485  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1486  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
1487  static void saveData(std::ostream &os, UT_Matrix2D v)
1488  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) UTwrite<fpreal64>(os, &v(r, c)); }
1489  static void saveData(std::ostream &os, UT_Matrix3D v)
1490  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) UTwrite<fpreal64>(os, &v(r, c)); }
1491  static void saveData(std::ostream &os, UT_Matrix4D v)
1492  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) UTwrite<fpreal64>(os, &v(r, c)); }
1493  static void saveData(std::ostream &os, UT_StringHolder s)
1494  { UT_StringWrap(s).saveBinary(os); }
1495  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
1497  UT_OStringStream ostr;
1498  if (s) s->save(ostr);
1499  result = ostr.str();
1500  saveData(os, result);
1501  }
1502  static void saveData(std::ostream &os, PRM_DataItemHandle s)
1504  UT_OStringStream ostr;
1505  if (s)
1506  {
1507  ostr << s->getDataTypeToken();
1508  ostr << ":";
1509  s->saveBinary(ostr);
1510  }
1511  result = ostr.str();
1512  saveData(os, result);
1513  }
1514 
1515 
1516  void save(std::ostream &os) const
1517  {
1518  int32 v = version();
1519  UTwrite(os, &v);
1520  saveData(os, myGroup);
1521  saveData(os, myUVAttrib);
1522  saveData(os, myMethod);
1523  saveData(os, myKeepExistingSeams);
1524  saveData(os, myKeepExistingLayout);
1525  saveData(os, myPinBoundaries);
1526  saveData(os, mySeams);
1527  saveData(os, myUsePins);
1528  {
1529  int64 length = myPins.entries();
1530  UTwrite(os, &length);
1531  for (exint i = 0; i < length; i++)
1532  {
1533  auto && _curentry = myPins(i);
1534  (void) _curentry;
1535  saveData(os, _curentry.usepin);
1536  saveData(os, _curentry.primvert);
1537  saveData(os, _curentry.pinuv);
1538  saveData(os, _curentry.pinrefuv);
1539 
1540  }
1541  }
1542  saveData(os, myUseAlignments);
1543  {
1544  int64 length = myAlignments.entries();
1545  UTwrite(os, &length);
1546  for (exint i = 0; i < length; i++)
1547  {
1548  auto && _curentry = myAlignments(i);
1549  (void) _curentry;
1550  saveData(os, _curentry.align_enabled);
1551  saveData(os, _curentry.align_group);
1552  saveData(os, _curentry.align_axis);
1553 
1554  }
1555  }
1556  saveData(os, myUseStraightenings);
1557  {
1558  int64 length = myStraightenings.entries();
1559  UTwrite(os, &length);
1560  for (exint i = 0; i < length; i++)
1561  {
1562  auto && _curentry = myStraightenings(i);
1563  (void) _curentry;
1564  saveData(os, _curentry.straight_enabled);
1565  saveData(os, _curentry.straight_group);
1566 
1567  }
1568  }
1569  saveData(os, myManualLayout);
1570  saveData(os, myLayoutSeams);
1571  {
1572  int64 length = myLpins.entries();
1573  UTwrite(os, &length);
1574  for (exint i = 0; i < length; i++)
1575  {
1576  auto && _curentry = myLpins(i);
1577  (void) _curentry;
1578  saveData(os, _curentry.lprimvert);
1579  saveData(os, _curentry.lpinuv);
1580  saveData(os, _curentry.lpinrefuv);
1581 
1582  }
1583  }
1584  {
1585  int64 length = myLalignments.entries();
1586  UTwrite(os, &length);
1587  for (exint i = 0; i < length; i++)
1588  {
1589  auto && _curentry = myLalignments(i);
1590  (void) _curentry;
1591  saveData(os, _curentry.lalign_group);
1592  saveData(os, _curentry.lalign_axis);
1593 
1594  }
1595  }
1596  {
1597  int64 length = myLstraightenings.entries();
1598  UTwrite(os, &length);
1599  for (exint i = 0; i < length; i++)
1600  {
1601  auto && _curentry = myLstraightenings(i);
1602  (void) _curentry;
1603  saveData(os, _curentry.lstraight_group);
1604 
1605  }
1606  }
1607  saveData(os, myUseOutputSeams);
1608  saveData(os, myOutputSeams);
1609  saveData(os, myUseOutputConstrIslands);
1610  saveData(os, myOutputConstrIslands);
1611  saveData(os, myBBoxCenter);
1612  saveData(os, myBBoxSize);
1613 
1614  }
1615 
1616  bool load(UT_IStream &is)
1617  {
1618  int32 v;
1619  is.bread(&v, 1);
1620  if (version() != v)
1621  {
1622  // Fail incompatible versions
1623  return false;
1624  }
1625  loadData(is, myGroup);
1626  loadData(is, myUVAttrib);
1627  loadData(is, myMethod);
1628  loadData(is, myKeepExistingSeams);
1629  loadData(is, myKeepExistingLayout);
1630  loadData(is, myPinBoundaries);
1631  loadData(is, mySeams);
1632  loadData(is, myUsePins);
1633  {
1634  int64 length;
1635  is.read(&length, 1);
1636  myPins.setSize(length);
1637  for (exint i = 0; i < length; i++)
1638  {
1639  auto && _curentry = myPins(i);
1640  (void) _curentry;
1641  loadData(is, _curentry.usepin);
1642  loadData(is, _curentry.primvert);
1643  loadData(is, _curentry.pinuv);
1644  loadData(is, _curentry.pinrefuv);
1645 
1646  }
1647  }
1648  loadData(is, myUseAlignments);
1649  {
1650  int64 length;
1651  is.read(&length, 1);
1652  myAlignments.setSize(length);
1653  for (exint i = 0; i < length; i++)
1654  {
1655  auto && _curentry = myAlignments(i);
1656  (void) _curentry;
1657  loadData(is, _curentry.align_enabled);
1658  loadData(is, _curentry.align_group);
1659  loadData(is, _curentry.align_axis);
1660 
1661  }
1662  }
1663  loadData(is, myUseStraightenings);
1664  {
1665  int64 length;
1666  is.read(&length, 1);
1667  myStraightenings.setSize(length);
1668  for (exint i = 0; i < length; i++)
1669  {
1670  auto && _curentry = myStraightenings(i);
1671  (void) _curentry;
1672  loadData(is, _curentry.straight_enabled);
1673  loadData(is, _curentry.straight_group);
1674 
1675  }
1676  }
1677  loadData(is, myManualLayout);
1678  loadData(is, myLayoutSeams);
1679  {
1680  int64 length;
1681  is.read(&length, 1);
1682  myLpins.setSize(length);
1683  for (exint i = 0; i < length; i++)
1684  {
1685  auto && _curentry = myLpins(i);
1686  (void) _curentry;
1687  loadData(is, _curentry.lprimvert);
1688  loadData(is, _curentry.lpinuv);
1689  loadData(is, _curentry.lpinrefuv);
1690 
1691  }
1692  }
1693  {
1694  int64 length;
1695  is.read(&length, 1);
1696  myLalignments.setSize(length);
1697  for (exint i = 0; i < length; i++)
1698  {
1699  auto && _curentry = myLalignments(i);
1700  (void) _curentry;
1701  loadData(is, _curentry.lalign_group);
1702  loadData(is, _curentry.lalign_axis);
1703 
1704  }
1705  }
1706  {
1707  int64 length;
1708  is.read(&length, 1);
1709  myLstraightenings.setSize(length);
1710  for (exint i = 0; i < length; i++)
1711  {
1712  auto && _curentry = myLstraightenings(i);
1713  (void) _curentry;
1714  loadData(is, _curentry.lstraight_group);
1715 
1716  }
1717  }
1718  loadData(is, myUseOutputSeams);
1719  loadData(is, myOutputSeams);
1720  loadData(is, myUseOutputConstrIslands);
1721  loadData(is, myOutputConstrIslands);
1722  loadData(is, myBBoxCenter);
1723  loadData(is, myBBoxSize);
1724 
1725  return true;
1726  }
1727 
1728  const UT_StringHolder & getGroup() const { return myGroup; }
1729  void setGroup(const UT_StringHolder & val) { myGroup = val; }
1731  {
1732  SOP_Node *thissop = cookparms.getNode();
1733  if (!thissop) return getGroup();
1735  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
1736  return result;
1737  }
1738  const UT_StringHolder & getUVAttrib() const { return myUVAttrib; }
1739  void setUVAttrib(const UT_StringHolder & val) { myUVAttrib = val; }
1741  {
1742  SOP_Node *thissop = cookparms.getNode();
1743  if (!thissop) return getUVAttrib();
1745  OP_Utils::evalOpParm(result, thissop, "uvattrib", cookparms.getCookTime(), 0);
1746  return result;
1747  }
1748  Method getMethod() const { return Method(myMethod); }
1749  void setMethod(Method val) { myMethod = int64(val); }
1750  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
1751  {
1752  SOP_Node *thissop = cookparms.getNode();
1753  if (!thissop) return getMethod();
1754  int64 result;
1755  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
1756  return Method(result);
1757  }
1758  bool getKeepExistingSeams() const { return myKeepExistingSeams; }
1759  void setKeepExistingSeams(bool val) { myKeepExistingSeams = val; }
1760  bool opKeepExistingSeams(const SOP_NodeVerb::CookParms &cookparms) const
1761  {
1762  SOP_Node *thissop = cookparms.getNode();
1763  if (!thissop) return getKeepExistingSeams();
1764  bool result;
1765  OP_Utils::evalOpParm(result, thissop, "keepexistingseams", cookparms.getCookTime(), 0);
1766  return result;
1767  }
1768  bool getKeepExistingLayout() const { return myKeepExistingLayout; }
1769  void setKeepExistingLayout(bool val) { myKeepExistingLayout = val; }
1770  bool opKeepExistingLayout(const SOP_NodeVerb::CookParms &cookparms) const
1771  {
1772  SOP_Node *thissop = cookparms.getNode();
1773  if (!thissop) return getKeepExistingLayout();
1774  bool result;
1775  OP_Utils::evalOpParm(result, thissop, "keepexistinglayout", cookparms.getCookTime(), 0);
1776  return result;
1777  }
1778  bool getPinBoundaries() const { return myPinBoundaries; }
1779  void setPinBoundaries(bool val) { myPinBoundaries = val; }
1780  bool opPinBoundaries(const SOP_NodeVerb::CookParms &cookparms) const
1781  {
1782  SOP_Node *thissop = cookparms.getNode();
1783  if (!thissop) return getPinBoundaries();
1784  bool result;
1785  OP_Utils::evalOpParm(result, thissop, "pinboundaries", cookparms.getCookTime(), 0);
1786  return result;
1787  }
1788  const UT_StringHolder & getSeams() const { return mySeams; }
1789  void setSeams(const UT_StringHolder & val) { mySeams = val; }
1791  {
1792  SOP_Node *thissop = cookparms.getNode();
1793  if (!thissop) return getSeams();
1795  OP_Utils::evalOpParm(result, thissop, "seamgroup", cookparms.getCookTime(), 0);
1796  return result;
1797  }
1798  bool getUsePins() const { return myUsePins; }
1799  void setUsePins(bool val) { myUsePins = val; }
1800  bool opUsePins(const SOP_NodeVerb::CookParms &cookparms) const
1801  {
1802  SOP_Node *thissop = cookparms.getNode();
1803  if (!thissop) return getUsePins();
1804  bool result;
1805  OP_Utils::evalOpParm(result, thissop, "usepins", cookparms.getCookTime(), 0);
1806  return result;
1807  }
1808  const UT_Array<Pins> &getPins() const { return myPins; }
1809 void setPins(const UT_Array<Pins> &val) { myPins = val; }
1810  exint opPins(const SOP_NodeVerb::CookParms &cookparms) const
1811  {
1812  SOP_Node *thissop = cookparms.getNode();
1813  if (!thissop) return getPins().entries();
1814  exint result;
1815  OP_Utils::evalOpParm(result, thissop, "pins", cookparms.getCookTime(), 0);
1816  return result;
1817  }
1818  bool opPins_usepin(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1819  { return opinstPins_usepin(cookparms, &_idx); }
1820  bool opinstPins_usepin(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1821  {
1822  SOP_Node *thissop = cookparms.getNode();
1823  if (!thissop) return (myPins(_idx[0]).usepin);
1824  int _parmidx[2-1];
1825  _parmidx[1-1] = _idx[1-1] + 0;
1826 
1827  bool result;
1828  OP_Utils::evalOpParmInst(result, thissop, "usepin#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1829  return (result);
1830  }
1831  UT_Vector2D opPins_primvert(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1832  { return opinstPins_primvert(cookparms, &_idx); }
1833  UT_Vector2D opinstPins_primvert(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1834  {
1835  SOP_Node *thissop = cookparms.getNode();
1836  if (!thissop) return (myPins(_idx[0]).primvert);
1837  int _parmidx[2-1];
1838  _parmidx[1-1] = _idx[1-1] + 0;
1839 
1841  OP_Utils::evalOpParmInst(result, thissop, "primvert#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1842  return (result);
1843  }
1844  UT_Vector2D opPins_pinuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1845  { return opinstPins_pinuv(cookparms, &_idx); }
1846  UT_Vector2D opinstPins_pinuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1847  {
1848  SOP_Node *thissop = cookparms.getNode();
1849  if (!thissop) return (myPins(_idx[0]).pinuv);
1850  int _parmidx[2-1];
1851  _parmidx[1-1] = _idx[1-1] + 0;
1852 
1854  OP_Utils::evalOpParmInst(result, thissop, "pinuv#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1855  return (result);
1856  }
1857  UT_Vector2D opPins_pinrefuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1858  { return opinstPins_pinrefuv(cookparms, &_idx); }
1859  UT_Vector2D opinstPins_pinrefuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1860  {
1861  SOP_Node *thissop = cookparms.getNode();
1862  if (!thissop) return (myPins(_idx[0]).pinrefuv);
1863  int _parmidx[2-1];
1864  _parmidx[1-1] = _idx[1-1] + 0;
1865 
1867  OP_Utils::evalOpParmInst(result, thissop, "pinrefuv#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1868  return (result);
1869  }
1870 
1871  bool getUseAlignments() const { return myUseAlignments; }
1872  void setUseAlignments(bool val) { myUseAlignments = val; }
1873  bool opUseAlignments(const SOP_NodeVerb::CookParms &cookparms) const
1874  {
1875  SOP_Node *thissop = cookparms.getNode();
1876  if (!thissop) return getUseAlignments();
1877  bool result;
1878  OP_Utils::evalOpParm(result, thissop, "usealignments", cookparms.getCookTime(), 0);
1879  return result;
1880  }
1881  const UT_Array<Alignments> &getAlignments() const { return myAlignments; }
1882 void setAlignments(const UT_Array<Alignments> &val) { myAlignments = val; }
1884  {
1885  SOP_Node *thissop = cookparms.getNode();
1886  if (!thissop) return getAlignments().entries();
1887  exint result;
1888  OP_Utils::evalOpParm(result, thissop, "alignments", cookparms.getCookTime(), 0);
1889  return result;
1890  }
1891  bool opAlignments_align_enabled(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1892  { return opinstAlignments_align_enabled(cookparms, &_idx); }
1893  bool opinstAlignments_align_enabled(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1894  {
1895  SOP_Node *thissop = cookparms.getNode();
1896  if (!thissop) return (myAlignments(_idx[0]).align_enabled);
1897  int _parmidx[2-1];
1898  _parmidx[1-1] = _idx[1-1] + 0;
1899 
1900  bool result;
1901  OP_Utils::evalOpParmInst(result, thissop, "align_enabled#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1902  return (result);
1903  }
1905  { return opinstAlignments_align_group(cookparms, &_idx); }
1907  {
1908  SOP_Node *thissop = cookparms.getNode();
1909  if (!thissop) return (myAlignments(_idx[0]).align_group);
1910  int _parmidx[2-1];
1911  _parmidx[1-1] = _idx[1-1] + 0;
1912 
1914  OP_Utils::evalOpParmInst(result, thissop, "align_group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1915  return (result);
1916  }
1917  int64 opAlignments_align_axis(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1918  { return opinstAlignments_align_axis(cookparms, &_idx); }
1919  int64 opinstAlignments_align_axis(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1920  {
1921  SOP_Node *thissop = cookparms.getNode();
1922  if (!thissop) return (myAlignments(_idx[0]).align_axis);
1923  int _parmidx[2-1];
1924  _parmidx[1-1] = _idx[1-1] + 0;
1925 
1926  int64 result;
1927  OP_Utils::evalOpParmInst(result, thissop, "align_axis#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1928  return (result);
1929  }
1930 
1931  bool getUseStraightenings() const { return myUseStraightenings; }
1932  void setUseStraightenings(bool val) { myUseStraightenings = val; }
1933  bool opUseStraightenings(const SOP_NodeVerb::CookParms &cookparms) const
1934  {
1935  SOP_Node *thissop = cookparms.getNode();
1936  if (!thissop) return getUseStraightenings();
1937  bool result;
1938  OP_Utils::evalOpParm(result, thissop, "usestraightenings", cookparms.getCookTime(), 0);
1939  return result;
1940  }
1941  const UT_Array<Straightenings> &getStraightenings() const { return myStraightenings; }
1942 void setStraightenings(const UT_Array<Straightenings> &val) { myStraightenings = val; }
1944  {
1945  SOP_Node *thissop = cookparms.getNode();
1946  if (!thissop) return getStraightenings().entries();
1947  exint result;
1948  OP_Utils::evalOpParm(result, thissop, "straightenings", cookparms.getCookTime(), 0);
1949  return result;
1950  }
1951  bool opStraightenings_straight_enabled(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1952  { return opinstStraightenings_straight_enabled(cookparms, &_idx); }
1953  bool opinstStraightenings_straight_enabled(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1954  {
1955  SOP_Node *thissop = cookparms.getNode();
1956  if (!thissop) return (myStraightenings(_idx[0]).straight_enabled);
1957  int _parmidx[2-1];
1958  _parmidx[1-1] = _idx[1-1] + 0;
1959 
1960  bool result;
1961  OP_Utils::evalOpParmInst(result, thissop, "straight_enabled#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1962  return (result);
1963  }
1965  { return opinstStraightenings_straight_group(cookparms, &_idx); }
1967  {
1968  SOP_Node *thissop = cookparms.getNode();
1969  if (!thissop) return (myStraightenings(_idx[0]).straight_group);
1970  int _parmidx[2-1];
1971  _parmidx[1-1] = _idx[1-1] + 0;
1972 
1974  OP_Utils::evalOpParmInst(result, thissop, "straight_group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1975  return (result);
1976  }
1977 
1978  bool getManualLayout() const { return myManualLayout; }
1979  void setManualLayout(bool val) { myManualLayout = val; }
1980  bool opManualLayout(const SOP_NodeVerb::CookParms &cookparms) const
1981  {
1982  SOP_Node *thissop = cookparms.getNode();
1983  if (!thissop) return getManualLayout();
1984  bool result;
1985  OP_Utils::evalOpParm(result, thissop, "manuallayout", cookparms.getCookTime(), 0);
1986  return result;
1987  }
1988  const UT_StringHolder & getLayoutSeams() const { return myLayoutSeams; }
1989  void setLayoutSeams(const UT_StringHolder & val) { myLayoutSeams = val; }
1991  {
1992  SOP_Node *thissop = cookparms.getNode();
1993  if (!thissop) return getLayoutSeams();
1995  OP_Utils::evalOpParm(result, thissop, "layoutseamgroup", cookparms.getCookTime(), 0);
1996  return result;
1997  }
1998  const UT_Array<Lpins> &getLpins() const { return myLpins; }
1999 void setLpins(const UT_Array<Lpins> &val) { myLpins = val; }
2000  exint opLpins(const SOP_NodeVerb::CookParms &cookparms) const
2001  {
2002  SOP_Node *thissop = cookparms.getNode();
2003  if (!thissop) return getLpins().entries();
2004  exint result;
2005  OP_Utils::evalOpParm(result, thissop, "lpins", cookparms.getCookTime(), 0);
2006  return result;
2007  }
2008  UT_Vector2D opLpins_lprimvert(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
2009  { return opinstLpins_lprimvert(cookparms, &_idx); }
2010  UT_Vector2D opinstLpins_lprimvert(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
2011  {
2012  SOP_Node *thissop = cookparms.getNode();
2013  if (!thissop) return (myLpins(_idx[0]).lprimvert);
2014  int _parmidx[2-1];
2015  _parmidx[1-1] = _idx[1-1] + 0;
2016 
2018  OP_Utils::evalOpParmInst(result, thissop, "lprimvert#", _parmidx, cookparms.getCookTime(), 0, 2-1);
2019  return (result);
2020  }
2021  UT_Vector2D opLpins_lpinuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
2022  { return opinstLpins_lpinuv(cookparms, &_idx); }
2023  UT_Vector2D opinstLpins_lpinuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
2024  {
2025  SOP_Node *thissop = cookparms.getNode();
2026  if (!thissop) return (myLpins(_idx[0]).lpinuv);
2027  int _parmidx[2-1];
2028  _parmidx[1-1] = _idx[1-1] + 0;
2029 
2031  OP_Utils::evalOpParmInst(result, thissop, "lpinuv#", _parmidx, cookparms.getCookTime(), 0, 2-1);
2032  return (result);
2033  }
2034  UT_Vector2D opLpins_lpinrefuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
2035  { return opinstLpins_lpinrefuv(cookparms, &_idx); }
2036  UT_Vector2D opinstLpins_lpinrefuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
2037  {
2038  SOP_Node *thissop = cookparms.getNode();
2039  if (!thissop) return (myLpins(_idx[0]).lpinrefuv);
2040  int _parmidx[2-1];
2041  _parmidx[1-1] = _idx[1-1] + 0;
2042 
2044  OP_Utils::evalOpParmInst(result, thissop, "lpinrefuv#", _parmidx, cookparms.getCookTime(), 0, 2-1);
2045  return (result);
2046  }
2047 
2048  const UT_Array<Lalignments> &getLalignments() const { return myLalignments; }
2049 void setLalignments(const UT_Array<Lalignments> &val) { myLalignments = val; }
2051  {
2052  SOP_Node *thissop = cookparms.getNode();
2053  if (!thissop) return getLalignments().entries();
2054  exint result;
2055  OP_Utils::evalOpParm(result, thissop, "lalignments", cookparms.getCookTime(), 0);
2056  return result;
2057  }
2059  { return opinstLalignments_lalign_group(cookparms, &_idx); }
2061  {
2062  SOP_Node *thissop = cookparms.getNode();
2063  if (!thissop) return (myLalignments(_idx[0]).lalign_group);
2064  int _parmidx[2-1];
2065  _parmidx[1-1] = _idx[1-1] + 0;
2066 
2068  OP_Utils::evalOpParmInst(result, thissop, "lalign_group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
2069  return (result);
2070  }
2071  int64 opLalignments_lalign_axis(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
2072  { return opinstLalignments_lalign_axis(cookparms, &_idx); }
2073  int64 opinstLalignments_lalign_axis(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
2074  {
2075  SOP_Node *thissop = cookparms.getNode();
2076  if (!thissop) return (myLalignments(_idx[0]).lalign_axis);
2077  int _parmidx[2-1];
2078  _parmidx[1-1] = _idx[1-1] + 0;
2079 
2080  int64 result;
2081  OP_Utils::evalOpParmInst(result, thissop, "lalign_axis#", _parmidx, cookparms.getCookTime(), 0, 2-1);
2082  return (result);
2083  }
2084 
2085  const UT_Array<Lstraightenings> &getLstraightenings() const { return myLstraightenings; }
2086 void setLstraightenings(const UT_Array<Lstraightenings> &val) { myLstraightenings = val; }
2088  {
2089  SOP_Node *thissop = cookparms.getNode();
2090  if (!thissop) return getLstraightenings().entries();
2091  exint result;
2092  OP_Utils::evalOpParm(result, thissop, "lstraightenings", cookparms.getCookTime(), 0);
2093  return result;
2094  }
2096  { return opinstLstraightenings_lstraight_group(cookparms, &_idx); }
2098  {
2099  SOP_Node *thissop = cookparms.getNode();
2100  if (!thissop) return (myLstraightenings(_idx[0]).lstraight_group);
2101  int _parmidx[2-1];
2102  _parmidx[1-1] = _idx[1-1] + 0;
2103 
2105  OP_Utils::evalOpParmInst(result, thissop, "lstraight_group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
2106  return (result);
2107  }
2108 
2109  bool getUseOutputSeams() const { return myUseOutputSeams; }
2110  void setUseOutputSeams(bool val) { myUseOutputSeams = val; }
2111  bool opUseOutputSeams(const SOP_NodeVerb::CookParms &cookparms) const
2112  {
2113  SOP_Node *thissop = cookparms.getNode();
2114  if (!thissop) return getUseOutputSeams();
2115  bool result;
2116  OP_Utils::evalOpParm(result, thissop, "useoutputseams", cookparms.getCookTime(), 0);
2117  return result;
2118  }
2119  const UT_StringHolder & getOutputSeams() const { return myOutputSeams; }
2120  void setOutputSeams(const UT_StringHolder & val) { myOutputSeams = val; }
2122  {
2123  SOP_Node *thissop = cookparms.getNode();
2124  if (!thissop) return getOutputSeams();
2126  OP_Utils::evalOpParm(result, thissop, "outputseams", cookparms.getCookTime(), 0);
2127  return result;
2128  }
2129  bool getUseOutputConstrIslands() const { return myUseOutputConstrIslands; }
2130  void setUseOutputConstrIslands(bool val) { myUseOutputConstrIslands = val; }
2132  {
2133  SOP_Node *thissop = cookparms.getNode();
2134  if (!thissop) return getUseOutputConstrIslands();
2135  bool result;
2136  OP_Utils::evalOpParm(result, thissop, "useoutputconstrislands", cookparms.getCookTime(), 0);
2137  return result;
2138  }
2139  const UT_StringHolder & getOutputConstrIslands() const { return myOutputConstrIslands; }
2140  void setOutputConstrIslands(const UT_StringHolder & val) { myOutputConstrIslands = val; }
2142  {
2143  SOP_Node *thissop = cookparms.getNode();
2144  if (!thissop) return getOutputConstrIslands();
2146  OP_Utils::evalOpParm(result, thissop, "outputconstrislands", cookparms.getCookTime(), 0);
2147  return result;
2148  }
2149  UT_Vector2D getBBoxCenter() const { return myBBoxCenter; }
2150  void setBBoxCenter(UT_Vector2D val) { myBBoxCenter = val; }
2152  {
2153  SOP_Node *thissop = cookparms.getNode();
2154  if (!thissop) return getBBoxCenter();
2156  OP_Utils::evalOpParm(result, thissop, "bboxcenter", cookparms.getCookTime(), 0);
2157  return result;
2158  }
2159  UT_Vector2D getBBoxSize() const { return myBBoxSize; }
2160  void setBBoxSize(UT_Vector2D val) { myBBoxSize = val; }
2162  {
2163  SOP_Node *thissop = cookparms.getNode();
2164  if (!thissop) return getBBoxSize();
2166  OP_Utils::evalOpParm(result, thissop, "bboxsize", cookparms.getCookTime(), 0);
2167  return result;
2168  }
2169 
2170 private:
2171  UT_StringHolder myGroup;
2172  UT_StringHolder myUVAttrib;
2173  int64 myMethod;
2174  bool myKeepExistingSeams;
2175  bool myKeepExistingLayout;
2176  bool myPinBoundaries;
2177  UT_StringHolder mySeams;
2178  bool myUsePins;
2179  UT_Array<Pins> myPins;
2180  bool myUseAlignments;
2181  UT_Array<Alignments> myAlignments;
2182  bool myUseStraightenings;
2183  UT_Array<Straightenings> myStraightenings;
2184  bool myManualLayout;
2185  UT_StringHolder myLayoutSeams;
2186  UT_Array<Lpins> myLpins;
2187  UT_Array<Lalignments> myLalignments;
2188  UT_Array<Lstraightenings> myLstraightenings;
2189  bool myUseOutputSeams;
2190  UT_StringHolder myOutputSeams;
2191  bool myUseOutputConstrIslands;
2192  UT_StringHolder myOutputConstrIslands;
2193  UT_Vector2D myBBoxCenter;
2194  UT_Vector2D myBBoxSize;
2195 
2196 };
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, int64 v)
bool operator==(const SOP_UVFlatten_2_0Parms &src) const
UT_Vector2D opBBoxCenter(const SOP_NodeVerb::CookParms &cookparms) const
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
UT_Vector2D opPins_primvert(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
const UT_Array< Lstraightenings > & getLstraightenings() const
static void saveData(std::ostream &os, bool v)
bool opPins_usepin(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder createString(const UT_Array< Pins > &list) const
UT_StringHolder opinstLstraightenings_lstraight_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
void setLstraightenings(const UT_Array< Lstraightenings > &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
UT_StringHolder opOutputSeams(const SOP_NodeVerb::CookParms &cookparms) const
void
Definition: png.h:1083
UT_Vector2D opinstLpins_lpinrefuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
bool opAlignments_align_enabled(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
UT_Vector2D opLpins_lprimvert(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opUsePins(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
static void loadData(UT_IStream &is, int64 &v)
UT_Vector2T< fpreal64 > UT_Vector2D
UT_Vector2D opPins_pinuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool operator==(const Lpins &src) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_Vector2D opBBoxSize(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getBBoxCenter() const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_StringHolder createString(const UT_Array< Alignments > &list) const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool operator==(const Pins &src) const
bool opKeepExistingSeams(const SOP_NodeVerb::CookParms &cookparms) const
bool opPinBoundaries(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
UT_Vector2D opinstPins_pinrefuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
An output stream object that owns its own string buffer storage.
bool operator==(const Alignments &src) const
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, UT_Matrix3D v)
const UT_Array< Lpins > & getLpins() const
**But if you need a result
Definition: thread.h:613
const UT_StringHolder & getGroup() const
UT_Vector2D opinstLpins_lprimvert(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint opPins(const SOP_NodeVerb::CookParms &cookparms) const
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
static void loadData(UT_IStream &is, fpreal64 &v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
const UT_Array< Lalignments > & getLalignments() const
UT_StringHolder opAlignments_align_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder opLayoutSeams(const SOP_NodeVerb::CookParms &cookparms) const
void setOutputConstrIslands(const UT_StringHolder &val)
UT_StringHolder createString(const UT_Array< Lstraightenings > &list) const
bool operator!=(const Lstraightenings &src) const
void setLpins(const UT_Array< Lpins > &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
exint opLstraightenings(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opLstraightenings_lstraight_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
UT_Vector2D opinstPins_pinuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint opAlignments(const SOP_NodeVerb::CookParms &cookparms) const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool opinstPins_usepin(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setBBoxCenter(UT_Vector2D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_StringHolder opStraightenings_straight_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint opLalignments(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opOutputConstrIslands(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void copyFrom(const OP_NodeParms *src) override
int64 opAlignments_align_axis(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint length() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
bool operator!=(const Pins &src) const
const UT_Array< Alignments > & getAlignments() const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
UT_StringHolder opinstAlignments_align_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const UT_StringHolder & getUVAttrib() const
static void saveData(std::ostream &os, UT_Vector2D v)
bool operator!=(const Lpins &src) const
UT_StringHolder createString(const UT_Array< Lalignments > &list) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
const UT_Array< Pins > & getPins() const
void setAlignments(const UT_Array< Alignments > &val)
void setBBoxSize(UT_Vector2D val)
UT_Vector2D getBBoxSize() const
bool opUseAlignments(const SOP_NodeVerb::CookParms &cookparms) 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
bool opKeepExistingLayout(const SOP_NodeVerb::CookParms &cookparms) const
int64 opLalignments_lalign_axis(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opUseStraightenings(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
UT_Vector2D opPins_pinrefuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
const UT_StringHolder & getOutputConstrIslands() const
bool operator!=(const Alignments &src) const
ParmType getNestParmType(TempIndex fieldnum) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_StringHolder createString(const UT_Array< Straightenings > &list) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator!=(const Lalignments &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
SYS_FORCE_INLINE void strcat(const char *src)
bool opUseOutputConstrIslands(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool operator!=(const Straightenings &src) const
GT_API const UT_StringHolder version
bool opinstStraightenings_straight_enabled(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, fpreal64 v)
void setPins(const UT_Array< Pins > &val)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
exint opLpins(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getSeams() const
const UT_StringHolder & getLayoutSeams() const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setStraightenings(const UT_Array< Straightenings > &val)
UT_StringHolder opinstLalignments_lalign_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder createString(const UT_Array< Lpins > &list) const
void setGroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
bool opManualLayout(const SOP_NodeVerb::CookParms &cookparms) const
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setOutputSeams(const UT_StringHolder &val)
UT_Vector2D opLpins_lpinrefuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal64 fpreal
Definition: SYS_Types.h:277
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
UT_StringHolder opinstStraightenings_straight_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const UT_Array< Straightenings > & getStraightenings() const
void setUVAttrib(const UT_StringHolder &val)
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_Vector2D &v)
void setLayoutSeams(const UT_StringHolder &val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
UT_StringHolder opUVAttrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseOutputSeams(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getOutputSeams() const
exint opStraightenings(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
UT_Vector2D opinstLpins_lpinuv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool operator==(const Lalignments &src) const
UT_StringHolder opSeams(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
bool operator!=(const SOP_UVFlatten_2_0Parms &src) const
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void saveData(std::ostream &os, UT_Vector4D v)
Definition: core.h:1131
void setLalignments(const UT_Array< Lalignments > &val)
GLboolean r
Definition: glcorearb.h:1222
static void saveData(std::ostream &os, UT_Vector3D v)
bool operator==(const Lstraightenings &src) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void setSeams(const UT_StringHolder &val)
type
Definition: core.h:1059
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool opinstAlignments_align_enabled(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const Straightenings &src) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_Vector2D opLpins_lpinuv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void save(std::ostream &os) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
int64 opinstAlignments_align_axis(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
OP_NodeParms & operator=(const OP_NodeParms &)=default
UT_StringHolder opLalignments_lalign_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opStraightenings_straight_enabled(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
int64 opinstLalignments_lalign_axis(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_Vector2D opinstPins_primvert(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663