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