HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Resample.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_ResampleEnums
24 {
25  enum class Method
26  {
27  DIST = 0,
28  X,
29  Y,
30  Z
31  };
32  enum class Measure
33  {
34  ARC = 0,
35  CHORD
36  };
37  enum class Treatpolysas
38  {
39  STRAIGHT = 0,
40  SUBD,
41  INTERP
42  };
43 }
44 
45 
47 {
48 public:
49  static int version() { return 1; }
50 
52  {
53  myGroup = ""_sh;
54  myLod = 1;
55  myEdge = false;
56  myMethod = 0;
57  myMeasure = 0;
58  myDolength = true;
59  myLength = 0.1;
60  myDosegs = false;
61  mySegs = 10;
62  myUseattribs = true;
63  myAllequal = true;
64  myLast = false;
65  myRandomshift = false;
66  myOnlypoints = false;
67  myTreatpolysas = 0;
68  myOutputsubdpoly = false;
69  myDoptdistattr = false;
70  myPtdistattr = "ptdist"_sh;
71  myDotangentattr = false;
72  myTangentattr = "tangentu"_sh;
73  myDocurveuattr = false;
74  myCurveuattr = "curveu"_sh;
75  myDocurvenumattr = false;
76  myCurvenumattr = "curvenum"_sh;
77 
78  }
79 
80  explicit SOP_ResampleParms(const SOP_ResampleParms &) = default;
81 
82  ~SOP_ResampleParms() override {}
83 
84  bool operator==(const SOP_ResampleParms &src) const
85  {
86  if (myGroup != src.myGroup) return false;
87  if (myLod != src.myLod) return false;
88  if (myEdge != src.myEdge) return false;
89  if (myMethod != src.myMethod) return false;
90  if (myMeasure != src.myMeasure) return false;
91  if (myDolength != src.myDolength) return false;
92  if (myLength != src.myLength) return false;
93  if (myDosegs != src.myDosegs) return false;
94  if (mySegs != src.mySegs) return false;
95  if (myUseattribs != src.myUseattribs) return false;
96  if (myAllequal != src.myAllequal) return false;
97  if (myLast != src.myLast) return false;
98  if (myRandomshift != src.myRandomshift) return false;
99  if (myOnlypoints != src.myOnlypoints) return false;
100  if (myTreatpolysas != src.myTreatpolysas) return false;
101  if (myOutputsubdpoly != src.myOutputsubdpoly) return false;
102  if (myDoptdistattr != src.myDoptdistattr) return false;
103  if (myPtdistattr != src.myPtdistattr) return false;
104  if (myDotangentattr != src.myDotangentattr) return false;
105  if (myTangentattr != src.myTangentattr) return false;
106  if (myDocurveuattr != src.myDocurveuattr) return false;
107  if (myCurveuattr != src.myCurveuattr) return false;
108  if (myDocurvenumattr != src.myDocurvenumattr) return false;
109  if (myCurvenumattr != src.myCurvenumattr) return false;
110 
111  return true;
112  }
113  bool operator!=(const SOP_ResampleParms &src) const
114  {
115  return !operator==(src);
116  }
120 
121 
122 
123  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
124  {
125  myGroup = ""_sh;
126  if (true)
127  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
128  myLod = 1;
129  if (true)
130  graph->evalOpParm(myLod, nodeidx, "lod", time, 0);
131  myEdge = false;
132  if (true)
133  graph->evalOpParm(myEdge, nodeidx, "edge", time, 0);
134  myMethod = 0;
135  if (true)
136  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
137  myMeasure = 0;
138  if (true)
139  graph->evalOpParm(myMeasure, nodeidx, "measure", time, 0);
140  myDolength = true;
141  if (true)
142  graph->evalOpParm(myDolength, nodeidx, "dolength", time, 0);
143  myLength = 0.1;
144  if (true && ( (!(((getDolength()==0)))) ) )
145  graph->evalOpParm(myLength, nodeidx, "length", time, 0);
146  myDosegs = false;
147  if (true)
148  graph->evalOpParm(myDosegs, nodeidx, "dosegs", time, 0);
149  mySegs = 10;
150  if (true && ( (!(((getDosegs()==0)))) ) )
151  graph->evalOpParm(mySegs, nodeidx, "segs", time, 0);
152  myUseattribs = true;
153  if (true)
154  graph->evalOpParm(myUseattribs, nodeidx, "useattribs", time, 0);
155  myAllequal = true;
156  if (true && ( (!(((getDolength()==0))||((getEdge()==1))||((int64(getMeasure())!=0))||((int64(getMethod())!=0)))) ) )
157  graph->evalOpParm(myAllequal, nodeidx, "allequal", time, 0);
158  myLast = false;
159  if (true && ( (!(((getDolength()==0))||((getEdge()==1))||((getDolength()==1)&&(getEdge()==0)&&(int64(getMeasure())==0)&&(int64(getMethod())==0)&&(getAllequal()==1)))) ) )
160  graph->evalOpParm(myLast, nodeidx, "last", time, 0);
161  myRandomshift = false;
162  if (true && ( (!(((getDolength()==0))||((getEdge()==1))||((getDolength()==1)&&(getEdge()==0)&&(int64(getMeasure())==0)&&(int64(getMethod())==0)&&(getAllequal()==1)))) ) )
163  graph->evalOpParm(myRandomshift, nodeidx, "randomshift", time, 0);
164  myOnlypoints = false;
165  if (true)
166  graph->evalOpParm(myOnlypoints, nodeidx, "onlypoints", time, 0);
167  myTreatpolysas = 0;
168  if (true)
169  graph->evalOpParm(myTreatpolysas, nodeidx, "treatpolysas", time, 0);
170  myOutputsubdpoly = false;
171  if (true)
172  graph->evalOpParm(myOutputsubdpoly, nodeidx, "outputsubdpoly", time, 0);
173  myDoptdistattr = false;
174  if (true)
175  graph->evalOpParm(myDoptdistattr, nodeidx, "doptdistattr", time, 0);
176  myPtdistattr = "ptdist"_sh;
177  if (true && ( (!(((getDoptdistattr()==0)))) ) )
178  graph->evalOpParm(myPtdistattr, nodeidx, "ptdistattr", time, 0);
179  myDotangentattr = false;
180  if (true)
181  graph->evalOpParm(myDotangentattr, nodeidx, "dotangentattr", time, 0);
182  myTangentattr = "tangentu"_sh;
183  if (true && ( (!(((getDotangentattr()==0)))) ) )
184  graph->evalOpParm(myTangentattr, nodeidx, "tangentattr", time, 0);
185  myDocurveuattr = false;
186  if (true)
187  graph->evalOpParm(myDocurveuattr, nodeidx, "docurveuattr", time, 0);
188  myCurveuattr = "curveu"_sh;
189  if (true && ( (!(((getDocurveuattr()==0)))) ) )
190  graph->evalOpParm(myCurveuattr, nodeidx, "curveuattr", time, 0);
191  myDocurvenumattr = false;
192  if (true)
193  graph->evalOpParm(myDocurvenumattr, nodeidx, "docurvenumattr", time, 0);
194  myCurvenumattr = "curvenum"_sh;
195  if (true && ( (!(((getDocurvenumattr()==0)))) ) )
196  graph->evalOpParm(myCurvenumattr, nodeidx, "curvenumattr", time, 0);
197 
198  }
199 
200 
201  void loadFromOpSubclass(const LoadParms &loadparms) override
202  {
203  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
204  }
205 
206 
207  void copyFrom(const SOP_NodeParms *src) override
208  {
209  *this = *((const SOP_ResampleParms *)src);
210  }
211 
212  template <typename T>
213  void
214  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
215  {
216  if (idx.size() < 1)
217  return;
218  UT_ASSERT(idx.size() == instance.size()+1);
219  if (idx.size() != instance.size()+1)
220  return;
221  switch (idx[0])
222  {
223  case 0:
224  coerceValue(value, myGroup);
225  break;
226  case 1:
227  coerceValue(value, myLod);
228  break;
229  case 2:
230  coerceValue(value, myEdge);
231  break;
232  case 3:
233  coerceValue(value, myMethod);
234  break;
235  case 4:
236  coerceValue(value, myMeasure);
237  break;
238  case 5:
239  coerceValue(value, myDolength);
240  break;
241  case 6:
242  coerceValue(value, myLength);
243  break;
244  case 7:
245  coerceValue(value, myDosegs);
246  break;
247  case 8:
248  coerceValue(value, mySegs);
249  break;
250  case 9:
251  coerceValue(value, myUseattribs);
252  break;
253  case 10:
254  coerceValue(value, myAllequal);
255  break;
256  case 11:
257  coerceValue(value, myLast);
258  break;
259  case 12:
260  coerceValue(value, myRandomshift);
261  break;
262  case 13:
263  coerceValue(value, myOnlypoints);
264  break;
265  case 14:
266  coerceValue(value, myTreatpolysas);
267  break;
268  case 15:
269  coerceValue(value, myOutputsubdpoly);
270  break;
271  case 16:
272  coerceValue(value, myDoptdistattr);
273  break;
274  case 17:
275  coerceValue(value, myPtdistattr);
276  break;
277  case 18:
278  coerceValue(value, myDotangentattr);
279  break;
280  case 19:
281  coerceValue(value, myTangentattr);
282  break;
283  case 20:
284  coerceValue(value, myDocurveuattr);
285  break;
286  case 21:
287  coerceValue(value, myCurveuattr);
288  break;
289  case 22:
290  coerceValue(value, myDocurvenumattr);
291  break;
292  case 23:
293  coerceValue(value, myCurvenumattr);
294  break;
295 
296  }
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(myGroup, value);
335  break;
336  case 1:
337  coerceValue(myLod, value);
338  break;
339  case 2:
340  coerceValue(myEdge, value);
341  break;
342  case 3:
343  coerceValue(myMethod, value);
344  break;
345  case 4:
346  coerceValue(myMeasure, value);
347  break;
348  case 5:
349  coerceValue(myDolength, value);
350  break;
351  case 6:
352  coerceValue(myLength, value);
353  break;
354  case 7:
355  coerceValue(myDosegs, value);
356  break;
357  case 8:
358  coerceValue(mySegs, value);
359  break;
360  case 9:
361  coerceValue(myUseattribs, value);
362  break;
363  case 10:
364  coerceValue(myAllequal, value);
365  break;
366  case 11:
367  coerceValue(myLast, value);
368  break;
369  case 12:
370  coerceValue(myRandomshift, value);
371  break;
372  case 13:
373  coerceValue(myOnlypoints, value);
374  break;
375  case 14:
376  coerceValue(myTreatpolysas, value);
377  break;
378  case 15:
379  coerceValue(myOutputsubdpoly, value);
380  break;
381  case 16:
382  coerceValue(myDoptdistattr, value);
383  break;
384  case 17:
385  coerceValue(myPtdistattr, value);
386  break;
387  case 18:
388  coerceValue(myDotangentattr, value);
389  break;
390  case 19:
391  coerceValue(myTangentattr, value);
392  break;
393  case 20:
394  coerceValue(myDocurveuattr, value);
395  break;
396  case 21:
397  coerceValue(myCurveuattr, value);
398  break;
399  case 22:
400  coerceValue(myDocurvenumattr, value);
401  break;
402  case 23:
403  coerceValue(myCurvenumattr, value);
404  break;
405 
406  }
407  }
408 
409  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
418  { doSetParmValue(idx, instance, value); }
419  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
420  { doSetParmValue(idx, instance, value); }
421  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
422  { doSetParmValue(idx, instance, value); }
423  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
424  { doSetParmValue(idx, instance, value); }
425  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
426  { doSetParmValue(idx, instance, value); }
427  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
428  { doSetParmValue(idx, instance, value); }
429  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
430  { doSetParmValue(idx, instance, value); }
431 
432  exint getNestNumParms(TempIndex idx) const override
433  {
434  if (idx.size() == 0)
435  return 24;
436  switch (idx[0])
437  {
438 
439  }
440  // Invalid
441  return 0;
442  }
443 
444  const char *getNestParmName(TempIndex fieldnum) const override
445  {
446  if (fieldnum.size() < 1)
447  return 0;
448  switch (fieldnum[0])
449  {
450  case 0:
451  return "group";
452  case 1:
453  return "lod";
454  case 2:
455  return "edge";
456  case 3:
457  return "method";
458  case 4:
459  return "measure";
460  case 5:
461  return "dolength";
462  case 6:
463  return "length";
464  case 7:
465  return "dosegs";
466  case 8:
467  return "segs";
468  case 9:
469  return "useattribs";
470  case 10:
471  return "allequal";
472  case 11:
473  return "last";
474  case 12:
475  return "randomshift";
476  case 13:
477  return "onlypoints";
478  case 14:
479  return "treatpolysas";
480  case 15:
481  return "outputsubdpoly";
482  case 16:
483  return "doptdistattr";
484  case 17:
485  return "ptdistattr";
486  case 18:
487  return "dotangentattr";
488  case 19:
489  return "tangentattr";
490  case 20:
491  return "docurveuattr";
492  case 21:
493  return "curveuattr";
494  case 22:
495  return "docurvenumattr";
496  case 23:
497  return "curvenumattr";
498 
499  }
500  return 0;
501  }
502 
503  ParmType getNestParmType(TempIndex fieldnum) const override
504  {
505  if (fieldnum.size() < 1)
506  return PARM_UNSUPPORTED;
507  switch (fieldnum[0])
508  {
509  case 0:
510  return PARM_STRING;
511  case 1:
512  return PARM_FLOAT;
513  case 2:
514  return PARM_INTEGER;
515  case 3:
516  return PARM_INTEGER;
517  case 4:
518  return PARM_INTEGER;
519  case 5:
520  return PARM_INTEGER;
521  case 6:
522  return PARM_FLOAT;
523  case 7:
524  return PARM_INTEGER;
525  case 8:
526  return PARM_INTEGER;
527  case 9:
528  return PARM_INTEGER;
529  case 10:
530  return PARM_INTEGER;
531  case 11:
532  return PARM_INTEGER;
533  case 12:
534  return PARM_INTEGER;
535  case 13:
536  return PARM_INTEGER;
537  case 14:
538  return PARM_INTEGER;
539  case 15:
540  return PARM_INTEGER;
541  case 16:
542  return PARM_INTEGER;
543  case 17:
544  return PARM_STRING;
545  case 18:
546  return PARM_INTEGER;
547  case 19:
548  return PARM_STRING;
549  case 20:
550  return PARM_INTEGER;
551  case 21:
552  return PARM_STRING;
553  case 22:
554  return PARM_INTEGER;
555  case 23:
556  return PARM_STRING;
557 
558  }
559  return PARM_UNSUPPORTED;
560  }
561 
562  // Boiler plate to load individual types.
563  static void loadData(UT_IStream &is, int64 &v)
564  { is.bread(&v, 1); }
565  static void loadData(UT_IStream &is, bool &v)
566  { int64 iv; is.bread(&iv, 1); v = iv; }
567  static void loadData(UT_IStream &is, fpreal64 &v)
568  { is.bread<fpreal64>(&v, 1); }
569  static void loadData(UT_IStream &is, UT_Vector2D &v)
570  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
571  static void loadData(UT_IStream &is, UT_Vector3D &v)
572  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
573  is.bread<fpreal64>(&v.z(), 1); }
574  static void loadData(UT_IStream &is, UT_Vector4D &v)
575  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
576  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
577  static void loadData(UT_IStream &is, UT_Matrix2D &v)
578  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
579  static void loadData(UT_IStream &is, UT_Matrix3D &v)
580  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
581  static void loadData(UT_IStream &is, UT_Matrix4D &v)
582  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
583  static void loadData(UT_IStream &is, UT_Vector2I &v)
584  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
585  static void loadData(UT_IStream &is, UT_Vector3I &v)
586  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
587  is.bread<int64>(&v.z(), 1); }
588  static void loadData(UT_IStream &is, UT_Vector4I &v)
589  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
590  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
592  { is.bread(v); }
594  { UT_StringHolder rampdata;
595  loadData(is, rampdata);
596  if (rampdata.isstring())
597  {
598  v.reset(new UT_Ramp());
599  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
600  v->load(istr);
601  }
602  else v.reset();
603  }
606  loadData(is, data);
607  if (data.isstring())
608  {
609  // Find the data type.
610  const char *colon = UT_StringWrap(data).findChar(':');
611  if (colon)
612  {
613  int typelen = colon - data.buffer();
615  type.strncpy(data.buffer(), typelen);
616  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
617 
618  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
619  }
620  }
621  else v.reset();
622  }
623 
624  static void saveData(std::ostream &os, int64 v)
625  { UTwrite(os, &v); }
626  static void saveData(std::ostream &os, bool v)
627  { int64 iv = v; UTwrite(os, &iv); }
628  static void saveData(std::ostream &os, fpreal64 v)
629  { UTwrite<fpreal64>(os, &v); }
630  static void saveData(std::ostream &os, UT_Vector2D v)
631  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
632  static void saveData(std::ostream &os, UT_Vector3D v)
633  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
634  UTwrite<fpreal64>(os, &v.z()); }
635  static void saveData(std::ostream &os, UT_Vector4D v)
636  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
637  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
638  static void saveData(std::ostream &os, UT_Matrix2D v)
640  static void saveData(std::ostream &os, UT_Matrix3D v)
642  static void saveData(std::ostream &os, UT_Matrix4D v)
644  static void saveData(std::ostream &os, UT_StringHolder s)
645  { UT_StringWrap(s).saveBinary(os); }
646  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
648  UT_OStringStream ostr;
649  if (s) s->save(ostr);
650  result = ostr.str();
651  saveData(os, result);
652  }
653  static void saveData(std::ostream &os, PRM_DataItemHandle s)
655  UT_OStringStream ostr;
656  if (s)
657  {
658  ostr << s->getDataTypeToken();
659  ostr << ":";
660  s->saveBinary(ostr);
661  }
662  result = ostr.str();
663  saveData(os, result);
664  }
665 
666 
667  void save(std::ostream &os) const
668  {
669  int32 v = version();
670  UTwrite(os, &v);
671  saveData(os, myGroup);
672  saveData(os, myLod);
673  saveData(os, myEdge);
674  saveData(os, myMethod);
675  saveData(os, myMeasure);
676  saveData(os, myDolength);
677  saveData(os, myLength);
678  saveData(os, myDosegs);
679  saveData(os, mySegs);
680  saveData(os, myUseattribs);
681  saveData(os, myAllequal);
682  saveData(os, myLast);
683  saveData(os, myRandomshift);
684  saveData(os, myOnlypoints);
685  saveData(os, myTreatpolysas);
686  saveData(os, myOutputsubdpoly);
687  saveData(os, myDoptdistattr);
688  saveData(os, myPtdistattr);
689  saveData(os, myDotangentattr);
690  saveData(os, myTangentattr);
691  saveData(os, myDocurveuattr);
692  saveData(os, myCurveuattr);
693  saveData(os, myDocurvenumattr);
694  saveData(os, myCurvenumattr);
695 
696  }
697 
698  bool load(UT_IStream &is)
699  {
700  int32 v;
701  is.bread(&v, 1);
702  if (version() != v)
703  {
704  // Fail incompatible versions
705  return false;
706  }
707  loadData(is, myGroup);
708  loadData(is, myLod);
709  loadData(is, myEdge);
710  loadData(is, myMethod);
711  loadData(is, myMeasure);
712  loadData(is, myDolength);
713  loadData(is, myLength);
714  loadData(is, myDosegs);
715  loadData(is, mySegs);
716  loadData(is, myUseattribs);
717  loadData(is, myAllequal);
718  loadData(is, myLast);
719  loadData(is, myRandomshift);
720  loadData(is, myOnlypoints);
721  loadData(is, myTreatpolysas);
722  loadData(is, myOutputsubdpoly);
723  loadData(is, myDoptdistattr);
724  loadData(is, myPtdistattr);
725  loadData(is, myDotangentattr);
726  loadData(is, myTangentattr);
727  loadData(is, myDocurveuattr);
728  loadData(is, myCurveuattr);
729  loadData(is, myDocurvenumattr);
730  loadData(is, myCurvenumattr);
731 
732  return true;
733  }
734 
735  const UT_StringHolder & getGroup() const { return myGroup; }
736  void setGroup(const UT_StringHolder & val) { myGroup = val; }
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return getGroup();
742  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
743  return result;
744  }
745  fpreal64 getLod() const { return myLod; }
746  void setLod(fpreal64 val) { myLod = val; }
747  fpreal64 opLod(const SOP_NodeVerb::CookParms &cookparms) const
748  {
749  SOP_Node *thissop = cookparms.getNode();
750  if (!thissop) return getLod();
752  OP_Utils::evalOpParm(result, thissop, "lod", cookparms.getCookTime(), 0);
753  return result;
754  }
755  bool getEdge() const { return myEdge; }
756  void setEdge(bool val) { myEdge = val; }
757  bool opEdge(const SOP_NodeVerb::CookParms &cookparms) const
758  {
759  SOP_Node *thissop = cookparms.getNode();
760  if (!thissop) return getEdge();
761  bool result;
762  OP_Utils::evalOpParm(result, thissop, "edge", cookparms.getCookTime(), 0);
763  return result;
764  }
765  Method getMethod() const { return Method(myMethod); }
766  void setMethod(Method val) { myMethod = int64(val); }
767  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return getMethod();
771  int64 result;
772  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
773  return Method(result);
774  }
775  Measure getMeasure() const { return Measure(myMeasure); }
776  void setMeasure(Measure val) { myMeasure = int64(val); }
777  Measure opMeasure(const SOP_NodeVerb::CookParms &cookparms) const
778  {
779  SOP_Node *thissop = cookparms.getNode();
780  if (!thissop) return getMeasure();
781  int64 result;
782  OP_Utils::evalOpParm(result, thissop, "measure", cookparms.getCookTime(), 0);
783  return Measure(result);
784  }
785  bool getDolength() const { return myDolength; }
786  void setDolength(bool val) { myDolength = val; }
787  bool opDolength(const SOP_NodeVerb::CookParms &cookparms) const
788  {
789  SOP_Node *thissop = cookparms.getNode();
790  if (!thissop) return getDolength();
791  bool result;
792  OP_Utils::evalOpParm(result, thissop, "dolength", cookparms.getCookTime(), 0);
793  return result;
794  }
795  fpreal64 getLength() const { return myLength; }
796  void setLength(fpreal64 val) { myLength = val; }
797  fpreal64 opLength(const SOP_NodeVerb::CookParms &cookparms) const
798  {
799  SOP_Node *thissop = cookparms.getNode();
800  if (!thissop) return getLength();
802  OP_Utils::evalOpParm(result, thissop, "length", cookparms.getCookTime(), 0);
803  return result;
804  }
805  bool getDosegs() const { return myDosegs; }
806  void setDosegs(bool val) { myDosegs = val; }
807  bool opDosegs(const SOP_NodeVerb::CookParms &cookparms) const
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return getDosegs();
811  bool result;
812  OP_Utils::evalOpParm(result, thissop, "dosegs", cookparms.getCookTime(), 0);
813  return result;
814  }
815  int64 getSegs() const { return mySegs; }
816  void setSegs(int64 val) { mySegs = val; }
817  int64 opSegs(const SOP_NodeVerb::CookParms &cookparms) const
818  {
819  SOP_Node *thissop = cookparms.getNode();
820  if (!thissop) return getSegs();
821  int64 result;
822  OP_Utils::evalOpParm(result, thissop, "segs", cookparms.getCookTime(), 0);
823  return result;
824  }
825  bool getUseattribs() const { return myUseattribs; }
826  void setUseattribs(bool val) { myUseattribs = val; }
827  bool opUseattribs(const SOP_NodeVerb::CookParms &cookparms) const
828  {
829  SOP_Node *thissop = cookparms.getNode();
830  if (!thissop) return getUseattribs();
831  bool result;
832  OP_Utils::evalOpParm(result, thissop, "useattribs", cookparms.getCookTime(), 0);
833  return result;
834  }
835  bool getAllequal() const { return myAllequal; }
836  void setAllequal(bool val) { myAllequal = val; }
837  bool opAllequal(const SOP_NodeVerb::CookParms &cookparms) const
838  {
839  SOP_Node *thissop = cookparms.getNode();
840  if (!thissop) return getAllequal();
841  bool result;
842  OP_Utils::evalOpParm(result, thissop, "allequal", cookparms.getCookTime(), 0);
843  return result;
844  }
845  bool getLast() const { return myLast; }
846  void setLast(bool val) { myLast = val; }
847  bool opLast(const SOP_NodeVerb::CookParms &cookparms) const
848  {
849  SOP_Node *thissop = cookparms.getNode();
850  if (!thissop) return getLast();
851  bool result;
852  OP_Utils::evalOpParm(result, thissop, "last", cookparms.getCookTime(), 0);
853  return result;
854  }
855  bool getRandomshift() const { return myRandomshift; }
856  void setRandomshift(bool val) { myRandomshift = val; }
857  bool opRandomshift(const SOP_NodeVerb::CookParms &cookparms) const
858  {
859  SOP_Node *thissop = cookparms.getNode();
860  if (!thissop) return getRandomshift();
861  bool result;
862  OP_Utils::evalOpParm(result, thissop, "randomshift", cookparms.getCookTime(), 0);
863  return result;
864  }
865  bool getOnlypoints() const { return myOnlypoints; }
866  void setOnlypoints(bool val) { myOnlypoints = val; }
867  bool opOnlypoints(const SOP_NodeVerb::CookParms &cookparms) const
868  {
869  SOP_Node *thissop = cookparms.getNode();
870  if (!thissop) return getOnlypoints();
871  bool result;
872  OP_Utils::evalOpParm(result, thissop, "onlypoints", cookparms.getCookTime(), 0);
873  return result;
874  }
875  Treatpolysas getTreatpolysas() const { return Treatpolysas(myTreatpolysas); }
876  void setTreatpolysas(Treatpolysas val) { myTreatpolysas = int64(val); }
878  {
879  SOP_Node *thissop = cookparms.getNode();
880  if (!thissop) return getTreatpolysas();
881  int64 result;
882  OP_Utils::evalOpParm(result, thissop, "treatpolysas", cookparms.getCookTime(), 0);
883  return Treatpolysas(result);
884  }
885  bool getOutputsubdpoly() const { return myOutputsubdpoly; }
886  void setOutputsubdpoly(bool val) { myOutputsubdpoly = val; }
887  bool opOutputsubdpoly(const SOP_NodeVerb::CookParms &cookparms) const
888  {
889  SOP_Node *thissop = cookparms.getNode();
890  if (!thissop) return getOutputsubdpoly();
891  bool result;
892  OP_Utils::evalOpParm(result, thissop, "outputsubdpoly", cookparms.getCookTime(), 0);
893  return result;
894  }
895  bool getDoptdistattr() const { return myDoptdistattr; }
896  void setDoptdistattr(bool val) { myDoptdistattr = val; }
897  bool opDoptdistattr(const SOP_NodeVerb::CookParms &cookparms) const
898  {
899  SOP_Node *thissop = cookparms.getNode();
900  if (!thissop) return getDoptdistattr();
901  bool result;
902  OP_Utils::evalOpParm(result, thissop, "doptdistattr", cookparms.getCookTime(), 0);
903  return result;
904  }
905  const UT_StringHolder & getPtdistattr() const { return myPtdistattr; }
906  void setPtdistattr(const UT_StringHolder & val) { myPtdistattr = val; }
908  {
909  SOP_Node *thissop = cookparms.getNode();
910  if (!thissop) return getPtdistattr();
912  OP_Utils::evalOpParm(result, thissop, "ptdistattr", cookparms.getCookTime(), 0);
913  return result;
914  }
915  bool getDotangentattr() const { return myDotangentattr; }
916  void setDotangentattr(bool val) { myDotangentattr = val; }
917  bool opDotangentattr(const SOP_NodeVerb::CookParms &cookparms) const
918  {
919  SOP_Node *thissop = cookparms.getNode();
920  if (!thissop) return getDotangentattr();
921  bool result;
922  OP_Utils::evalOpParm(result, thissop, "dotangentattr", cookparms.getCookTime(), 0);
923  return result;
924  }
925  const UT_StringHolder & getTangentattr() const { return myTangentattr; }
926  void setTangentattr(const UT_StringHolder & val) { myTangentattr = val; }
928  {
929  SOP_Node *thissop = cookparms.getNode();
930  if (!thissop) return getTangentattr();
932  OP_Utils::evalOpParm(result, thissop, "tangentattr", cookparms.getCookTime(), 0);
933  return result;
934  }
935  bool getDocurveuattr() const { return myDocurveuattr; }
936  void setDocurveuattr(bool val) { myDocurveuattr = val; }
937  bool opDocurveuattr(const SOP_NodeVerb::CookParms &cookparms) const
938  {
939  SOP_Node *thissop = cookparms.getNode();
940  if (!thissop) return getDocurveuattr();
941  bool result;
942  OP_Utils::evalOpParm(result, thissop, "docurveuattr", cookparms.getCookTime(), 0);
943  return result;
944  }
945  const UT_StringHolder & getCurveuattr() const { return myCurveuattr; }
946  void setCurveuattr(const UT_StringHolder & val) { myCurveuattr = val; }
948  {
949  SOP_Node *thissop = cookparms.getNode();
950  if (!thissop) return getCurveuattr();
952  OP_Utils::evalOpParm(result, thissop, "curveuattr", cookparms.getCookTime(), 0);
953  return result;
954  }
955  bool getDocurvenumattr() const { return myDocurvenumattr; }
956  void setDocurvenumattr(bool val) { myDocurvenumattr = val; }
957  bool opDocurvenumattr(const SOP_NodeVerb::CookParms &cookparms) const
958  {
959  SOP_Node *thissop = cookparms.getNode();
960  if (!thissop) return getDocurvenumattr();
961  bool result;
962  OP_Utils::evalOpParm(result, thissop, "docurvenumattr", cookparms.getCookTime(), 0);
963  return result;
964  }
965  const UT_StringHolder & getCurvenumattr() const { return myCurvenumattr; }
966  void setCurvenumattr(const UT_StringHolder & val) { myCurvenumattr = val; }
968  {
969  SOP_Node *thissop = cookparms.getNode();
970  if (!thissop) return getCurvenumattr();
972  OP_Utils::evalOpParm(result, thissop, "curvenumattr", cookparms.getCookTime(), 0);
973  return result;
974  }
975 
976 private:
977  UT_StringHolder myGroup;
978  fpreal64 myLod;
979  bool myEdge;
980  int64 myMethod;
981  int64 myMeasure;
982  bool myDolength;
983  fpreal64 myLength;
984  bool myDosegs;
985  int64 mySegs;
986  bool myUseattribs;
987  bool myAllequal;
988  bool myLast;
989  bool myRandomshift;
990  bool myOnlypoints;
991  int64 myTreatpolysas;
992  bool myOutputsubdpoly;
993  bool myDoptdistattr;
994  UT_StringHolder myPtdistattr;
995  bool myDotangentattr;
996  UT_StringHolder myTangentattr;
997  bool myDocurveuattr;
998  UT_StringHolder myCurveuattr;
999  bool myDocurvenumattr;
1000  UT_StringHolder myCurvenumattr;
1001 
1002 };
static void saveData(std::ostream &os, int64 v)
GLdouble s
Definition: glew.h:1390
bool opDosegs(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opTangentattr(const SOP_NodeVerb::CookParms &cookparms) const
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const UT_StringHolder & getCurveuattr() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getOutputsubdpoly() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool opDoptdistattr(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GT_API const UT_StringHolder time
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
bool getDolength() const
fpreal getTime() const
Definition: OP_Context.h:60
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GLuint const GLfloat * val
Definition: glew.h:2794
Measure getMeasure() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
Treatpolysas getTreatpolysas() const
bool opOutputsubdpoly(const SOP_NodeVerb::CookParms &cookparms) const
bool opOnlypoints(const SOP_NodeVerb::CookParms &cookparms) const
int64 exint
Definition: SYS_Types.h:125
fpreal64 opLod(const SOP_NodeVerb::CookParms &cookparms) const
bool opDolength(const SOP_NodeVerb::CookParms &cookparms) const
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
Treatpolysas opTreatpolysas(const SOP_NodeVerb::CookParms &cookparms) const
bool getDotangentattr() const
void setMeasure(Measure val)
An output stream object that owns its own string buffer storage.
void setDoptdistattr(bool val)
void setCurveuattr(const UT_StringHolder &val)
fpreal64 getLength() const
void setLod(fpreal64 val)
const GLdouble * v
Definition: glew.h:1391
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool opDocurvenumattr(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
const UT_StringHolder & getPtdistattr() const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool opDocurveuattr(const SOP_NodeVerb::CookParms &cookparms) const
void setRandomshift(bool val)
static void loadData(UT_IStream &is, fpreal64 &v)
bool opUseattribs(const SOP_NodeVerb::CookParms &cookparms) const
double fpreal64
Definition: SYS_Types.h:201
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const UT_StringHolder & getCurvenumattr() const
void save(std::ostream &os) const
bool operator==(const SOP_ResampleParms &src) const
void setLength(fpreal64 val)
bool opAllequal(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
~SOP_ResampleParms() override
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
void setDolength(bool val)
Measure opMeasure(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
const GLfloat * c
Definition: glew.h:16296
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool getAllequal() const
long long int64
Definition: SYS_Types.h:116
void setTreatpolysas(Treatpolysas val)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool getDocurveuattr() const
fpreal64 opLength(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
bool getDocurvenumattr() const
void setTangentattr(const UT_StringHolder &val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setDocurveuattr(bool val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
bool opDotangentattr(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
bool getOnlypoints() const
void setDosegs(bool val)
void setPtdistattr(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool getDosegs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setLast(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
void setMethod(Method val)
const char * getNestParmName(TempIndex fieldnum) const override
bool opEdge(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
void setCurvenumattr(const UT_StringHolder &val)
int64 getSegs() const
UT_StringHolder opCurvenumattr(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
static void saveData(std::ostream &os, fpreal64 v)
void copyFrom(const SOP_NodeParms *src) override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void setUseattribs(bool val)
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool load(UT_IStream &is)
#define SOP_API
Definition: SOP_API.h:10
void setOutputsubdpoly(bool val)
const UT_StringHolder & getTangentattr() 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
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool getDoptdistattr() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
GLuint64EXT * result
Definition: glew.h:14007
Method getMethod() const
void setSegs(int64 val)
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
int64 opSegs(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
bool getUseattribs() const
bool getRandomshift() const
void loadFromOpSubclass(const LoadParms &loadparms) override
void setGroup(const UT_StringHolder &val)
void setDotangentattr(bool val)
UT_StringHolder opCurveuattr(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_ResampleParms &src) const
void setDocurvenumattr(bool val)
bool opLast(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
fpreal64 getLod() const
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
GLsizei const GLfloat * value
Definition: glew.h:1849
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setOnlypoints(bool val)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setAllequal(bool val)
UT_StringHolder opPtdistattr(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
void setEdge(bool val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opRandomshift(const SOP_NodeVerb::CookParms &cookparms) const