HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Refine.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_RefineEnums
24 {
25  enum class Refinespace
26  {
27  DOMAIN_ = 0,
28  ARC
29  };
30 
32  getToken(Refinespace enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case Refinespace::DOMAIN_: return "domain"_sh;
37  case Refinespace::ARC: return "arc"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Subdivspace
43  {
44  DOMAIN_ = 0,
45  ARC
46  };
47 
49  getToken(Subdivspace enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case Subdivspace::DOMAIN_: return "domain"_sh;
54  case Subdivspace::ARC: return "arc"_sh;
55  default: UT_ASSERT(false); return ""_sh;
56  }
57  }
58 
59 }
60 
61 
63 {
64 public:
65  static int version() { return 1; }
66 
68  {
69  myGroup = ""_UTsh;
70  myFirstu = true;
71  myDomainu1 = 0.25;
72  mySecondu = false;
73  myDomainu2 = 0.75;
74  myFirstv = false;
75  myDomainv1 = 0.25;
76  mySecondv = false;
77  myDomainv2 = 0.75;
78  myRefineu = 1;
79  myRefinev = 1;
80  myRefinespace = 0;
81  myStdswitcher = 0;
82  myUnrefineu = 1;
83  myUnrefinev = 1;
84  myTolu = 0.01;
85  myTolv = 0.01;
86  mySubdivspace = 0;
87  myDivsu = 2;
88  myDivsv = 2;
89 
90  }
91 
92  explicit SOP_RefineParms(const SOP_RefineParms &) = default;
93  SOP_RefineParms &operator=(const SOP_RefineParms &) = default;
94  SOP_RefineParms(SOP_RefineParms &&) noexcept = default;
95  SOP_RefineParms &operator=(SOP_RefineParms &&) noexcept = default;
96 
97  ~SOP_RefineParms() override {}
98 
99  bool operator==(const SOP_RefineParms &src) const
100  {
101  if (myGroup != src.myGroup) return false;
102  if (myFirstu != src.myFirstu) return false;
103  if (myDomainu1 != src.myDomainu1) return false;
104  if (mySecondu != src.mySecondu) return false;
105  if (myDomainu2 != src.myDomainu2) return false;
106  if (myFirstv != src.myFirstv) return false;
107  if (myDomainv1 != src.myDomainv1) return false;
108  if (mySecondv != src.mySecondv) return false;
109  if (myDomainv2 != src.myDomainv2) return false;
110  if (myRefineu != src.myRefineu) return false;
111  if (myRefinev != src.myRefinev) return false;
112  if (myRefinespace != src.myRefinespace) return false;
113  if (myStdswitcher != src.myStdswitcher) return false;
114  if (myUnrefineu != src.myUnrefineu) return false;
115  if (myUnrefinev != src.myUnrefinev) return false;
116  if (myTolu != src.myTolu) return false;
117  if (myTolv != src.myTolv) return false;
118  if (mySubdivspace != src.mySubdivspace) return false;
119  if (myDivsu != src.myDivsu) return false;
120  if (myDivsv != src.myDivsv) return false;
121 
122  return true;
123  }
124  bool operator!=(const SOP_RefineParms &src) const
125  {
126  return !operator==(src);
127  }
130 
131 
132 
133  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
134  {
135  myGroup = ""_UTsh;
136  if (true)
137  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
138  myFirstu = true;
139  if (true)
140  graph->evalOpParm(myFirstu, nodeidx, "firstu", time, 0);
141  myDomainu1 = 0.25;
142  if (true && ( (true&&!(((getFirstu()==0)))) ) )
143  graph->evalOpParm(myDomainu1, nodeidx, "domainu1", time, 0);
144  mySecondu = false;
145  if (true)
146  graph->evalOpParm(mySecondu, nodeidx, "secondu", time, 0);
147  myDomainu2 = 0.75;
148  if (true && ( (true&&!(((getSecondu()==0)))) ) )
149  graph->evalOpParm(myDomainu2, nodeidx, "domainu2", time, 0);
150  myFirstv = false;
151  if (true)
152  graph->evalOpParm(myFirstv, nodeidx, "firstv", time, 0);
153  myDomainv1 = 0.25;
154  if (true && ( (true&&!(((getFirstv()==0)))) ) )
155  graph->evalOpParm(myDomainv1, nodeidx, "domainv1", time, 0);
156  mySecondv = false;
157  if (true)
158  graph->evalOpParm(mySecondv, nodeidx, "secondv", time, 0);
159  myDomainv2 = 0.75;
160  if (true && ( (true&&!(((getSecondv()==0)))) ) )
161  graph->evalOpParm(myDomainv2, nodeidx, "domainv2", time, 0);
162  myRefineu = 1;
163  if (true && ( (true&&!(((getFirstu()==0)&&(getSecondu()==0)))) ) )
164  graph->evalOpParm(myRefineu, nodeidx, "refineu", time, 0);
165  myRefinev = 1;
166  if (true && ( (true&&!(((getFirstv()==0)&&(getSecondv()==0)))) ) )
167  graph->evalOpParm(myRefinev, nodeidx, "refinev", time, 0);
168  myRefinespace = 0;
169  if (true && ( (true&&!(((getFirstu()==0)&&(getFirstv()==0))||((getFirstu()==0)&&(getSecondv()==0))||((getSecondu()==0)&&(getFirstv()==0))||((getSecondu()==0)&&(getSecondv()==0)))) ) )
170  graph->evalOpParm(myRefinespace, nodeidx, "refinespace", time, 0);
171  myStdswitcher = 0;
172  if (true)
173  graph->evalOpParm(myStdswitcher, nodeidx, "stdswitcher", time, 0);
174  myUnrefineu = 1;
175  if (true && ( (true&&!(((getFirstu()==0)&&(getSecondu()==0)))) ) )
176  graph->evalOpParm(myUnrefineu, nodeidx, "unrefineu", time, 0);
177  myUnrefinev = 1;
178  if (true && ( (true&&!(((getFirstv()==0)&&(getSecondv()==0)))) ) )
179  graph->evalOpParm(myUnrefinev, nodeidx, "unrefinev", time, 0);
180  myTolu = 0.01;
181  if (true && ( (true&&!(((getFirstu()==0)&&(getSecondu()==0)))) ) )
182  graph->evalOpParm(myTolu, nodeidx, "tolu", time, 0);
183  myTolv = 0.01;
184  if (true && ( (true&&!(((getFirstv()==0)&&(getSecondv()==0)))) ) )
185  graph->evalOpParm(myTolv, nodeidx, "tolv", time, 0);
186  mySubdivspace = 0;
187  if (true && ( (true&&!(((getFirstu()==0)&&(getFirstv()==0))||((getFirstu()==0)&&(getSecondv()==0))||((getSecondu()==0)&&(getFirstv()==0))||((getSecondu()==0)&&(getSecondv()==0)))) ) )
188  graph->evalOpParm(mySubdivspace, nodeidx, "subdivspace", time, 0);
189  myDivsu = 2;
190  if (true && ( (true&&!(((getFirstu()==0))||((getSecondu()==0))||((int64(getStdswitcher())==1)))) ) )
191  graph->evalOpParm(myDivsu, nodeidx, "divsu", time, 0);
192  myDivsv = 2;
193  if (true && ( (true&&!(((getFirstv()==0))||((getSecondv()==0))||((int64(getStdswitcher())==1)))) ) )
194  graph->evalOpParm(myDivsv, nodeidx, "divsv", time, 0);
195 
196  }
197 
198 
199  void loadFromOpSubclass(const LoadParms &loadparms) override
200  {
201  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
202  }
203 
204 
205  void copyFrom(const OP_NodeParms *src) override
206  {
207  *this = *((const SOP_RefineParms *)src);
208  }
209 
210  template <typename T>
211  void
212  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
213  {
214  if (idx.size() < 1)
215  return;
216  UT_ASSERT(idx.size() == instance.size()+1);
217  if (idx.size() != instance.size()+1)
218  return;
219  switch (idx[0])
220  {
221  case 0:
222  coerceValue(value, myGroup);
223  break;
224  case 1:
225  coerceValue(value, myFirstu);
226  break;
227  case 2:
228  coerceValue(value, myDomainu1);
229  break;
230  case 3:
231  coerceValue(value, mySecondu);
232  break;
233  case 4:
234  coerceValue(value, myDomainu2);
235  break;
236  case 5:
237  coerceValue(value, myFirstv);
238  break;
239  case 6:
240  coerceValue(value, myDomainv1);
241  break;
242  case 7:
243  coerceValue(value, mySecondv);
244  break;
245  case 8:
246  coerceValue(value, myDomainv2);
247  break;
248  case 9:
249  coerceValue(value, myRefineu);
250  break;
251  case 10:
252  coerceValue(value, myRefinev);
253  break;
254  case 11:
255  coerceValue(value, myRefinespace);
256  break;
257  case 12:
258  coerceValue(value, myStdswitcher);
259  break;
260  case 13:
261  coerceValue(value, myUnrefineu);
262  break;
263  case 14:
264  coerceValue(value, myUnrefinev);
265  break;
266  case 15:
267  coerceValue(value, myTolu);
268  break;
269  case 16:
270  coerceValue(value, myTolv);
271  break;
272  case 17:
273  coerceValue(value, mySubdivspace);
274  break;
275  case 18:
276  coerceValue(value, myDivsu);
277  break;
278  case 19:
279  coerceValue(value, myDivsv);
280  break;
281 
282  }
283  }
284 
285  bool isParmColorRamp(exint idx) const override
286  {
287  switch (idx)
288  {
289 
290  }
291  return false;
292  }
293 
294  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
315  { doGetParmValue(idx, instance, value); }
316 
317  template <typename T>
318  void
319  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
320  {
321  if (idx.size() < 1)
322  return;
323  UT_ASSERT(idx.size() == instance.size()+1);
324  if (idx.size() != instance.size()+1)
325  return;
326  switch (idx[0])
327  {
328  case 0:
329  coerceValue(myGroup, ( ( value ) ));
330  break;
331  case 1:
332  coerceValue(myFirstu, ( ( value ) ));
333  break;
334  case 2:
335  coerceValue(myDomainu1, clampMinValue(0, clampMaxValue(1, value ) ));
336  break;
337  case 3:
338  coerceValue(mySecondu, ( ( value ) ));
339  break;
340  case 4:
341  coerceValue(myDomainu2, clampMinValue(0, clampMaxValue(1, value ) ));
342  break;
343  case 5:
344  coerceValue(myFirstv, ( ( value ) ));
345  break;
346  case 6:
347  coerceValue(myDomainv1, clampMinValue(0, clampMaxValue(1, value ) ));
348  break;
349  case 7:
350  coerceValue(mySecondv, ( ( value ) ));
351  break;
352  case 8:
353  coerceValue(myDomainv2, clampMinValue(0, clampMaxValue(1, value ) ));
354  break;
355  case 9:
356  coerceValue(myRefineu, clampMinValue(1, ( value ) ));
357  break;
358  case 10:
359  coerceValue(myRefinev, clampMinValue(1, ( value ) ));
360  break;
361  case 11:
362  coerceValue(myRefinespace, clampMinValue(0, clampMaxValue(1, value ) ));
363  break;
364  case 12:
365  coerceValue(myStdswitcher, ( ( value ) ));
366  break;
367  case 13:
368  coerceValue(myUnrefineu, clampMinValue(1, ( value ) ));
369  break;
370  case 14:
371  coerceValue(myUnrefinev, clampMinValue(1, ( value ) ));
372  break;
373  case 15:
374  coerceValue(myTolu, clampMinValue(0, ( value ) ));
375  break;
376  case 16:
377  coerceValue(myTolv, clampMinValue(0, ( value ) ));
378  break;
379  case 17:
380  coerceValue(mySubdivspace, clampMinValue(0, clampMaxValue(1, value ) ));
381  break;
382  case 18:
383  coerceValue(myDivsu, clampMinValue(2, ( value ) ));
384  break;
385  case 19:
386  coerceValue(myDivsv, clampMinValue(2, ( value ) ));
387  break;
388 
389  }
390  }
391 
392  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
393  { doSetParmValue(idx, instance, value); }
394  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
395  { doSetParmValue(idx, instance, value); }
396  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
397  { doSetParmValue(idx, instance, value); }
398  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
399  { doSetParmValue(idx, instance, value); }
400  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
407  { doSetParmValue(idx, instance, value); }
408  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
409  { doSetParmValue(idx, instance, value); }
410  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
413  { doSetParmValue(idx, instance, value); }
414 
415  exint getNestNumParms(TempIndex idx) const override
416  {
417  if (idx.size() == 0)
418  return 20;
419  switch (idx[0])
420  {
421 
422  }
423  // Invalid
424  return 0;
425  }
426 
427  const char *getNestParmName(TempIndex fieldnum) const override
428  {
429  if (fieldnum.size() < 1)
430  return 0;
431  switch (fieldnum[0])
432  {
433  case 0:
434  return "group";
435  case 1:
436  return "firstu";
437  case 2:
438  return "domainu1";
439  case 3:
440  return "secondu";
441  case 4:
442  return "domainu2";
443  case 5:
444  return "firstv";
445  case 6:
446  return "domainv1";
447  case 7:
448  return "secondv";
449  case 8:
450  return "domainv2";
451  case 9:
452  return "refineu";
453  case 10:
454  return "refinev";
455  case 11:
456  return "refinespace";
457  case 12:
458  return "stdswitcher";
459  case 13:
460  return "unrefineu";
461  case 14:
462  return "unrefinev";
463  case 15:
464  return "tolu";
465  case 16:
466  return "tolv";
467  case 17:
468  return "subdivspace";
469  case 18:
470  return "divsu";
471  case 19:
472  return "divsv";
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_INTEGER;
488  case 2:
489  return PARM_FLOAT;
490  case 3:
491  return PARM_INTEGER;
492  case 4:
493  return PARM_FLOAT;
494  case 5:
495  return PARM_INTEGER;
496  case 6:
497  return PARM_FLOAT;
498  case 7:
499  return PARM_INTEGER;
500  case 8:
501  return PARM_FLOAT;
502  case 9:
503  return PARM_INTEGER;
504  case 10:
505  return PARM_INTEGER;
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_FLOAT;
516  case 16:
517  return PARM_FLOAT;
518  case 17:
519  return PARM_INTEGER;
520  case 18:
521  return PARM_INTEGER;
522  case 19:
523  return PARM_INTEGER;
524 
525  }
526  return PARM_UNSUPPORTED;
527  }
528 
529  // Boiler plate to load individual types.
530  static void loadData(UT_IStream &is, int64 &v)
531  { is.bread(&v, 1); }
532  static void loadData(UT_IStream &is, bool &v)
533  { int64 iv; is.bread(&iv, 1); v = iv; }
534  static void loadData(UT_IStream &is, fpreal64 &v)
535  { is.bread<fpreal64>(&v, 1); }
536  static void loadData(UT_IStream &is, UT_Vector2D &v)
537  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
538  static void loadData(UT_IStream &is, UT_Vector3D &v)
539  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
540  is.bread<fpreal64>(&v.z(), 1); }
541  static void loadData(UT_IStream &is, UT_Vector4D &v)
542  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
543  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
544  static void loadData(UT_IStream &is, UT_Matrix2D &v)
545  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
546  static void loadData(UT_IStream &is, UT_Matrix3D &v)
547  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
548  static void loadData(UT_IStream &is, UT_Matrix4D &v)
549  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
550  static void loadData(UT_IStream &is, UT_Vector2I &v)
551  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
552  static void loadData(UT_IStream &is, UT_Vector3I &v)
553  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
554  is.bread<int64>(&v.z(), 1); }
555  static void loadData(UT_IStream &is, UT_Vector4I &v)
556  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
557  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
559  { is.bread(v); }
561  { UT_StringHolder rampdata;
562  loadData(is, rampdata);
563  if (rampdata.isstring())
564  {
565  v.reset(new UT_Ramp());
566  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
567  v->load(istr);
568  }
569  else v.reset();
570  }
573  loadData(is, data);
574  if (data.isstring())
575  {
576  // Find the data type.
577  const char *colon = UT_StringWrap(data).findChar(':');
578  if (colon)
579  {
580  int typelen = colon - data.buffer();
582  type.strncpy(data.buffer(), typelen);
583  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
584 
585  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
586  }
587  }
588  else v.reset();
589  }
590 
591  static void saveData(std::ostream &os, int64 v)
592  { UTwrite(os, &v); }
593  static void saveData(std::ostream &os, bool v)
594  { int64 iv = v; UTwrite(os, &iv); }
595  static void saveData(std::ostream &os, fpreal64 v)
596  { UTwrite<fpreal64>(os, &v); }
597  static void saveData(std::ostream &os, UT_Vector2D v)
598  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
599  static void saveData(std::ostream &os, UT_Vector3D v)
600  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
601  UTwrite<fpreal64>(os, &v.z()); }
602  static void saveData(std::ostream &os, UT_Vector4D v)
603  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
604  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
605  static void saveData(std::ostream &os, UT_Matrix2D v)
607  static void saveData(std::ostream &os, UT_Matrix3D v)
609  static void saveData(std::ostream &os, UT_Matrix4D v)
611  static void saveData(std::ostream &os, UT_StringHolder s)
612  { UT_StringWrap(s).saveBinary(os); }
613  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
615  UT_OStringStream ostr;
616  if (s) s->save(ostr);
617  result = ostr.str();
618  saveData(os, result);
619  }
620  static void saveData(std::ostream &os, PRM_DataItemHandle s)
622  UT_OStringStream ostr;
623  if (s)
624  {
625  ostr << s->getDataTypeToken();
626  ostr << ":";
627  s->saveBinary(ostr);
628  }
629  result = ostr.str();
630  saveData(os, result);
631  }
632 
633 
634  void save(std::ostream &os) const
635  {
636  int32 v = version();
637  UTwrite(os, &v);
638  saveData(os, myGroup);
639  saveData(os, myFirstu);
640  saveData(os, myDomainu1);
641  saveData(os, mySecondu);
642  saveData(os, myDomainu2);
643  saveData(os, myFirstv);
644  saveData(os, myDomainv1);
645  saveData(os, mySecondv);
646  saveData(os, myDomainv2);
647  saveData(os, myRefineu);
648  saveData(os, myRefinev);
649  saveData(os, myRefinespace);
650  saveData(os, myStdswitcher);
651  saveData(os, myUnrefineu);
652  saveData(os, myUnrefinev);
653  saveData(os, myTolu);
654  saveData(os, myTolv);
655  saveData(os, mySubdivspace);
656  saveData(os, myDivsu);
657  saveData(os, myDivsv);
658 
659  }
660 
661  bool load(UT_IStream &is)
662  {
663  int32 v;
664  is.bread(&v, 1);
665  if (version() != v)
666  {
667  // Fail incompatible versions
668  return false;
669  }
670  loadData(is, myGroup);
671  loadData(is, myFirstu);
672  loadData(is, myDomainu1);
673  loadData(is, mySecondu);
674  loadData(is, myDomainu2);
675  loadData(is, myFirstv);
676  loadData(is, myDomainv1);
677  loadData(is, mySecondv);
678  loadData(is, myDomainv2);
679  loadData(is, myRefineu);
680  loadData(is, myRefinev);
681  loadData(is, myRefinespace);
682  loadData(is, myStdswitcher);
683  loadData(is, myUnrefineu);
684  loadData(is, myUnrefinev);
685  loadData(is, myTolu);
686  loadData(is, myTolv);
687  loadData(is, mySubdivspace);
688  loadData(is, myDivsu);
689  loadData(is, myDivsv);
690 
691  return true;
692  }
693 
694  const UT_StringHolder & getGroup() const { return myGroup; }
695  void setGroup(const UT_StringHolder & val) { myGroup = val; }
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getGroup();
701  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
702  return result;
703  }
704  bool getFirstu() const { return myFirstu; }
705  void setFirstu(bool val) { myFirstu = val; }
706  bool opFirstu(const SOP_NodeVerb::CookParms &cookparms) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return getFirstu();
710  bool result;
711  OP_Utils::evalOpParm(result, thissop, "firstu", cookparms.getCookTime(), 0);
712  return result;
713  }
714  fpreal64 getDomainu1() const { return myDomainu1; }
715  void setDomainu1(fpreal64 val) { myDomainu1 = val; }
717  {
718  SOP_Node *thissop = cookparms.getNode();
719  if (!thissop) return getDomainu1();
721  OP_Utils::evalOpParm(result, thissop, "domainu1", cookparms.getCookTime(), 0);
722  return result;
723  }
724  bool getSecondu() const { return mySecondu; }
725  void setSecondu(bool val) { mySecondu = val; }
726  bool opSecondu(const SOP_NodeVerb::CookParms &cookparms) const
727  {
728  SOP_Node *thissop = cookparms.getNode();
729  if (!thissop) return getSecondu();
730  bool result;
731  OP_Utils::evalOpParm(result, thissop, "secondu", cookparms.getCookTime(), 0);
732  return result;
733  }
734  fpreal64 getDomainu2() const { return myDomainu2; }
735  void setDomainu2(fpreal64 val) { myDomainu2 = val; }
737  {
738  SOP_Node *thissop = cookparms.getNode();
739  if (!thissop) return getDomainu2();
741  OP_Utils::evalOpParm(result, thissop, "domainu2", cookparms.getCookTime(), 0);
742  return result;
743  }
744  bool getFirstv() const { return myFirstv; }
745  void setFirstv(bool val) { myFirstv = val; }
746  bool opFirstv(const SOP_NodeVerb::CookParms &cookparms) const
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getFirstv();
750  bool result;
751  OP_Utils::evalOpParm(result, thissop, "firstv", cookparms.getCookTime(), 0);
752  return result;
753  }
754  fpreal64 getDomainv1() const { return myDomainv1; }
755  void setDomainv1(fpreal64 val) { myDomainv1 = val; }
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getDomainv1();
761  OP_Utils::evalOpParm(result, thissop, "domainv1", cookparms.getCookTime(), 0);
762  return result;
763  }
764  bool getSecondv() const { return mySecondv; }
765  void setSecondv(bool val) { mySecondv = val; }
766  bool opSecondv(const SOP_NodeVerb::CookParms &cookparms) const
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getSecondv();
770  bool result;
771  OP_Utils::evalOpParm(result, thissop, "secondv", cookparms.getCookTime(), 0);
772  return result;
773  }
774  fpreal64 getDomainv2() const { return myDomainv2; }
775  void setDomainv2(fpreal64 val) { myDomainv2 = val; }
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getDomainv2();
781  OP_Utils::evalOpParm(result, thissop, "domainv2", cookparms.getCookTime(), 0);
782  return result;
783  }
784  int64 getRefineu() const { return myRefineu; }
785  void setRefineu(int64 val) { myRefineu = val; }
786  int64 opRefineu(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getRefineu();
790  int64 result;
791  OP_Utils::evalOpParm(result, thissop, "refineu", cookparms.getCookTime(), 0);
792  return result;
793  }
794  int64 getRefinev() const { return myRefinev; }
795  void setRefinev(int64 val) { myRefinev = val; }
796  int64 opRefinev(const SOP_NodeVerb::CookParms &cookparms) const
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getRefinev();
800  int64 result;
801  OP_Utils::evalOpParm(result, thissop, "refinev", cookparms.getCookTime(), 0);
802  return result;
803  }
804  Refinespace getRefinespace() const { return Refinespace(myRefinespace); }
805  void setRefinespace(Refinespace val) { myRefinespace = int64(val); }
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getRefinespace();
810  int64 result;
811  OP_Utils::evalOpParm(result, thissop, "refinespace", cookparms.getCookTime(), 0);
812  return Refinespace(result);
813  }
814  int64 getStdswitcher() const { return myStdswitcher; }
815  void setStdswitcher(int64 val) { myStdswitcher = val; }
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getStdswitcher();
820  int64 result;
821  OP_Utils::evalOpParm(result, thissop, "stdswitcher", cookparms.getCookTime(), 0);
822  return result;
823  }
824  int64 getUnrefineu() const { return myUnrefineu; }
825  void setUnrefineu(int64 val) { myUnrefineu = val; }
826  int64 opUnrefineu(const SOP_NodeVerb::CookParms &cookparms) const
827  {
828  SOP_Node *thissop = cookparms.getNode();
829  if (!thissop) return getUnrefineu();
830  int64 result;
831  OP_Utils::evalOpParm(result, thissop, "unrefineu", cookparms.getCookTime(), 0);
832  return result;
833  }
834  int64 getUnrefinev() const { return myUnrefinev; }
835  void setUnrefinev(int64 val) { myUnrefinev = val; }
836  int64 opUnrefinev(const SOP_NodeVerb::CookParms &cookparms) const
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return getUnrefinev();
840  int64 result;
841  OP_Utils::evalOpParm(result, thissop, "unrefinev", cookparms.getCookTime(), 0);
842  return result;
843  }
844  fpreal64 getTolu() const { return myTolu; }
845  void setTolu(fpreal64 val) { myTolu = val; }
846  fpreal64 opTolu(const SOP_NodeVerb::CookParms &cookparms) const
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return getTolu();
851  OP_Utils::evalOpParm(result, thissop, "tolu", cookparms.getCookTime(), 0);
852  return result;
853  }
854  fpreal64 getTolv() const { return myTolv; }
855  void setTolv(fpreal64 val) { myTolv = val; }
856  fpreal64 opTolv(const SOP_NodeVerb::CookParms &cookparms) const
857  {
858  SOP_Node *thissop = cookparms.getNode();
859  if (!thissop) return getTolv();
861  OP_Utils::evalOpParm(result, thissop, "tolv", cookparms.getCookTime(), 0);
862  return result;
863  }
864  Subdivspace getSubdivspace() const { return Subdivspace(mySubdivspace); }
865  void setSubdivspace(Subdivspace val) { mySubdivspace = int64(val); }
867  {
868  SOP_Node *thissop = cookparms.getNode();
869  if (!thissop) return getSubdivspace();
870  int64 result;
871  OP_Utils::evalOpParm(result, thissop, "subdivspace", cookparms.getCookTime(), 0);
872  return Subdivspace(result);
873  }
874  int64 getDivsu() const { return myDivsu; }
875  void setDivsu(int64 val) { myDivsu = val; }
876  int64 opDivsu(const SOP_NodeVerb::CookParms &cookparms) const
877  {
878  SOP_Node *thissop = cookparms.getNode();
879  if (!thissop) return getDivsu();
880  int64 result;
881  OP_Utils::evalOpParm(result, thissop, "divsu", cookparms.getCookTime(), 0);
882  return result;
883  }
884  int64 getDivsv() const { return myDivsv; }
885  void setDivsv(int64 val) { myDivsv = val; }
886  int64 opDivsv(const SOP_NodeVerb::CookParms &cookparms) const
887  {
888  SOP_Node *thissop = cookparms.getNode();
889  if (!thissop) return getDivsv();
890  int64 result;
891  OP_Utils::evalOpParm(result, thissop, "divsv", cookparms.getCookTime(), 0);
892  return result;
893  }
894 
895 private:
896  UT_StringHolder myGroup;
897  bool myFirstu;
898  fpreal64 myDomainu1;
899  bool mySecondu;
900  fpreal64 myDomainu2;
901  bool myFirstv;
902  fpreal64 myDomainv1;
903  bool mySecondv;
904  fpreal64 myDomainv2;
905  int64 myRefineu;
906  int64 myRefinev;
907  int64 myRefinespace;
908  int64 myStdswitcher;
909  int64 myUnrefineu;
910  int64 myUnrefinev;
911  fpreal64 myTolu;
912  fpreal64 myTolv;
913  int64 mySubdivspace;
914  int64 myDivsu;
915  int64 myDivsv;
916 
917 };
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool getSecondu() const
Refinespace getRefinespace() const
bool opSecondv(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
int64 getDivsv() const
bool opFirstv(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDomainv2(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
int64 getUnrefinev() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setDomainu2(fpreal64 val)
void setDivsv(int64 val)
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
fpreal getTime() const
Definition: OP_Context.h:62
void setDomainv1(fpreal64 val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setUnrefineu(int64 val)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
fpreal64 opDomainu2(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
Subdivspace opSubdivspace(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
fpreal64 getTolv() const
int64 opDivsu(const SOP_NodeVerb::CookParms &cookparms) const
void setRefinespace(Refinespace val)
An output stream object that owns its own string buffer storage.
void setSecondv(bool val)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
**But if you need a result
Definition: thread.h:613
void setDivsu(int64 val)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
Subdivspace getSubdivspace() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool getSecondv() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 opTolu(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool load(UT_IStream &is)
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.
const char * getNestParmName(TempIndex fieldnum) const override
void setDomainu1(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, int64 v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
double fpreal64
Definition: SYS_Types.h:201
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void save(std::ostream &os) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool operator==(const SOP_RefineParms &src) const
fpreal64 getDomainu2() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal64 opDomainv1(const SOP_NodeVerb::CookParms &cookparms) const
bool getFirstu() const
static int version()
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setStdswitcher(int64 val)
exint length() const
bool getFirstv() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 opDomainu1(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
int64 getUnrefineu() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool opSecondu(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
int64 getDivsu() const
fpreal64 getTolu() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setTolu(fpreal64 val)
long long int64
Definition: SYS_Types.h:116
void setFirstu(bool val)
int64 opDivsv(const SOP_NodeVerb::CookParms &cookparms) const
int64 opUnrefineu(const SOP_NodeVerb::CookParms &cookparms) const
int64 getRefineu() const
void setDomainv2(fpreal64 val)
void setTolv(fpreal64 val)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, fpreal64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
int64 opRefinev(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setRefinev(int64 val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
SYS_FORCE_INLINE UT_StringHolder getToken(Refinespace enum_value)
GT_API const UT_StringHolder version
Refinespace opRefinespace(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setSubdivspace(Subdivspace val)
int64 opRefineu(const SOP_NodeVerb::CookParms &cookparms) const
void setUnrefinev(int64 val)
void setGroup(const UT_StringHolder &val)
void setSecondu(bool val)
fpreal64 opTolv(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
fpreal64 fpreal
Definition: SYS_Types.h:277
static void loadData(UT_IStream &is, UT_StringHolder &v)
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:92
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setFirstv(bool val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal64 getDomainv2() const
int64 opUnrefinev(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
int64 getRefinev() const
int64 opStdswitcher(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
bool opFirstu(const SOP_NodeVerb::CookParms &cookparms) const
GLboolean r
Definition: glcorearb.h:1222
fpreal64 getDomainu1() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_Vector3D v)
fpreal64 getDomainv1() const
int64 getStdswitcher() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void setRefineu(int64 val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
bool operator!=(const SOP_RefineParms &src) const