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