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