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