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