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