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