HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_UVLayout-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_UVLayout_2_0Enums
24 {
25  enum class Packing
26  {
27  ONEFRAME = 0,
29  USEUDIM,
31  };
32 
34  getToken(Packing enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case Packing::ONEFRAME: return "oneframe"_sh;
39  case Packing::MULTIFRAMES: return "multiframes"_sh;
40  case Packing::USEUDIM: return "useudim"_sh;
41  case Packing::CURRENTTILE: return "currenttile"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46  enum class Resolution
47  {
48  RES1 = 0,
49  RES2,
50  RES3,
51  RES4,
52  RES5
53  };
54 
56  getToken(Resolution enum_value)
57  {
58  using namespace UT::Literal;
59  switch (enum_value) {
60  case Resolution::RES1: return "res1"_sh;
61  case Resolution::RES2: return "res2"_sh;
62  case Resolution::RES3: return "res3"_sh;
63  case Resolution::RES4: return "res4"_sh;
64  case Resolution::RES5: return "res5"_sh;
65  default: UT_ASSERT(false); return ""_sh;
66  }
67  }
68 
69 }
70 
71 
73 {
74 public:
75  static int version() { return 1; }
76 
78  {
79  myUvAttr = "uv"_UTsh;
80  myGroup = ""_UTsh;
81  myPackBetween = false;
82  myAdditionalSeams = ""_UTsh;
83  myPacking = 0;
84  myScale = 1;
85  myPadding = 1;
86  myPaddingBoundary = false;
87  myPackInCavities = true;
88  myBBoxCenter = UT_Vector2D(0.5,0.5);
89  myBBoxSize = UT_Vector2D(1,1);
90  myCorrectAreas = false;
91  myAxisAlignIslands = true;
92  myRotations = 4;
93  myIterations = 1;
94  myRandSeed = 5489;
95  myResolution = 2;
96  myUvTolerance = 1e-05;
97  myScaleTolerance = 0.005;
98 
99  }
100 
101  explicit SOP_UVLayout_2_0Parms(const SOP_UVLayout_2_0Parms &) = default;
103  SOP_UVLayout_2_0Parms(SOP_UVLayout_2_0Parms &&) noexcept = default;
104  SOP_UVLayout_2_0Parms &operator=(SOP_UVLayout_2_0Parms &&) noexcept = default;
105 
106  ~SOP_UVLayout_2_0Parms() override {}
107 
109  {
110  if (myUvAttr != src.myUvAttr) return false;
111  if (myGroup != src.myGroup) return false;
112  if (myPackBetween != src.myPackBetween) return false;
113  if (myAdditionalSeams != src.myAdditionalSeams) return false;
114  if (myPacking != src.myPacking) return false;
115  if (myScale != src.myScale) return false;
116  if (myPadding != src.myPadding) return false;
117  if (myPaddingBoundary != src.myPaddingBoundary) return false;
118  if (myPackInCavities != src.myPackInCavities) return false;
119  if (myBBoxCenter != src.myBBoxCenter) return false;
120  if (myBBoxSize != src.myBBoxSize) return false;
121  if (myCorrectAreas != src.myCorrectAreas) return false;
122  if (myAxisAlignIslands != src.myAxisAlignIslands) return false;
123  if (myRotations != src.myRotations) return false;
124  if (myIterations != src.myIterations) return false;
125  if (myRandSeed != src.myRandSeed) return false;
126  if (myResolution != src.myResolution) return false;
127  if (myUvTolerance != src.myUvTolerance) return false;
128  if (myScaleTolerance != src.myScaleTolerance) return false;
129 
130  return true;
131  }
133  {
134  return !operator==(src);
135  }
138 
139 
140 
141  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
142  {
143  myUvAttr = "uv"_UTsh;
144  if (true)
145  graph->evalOpParm(myUvAttr, nodeidx, "uvattr", time, 0);
146  myGroup = ""_UTsh;
147  if (true)
148  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
149  myPackBetween = false;
150  if (true)
151  graph->evalOpParm(myPackBetween, nodeidx, "packbetween", time, 0);
152  myAdditionalSeams = ""_UTsh;
153  if (true)
154  graph->evalOpParm(myAdditionalSeams, nodeidx, "additionalseams", time, 0);
155  myPacking = 0;
156  if (true)
157  graph->evalOpParm(myPacking, nodeidx, "packing", time, 0);
158  myScale = 1;
159  if (true && ( (true&&!(((int64(getPacking())!=1)))) ) )
160  graph->evalOpParm(myScale, nodeidx, "scale", time, 0);
161  myPadding = 1;
162  if (true)
163  graph->evalOpParm(myPadding, nodeidx, "padding", time, 0);
164  myPaddingBoundary = false;
165  if (true)
166  graph->evalOpParm(myPaddingBoundary, nodeidx, "paddingboundary", time, 0);
167  myPackInCavities = true;
168  if (true)
169  graph->evalOpParm(myPackInCavities, nodeidx, "packincavities", time, 0);
170  myBBoxCenter = UT_Vector2D(0.5,0.5);
171  if (true && ( (true&&!(((int64(getPacking())!=0)))) ) )
172  graph->evalOpParm(myBBoxCenter, nodeidx, "bboxcenter", time, 0);
173  myBBoxSize = UT_Vector2D(1,1);
174  if (true && ( (true&&!(((int64(getPacking())!=0)))) ) )
175  graph->evalOpParm(myBBoxSize, nodeidx, "bboxsize", time, 0);
176  myCorrectAreas = false;
177  if (true)
178  graph->evalOpParm(myCorrectAreas, nodeidx, "correctareas", time, 0);
179  myAxisAlignIslands = true;
180  if (true)
181  graph->evalOpParm(myAxisAlignIslands, nodeidx, "axisalignislands", time, 0);
182  myRotations = 4;
183  if (true)
184  graph->evalOpParm(myRotations, nodeidx, "rotations", time, 0);
185  myIterations = 1;
186  if (true)
187  graph->evalOpParm(myIterations, nodeidx, "iterations", time, 0);
188  myRandSeed = 5489;
189  if (true && ( (true&&!(((int64(getIterations())==1)))) ) )
190  graph->evalOpParm(myRandSeed, nodeidx, "randseed", time, 0);
191  myResolution = 2;
192  if (true)
193  graph->evalOpParm(myResolution, nodeidx, "resolution", time, 0);
194  myUvTolerance = 1e-05;
195  if (true)
196  graph->evalOpParm(myUvTolerance, nodeidx, "uvtolerance", time, 0);
197  myScaleTolerance = 0.005;
198  if (true && ( (true&&!(((int64(getPacking())==1)))) ) )
199  graph->evalOpParm(myScaleTolerance, nodeidx, "scaletolerance", time, 0);
200 
201  }
202 
203 
204  void loadFromOpSubclass(const LoadParms &loadparms) override
205  {
206  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
207  }
208 
209 
210  void copyFrom(const OP_NodeParms *src) override
211  {
212  *this = *((const SOP_UVLayout_2_0Parms *)src);
213  }
214 
215  template <typename T>
216  void
217  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
218  {
219  if (idx.size() < 1)
220  return;
221  UT_ASSERT(idx.size() == instance.size()+1);
222  if (idx.size() != instance.size()+1)
223  return;
224  switch (idx[0])
225  {
226  case 0:
227  coerceValue(value, myUvAttr);
228  break;
229  case 1:
230  coerceValue(value, myGroup);
231  break;
232  case 2:
233  coerceValue(value, myPackBetween);
234  break;
235  case 3:
236  coerceValue(value, myAdditionalSeams);
237  break;
238  case 4:
239  coerceValue(value, myPacking);
240  break;
241  case 5:
242  coerceValue(value, myScale);
243  break;
244  case 6:
245  coerceValue(value, myPadding);
246  break;
247  case 7:
248  coerceValue(value, myPaddingBoundary);
249  break;
250  case 8:
251  coerceValue(value, myPackInCavities);
252  break;
253  case 9:
254  coerceValue(value, myBBoxCenter);
255  break;
256  case 10:
257  coerceValue(value, myBBoxSize);
258  break;
259  case 11:
260  coerceValue(value, myCorrectAreas);
261  break;
262  case 12:
263  coerceValue(value, myAxisAlignIslands);
264  break;
265  case 13:
266  coerceValue(value, myRotations);
267  break;
268  case 14:
269  coerceValue(value, myIterations);
270  break;
271  case 15:
272  coerceValue(value, myRandSeed);
273  break;
274  case 16:
275  coerceValue(value, myResolution);
276  break;
277  case 17:
278  coerceValue(value, myUvTolerance);
279  break;
280  case 18:
281  coerceValue(value, myScaleTolerance);
282  break;
283 
284  }
285  }
286 
287  bool isParmColorRamp(exint idx) const override
288  {
289  switch (idx)
290  {
291 
292  }
293  return false;
294  }
295 
296  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
315  { doGetParmValue(idx, instance, value); }
316  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
317  { doGetParmValue(idx, instance, value); }
318 
319  template <typename T>
320  void
321  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
322  {
323  if (idx.size() < 1)
324  return;
325  UT_ASSERT(idx.size() == instance.size()+1);
326  if (idx.size() != instance.size()+1)
327  return;
328  switch (idx[0])
329  {
330  case 0:
331  coerceValue(myUvAttr, ( ( value ) ));
332  break;
333  case 1:
334  coerceValue(myGroup, ( ( value ) ));
335  break;
336  case 2:
337  coerceValue(myPackBetween, ( ( value ) ));
338  break;
339  case 3:
340  coerceValue(myAdditionalSeams, ( ( value ) ));
341  break;
342  case 4:
343  coerceValue(myPacking, clampMinValue(0, clampMaxValue(3, value ) ));
344  break;
345  case 5:
346  coerceValue(myScale, clampMinValue(0, ( value ) ));
347  break;
348  case 6:
349  coerceValue(myPadding, clampMinValue(0, ( value ) ));
350  break;
351  case 7:
352  coerceValue(myPaddingBoundary, ( ( value ) ));
353  break;
354  case 8:
355  coerceValue(myPackInCavities, ( ( value ) ));
356  break;
357  case 9:
358  coerceValue(myBBoxCenter, ( ( value ) ));
359  break;
360  case 10:
361  coerceValue(myBBoxSize, clampMinValue(0, ( value ) ));
362  break;
363  case 11:
364  coerceValue(myCorrectAreas, ( ( value ) ));
365  break;
366  case 12:
367  coerceValue(myAxisAlignIslands, ( ( value ) ));
368  break;
369  case 13:
370  coerceValue(myRotations, clampMinValue(1, ( value ) ));
371  break;
372  case 14:
373  coerceValue(myIterations, clampMinValue(1, ( value ) ));
374  break;
375  case 15:
376  coerceValue(myRandSeed, clampMinValue(0, ( value ) ));
377  break;
378  case 16:
379  coerceValue(myResolution, clampMinValue(0, clampMaxValue(4, value ) ));
380  break;
381  case 17:
382  coerceValue(myUvTolerance, clampMinValue(0, ( value ) ));
383  break;
384  case 18:
385  coerceValue(myScaleTolerance, ( clampMaxValue(-06, value ) ));
386  break;
387 
388  }
389  }
390 
391  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
392  { doSetParmValue(idx, instance, value); }
393  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
394  { doSetParmValue(idx, instance, value); }
395  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
396  { doSetParmValue(idx, instance, value); }
397  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
412  { doSetParmValue(idx, instance, value); }
413 
414  exint getNestNumParms(TempIndex idx) const override
415  {
416  if (idx.size() == 0)
417  return 19;
418  switch (idx[0])
419  {
420 
421  }
422  // Invalid
423  return 0;
424  }
425 
426  const char *getNestParmName(TempIndex fieldnum) const override
427  {
428  if (fieldnum.size() < 1)
429  return 0;
430  switch (fieldnum[0])
431  {
432  case 0:
433  return "uvattr";
434  case 1:
435  return "group";
436  case 2:
437  return "packbetween";
438  case 3:
439  return "additionalseams";
440  case 4:
441  return "packing";
442  case 5:
443  return "scale";
444  case 6:
445  return "padding";
446  case 7:
447  return "paddingboundary";
448  case 8:
449  return "packincavities";
450  case 9:
451  return "bboxcenter";
452  case 10:
453  return "bboxsize";
454  case 11:
455  return "correctareas";
456  case 12:
457  return "axisalignislands";
458  case 13:
459  return "rotations";
460  case 14:
461  return "iterations";
462  case 15:
463  return "randseed";
464  case 16:
465  return "resolution";
466  case 17:
467  return "uvtolerance";
468  case 18:
469  return "scaletolerance";
470 
471  }
472  return 0;
473  }
474 
475  ParmType getNestParmType(TempIndex fieldnum) const override
476  {
477  if (fieldnum.size() < 1)
478  return PARM_UNSUPPORTED;
479  switch (fieldnum[0])
480  {
481  case 0:
482  return PARM_STRING;
483  case 1:
484  return PARM_STRING;
485  case 2:
486  return PARM_INTEGER;
487  case 3:
488  return PARM_STRING;
489  case 4:
490  return PARM_INTEGER;
491  case 5:
492  return PARM_FLOAT;
493  case 6:
494  return PARM_INTEGER;
495  case 7:
496  return PARM_INTEGER;
497  case 8:
498  return PARM_INTEGER;
499  case 9:
500  return PARM_VECTOR2;
501  case 10:
502  return PARM_VECTOR2;
503  case 11:
504  return PARM_INTEGER;
505  case 12:
506  return PARM_INTEGER;
507  case 13:
508  return PARM_INTEGER;
509  case 14:
510  return PARM_INTEGER;
511  case 15:
512  return PARM_INTEGER;
513  case 16:
514  return PARM_INTEGER;
515  case 17:
516  return PARM_FLOAT;
517  case 18:
518  return PARM_FLOAT;
519 
520  }
521  return PARM_UNSUPPORTED;
522  }
523 
524  // Boiler plate to load individual types.
525  static void loadData(UT_IStream &is, int64 &v)
526  { is.bread(&v, 1); }
527  static void loadData(UT_IStream &is, bool &v)
528  { int64 iv; is.bread(&iv, 1); v = iv; }
529  static void loadData(UT_IStream &is, fpreal64 &v)
530  { is.bread<fpreal64>(&v, 1); }
531  static void loadData(UT_IStream &is, UT_Vector2D &v)
532  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
533  static void loadData(UT_IStream &is, UT_Vector3D &v)
534  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
535  is.bread<fpreal64>(&v.z(), 1); }
536  static void loadData(UT_IStream &is, UT_Vector4D &v)
537  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
538  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
539  static void loadData(UT_IStream &is, UT_Matrix2D &v)
540  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
541  static void loadData(UT_IStream &is, UT_Matrix3D &v)
542  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
543  static void loadData(UT_IStream &is, UT_Matrix4D &v)
544  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
545  static void loadData(UT_IStream &is, UT_Vector2I &v)
546  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
547  static void loadData(UT_IStream &is, UT_Vector3I &v)
548  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
549  is.bread<int64>(&v.z(), 1); }
550  static void loadData(UT_IStream &is, UT_Vector4I &v)
551  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
552  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
554  { is.bread(v); }
556  { UT_StringHolder rampdata;
557  loadData(is, rampdata);
558  if (rampdata.isstring())
559  {
560  v.reset(new UT_Ramp());
561  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
562  v->load(istr);
563  }
564  else v.reset();
565  }
568  loadData(is, data);
569  if (data.isstring())
570  {
571  // Find the data type.
572  const char *colon = UT_StringWrap(data).findChar(':');
573  if (colon)
574  {
575  int typelen = colon - data.buffer();
577  type.strncpy(data.buffer(), typelen);
578  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
579 
580  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
581  }
582  }
583  else v.reset();
584  }
585 
586  static void saveData(std::ostream &os, int64 v)
587  { UTwrite(os, &v); }
588  static void saveData(std::ostream &os, bool v)
589  { int64 iv = v; UTwrite(os, &iv); }
590  static void saveData(std::ostream &os, fpreal64 v)
591  { UTwrite<fpreal64>(os, &v); }
592  static void saveData(std::ostream &os, UT_Vector2D v)
593  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
594  static void saveData(std::ostream &os, UT_Vector3D v)
595  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
596  UTwrite<fpreal64>(os, &v.z()); }
597  static void saveData(std::ostream &os, UT_Vector4D v)
598  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
599  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
600  static void saveData(std::ostream &os, UT_Matrix2D v)
602  static void saveData(std::ostream &os, UT_Matrix3D v)
604  static void saveData(std::ostream &os, UT_Matrix4D v)
606  static void saveData(std::ostream &os, UT_StringHolder s)
607  { UT_StringWrap(s).saveBinary(os); }
608  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
610  UT_OStringStream ostr;
611  if (s) s->save(ostr);
612  result = ostr.str();
613  saveData(os, result);
614  }
615  static void saveData(std::ostream &os, PRM_DataItemHandle s)
617  UT_OStringStream ostr;
618  if (s)
619  {
620  ostr << s->getDataTypeToken();
621  ostr << ":";
622  s->saveBinary(ostr);
623  }
624  result = ostr.str();
625  saveData(os, result);
626  }
627 
628 
629  void save(std::ostream &os) const
630  {
631  int32 v = version();
632  UTwrite(os, &v);
633  saveData(os, myUvAttr);
634  saveData(os, myGroup);
635  saveData(os, myPackBetween);
636  saveData(os, myAdditionalSeams);
637  saveData(os, myPacking);
638  saveData(os, myScale);
639  saveData(os, myPadding);
640  saveData(os, myPaddingBoundary);
641  saveData(os, myPackInCavities);
642  saveData(os, myBBoxCenter);
643  saveData(os, myBBoxSize);
644  saveData(os, myCorrectAreas);
645  saveData(os, myAxisAlignIslands);
646  saveData(os, myRotations);
647  saveData(os, myIterations);
648  saveData(os, myRandSeed);
649  saveData(os, myResolution);
650  saveData(os, myUvTolerance);
651  saveData(os, myScaleTolerance);
652 
653  }
654 
655  bool load(UT_IStream &is)
656  {
657  int32 v;
658  is.bread(&v, 1);
659  if (version() != v)
660  {
661  // Fail incompatible versions
662  return false;
663  }
664  loadData(is, myUvAttr);
665  loadData(is, myGroup);
666  loadData(is, myPackBetween);
667  loadData(is, myAdditionalSeams);
668  loadData(is, myPacking);
669  loadData(is, myScale);
670  loadData(is, myPadding);
671  loadData(is, myPaddingBoundary);
672  loadData(is, myPackInCavities);
673  loadData(is, myBBoxCenter);
674  loadData(is, myBBoxSize);
675  loadData(is, myCorrectAreas);
676  loadData(is, myAxisAlignIslands);
677  loadData(is, myRotations);
678  loadData(is, myIterations);
679  loadData(is, myRandSeed);
680  loadData(is, myResolution);
681  loadData(is, myUvTolerance);
682  loadData(is, myScaleTolerance);
683 
684  return true;
685  }
686 
687  const UT_StringHolder & getUvAttr() const { return myUvAttr; }
688  void setUvAttr(const UT_StringHolder & val) { myUvAttr = val; }
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getUvAttr();
694  OP_Utils::evalOpParm(result, thissop, "uvattr", cookparms.getCookTime(), 0);
695  return result;
696  }
697  const UT_StringHolder & getGroup() const { return myGroup; }
698  void setGroup(const UT_StringHolder & val) { myGroup = val; }
700  {
701  SOP_Node *thissop = cookparms.getNode();
702  if (!thissop) return getGroup();
704  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
705  return result;
706  }
707  bool getPackBetween() const { return myPackBetween; }
708  void setPackBetween(bool val) { myPackBetween = val; }
709  bool opPackBetween(const SOP_NodeVerb::CookParms &cookparms) const
710  {
711  SOP_Node *thissop = cookparms.getNode();
712  if (!thissop) return getPackBetween();
713  bool result;
714  OP_Utils::evalOpParm(result, thissop, "packbetween", cookparms.getCookTime(), 0);
715  return result;
716  }
717  const UT_StringHolder & getAdditionalSeams() const { return myAdditionalSeams; }
718  void setAdditionalSeams(const UT_StringHolder & val) { myAdditionalSeams = val; }
720  {
721  SOP_Node *thissop = cookparms.getNode();
722  if (!thissop) return getAdditionalSeams();
724  OP_Utils::evalOpParm(result, thissop, "additionalseams", cookparms.getCookTime(), 0);
725  return result;
726  }
727  Packing getPacking() const { return Packing(myPacking); }
728  void setPacking(Packing val) { myPacking = int64(val); }
729  Packing opPacking(const SOP_NodeVerb::CookParms &cookparms) const
730  {
731  SOP_Node *thissop = cookparms.getNode();
732  if (!thissop) return getPacking();
733  int64 result;
734  OP_Utils::evalOpParm(result, thissop, "packing", cookparms.getCookTime(), 0);
735  return Packing(result);
736  }
737  fpreal64 getScale() const { return myScale; }
738  void setScale(fpreal64 val) { myScale = val; }
739  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
740  {
741  SOP_Node *thissop = cookparms.getNode();
742  if (!thissop) return getScale();
744  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
745  return result;
746  }
747  int64 getPadding() const { return myPadding; }
748  void setPadding(int64 val) { myPadding = val; }
749  int64 opPadding(const SOP_NodeVerb::CookParms &cookparms) const
750  {
751  SOP_Node *thissop = cookparms.getNode();
752  if (!thissop) return getPadding();
753  int64 result;
754  OP_Utils::evalOpParm(result, thissop, "padding", cookparms.getCookTime(), 0);
755  return result;
756  }
757  bool getPaddingBoundary() const { return myPaddingBoundary; }
758  void setPaddingBoundary(bool val) { myPaddingBoundary = val; }
759  bool opPaddingBoundary(const SOP_NodeVerb::CookParms &cookparms) const
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getPaddingBoundary();
763  bool result;
764  OP_Utils::evalOpParm(result, thissop, "paddingboundary", cookparms.getCookTime(), 0);
765  return result;
766  }
767  bool getPackInCavities() const { return myPackInCavities; }
768  void setPackInCavities(bool val) { myPackInCavities = val; }
769  bool opPackInCavities(const SOP_NodeVerb::CookParms &cookparms) const
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getPackInCavities();
773  bool result;
774  OP_Utils::evalOpParm(result, thissop, "packincavities", cookparms.getCookTime(), 0);
775  return result;
776  }
777  UT_Vector2D getBBoxCenter() const { return myBBoxCenter; }
778  void setBBoxCenter(UT_Vector2D val) { myBBoxCenter = val; }
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return getBBoxCenter();
784  OP_Utils::evalOpParm(result, thissop, "bboxcenter", cookparms.getCookTime(), 0);
785  return result;
786  }
787  UT_Vector2D getBBoxSize() const { return myBBoxSize; }
788  void setBBoxSize(UT_Vector2D val) { myBBoxSize = val; }
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getBBoxSize();
794  OP_Utils::evalOpParm(result, thissop, "bboxsize", cookparms.getCookTime(), 0);
795  return result;
796  }
797  bool getCorrectAreas() const { return myCorrectAreas; }
798  void setCorrectAreas(bool val) { myCorrectAreas = val; }
799  bool opCorrectAreas(const SOP_NodeVerb::CookParms &cookparms) const
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getCorrectAreas();
803  bool result;
804  OP_Utils::evalOpParm(result, thissop, "correctareas", cookparms.getCookTime(), 0);
805  return result;
806  }
807  bool getAxisAlignIslands() const { return myAxisAlignIslands; }
808  void setAxisAlignIslands(bool val) { myAxisAlignIslands = val; }
809  bool opAxisAlignIslands(const SOP_NodeVerb::CookParms &cookparms) const
810  {
811  SOP_Node *thissop = cookparms.getNode();
812  if (!thissop) return getAxisAlignIslands();
813  bool result;
814  OP_Utils::evalOpParm(result, thissop, "axisalignislands", cookparms.getCookTime(), 0);
815  return result;
816  }
817  int64 getRotations() const { return myRotations; }
818  void setRotations(int64 val) { myRotations = val; }
819  int64 opRotations(const SOP_NodeVerb::CookParms &cookparms) const
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getRotations();
823  int64 result;
824  OP_Utils::evalOpParm(result, thissop, "rotations", cookparms.getCookTime(), 0);
825  return result;
826  }
827  int64 getIterations() const { return myIterations; }
828  void setIterations(int64 val) { myIterations = val; }
830  {
831  SOP_Node *thissop = cookparms.getNode();
832  if (!thissop) return getIterations();
833  int64 result;
834  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
835  return result;
836  }
837  int64 getRandSeed() const { return myRandSeed; }
838  void setRandSeed(int64 val) { myRandSeed = val; }
839  int64 opRandSeed(const SOP_NodeVerb::CookParms &cookparms) const
840  {
841  SOP_Node *thissop = cookparms.getNode();
842  if (!thissop) return getRandSeed();
843  int64 result;
844  OP_Utils::evalOpParm(result, thissop, "randseed", cookparms.getCookTime(), 0);
845  return result;
846  }
847  Resolution getResolution() const { return Resolution(myResolution); }
848  void setResolution(Resolution val) { myResolution = int64(val); }
850  {
851  SOP_Node *thissop = cookparms.getNode();
852  if (!thissop) return getResolution();
853  int64 result;
854  OP_Utils::evalOpParm(result, thissop, "resolution", cookparms.getCookTime(), 0);
855  return Resolution(result);
856  }
857  fpreal64 getUvTolerance() const { return myUvTolerance; }
858  void setUvTolerance(fpreal64 val) { myUvTolerance = val; }
860  {
861  SOP_Node *thissop = cookparms.getNode();
862  if (!thissop) return getUvTolerance();
864  OP_Utils::evalOpParm(result, thissop, "uvtolerance", cookparms.getCookTime(), 0);
865  return result;
866  }
867  fpreal64 getScaleTolerance() const { return myScaleTolerance; }
868  void setScaleTolerance(fpreal64 val) { myScaleTolerance = val; }
870  {
871  SOP_Node *thissop = cookparms.getNode();
872  if (!thissop) return getScaleTolerance();
874  OP_Utils::evalOpParm(result, thissop, "scaletolerance", cookparms.getCookTime(), 0);
875  return result;
876  }
877 
878 private:
879  UT_StringHolder myUvAttr;
880  UT_StringHolder myGroup;
881  bool myPackBetween;
882  UT_StringHolder myAdditionalSeams;
883  int64 myPacking;
884  fpreal64 myScale;
885  int64 myPadding;
886  bool myPaddingBoundary;
887  bool myPackInCavities;
888  UT_Vector2D myBBoxCenter;
889  UT_Vector2D myBBoxSize;
890  bool myCorrectAreas;
891  bool myAxisAlignIslands;
892  int64 myRotations;
893  int64 myIterations;
894  int64 myRandSeed;
895  int64 myResolution;
896  fpreal64 myUvTolerance;
897  fpreal64 myScaleTolerance;
898 
899 };
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
int64 opPadding(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
bool operator!=(const SOP_UVLayout_2_0Parms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal64 getUvTolerance() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opPaddingBoundary(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, fpreal64 &v)
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
UT_Vector2D getBBoxSize() const
UT_StringHolder opAdditionalSeams(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
SYS_FORCE_INLINE UT_StringHolder getToken(Packing enum_value)
int64 opRandSeed(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getTime() const
Definition: OP_Context.h:62
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_Vector2T< fpreal64 > UT_Vector2D
static void saveData(std::ostream &os, UT_Matrix2D v)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
Resolution getResolution() const
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
An output stream object that owns its own string buffer storage.
fpreal64 getScaleTolerance() const
bool opPackInCavities(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
**But if you need a result
Definition: thread.h:613
void setAdditionalSeams(const UT_StringHolder &val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setResolution(Resolution val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setUvTolerance(fpreal64 val)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
Packing opPacking(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
exint length() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &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
const UT_StringHolder & getUvAttr() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool operator==(const SOP_UVLayout_2_0Parms &src) const
void copyFrom(const OP_NodeParms *src) override
UT_Vector2D getBBoxCenter() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, fpreal64 v)
void setUvAttr(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
long long int64
Definition: SYS_Types.h:116
void setBBoxCenter(UT_Vector2D val)
UT_StringHolder opUvAttr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_Vector2D opBBoxSize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
Resolution opResolution(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GT_API const UT_StringHolder version
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
bool opAxisAlignIslands(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
void setScaleTolerance(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setBBoxSize(UT_Vector2D val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, bool v)
fpreal64 fpreal
Definition: SYS_Types.h:277
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
static void loadData(UT_IStream &is, UT_Vector3D &v)
const UT_StringHolder & getAdditionalSeams() const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
Definition: Mat.h:633
int64 opRotations(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_Matrix4D v)
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
const char * getNestParmName(TempIndex fieldnum) const override
ParmType getNestParmType(TempIndex fieldnum) const override
GLboolean r
Definition: glcorearb.h:1222
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal64 opScaleTolerance(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
fpreal64 opUvTolerance(const SOP_NodeVerb::CookParms &cookparms) const
type
Definition: core.h:1059
bool opCorrectAreas(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
UT_Vector2D opBBoxCenter(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, int64 v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opPackBetween(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override