HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Unsubdivide.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_UnsubdivideEnums
24 {
25  enum class Algorithm
26  {
27  CC = 0,
28  BILINEAR
29  };
30 
32  getToken(Algorithm enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case Algorithm::CC: return "cc"_sh;
37  case Algorithm::BILINEAR: return "bilinear"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Strategy
43  {
44  HEURISTICS = 0,
45  SEED
46  };
47 
49  getToken(Strategy enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case Strategy::HEURISTICS: return "heuristics"_sh;
54  case Strategy::SEED: return "seed"_sh;
55  default: UT_ASSERT(false); return ""_sh;
56  }
57  }
58 
59 }
60 
61 
63 {
64 public:
65  static int version() { return 1; }
66 
68  {
69  myGroup = ""_UTsh;
70  myUsepieceattrib = false;
71  myPieceattrib = "name"_UTsh;
72  myAlgorithm = 0;
73  myUseiter = true;
74  myIterations = 1;
75  myTol = 1e-6;
76  myAllowpartialunsub = true;
77  myRepairmesh = true;
78  myStrategy = 0;
79  myPreferuniform = false;
80  mySeed = 0;
81  myUseconnectivityattribute = false;
82  myConnectivityattribute = "uv"_UTsh;
83  myConnectivitytol = 1e-6;
84  myUseoutputdepthattribute = false;
85  myOutputdepthattribute = "depth"_UTsh;
86 
87  }
88 
89  explicit SOP_UnsubdivideParms(const SOP_UnsubdivideParms &) = default;
91  SOP_UnsubdivideParms(SOP_UnsubdivideParms &&) noexcept = default;
92  SOP_UnsubdivideParms &operator=(SOP_UnsubdivideParms &&) noexcept = default;
93 
94  ~SOP_UnsubdivideParms() override {}
95 
96  bool operator==(const SOP_UnsubdivideParms &src) const
97  {
98  if (myGroup != src.myGroup) return false;
99  if (myUsepieceattrib != src.myUsepieceattrib) return false;
100  if (myPieceattrib != src.myPieceattrib) return false;
101  if (myAlgorithm != src.myAlgorithm) return false;
102  if (myUseiter != src.myUseiter) return false;
103  if (myIterations != src.myIterations) return false;
104  if (myTol != src.myTol) return false;
105  if (myAllowpartialunsub != src.myAllowpartialunsub) return false;
106  if (myRepairmesh != src.myRepairmesh) return false;
107  if (myStrategy != src.myStrategy) return false;
108  if (myPreferuniform != src.myPreferuniform) return false;
109  if (mySeed != src.mySeed) return false;
110  if (myUseconnectivityattribute != src.myUseconnectivityattribute) return false;
111  if (myConnectivityattribute != src.myConnectivityattribute) return false;
112  if (myConnectivitytol != src.myConnectivitytol) return false;
113  if (myUseoutputdepthattribute != src.myUseoutputdepthattribute) return false;
114  if (myOutputdepthattribute != src.myOutputdepthattribute) return false;
115 
116 
117  if (baseGetSignature() != src.baseGetSignature()) return false;
118 
119  return true;
120  }
122  {
123  return !operator==(src);
124  }
127 
128 
129 
130  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
131  {
132  myGroup = ""_UTsh;
133  if (true)
134  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
135  myUsepieceattrib = false;
136  if (true)
137  graph->evalOpParm(myUsepieceattrib, nodeidx, "usepieceattrib", time, graph->isDirect()?nullptr:depnode);
138  myPieceattrib = "name"_UTsh;
139  if (true && ( (true&&!(((getUsepieceattrib()==0)))) ) )
140  graph->evalOpParm(myPieceattrib, nodeidx, "pieceattrib", time, graph->isDirect()?nullptr:depnode);
141  myAlgorithm = 0;
142  if (true)
143  graph->evalOpParm(myAlgorithm, nodeidx, "algorithm", time, graph->isDirect()?nullptr:depnode);
144  myUseiter = true;
145  if (true)
146  graph->evalOpParm(myUseiter, nodeidx, "useiter", time, graph->isDirect()?nullptr:depnode);
147  myIterations = 1;
148  if (true && ( (true&&!(((getUseiter()==0)))) ) )
149  graph->evalOpParm(myIterations, nodeidx, "iterations", time, graph->isDirect()?nullptr:depnode);
150  myTol = 1e-6;
151  if (true)
152  graph->evalOpParm(myTol, nodeidx, "tol", time, graph->isDirect()?nullptr:depnode);
153  myAllowpartialunsub = true;
154  if (true)
155  graph->evalOpParm(myAllowpartialunsub, nodeidx, "allowpartialunsub", time, graph->isDirect()?nullptr:depnode);
156  myRepairmesh = true;
157  if (true && ( (true&&!(((getAllowpartialunsub()==0)))) ) )
158  graph->evalOpParm(myRepairmesh, nodeidx, "repairmesh", time, graph->isDirect()?nullptr:depnode);
159  myStrategy = 0;
160  if (true)
161  graph->evalOpParm(myStrategy, nodeidx, "strategy", time, graph->isDirect()?nullptr:depnode);
162  myPreferuniform = false;
163  if (true && ( (true&&!(((int64(getStrategy())!=0)))) ) )
164  graph->evalOpParm(myPreferuniform, nodeidx, "preferuniform", time, graph->isDirect()?nullptr:depnode);
165  mySeed = 0;
166  if (true && ( (true&&!(((int64(getStrategy())!=1)))) ) )
167  graph->evalOpParm(mySeed, nodeidx, "seed", time, graph->isDirect()?nullptr:depnode);
168  myUseconnectivityattribute = false;
169  if (true)
170  graph->evalOpParm(myUseconnectivityattribute, nodeidx, "useconnectivityattribute", time, graph->isDirect()?nullptr:depnode);
171  myConnectivityattribute = "uv"_UTsh;
172  if (true && ( (true&&!(((getUseconnectivityattribute()==0)))) ) )
173  graph->evalOpParm(myConnectivityattribute, nodeidx, "connectivityattribute", time, graph->isDirect()?nullptr:depnode);
174  myConnectivitytol = 1e-6;
175  if (true && ( (true&&!(((getUseconnectivityattribute()==0)))) ) )
176  graph->evalOpParm(myConnectivitytol, nodeidx, "connectivitytol", time, graph->isDirect()?nullptr:depnode);
177  myUseoutputdepthattribute = false;
178  if (true)
179  graph->evalOpParm(myUseoutputdepthattribute, nodeidx, "useoutputdepthattribute", time, graph->isDirect()?nullptr:depnode);
180  myOutputdepthattribute = "depth"_UTsh;
181  if (true && ( (true&&!(((getUseoutputdepthattribute()==0)))) ) )
182  graph->evalOpParm(myOutputdepthattribute, nodeidx, "outputdepthattribute", time, graph->isDirect()?nullptr:depnode);
183 
184  }
185 
186 
187  void loadFromOpSubclass(const LoadParms &loadparms) override
188  {
189  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
190  }
191 
192 
193  void copyFrom(const OP_NodeParms *src) override
194  {
195  *this = *((const SOP_UnsubdivideParms *)src);
196  }
197 
198  template <typename T>
199  void
200  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
201  {
202  if (idx.size() < 1)
203  return;
204  UT_ASSERT(idx.size() == instance.size()+1);
205  if (idx.size() != instance.size()+1)
206  return;
207  switch (idx[0])
208  {
209  case 0:
210  coerceValue(value, myGroup);
211  break;
212  case 1:
213  coerceValue(value, myUsepieceattrib);
214  break;
215  case 2:
216  coerceValue(value, myPieceattrib);
217  break;
218  case 3:
219  coerceValue(value, myAlgorithm);
220  break;
221  case 4:
222  coerceValue(value, myUseiter);
223  break;
224  case 5:
225  coerceValue(value, myIterations);
226  break;
227  case 6:
228  coerceValue(value, myTol);
229  break;
230  case 7:
231  coerceValue(value, myAllowpartialunsub);
232  break;
233  case 8:
234  coerceValue(value, myRepairmesh);
235  break;
236  case 9:
237  coerceValue(value, myStrategy);
238  break;
239  case 10:
240  coerceValue(value, myPreferuniform);
241  break;
242  case 11:
243  coerceValue(value, mySeed);
244  break;
245  case 12:
246  coerceValue(value, myUseconnectivityattribute);
247  break;
248  case 13:
249  coerceValue(value, myConnectivityattribute);
250  break;
251  case 14:
252  coerceValue(value, myConnectivitytol);
253  break;
254  case 15:
255  coerceValue(value, myUseoutputdepthattribute);
256  break;
257  case 16:
258  coerceValue(value, myOutputdepthattribute);
259  break;
260 
261  }
262  }
263 
264  bool isParmColorRamp(exint idx) const override
265  {
266  switch (idx)
267  {
268 
269  }
270  return false;
271  }
272 
273  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
294  { doGetParmValue(idx, instance, value); }
295 
296  template <typename T>
297  void
298  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
299  {
300  if (idx.size() < 1)
301  return;
302  UT_ASSERT(idx.size() == instance.size()+1);
303  if (idx.size() != instance.size()+1)
304  return;
305  switch (idx[0])
306  {
307  case 0:
308  coerceValue(myGroup, ( ( value ) ));
309  break;
310  case 1:
311  coerceValue(myUsepieceattrib, ( ( value ) ));
312  break;
313  case 2:
314  coerceValue(myPieceattrib, ( ( value ) ));
315  break;
316  case 3:
317  coerceValue(myAlgorithm, clampMinValue(0, clampMaxValue(1, value ) ));
318  break;
319  case 4:
320  coerceValue(myUseiter, ( ( value ) ));
321  break;
322  case 5:
323  coerceValue(myIterations, ( ( value ) ));
324  break;
325  case 6:
326  coerceValue(myTol, clampMinValue(0, ( value ) ));
327  break;
328  case 7:
329  coerceValue(myAllowpartialunsub, ( ( value ) ));
330  break;
331  case 8:
332  coerceValue(myRepairmesh, ( ( value ) ));
333  break;
334  case 9:
335  coerceValue(myStrategy, clampMinValue(0, clampMaxValue(1, value ) ));
336  break;
337  case 10:
338  coerceValue(myPreferuniform, ( ( value ) ));
339  break;
340  case 11:
341  coerceValue(mySeed, clampMinValue(0, clampMaxValue(3, value ) ));
342  break;
343  case 12:
344  coerceValue(myUseconnectivityattribute, ( ( value ) ));
345  break;
346  case 13:
347  coerceValue(myConnectivityattribute, ( ( value ) ));
348  break;
349  case 14:
350  coerceValue(myConnectivitytol, ( ( value ) ));
351  break;
352  case 15:
353  coerceValue(myUseoutputdepthattribute, ( ( value ) ));
354  break;
355  case 16:
356  coerceValue(myOutputdepthattribute, ( ( value ) ));
357  break;
358 
359  }
360  }
361 
362  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
363  { doSetParmValue(idx, instance, value); }
364  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
365  { doSetParmValue(idx, instance, value); }
366  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
367  { doSetParmValue(idx, instance, value); }
368  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
369  { doSetParmValue(idx, instance, value); }
370  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
371  { doSetParmValue(idx, instance, value); }
372  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
383  { doSetParmValue(idx, instance, value); }
384 
385  exint getNestNumParms(TempIndex idx) const override
386  {
387  if (idx.size() == 0)
388  return 17;
389  switch (idx[0])
390  {
391 
392  }
393  // Invalid
394  return 0;
395  }
396 
397  const char *getNestParmName(TempIndex fieldnum) const override
398  {
399  if (fieldnum.size() < 1)
400  return 0;
401  switch (fieldnum[0])
402  {
403  case 0:
404  return "group";
405  case 1:
406  return "usepieceattrib";
407  case 2:
408  return "pieceattrib";
409  case 3:
410  return "algorithm";
411  case 4:
412  return "useiter";
413  case 5:
414  return "iterations";
415  case 6:
416  return "tol";
417  case 7:
418  return "allowpartialunsub";
419  case 8:
420  return "repairmesh";
421  case 9:
422  return "strategy";
423  case 10:
424  return "preferuniform";
425  case 11:
426  return "seed";
427  case 12:
428  return "useconnectivityattribute";
429  case 13:
430  return "connectivityattribute";
431  case 14:
432  return "connectivitytol";
433  case 15:
434  return "useoutputdepthattribute";
435  case 16:
436  return "outputdepthattribute";
437 
438  }
439  return 0;
440  }
441 
442  ParmType getNestParmType(TempIndex fieldnum) const override
443  {
444  if (fieldnum.size() < 1)
445  return PARM_UNSUPPORTED;
446  switch (fieldnum[0])
447  {
448  case 0:
449  return PARM_STRING;
450  case 1:
451  return PARM_INTEGER;
452  case 2:
453  return PARM_STRING;
454  case 3:
455  return PARM_INTEGER;
456  case 4:
457  return PARM_INTEGER;
458  case 5:
459  return PARM_INTEGER;
460  case 6:
461  return PARM_FLOAT;
462  case 7:
463  return PARM_INTEGER;
464  case 8:
465  return PARM_INTEGER;
466  case 9:
467  return PARM_INTEGER;
468  case 10:
469  return PARM_INTEGER;
470  case 11:
471  return PARM_INTEGER;
472  case 12:
473  return PARM_INTEGER;
474  case 13:
475  return PARM_STRING;
476  case 14:
477  return PARM_FLOAT;
478  case 15:
479  return PARM_INTEGER;
480  case 16:
481  return PARM_STRING;
482 
483  }
484  return PARM_UNSUPPORTED;
485  }
486 
487  // Boiler plate to load individual types.
488  static void loadData(UT_IStream &is, int64 &v)
489  { is.bread(&v, 1); }
490  static void loadData(UT_IStream &is, bool &v)
491  { int64 iv; is.bread(&iv, 1); v = iv; }
492  static void loadData(UT_IStream &is, fpreal64 &v)
493  { is.bread<fpreal64>(&v, 1); }
494  static void loadData(UT_IStream &is, UT_Vector2D &v)
495  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
496  static void loadData(UT_IStream &is, UT_Vector3D &v)
497  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
498  is.bread<fpreal64>(&v.z(), 1); }
499  static void loadData(UT_IStream &is, UT_Vector4D &v)
500  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
501  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
502  static void loadData(UT_IStream &is, UT_Matrix2D &v)
503  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
504  static void loadData(UT_IStream &is, UT_Matrix3D &v)
505  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
506  static void loadData(UT_IStream &is, UT_Matrix4D &v)
507  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
508  static void loadData(UT_IStream &is, UT_Vector2I &v)
509  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
510  static void loadData(UT_IStream &is, UT_Vector3I &v)
511  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
512  is.bread<int64>(&v.z(), 1); }
513  static void loadData(UT_IStream &is, UT_Vector4I &v)
514  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
515  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
517  { is.bread(v); }
519  { UT_StringHolder rampdata;
520  loadData(is, rampdata);
521  if (rampdata.isstring())
522  {
523  v.reset(new UT_Ramp());
524  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
525  v->load(istr);
526  }
527  else v.reset();
528  }
531  loadData(is, data);
532  if (data.isstring())
533  {
534  // Find the data type.
535  const char *colon = UT_StringWrap(data).findChar(':');
536  if (colon)
537  {
538  int typelen = colon - data.buffer();
540  type.strncpy(data.buffer(), typelen);
541  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
542 
543  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
544  }
545  }
546  else v.reset();
547  }
548 
549  static void saveData(std::ostream &os, int64 v)
550  { UTwrite(os, &v); }
551  static void saveData(std::ostream &os, bool v)
552  { int64 iv = v; UTwrite(os, &iv); }
553  static void saveData(std::ostream &os, fpreal64 v)
554  { UTwrite<fpreal64>(os, &v); }
555  static void saveData(std::ostream &os, UT_Vector2D v)
556  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
557  static void saveData(std::ostream &os, UT_Vector3D v)
558  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
559  UTwrite<fpreal64>(os, &v.z()); }
560  static void saveData(std::ostream &os, UT_Vector4D v)
561  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
562  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
563  static void saveData(std::ostream &os, UT_Matrix2D v)
565  static void saveData(std::ostream &os, UT_Matrix3D v)
567  static void saveData(std::ostream &os, UT_Matrix4D v)
569  static void saveData(std::ostream &os, UT_StringHolder s)
570  { UT_StringWrap(s).saveBinary(os); }
571  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
573  UT_OStringStream ostr;
574  if (s) s->save(ostr);
575  result = ostr.str();
576  saveData(os, result);
577  }
578  static void saveData(std::ostream &os, PRM_DataItemHandle s)
580  UT_OStringStream ostr;
581  if (s)
582  {
583  ostr << s->getDataTypeToken();
584  ostr << ":";
585  s->saveBinary(ostr);
586  }
587  result = ostr.str();
588  saveData(os, result);
589  }
590 
591 
592  void save(std::ostream &os) const
593  {
594  int32 v = version();
595  UTwrite(os, &v);
596  saveData(os, myGroup);
597  saveData(os, myUsepieceattrib);
598  saveData(os, myPieceattrib);
599  saveData(os, myAlgorithm);
600  saveData(os, myUseiter);
601  saveData(os, myIterations);
602  saveData(os, myTol);
603  saveData(os, myAllowpartialunsub);
604  saveData(os, myRepairmesh);
605  saveData(os, myStrategy);
606  saveData(os, myPreferuniform);
607  saveData(os, mySeed);
608  saveData(os, myUseconnectivityattribute);
609  saveData(os, myConnectivityattribute);
610  saveData(os, myConnectivitytol);
611  saveData(os, myUseoutputdepthattribute);
612  saveData(os, myOutputdepthattribute);
613 
614  }
615 
616  bool load(UT_IStream &is)
617  {
618  int32 v;
619  is.bread(&v, 1);
620  if (version() != v)
621  {
622  // Fail incompatible versions
623  return false;
624  }
625  loadData(is, myGroup);
626  loadData(is, myUsepieceattrib);
627  loadData(is, myPieceattrib);
628  loadData(is, myAlgorithm);
629  loadData(is, myUseiter);
630  loadData(is, myIterations);
631  loadData(is, myTol);
632  loadData(is, myAllowpartialunsub);
633  loadData(is, myRepairmesh);
634  loadData(is, myStrategy);
635  loadData(is, myPreferuniform);
636  loadData(is, mySeed);
637  loadData(is, myUseconnectivityattribute);
638  loadData(is, myConnectivityattribute);
639  loadData(is, myConnectivitytol);
640  loadData(is, myUseoutputdepthattribute);
641  loadData(is, myOutputdepthattribute);
642 
643  return true;
644  }
645 
646  const UT_StringHolder & getGroup() const { return myGroup; }
647  void setGroup(const UT_StringHolder & val) { myGroup = val; }
649  {
650  SOP_Node *thissop = cookparms.getNode();
651  if (!thissop) return getGroup();
653  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
654  return result;
655  }
656  bool getUsepieceattrib() const { return myUsepieceattrib; }
657  void setUsepieceattrib(bool val) { myUsepieceattrib = val; }
658  bool opUsepieceattrib(const SOP_NodeVerb::CookParms &cookparms) const
659  {
660  SOP_Node *thissop = cookparms.getNode();
661  if (!thissop) return getUsepieceattrib();
662  bool result;
663  OP_Utils::evalOpParm(result, thissop, "usepieceattrib", cookparms.getCookTime(), 0);
664  return result;
665  }
666  const UT_StringHolder & getPieceattrib() const { return myPieceattrib; }
667  void setPieceattrib(const UT_StringHolder & val) { myPieceattrib = val; }
669  {
670  SOP_Node *thissop = cookparms.getNode();
671  if (!thissop) return getPieceattrib();
673  OP_Utils::evalOpParm(result, thissop, "pieceattrib", cookparms.getCookTime(), 0);
674  return result;
675  }
676  Algorithm getAlgorithm() const { return Algorithm(myAlgorithm); }
677  void setAlgorithm(Algorithm val) { myAlgorithm = int64(val); }
679  {
680  SOP_Node *thissop = cookparms.getNode();
681  if (!thissop) return getAlgorithm();
682  int64 result;
683  OP_Utils::evalOpParm(result, thissop, "algorithm", cookparms.getCookTime(), 0);
684  return Algorithm(result);
685  }
686  bool getUseiter() const { return myUseiter; }
687  void setUseiter(bool val) { myUseiter = val; }
688  bool opUseiter(const SOP_NodeVerb::CookParms &cookparms) const
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getUseiter();
692  bool result;
693  OP_Utils::evalOpParm(result, thissop, "useiter", cookparms.getCookTime(), 0);
694  return result;
695  }
696  int64 getIterations() const { return myIterations; }
697  void setIterations(int64 val) { myIterations = val; }
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getIterations();
702  int64 result;
703  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
704  return result;
705  }
706  fpreal64 getTol() const { return myTol; }
707  void setTol(fpreal64 val) { myTol = val; }
708  fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getTol();
713  OP_Utils::evalOpParm(result, thissop, "tol", cookparms.getCookTime(), 0);
714  return result;
715  }
716  bool getAllowpartialunsub() const { return myAllowpartialunsub; }
717  void setAllowpartialunsub(bool val) { myAllowpartialunsub = val; }
718  bool opAllowpartialunsub(const SOP_NodeVerb::CookParms &cookparms) const
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getAllowpartialunsub();
722  bool result;
723  OP_Utils::evalOpParm(result, thissop, "allowpartialunsub", cookparms.getCookTime(), 0);
724  return result;
725  }
726  bool getRepairmesh() const { return myRepairmesh; }
727  void setRepairmesh(bool val) { myRepairmesh = val; }
728  bool opRepairmesh(const SOP_NodeVerb::CookParms &cookparms) const
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getRepairmesh();
732  bool result;
733  OP_Utils::evalOpParm(result, thissop, "repairmesh", cookparms.getCookTime(), 0);
734  return result;
735  }
736  Strategy getStrategy() const { return Strategy(myStrategy); }
737  void setStrategy(Strategy val) { myStrategy = int64(val); }
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getStrategy();
742  int64 result;
743  OP_Utils::evalOpParm(result, thissop, "strategy", cookparms.getCookTime(), 0);
744  return Strategy(result);
745  }
746  bool getPreferuniform() const { return myPreferuniform; }
747  void setPreferuniform(bool val) { myPreferuniform = val; }
748  bool opPreferuniform(const SOP_NodeVerb::CookParms &cookparms) const
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getPreferuniform();
752  bool result;
753  OP_Utils::evalOpParm(result, thissop, "preferuniform", cookparms.getCookTime(), 0);
754  return result;
755  }
756  int64 getSeed() const { return mySeed; }
757  void setSeed(int64 val) { mySeed = val; }
758  int64 opSeed(const SOP_NodeVerb::CookParms &cookparms) const
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getSeed();
762  int64 result;
763  OP_Utils::evalOpParm(result, thissop, "seed", cookparms.getCookTime(), 0);
764  return result;
765  }
766  bool getUseconnectivityattribute() const { return myUseconnectivityattribute; }
767  void setUseconnectivityattribute(bool val) { myUseconnectivityattribute = val; }
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getUseconnectivityattribute();
772  bool result;
773  OP_Utils::evalOpParm(result, thissop, "useconnectivityattribute", cookparms.getCookTime(), 0);
774  return result;
775  }
776  const UT_StringHolder & getConnectivityattribute() const { return myConnectivityattribute; }
777  void setConnectivityattribute(const UT_StringHolder & val) { myConnectivityattribute = val; }
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getConnectivityattribute();
783  OP_Utils::evalOpParm(result, thissop, "connectivityattribute", cookparms.getCookTime(), 0);
784  return result;
785  }
786  fpreal64 getConnectivitytol() const { return myConnectivitytol; }
787  void setConnectivitytol(fpreal64 val) { myConnectivitytol = val; }
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getConnectivitytol();
793  OP_Utils::evalOpParm(result, thissop, "connectivitytol", cookparms.getCookTime(), 0);
794  return result;
795  }
796  bool getUseoutputdepthattribute() const { return myUseoutputdepthattribute; }
797  void setUseoutputdepthattribute(bool val) { myUseoutputdepthattribute = val; }
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getUseoutputdepthattribute();
802  bool result;
803  OP_Utils::evalOpParm(result, thissop, "useoutputdepthattribute", cookparms.getCookTime(), 0);
804  return result;
805  }
806  const UT_StringHolder & getOutputdepthattribute() const { return myOutputdepthattribute; }
807  void setOutputdepthattribute(const UT_StringHolder & val) { myOutputdepthattribute = val; }
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return getOutputdepthattribute();
813  OP_Utils::evalOpParm(result, thissop, "outputdepthattribute", cookparms.getCookTime(), 0);
814  return result;
815  }
816 
817 private:
818  UT_StringHolder myGroup;
819  bool myUsepieceattrib;
820  UT_StringHolder myPieceattrib;
821  int64 myAlgorithm;
822  bool myUseiter;
823  int64 myIterations;
824  fpreal64 myTol;
825  bool myAllowpartialunsub;
826  bool myRepairmesh;
827  int64 myStrategy;
828  bool myPreferuniform;
829  int64 mySeed;
830  bool myUseconnectivityattribute;
831  UT_StringHolder myConnectivityattribute;
832  fpreal64 myConnectivitytol;
833  bool myUseoutputdepthattribute;
834  UT_StringHolder myOutputdepthattribute;
835 
836 };
static void saveData(std::ostream &os, UT_Matrix3D v)
const UT_StringHolder & getOutputdepthattribute() const
type
Definition: core.h:556
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setGroup(const UT_StringHolder &val)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void save(std::ostream &os) const
static void loadData(UT_IStream &is, fpreal64 &v)
bool opAllowpartialunsub(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void setStrategy(Strategy val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
Strategy getStrategy() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
bool opRepairmesh(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPieceattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setUseconnectivityattribute(bool val)
An output stream object that owns its own string buffer storage.
const UT_StringHolder & getGroup() const
**But if you need a result
Definition: thread.h:622
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setUsepieceattrib(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
bool opPreferuniform(const SOP_NodeVerb::CookParms &cookparms) const
void setTol(fpreal64 val)
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
bool getUseconnectivityattribute() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator!=(const SOP_UnsubdivideParms &src) const
void setOutputdepthattribute(const UT_StringHolder &val)
const UT_StringHolder & getConnectivityattribute() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
exint length() const
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const 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
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_StringHolder & getPieceattrib() const
static void saveData(std::ostream &os, fpreal64 v)
void setAlgorithm(Algorithm val)
bool opUseoutputdepthattribute(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opOutputdepthattribute(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
bool opUseconnectivityattribute(const SOP_NodeVerb::CookParms &cookparms) const
void setConnectivitytol(fpreal64 val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setPieceattrib(const UT_StringHolder &val)
UT_StringHolder opConnectivityattribute(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
void setConnectivityattribute(const UT_StringHolder &val)
bool load(UT_IStream &is)
long long int64
Definition: SYS_Types.h:116
fpreal64 opConnectivitytol(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getConnectivitytol() const
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
void setUseoutputdepthattribute(bool val)
static void saveData(std::ostream &os, bool v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opSeed(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
Algorithm getAlgorithm() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
fpreal64 fpreal
Definition: SYS_Types.h:278
static void loadData(UT_IStream &is, UT_Matrix2D &v)
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void setAllowpartialunsub(bool val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#define SOP_API
Definition: SOP_API.h:10
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool operator==(const SOP_UnsubdivideParms &src) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint getNestNumParms(TempIndex idx) const override
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
bool opUsepieceattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
bool getAllowpartialunsub() const
GLboolean r
Definition: glcorearb.h:1222
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool getUseoutputdepthattribute() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Strategy opStrategy(const SOP_NodeVerb::CookParms &cookparms) const
Algorithm opAlgorithm(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Algorithm enum_value)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool opUseiter(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663