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