HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Fit.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_FitEnums
24 {
25  enum class Method
26  {
27  APPROX = 0,
28  INTERP
29  };
30  enum class Type
31  {
32  NURBS = 0,
33  BEZIER
34  };
35  enum class SurfType
36  {
37  ROWS = 0,
38  COLS,
39  ROWCOL,
40  TRIANGLES,
41  QUADS,
44  };
45  enum class Scope
46  {
47  GLOBAL = 0,
48  LOCAL,
49  BREAKPNT
50  };
51  enum class DataParmU
52  {
53  UNIFORM = 0,
54  CHRDLEN,
55  CENTRIP
56  };
57  enum class DataParmV
58  {
59  UNIFORM = 0,
60  CHRDLEN,
61  CENTRIP
62  };
63  enum class CloseU
64  {
65  NONEWU = 0,
66  WU,
67  IFPRIMWU
68  };
69  enum class CloseV
70  {
71  NONEWV = 0,
72  WV,
73  IFPRIMWV
74  };
75 }
76 
77 
79 {
80 public:
81  static int version() { return 1; }
82 
84  {
85  myGroup = ""_UTsh;
86  myMethod = 0;
87  myType = 0;
88  mySurfType = 4;
89  myOrderU = 4;
90  myOrderV = 4;
91  myTol = 0.01;
92  mySmooth = 0;
93  myMultipleU = false;
94  myMultipleV = false;
95  myScope = 0;
96  myDataParmU = 1;
97  myDataParmV = 1;
98  myCloseU = 2;
99  myCloseV = 2;
100  myCorners = false;
101 
102  }
103 
104  explicit SOP_FitParms(const SOP_FitParms &) = default;
105  SOP_FitParms &operator=(const SOP_FitParms &) = default;
106  SOP_FitParms(SOP_FitParms &&) noexcept = default;
107  SOP_FitParms &operator=(SOP_FitParms &&) noexcept = default;
108 
109  ~SOP_FitParms() override {}
110 
111  bool operator==(const SOP_FitParms &src) const
112  {
113  if (myGroup != src.myGroup) return false;
114  if (myMethod != src.myMethod) return false;
115  if (myType != src.myType) return false;
116  if (mySurfType != src.mySurfType) return false;
117  if (myOrderU != src.myOrderU) return false;
118  if (myOrderV != src.myOrderV) return false;
119  if (myTol != src.myTol) return false;
120  if (mySmooth != src.mySmooth) return false;
121  if (myMultipleU != src.myMultipleU) return false;
122  if (myMultipleV != src.myMultipleV) return false;
123  if (myScope != src.myScope) return false;
124  if (myDataParmU != src.myDataParmU) return false;
125  if (myDataParmV != src.myDataParmV) return false;
126  if (myCloseU != src.myCloseU) return false;
127  if (myCloseV != src.myCloseV) return false;
128  if (myCorners != src.myCorners) return false;
129 
130  return true;
131  }
132  bool operator!=(const SOP_FitParms &src) const
133  {
134  return !operator==(src);
135  }
144 
145 
146 
147  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
148  {
149  myGroup = ""_UTsh;
150  if (true)
151  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
152  myMethod = 0;
153  if (true)
154  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
155  myType = 0;
156  if (true)
157  graph->evalOpParm(myType, nodeidx, "type", time, 0);
158  mySurfType = 4;
159  if (true)
160  graph->evalOpParm(mySurfType, nodeidx, "surftype", time, 0);
161  myOrderU = 4;
162  if (true)
163  graph->evalOpParm(myOrderU, nodeidx, "orderu", time, 0);
164  myOrderV = 4;
165  if (true)
166  graph->evalOpParm(myOrderV, nodeidx, "orderv", time, 0);
167  myTol = 0.01;
168  if (true && ( (true&&!(((int64(getMethod())!=0))||((int64(getMethod())==1)))) ) )
169  graph->evalOpParm(myTol, nodeidx, "tol", time, 0);
170  mySmooth = 0;
171  if (true && ( (true&&!(((int64(getMethod())!=0))||((int64(getMethod())==1)))) ) )
172  graph->evalOpParm(mySmooth, nodeidx, "smooth", time, 0);
173  myMultipleU = false;
174  if (true && ( (true&&!(((int64(getMethod())!=0))||((int64(getMethod())==1)))) ) )
175  graph->evalOpParm(myMultipleU, nodeidx, "multipleu", time, 0);
176  myMultipleV = false;
177  if (true && ( (true&&!(((int64(getMethod())!=0))||((int64(getMethod())==1)))) ) )
178  graph->evalOpParm(myMultipleV, nodeidx, "multiplev", time, 0);
179  myScope = 0;
180  if (true && ( (true&&!(((int64(getMethod())!=1))||((int64(getMethod())==0)))) ) )
181  graph->evalOpParm(myScope, nodeidx, "scope", time, 0);
182  myDataParmU = 1;
183  if (true && ( (true&&!(((int64(getMethod())!=1))||((int64(getMethod())==0)))) ) )
184  graph->evalOpParm(myDataParmU, nodeidx, "dataparmu", time, 0);
185  myDataParmV = 1;
186  if (true && ( (true&&!(((int64(getMethod())!=1))||((int64(getMethod())==0)))) ) )
187  graph->evalOpParm(myDataParmV, nodeidx, "dataparmv", time, 0);
188  myCloseU = 2;
189  if (true && ( (true&&!(((int64(getMethod())!=1))||((int64(getMethod())==0)))) ) )
190  graph->evalOpParm(myCloseU, nodeidx, "closeu", time, 0);
191  myCloseV = 2;
192  if (true && ( (true&&!(((int64(getMethod())!=1))||((int64(getMethod())==0)))) ) )
193  graph->evalOpParm(myCloseV, nodeidx, "closev", time, 0);
194  myCorners = false;
195  if (true && ( (true&&!(((int64(getMethod())!=1))||((int64(getMethod())==0))||((int64(getScope())!=1)))) ) )
196  graph->evalOpParm(myCorners, nodeidx, "corners", time, 0);
197 
198  }
199 
200 
201  void loadFromOpSubclass(const LoadParms &loadparms) override
202  {
203  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
204  }
205 
206 
207  void copyFrom(const OP_NodeParms *src) override
208  {
209  *this = *((const SOP_FitParms *)src);
210  }
211 
212  template <typename T>
213  void
214  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
215  {
216  if (idx.size() < 1)
217  return;
218  UT_ASSERT(idx.size() == instance.size()+1);
219  if (idx.size() != instance.size()+1)
220  return;
221  switch (idx[0])
222  {
223  case 0:
224  coerceValue(value, myGroup);
225  break;
226  case 1:
227  coerceValue(value, myMethod);
228  break;
229  case 2:
230  coerceValue(value, myType);
231  break;
232  case 3:
233  coerceValue(value, mySurfType);
234  break;
235  case 4:
236  coerceValue(value, myOrderU);
237  break;
238  case 5:
239  coerceValue(value, myOrderV);
240  break;
241  case 6:
242  coerceValue(value, myTol);
243  break;
244  case 7:
245  coerceValue(value, mySmooth);
246  break;
247  case 8:
248  coerceValue(value, myMultipleU);
249  break;
250  case 9:
251  coerceValue(value, myMultipleV);
252  break;
253  case 10:
254  coerceValue(value, myScope);
255  break;
256  case 11:
257  coerceValue(value, myDataParmU);
258  break;
259  case 12:
260  coerceValue(value, myDataParmV);
261  break;
262  case 13:
263  coerceValue(value, myCloseU);
264  break;
265  case 14:
266  coerceValue(value, myCloseV);
267  break;
268  case 15:
269  coerceValue(value, myCorners);
270  break;
271 
272  }
273  }
274 
275  bool isParmColorRamp(exint idx) const override
276  {
277  switch (idx)
278  {
279 
280  }
281  return false;
282  }
283 
284  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
305  { doGetParmValue(idx, instance, value); }
306 
307  template <typename T>
308  void
309  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
310  {
311  if (idx.size() < 1)
312  return;
313  UT_ASSERT(idx.size() == instance.size()+1);
314  if (idx.size() != instance.size()+1)
315  return;
316  switch (idx[0])
317  {
318  case 0:
319  coerceValue(myGroup, ( ( value ) ));
320  break;
321  case 1:
322  coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
323  break;
324  case 2:
325  coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
326  break;
327  case 3:
328  coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
329  break;
330  case 4:
331  coerceValue(myOrderU, clampMinValue(2, clampMaxValue(11, value ) ));
332  break;
333  case 5:
334  coerceValue(myOrderV, clampMinValue(2, clampMaxValue(11, value ) ));
335  break;
336  case 6:
337  coerceValue(myTol, clampMinValue(0, ( value ) ));
338  break;
339  case 7:
340  coerceValue(mySmooth, clampMinValue(0, clampMaxValue(1, value ) ));
341  break;
342  case 8:
343  coerceValue(myMultipleU, ( ( value ) ));
344  break;
345  case 9:
346  coerceValue(myMultipleV, ( ( value ) ));
347  break;
348  case 10:
349  coerceValue(myScope, clampMinValue(0, clampMaxValue(2, value ) ));
350  break;
351  case 11:
352  coerceValue(myDataParmU, clampMinValue(0, clampMaxValue(2, value ) ));
353  break;
354  case 12:
355  coerceValue(myDataParmV, clampMinValue(0, clampMaxValue(2, value ) ));
356  break;
357  case 13:
358  coerceValue(myCloseU, clampMinValue(0, clampMaxValue(2, value ) ));
359  break;
360  case 14:
361  coerceValue(myCloseV, clampMinValue(0, clampMaxValue(2, value ) ));
362  break;
363  case 15:
364  coerceValue(myCorners, ( ( value ) ));
365  break;
366 
367  }
368  }
369 
370  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
371  { doSetParmValue(idx, instance, value); }
372  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
383  { doSetParmValue(idx, instance, value); }
384  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
385  { doSetParmValue(idx, instance, value); }
386  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
391  { doSetParmValue(idx, instance, value); }
392 
393  exint getNestNumParms(TempIndex idx) const override
394  {
395  if (idx.size() == 0)
396  return 16;
397  switch (idx[0])
398  {
399 
400  }
401  // Invalid
402  return 0;
403  }
404 
405  const char *getNestParmName(TempIndex fieldnum) const override
406  {
407  if (fieldnum.size() < 1)
408  return 0;
409  switch (fieldnum[0])
410  {
411  case 0:
412  return "group";
413  case 1:
414  return "method";
415  case 2:
416  return "type";
417  case 3:
418  return "surftype";
419  case 4:
420  return "orderu";
421  case 5:
422  return "orderv";
423  case 6:
424  return "tol";
425  case 7:
426  return "smooth";
427  case 8:
428  return "multipleu";
429  case 9:
430  return "multiplev";
431  case 10:
432  return "scope";
433  case 11:
434  return "dataparmu";
435  case 12:
436  return "dataparmv";
437  case 13:
438  return "closeu";
439  case 14:
440  return "closev";
441  case 15:
442  return "corners";
443 
444  }
445  return 0;
446  }
447 
448  ParmType getNestParmType(TempIndex fieldnum) const override
449  {
450  if (fieldnum.size() < 1)
451  return PARM_UNSUPPORTED;
452  switch (fieldnum[0])
453  {
454  case 0:
455  return PARM_STRING;
456  case 1:
457  return PARM_INTEGER;
458  case 2:
459  return PARM_INTEGER;
460  case 3:
461  return PARM_INTEGER;
462  case 4:
463  return PARM_INTEGER;
464  case 5:
465  return PARM_INTEGER;
466  case 6:
467  return PARM_FLOAT;
468  case 7:
469  return PARM_FLOAT;
470  case 8:
471  return PARM_INTEGER;
472  case 9:
473  return PARM_INTEGER;
474  case 10:
475  return PARM_INTEGER;
476  case 11:
477  return PARM_INTEGER;
478  case 12:
479  return PARM_INTEGER;
480  case 13:
481  return PARM_INTEGER;
482  case 14:
483  return PARM_INTEGER;
484  case 15:
485  return PARM_INTEGER;
486 
487  }
488  return PARM_UNSUPPORTED;
489  }
490 
491  // Boiler plate to load individual types.
492  static void loadData(UT_IStream &is, int64 &v)
493  { is.bread(&v, 1); }
494  static void loadData(UT_IStream &is, bool &v)
495  { int64 iv; is.bread(&iv, 1); v = iv; }
496  static void loadData(UT_IStream &is, fpreal64 &v)
497  { is.bread<fpreal64>(&v, 1); }
498  static void loadData(UT_IStream &is, UT_Vector2D &v)
499  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
500  static void loadData(UT_IStream &is, UT_Vector3D &v)
501  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
502  is.bread<fpreal64>(&v.z(), 1); }
503  static void loadData(UT_IStream &is, UT_Vector4D &v)
504  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
505  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
506  static void loadData(UT_IStream &is, UT_Matrix2D &v)
507  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
508  static void loadData(UT_IStream &is, UT_Matrix3D &v)
509  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
510  static void loadData(UT_IStream &is, UT_Matrix4D &v)
511  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
512  static void loadData(UT_IStream &is, UT_Vector2I &v)
513  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
514  static void loadData(UT_IStream &is, UT_Vector3I &v)
515  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
516  is.bread<int64>(&v.z(), 1); }
517  static void loadData(UT_IStream &is, UT_Vector4I &v)
518  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
519  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
521  { is.bread(v); }
523  { UT_StringHolder rampdata;
524  loadData(is, rampdata);
525  if (rampdata.isstring())
526  {
527  v.reset(new UT_Ramp());
528  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
529  v->load(istr);
530  }
531  else v.reset();
532  }
535  loadData(is, data);
536  if (data.isstring())
537  {
538  // Find the data type.
539  const char *colon = UT_StringWrap(data).findChar(':');
540  if (colon)
541  {
542  int typelen = colon - data.buffer();
544  type.strncpy(data.buffer(), typelen);
545  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
546 
547  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
548  }
549  }
550  else v.reset();
551  }
552 
553  static void saveData(std::ostream &os, int64 v)
554  { UTwrite(os, &v); }
555  static void saveData(std::ostream &os, bool v)
556  { int64 iv = v; UTwrite(os, &iv); }
557  static void saveData(std::ostream &os, fpreal64 v)
558  { UTwrite<fpreal64>(os, &v); }
559  static void saveData(std::ostream &os, UT_Vector2D v)
560  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
561  static void saveData(std::ostream &os, UT_Vector3D v)
562  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
563  UTwrite<fpreal64>(os, &v.z()); }
564  static void saveData(std::ostream &os, UT_Vector4D v)
565  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
566  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
567  static void saveData(std::ostream &os, UT_Matrix2D v)
569  static void saveData(std::ostream &os, UT_Matrix3D v)
571  static void saveData(std::ostream &os, UT_Matrix4D v)
573  static void saveData(std::ostream &os, UT_StringHolder s)
574  { UT_StringWrap(s).saveBinary(os); }
575  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
577  UT_OStringStream ostr;
578  if (s) s->save(ostr);
579  result = ostr.str();
580  saveData(os, result);
581  }
582  static void saveData(std::ostream &os, PRM_DataItemHandle s)
584  UT_OStringStream ostr;
585  if (s)
586  {
587  ostr << s->getDataTypeToken();
588  ostr << ":";
589  s->saveBinary(ostr);
590  }
591  result = ostr.str();
592  saveData(os, result);
593  }
594 
595 
596  void save(std::ostream &os) const
597  {
598  int32 v = version();
599  UTwrite(os, &v);
600  saveData(os, myGroup);
601  saveData(os, myMethod);
602  saveData(os, myType);
603  saveData(os, mySurfType);
604  saveData(os, myOrderU);
605  saveData(os, myOrderV);
606  saveData(os, myTol);
607  saveData(os, mySmooth);
608  saveData(os, myMultipleU);
609  saveData(os, myMultipleV);
610  saveData(os, myScope);
611  saveData(os, myDataParmU);
612  saveData(os, myDataParmV);
613  saveData(os, myCloseU);
614  saveData(os, myCloseV);
615  saveData(os, myCorners);
616 
617  }
618 
619  bool load(UT_IStream &is)
620  {
621  int32 v;
622  is.bread(&v, 1);
623  if (version() != v)
624  {
625  // Fail incompatible versions
626  return false;
627  }
628  loadData(is, myGroup);
629  loadData(is, myMethod);
630  loadData(is, myType);
631  loadData(is, mySurfType);
632  loadData(is, myOrderU);
633  loadData(is, myOrderV);
634  loadData(is, myTol);
635  loadData(is, mySmooth);
636  loadData(is, myMultipleU);
637  loadData(is, myMultipleV);
638  loadData(is, myScope);
639  loadData(is, myDataParmU);
640  loadData(is, myDataParmV);
641  loadData(is, myCloseU);
642  loadData(is, myCloseV);
643  loadData(is, myCorners);
644 
645  return true;
646  }
647 
648  const UT_StringHolder & getGroup() const { return myGroup; }
649  void setGroup(const UT_StringHolder & val) { myGroup = val; }
651  {
652  SOP_Node *thissop = cookparms.getNode();
653  if (!thissop) return getGroup();
655  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
656  return result;
657  }
658  Method getMethod() const { return Method(myMethod); }
659  void setMethod(Method val) { myMethod = int64(val); }
660  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
661  {
662  SOP_Node *thissop = cookparms.getNode();
663  if (!thissop) return getMethod();
664  int64 result;
665  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
666  return Method(result);
667  }
668  Type getType() const { return Type(myType); }
669  void setType(Type val) { myType = int64(val); }
670  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
671  {
672  SOP_Node *thissop = cookparms.getNode();
673  if (!thissop) return getType();
674  int64 result;
675  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
676  return Type(result);
677  }
678  SurfType getSurfType() const { return SurfType(mySurfType); }
679  void setSurfType(SurfType val) { mySurfType = int64(val); }
681  {
682  SOP_Node *thissop = cookparms.getNode();
683  if (!thissop) return getSurfType();
684  int64 result;
685  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
686  return SurfType(result);
687  }
688  int64 getOrderU() const { return myOrderU; }
689  void setOrderU(int64 val) { myOrderU = val; }
690  int64 opOrderU(const SOP_NodeVerb::CookParms &cookparms) const
691  {
692  SOP_Node *thissop = cookparms.getNode();
693  if (!thissop) return getOrderU();
694  int64 result;
695  OP_Utils::evalOpParm(result, thissop, "orderu", cookparms.getCookTime(), 0);
696  return result;
697  }
698  int64 getOrderV() const { return myOrderV; }
699  void setOrderV(int64 val) { myOrderV = val; }
700  int64 opOrderV(const SOP_NodeVerb::CookParms &cookparms) const
701  {
702  SOP_Node *thissop = cookparms.getNode();
703  if (!thissop) return getOrderV();
704  int64 result;
705  OP_Utils::evalOpParm(result, thissop, "orderv", cookparms.getCookTime(), 0);
706  return result;
707  }
708  fpreal64 getTol() const { return myTol; }
709  void setTol(fpreal64 val) { myTol = val; }
710  fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return getTol();
715  OP_Utils::evalOpParm(result, thissop, "tol", cookparms.getCookTime(), 0);
716  return result;
717  }
718  fpreal64 getSmooth() const { return mySmooth; }
719  void setSmooth(fpreal64 val) { mySmooth = val; }
720  fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
721  {
722  SOP_Node *thissop = cookparms.getNode();
723  if (!thissop) return getSmooth();
725  OP_Utils::evalOpParm(result, thissop, "smooth", cookparms.getCookTime(), 0);
726  return result;
727  }
728  bool getMultipleU() const { return myMultipleU; }
729  void setMultipleU(bool val) { myMultipleU = val; }
730  bool opMultipleU(const SOP_NodeVerb::CookParms &cookparms) const
731  {
732  SOP_Node *thissop = cookparms.getNode();
733  if (!thissop) return getMultipleU();
734  bool result;
735  OP_Utils::evalOpParm(result, thissop, "multipleu", cookparms.getCookTime(), 0);
736  return result;
737  }
738  bool getMultipleV() const { return myMultipleV; }
739  void setMultipleV(bool val) { myMultipleV = val; }
740  bool opMultipleV(const SOP_NodeVerb::CookParms &cookparms) const
741  {
742  SOP_Node *thissop = cookparms.getNode();
743  if (!thissop) return getMultipleV();
744  bool result;
745  OP_Utils::evalOpParm(result, thissop, "multiplev", cookparms.getCookTime(), 0);
746  return result;
747  }
748  Scope getScope() const { return Scope(myScope); }
749  void setScope(Scope val) { myScope = int64(val); }
750  Scope opScope(const SOP_NodeVerb::CookParms &cookparms) const
751  {
752  SOP_Node *thissop = cookparms.getNode();
753  if (!thissop) return getScope();
754  int64 result;
755  OP_Utils::evalOpParm(result, thissop, "scope", cookparms.getCookTime(), 0);
756  return Scope(result);
757  }
758  DataParmU getDataParmU() const { return DataParmU(myDataParmU); }
759  void setDataParmU(DataParmU val) { myDataParmU = int64(val); }
761  {
762  SOP_Node *thissop = cookparms.getNode();
763  if (!thissop) return getDataParmU();
764  int64 result;
765  OP_Utils::evalOpParm(result, thissop, "dataparmu", cookparms.getCookTime(), 0);
766  return DataParmU(result);
767  }
768  DataParmV getDataParmV() const { return DataParmV(myDataParmV); }
769  void setDataParmV(DataParmV val) { myDataParmV = int64(val); }
771  {
772  SOP_Node *thissop = cookparms.getNode();
773  if (!thissop) return getDataParmV();
774  int64 result;
775  OP_Utils::evalOpParm(result, thissop, "dataparmv", cookparms.getCookTime(), 0);
776  return DataParmV(result);
777  }
778  CloseU getCloseU() const { return CloseU(myCloseU); }
779  void setCloseU(CloseU val) { myCloseU = int64(val); }
780  CloseU opCloseU(const SOP_NodeVerb::CookParms &cookparms) const
781  {
782  SOP_Node *thissop = cookparms.getNode();
783  if (!thissop) return getCloseU();
784  int64 result;
785  OP_Utils::evalOpParm(result, thissop, "closeu", cookparms.getCookTime(), 0);
786  return CloseU(result);
787  }
788  CloseV getCloseV() const { return CloseV(myCloseV); }
789  void setCloseV(CloseV val) { myCloseV = int64(val); }
790  CloseV opCloseV(const SOP_NodeVerb::CookParms &cookparms) const
791  {
792  SOP_Node *thissop = cookparms.getNode();
793  if (!thissop) return getCloseV();
794  int64 result;
795  OP_Utils::evalOpParm(result, thissop, "closev", cookparms.getCookTime(), 0);
796  return CloseV(result);
797  }
798  bool getCorners() const { return myCorners; }
799  void setCorners(bool val) { myCorners = val; }
800  bool opCorners(const SOP_NodeVerb::CookParms &cookparms) const
801  {
802  SOP_Node *thissop = cookparms.getNode();
803  if (!thissop) return getCorners();
804  bool result;
805  OP_Utils::evalOpParm(result, thissop, "corners", cookparms.getCookTime(), 0);
806  return result;
807  }
808 
809 private:
810  UT_StringHolder myGroup;
811  int64 myMethod;
812  int64 myType;
813  int64 mySurfType;
814  int64 myOrderU;
815  int64 myOrderV;
816  fpreal64 myTol;
817  fpreal64 mySmooth;
818  bool myMultipleU;
819  bool myMultipleV;
820  int64 myScope;
821  int64 myDataParmU;
822  int64 myDataParmV;
823  int64 myCloseU;
824  int64 myCloseV;
825  bool myCorners;
826 
827 };
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, int64 &v)
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
CloseU opCloseU(const SOP_NodeVerb::CookParms &cookparms) const
Method getMethod() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
int int32
Definition: SYS_Types.h:39
bool operator!=(const SOP_FitParms &src) const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
bool opMultipleU(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
void setDataParmV(DataParmV val)
void setOrderU(int64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
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
CloseV getCloseV() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getMultipleU() const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void setScope(Scope val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
void setMethod(Method val)
**But if you need a result
Definition: thread.h:613
bool getMultipleV() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
void setCorners(bool val)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setTol(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, bool v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void save(std::ostream &os) const
static void saveData(std::ostream &os, UT_Vector2D v)
double fpreal64
Definition: SYS_Types.h:201
static void loadData(UT_IStream &is, UT_Matrix2D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
DataParmU getDataParmU() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint length() const
void setSmooth(fpreal64 val)
void setMultipleV(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
bool opMultipleV(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void copyFrom(const OP_NodeParms *src) override
DataParmV getDataParmV() const
void setCloseV(CloseV val)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
CloseU getCloseU() const
fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
void setCloseU(CloseU val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
long long int64
Definition: SYS_Types.h:116
void setDataParmU(DataParmU val)
int64 getOrderU() const
int64 opOrderU(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setType(Type val)
void setOrderV(int64 val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void loadFromOpSubclass(const LoadParms &loadparms) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
bool getCorners() const
void setSurfType(SurfType val)
void setMultipleU(bool val)
Scope opScope(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
Type getType() const
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
SurfType opSurfType(const SOP_NodeVerb::CookParms &cookparms) const
CloseV opCloseV(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
SurfType getSurfType() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
static int version()
Definition: SOP_Fit.proto.h:81
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool opCorners(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
int64 getOrderV() const
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
DataParmV opDataParmV(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
Definition: core.h:1131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GLboolean r
Definition: glcorearb.h:1222
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal64 getTol() const
DataParmU opDataParmU(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
bool load(UT_IStream &is)
bool operator==(const SOP_FitParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
type
Definition: core.h:1059
const char * getNestParmName(TempIndex fieldnum) const override
int64 opOrderV(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
ParmType getNestParmType(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
Scope getScope() const
const UT_StringHolder & getGroup() const
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool isParmColorRamp(exint idx) const override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 getSmooth() const