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