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