HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Remesh.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myGroup = ""_UTsh;
32  myHard_edges = ""_UTsh;
33  myIterations = 1;
34  myRecompute_normals = false;
35  mySmoothing_level = 0;
36  myTarget_edge = 0.2;
37  myInput_pts_only = false;
38  myElement_sizing = 0;
39  myGradation = 0.25;
40  myDensity = 1;
41  myLimit_below = false;
42  myMin_edge_length = 1e-05;
43  myLimit_above = false;
44  myMax_edge_length = 10000;
45  myLfs_only = false;
46  myVisualize_lfs = false;
47  myLfs_ramp = UT_SharedPtr<UT_Ramp>(0);
48 
49  }
50 
51  explicit SOP_RemeshParms(const SOP_RemeshParms &) = default;
52  SOP_RemeshParms &operator=(const SOP_RemeshParms &) = default;
53  SOP_RemeshParms(SOP_RemeshParms &&) noexcept = default;
54  SOP_RemeshParms &operator=(SOP_RemeshParms &&) noexcept = default;
55 
56  ~SOP_RemeshParms() override {}
57 
58  bool operator==(const SOP_RemeshParms &src) const
59  {
60  if (myGroup != src.myGroup) return false;
61  if (myHard_edges != src.myHard_edges) return false;
62  if (myIterations != src.myIterations) return false;
63  if (myRecompute_normals != src.myRecompute_normals) return false;
64  if (mySmoothing_level != src.mySmoothing_level) return false;
65  if (myTarget_edge != src.myTarget_edge) return false;
66  if (myInput_pts_only != src.myInput_pts_only) return false;
67  if (myElement_sizing != src.myElement_sizing) return false;
68  if (myGradation != src.myGradation) return false;
69  if (myDensity != src.myDensity) return false;
70  if (myLimit_below != src.myLimit_below) return false;
71  if (myMin_edge_length != src.myMin_edge_length) return false;
72  if (myLimit_above != src.myLimit_above) return false;
73  if (myMax_edge_length != src.myMax_edge_length) return false;
74  if (myLfs_only != src.myLfs_only) return false;
75  if (myVisualize_lfs != src.myVisualize_lfs) return false;
76  if (myLfs_ramp != src.myLfs_ramp)
77  { if (!myLfs_ramp || !src.myLfs_ramp || !(*myLfs_ramp == *src.myLfs_ramp)) return false; }
78 
79  return true;
80  }
81  bool operator!=(const SOP_RemeshParms &src) const
82  {
83  return !operator==(src);
84  }
85 
86 
87 
88  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
89  {
90  myGroup = ""_UTsh;
91  if (true)
92  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
93  myHard_edges = ""_UTsh;
94  if (true)
95  graph->evalOpParm(myHard_edges, nodeidx, "hard_edges", time, 0);
96  myIterations = 1;
97  if (true)
98  graph->evalOpParm(myIterations, nodeidx, "iterations", time, 0);
99  myRecompute_normals = false;
100  if (true)
101  graph->evalOpParm(myRecompute_normals, nodeidx, "recompute_normals", time, 0);
102  mySmoothing_level = 0;
103  if (true)
104  graph->evalOpParm(mySmoothing_level, nodeidx, "smoothing_level", time, 0);
105  myTarget_edge = 0.2;
106  if (true)
107  graph->evalOpParm(myTarget_edge, nodeidx, "target_edge", time, 0);
108  myInput_pts_only = false;
109  if (true)
110  graph->evalOpParm(myInput_pts_only, nodeidx, "input_pts_only", time, 0);
111  myElement_sizing = 0;
112  if (true)
113  graph->evalOpParm(myElement_sizing, nodeidx, "element_sizing", time, 0);
114  myGradation = 0.25;
115  if (true)
116  graph->evalOpParm(myGradation, nodeidx, "gradation", time, 0);
117  myDensity = 1;
118  if (true)
119  graph->evalOpParm(myDensity, nodeidx, "density", time, 0);
120  myLimit_below = false;
121  if (true)
122  graph->evalOpParm(myLimit_below, nodeidx, "limit_below", time, 0);
123  myMin_edge_length = 1e-05;
124  if (true && ( (true&&!(((getLimit_below()==0)))) ) )
125  graph->evalOpParm(myMin_edge_length, nodeidx, "min_edge_length", time, 0);
126  myLimit_above = false;
127  if (true)
128  graph->evalOpParm(myLimit_above, nodeidx, "limit_above", time, 0);
129  myMax_edge_length = 10000;
130  if (true && ( (true&&!(((getLimit_above()==0)))) ) )
131  graph->evalOpParm(myMax_edge_length, nodeidx, "max_edge_length", time, 0);
132  myLfs_only = false;
133  if (true)
134  graph->evalOpParm(myLfs_only, nodeidx, "lfs_only", time, 0);
135  myVisualize_lfs = false;
136  if (true)
137  graph->evalOpParm(myVisualize_lfs, nodeidx, "visualize_lfs", time, 0);
138  myLfs_ramp = UT_SharedPtr<UT_Ramp>(0);
139  if (true && ( (true&&!(((getVisualize_lfs()==0)))) ) )
140  graph->evalOpParm(myLfs_ramp, nodeidx, "lfs_ramp", time, 0);
141 
142  }
143 
144 
145  void loadFromOpSubclass(const LoadParms &loadparms) override
146  {
147  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
148  }
149 
150 
151  void copyFrom(const OP_NodeParms *src) override
152  {
153  *this = *((const SOP_RemeshParms *)src);
154  }
155 
156  template <typename T>
157  void
158  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
159  {
160  if (idx.size() < 1)
161  return;
162  UT_ASSERT(idx.size() == instance.size()+1);
163  if (idx.size() != instance.size()+1)
164  return;
165  switch (idx[0])
166  {
167  case 0:
168  coerceValue(value, myGroup);
169  break;
170  case 1:
171  coerceValue(value, myHard_edges);
172  break;
173  case 2:
174  coerceValue(value, myIterations);
175  break;
176  case 3:
177  coerceValue(value, myRecompute_normals);
178  break;
179  case 4:
180  coerceValue(value, mySmoothing_level);
181  break;
182  case 5:
183  coerceValue(value, myTarget_edge);
184  break;
185  case 6:
186  coerceValue(value, myInput_pts_only);
187  break;
188  case 7:
189  coerceValue(value, myElement_sizing);
190  break;
191  case 8:
192  coerceValue(value, myGradation);
193  break;
194  case 9:
195  coerceValue(value, myDensity);
196  break;
197  case 10:
198  coerceValue(value, myLimit_below);
199  break;
200  case 11:
201  coerceValue(value, myMin_edge_length);
202  break;
203  case 12:
204  coerceValue(value, myLimit_above);
205  break;
206  case 13:
207  coerceValue(value, myMax_edge_length);
208  break;
209  case 14:
210  coerceValue(value, myLfs_only);
211  break;
212  case 15:
213  coerceValue(value, myVisualize_lfs);
214  break;
215  case 16:
216  coerceValue(value, myLfs_ramp);
217  break;
218 
219  }
220  }
221 
222  bool isParmColorRamp(exint idx) const override
223  {
224  switch (idx)
225  {
226  case 16:
227  return true;
228  }
229  return false;
230  }
231 
232  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
233  { doGetParmValue(idx, instance, value); }
234  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
235  { doGetParmValue(idx, instance, value); }
236  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
237  { doGetParmValue(idx, instance, value); }
238  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
239  { doGetParmValue(idx, instance, value); }
240  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
241  { doGetParmValue(idx, instance, value); }
242  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
243  { doGetParmValue(idx, instance, value); }
244  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
245  { doGetParmValue(idx, instance, value); }
246  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
247  { doGetParmValue(idx, instance, value); }
248  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
249  { doGetParmValue(idx, instance, value); }
250  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
251  { doGetParmValue(idx, instance, value); }
252  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
253  { doGetParmValue(idx, instance, value); }
254 
255  template <typename T>
256  void
257  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
258  {
259  if (idx.size() < 1)
260  return;
261  UT_ASSERT(idx.size() == instance.size()+1);
262  if (idx.size() != instance.size()+1)
263  return;
264  switch (idx[0])
265  {
266  case 0:
267  coerceValue(myGroup, ( ( value ) ));
268  break;
269  case 1:
270  coerceValue(myHard_edges, ( ( value ) ));
271  break;
272  case 2:
273  coerceValue(myIterations, clampMinValue(0, ( value ) ));
274  break;
275  case 3:
276  coerceValue(myRecompute_normals, ( ( value ) ));
277  break;
278  case 4:
279  coerceValue(mySmoothing_level, clampMinValue(0, ( value ) ));
280  break;
281  case 5:
282  coerceValue(myTarget_edge, clampMinValue(0.001, ( value ) ));
283  break;
284  case 6:
285  coerceValue(myInput_pts_only, ( ( value ) ));
286  break;
287  case 7:
288  coerceValue(myElement_sizing, ( ( value ) ));
289  break;
290  case 8:
291  coerceValue(myGradation, clampMinValue(0, clampMaxValue(1, value ) ));
292  break;
293  case 9:
294  coerceValue(myDensity, clampMinValue(0.001, ( value ) ));
295  break;
296  case 10:
297  coerceValue(myLimit_below, ( ( value ) ));
298  break;
299  case 11:
300  coerceValue(myMin_edge_length, ( ( value ) ));
301  break;
302  case 12:
303  coerceValue(myLimit_above, ( ( value ) ));
304  break;
305  case 13:
306  coerceValue(myMax_edge_length, ( ( value ) ));
307  break;
308  case 14:
309  coerceValue(myLfs_only, ( ( value ) ));
310  break;
311  case 15:
312  coerceValue(myVisualize_lfs, ( ( value ) ));
313  break;
314  case 16:
315  coerceValue(myLfs_ramp, clampMinValue(1, ( value ) ));
316  break;
317 
318  }
319  }
320 
321  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
322  { doSetParmValue(idx, instance, value); }
323  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
324  { doSetParmValue(idx, instance, value); }
325  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
326  { doSetParmValue(idx, instance, value); }
327  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
328  { doSetParmValue(idx, instance, value); }
329  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
330  { doSetParmValue(idx, instance, value); }
331  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
332  { doSetParmValue(idx, instance, value); }
333  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
334  { doSetParmValue(idx, instance, value); }
335  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
336  { doSetParmValue(idx, instance, value); }
337  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
338  { doSetParmValue(idx, instance, value); }
339  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
340  { doSetParmValue(idx, instance, value); }
341  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
342  { doSetParmValue(idx, instance, value); }
343 
344  exint getNestNumParms(TempIndex idx) const override
345  {
346  if (idx.size() == 0)
347  return 17;
348  switch (idx[0])
349  {
350 
351  }
352  // Invalid
353  return 0;
354  }
355 
356  const char *getNestParmName(TempIndex fieldnum) const override
357  {
358  if (fieldnum.size() < 1)
359  return 0;
360  switch (fieldnum[0])
361  {
362  case 0:
363  return "group";
364  case 1:
365  return "hard_edges";
366  case 2:
367  return "iterations";
368  case 3:
369  return "recompute_normals";
370  case 4:
371  return "smoothing_level";
372  case 5:
373  return "target_edge";
374  case 6:
375  return "input_pts_only";
376  case 7:
377  return "element_sizing";
378  case 8:
379  return "gradation";
380  case 9:
381  return "density";
382  case 10:
383  return "limit_below";
384  case 11:
385  return "min_edge_length";
386  case 12:
387  return "limit_above";
388  case 13:
389  return "max_edge_length";
390  case 14:
391  return "lfs_only";
392  case 15:
393  return "visualize_lfs";
394  case 16:
395  return "lfs_ramp";
396 
397  }
398  return 0;
399  }
400 
401  ParmType getNestParmType(TempIndex fieldnum) const override
402  {
403  if (fieldnum.size() < 1)
404  return PARM_UNSUPPORTED;
405  switch (fieldnum[0])
406  {
407  case 0:
408  return PARM_STRING;
409  case 1:
410  return PARM_STRING;
411  case 2:
412  return PARM_INTEGER;
413  case 3:
414  return PARM_INTEGER;
415  case 4:
416  return PARM_FLOAT;
417  case 5:
418  return PARM_FLOAT;
419  case 6:
420  return PARM_INTEGER;
421  case 7:
422  return PARM_INTEGER;
423  case 8:
424  return PARM_FLOAT;
425  case 9:
426  return PARM_FLOAT;
427  case 10:
428  return PARM_INTEGER;
429  case 11:
430  return PARM_FLOAT;
431  case 12:
432  return PARM_INTEGER;
433  case 13:
434  return PARM_FLOAT;
435  case 14:
436  return PARM_INTEGER;
437  case 15:
438  return PARM_INTEGER;
439  case 16:
440  return PARM_RAMP;
441 
442  }
443  return PARM_UNSUPPORTED;
444  }
445 
446  // Boiler plate to load individual types.
447  static void loadData(UT_IStream &is, int64 &v)
448  { is.bread(&v, 1); }
449  static void loadData(UT_IStream &is, bool &v)
450  { int64 iv; is.bread(&iv, 1); v = iv; }
451  static void loadData(UT_IStream &is, fpreal64 &v)
452  { is.bread<fpreal64>(&v, 1); }
453  static void loadData(UT_IStream &is, UT_Vector2D &v)
454  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
455  static void loadData(UT_IStream &is, UT_Vector3D &v)
456  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
457  is.bread<fpreal64>(&v.z(), 1); }
458  static void loadData(UT_IStream &is, UT_Vector4D &v)
459  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
460  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
461  static void loadData(UT_IStream &is, UT_Matrix2D &v)
462  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
463  static void loadData(UT_IStream &is, UT_Matrix3D &v)
464  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
465  static void loadData(UT_IStream &is, UT_Matrix4D &v)
466  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
467  static void loadData(UT_IStream &is, UT_Vector2I &v)
468  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
469  static void loadData(UT_IStream &is, UT_Vector3I &v)
470  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
471  is.bread<int64>(&v.z(), 1); }
472  static void loadData(UT_IStream &is, UT_Vector4I &v)
473  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
474  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
476  { is.bread(v); }
478  { UT_StringHolder rampdata;
479  loadData(is, rampdata);
480  if (rampdata.isstring())
481  {
482  v.reset(new UT_Ramp());
483  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
484  v->load(istr);
485  }
486  else v.reset();
487  }
490  loadData(is, data);
491  if (data.isstring())
492  {
493  // Find the data type.
494  const char *colon = UT_StringWrap(data).findChar(':');
495  if (colon)
496  {
497  int typelen = colon - data.buffer();
499  type.strncpy(data.buffer(), typelen);
500  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
501 
502  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
503  }
504  }
505  else v.reset();
506  }
507 
508  static void saveData(std::ostream &os, int64 v)
509  { UTwrite(os, &v); }
510  static void saveData(std::ostream &os, bool v)
511  { int64 iv = v; UTwrite(os, &iv); }
512  static void saveData(std::ostream &os, fpreal64 v)
513  { UTwrite<fpreal64>(os, &v); }
514  static void saveData(std::ostream &os, UT_Vector2D v)
515  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
516  static void saveData(std::ostream &os, UT_Vector3D v)
517  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
518  UTwrite<fpreal64>(os, &v.z()); }
519  static void saveData(std::ostream &os, UT_Vector4D v)
520  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
521  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
522  static void saveData(std::ostream &os, UT_Matrix2D v)
524  static void saveData(std::ostream &os, UT_Matrix3D v)
526  static void saveData(std::ostream &os, UT_Matrix4D v)
528  static void saveData(std::ostream &os, UT_StringHolder s)
529  { UT_StringWrap(s).saveBinary(os); }
530  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
532  UT_OStringStream ostr;
533  if (s) s->save(ostr);
534  result = ostr.str();
535  saveData(os, result);
536  }
537  static void saveData(std::ostream &os, PRM_DataItemHandle s)
539  UT_OStringStream ostr;
540  if (s)
541  {
542  ostr << s->getDataTypeToken();
543  ostr << ":";
544  s->saveBinary(ostr);
545  }
546  result = ostr.str();
547  saveData(os, result);
548  }
549 
550 
551  void save(std::ostream &os) const
552  {
553  int32 v = version();
554  UTwrite(os, &v);
555  saveData(os, myGroup);
556  saveData(os, myHard_edges);
557  saveData(os, myIterations);
558  saveData(os, myRecompute_normals);
559  saveData(os, mySmoothing_level);
560  saveData(os, myTarget_edge);
561  saveData(os, myInput_pts_only);
562  saveData(os, myElement_sizing);
563  saveData(os, myGradation);
564  saveData(os, myDensity);
565  saveData(os, myLimit_below);
566  saveData(os, myMin_edge_length);
567  saveData(os, myLimit_above);
568  saveData(os, myMax_edge_length);
569  saveData(os, myLfs_only);
570  saveData(os, myVisualize_lfs);
571  saveData(os, myLfs_ramp);
572 
573  }
574 
575  bool load(UT_IStream &is)
576  {
577  int32 v;
578  is.bread(&v, 1);
579  if (version() != v)
580  {
581  // Fail incompatible versions
582  return false;
583  }
584  loadData(is, myGroup);
585  loadData(is, myHard_edges);
586  loadData(is, myIterations);
587  loadData(is, myRecompute_normals);
588  loadData(is, mySmoothing_level);
589  loadData(is, myTarget_edge);
590  loadData(is, myInput_pts_only);
591  loadData(is, myElement_sizing);
592  loadData(is, myGradation);
593  loadData(is, myDensity);
594  loadData(is, myLimit_below);
595  loadData(is, myMin_edge_length);
596  loadData(is, myLimit_above);
597  loadData(is, myMax_edge_length);
598  loadData(is, myLfs_only);
599  loadData(is, myVisualize_lfs);
600  loadData(is, myLfs_ramp);
601 
602  return true;
603  }
604 
605  const UT_StringHolder & getGroup() const { return myGroup; }
606  void setGroup(const UT_StringHolder & val) { myGroup = val; }
608  {
609  SOP_Node *thissop = cookparms.getNode();
610  if (!thissop) return getGroup();
612  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
613  return result;
614  }
615  const UT_StringHolder & getHard_edges() const { return myHard_edges; }
616  void setHard_edges(const UT_StringHolder & val) { myHard_edges = val; }
618  {
619  SOP_Node *thissop = cookparms.getNode();
620  if (!thissop) return getHard_edges();
622  OP_Utils::evalOpParm(result, thissop, "hard_edges", cookparms.getCookTime(), 0);
623  return result;
624  }
625  int64 getIterations() const { return myIterations; }
626  void setIterations(int64 val) { myIterations = val; }
628  {
629  SOP_Node *thissop = cookparms.getNode();
630  if (!thissop) return getIterations();
631  int64 result;
632  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
633  return result;
634  }
635  bool getRecompute_normals() const { return myRecompute_normals; }
636  void setRecompute_normals(bool val) { myRecompute_normals = val; }
637  bool opRecompute_normals(const SOP_NodeVerb::CookParms &cookparms) const
638  {
639  SOP_Node *thissop = cookparms.getNode();
640  if (!thissop) return getRecompute_normals();
641  bool result;
642  OP_Utils::evalOpParm(result, thissop, "recompute_normals", cookparms.getCookTime(), 0);
643  return result;
644  }
645  fpreal64 getSmoothing_level() const { return mySmoothing_level; }
646  void setSmoothing_level(fpreal64 val) { mySmoothing_level = val; }
648  {
649  SOP_Node *thissop = cookparms.getNode();
650  if (!thissop) return getSmoothing_level();
652  OP_Utils::evalOpParm(result, thissop, "smoothing_level", cookparms.getCookTime(), 0);
653  return result;
654  }
655  fpreal64 getTarget_edge() const { return myTarget_edge; }
656  void setTarget_edge(fpreal64 val) { myTarget_edge = val; }
658  {
659  SOP_Node *thissop = cookparms.getNode();
660  if (!thissop) return getTarget_edge();
662  OP_Utils::evalOpParm(result, thissop, "target_edge", cookparms.getCookTime(), 0);
663  return result;
664  }
665  bool getInput_pts_only() const { return myInput_pts_only; }
666  void setInput_pts_only(bool val) { myInput_pts_only = val; }
667  bool opInput_pts_only(const SOP_NodeVerb::CookParms &cookparms) const
668  {
669  SOP_Node *thissop = cookparms.getNode();
670  if (!thissop) return getInput_pts_only();
671  bool result;
672  OP_Utils::evalOpParm(result, thissop, "input_pts_only", cookparms.getCookTime(), 0);
673  return result;
674  }
675  int64 getElement_sizing() const { return myElement_sizing; }
676  void setElement_sizing(int64 val) { myElement_sizing = val; }
678  {
679  SOP_Node *thissop = cookparms.getNode();
680  if (!thissop) return getElement_sizing();
681  int64 result;
682  OP_Utils::evalOpParm(result, thissop, "element_sizing", cookparms.getCookTime(), 0);
683  return result;
684  }
685  fpreal64 getGradation() const { return myGradation; }
686  void setGradation(fpreal64 val) { myGradation = val; }
688  {
689  SOP_Node *thissop = cookparms.getNode();
690  if (!thissop) return getGradation();
692  OP_Utils::evalOpParm(result, thissop, "gradation", cookparms.getCookTime(), 0);
693  return result;
694  }
695  fpreal64 getDensity() const { return myDensity; }
696  void setDensity(fpreal64 val) { myDensity = val; }
698  {
699  SOP_Node *thissop = cookparms.getNode();
700  if (!thissop) return getDensity();
702  OP_Utils::evalOpParm(result, thissop, "density", cookparms.getCookTime(), 0);
703  return result;
704  }
705  bool getLimit_below() const { return myLimit_below; }
706  void setLimit_below(bool val) { myLimit_below = val; }
707  bool opLimit_below(const SOP_NodeVerb::CookParms &cookparms) const
708  {
709  SOP_Node *thissop = cookparms.getNode();
710  if (!thissop) return getLimit_below();
711  bool result;
712  OP_Utils::evalOpParm(result, thissop, "limit_below", cookparms.getCookTime(), 0);
713  return result;
714  }
715  fpreal64 getMin_edge_length() const { return myMin_edge_length; }
716  void setMin_edge_length(fpreal64 val) { myMin_edge_length = val; }
718  {
719  SOP_Node *thissop = cookparms.getNode();
720  if (!thissop) return getMin_edge_length();
722  OP_Utils::evalOpParm(result, thissop, "min_edge_length", cookparms.getCookTime(), 0);
723  return result;
724  }
725  bool getLimit_above() const { return myLimit_above; }
726  void setLimit_above(bool val) { myLimit_above = val; }
727  bool opLimit_above(const SOP_NodeVerb::CookParms &cookparms) const
728  {
729  SOP_Node *thissop = cookparms.getNode();
730  if (!thissop) return getLimit_above();
731  bool result;
732  OP_Utils::evalOpParm(result, thissop, "limit_above", cookparms.getCookTime(), 0);
733  return result;
734  }
735  fpreal64 getMax_edge_length() const { return myMax_edge_length; }
736  void setMax_edge_length(fpreal64 val) { myMax_edge_length = val; }
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return getMax_edge_length();
742  OP_Utils::evalOpParm(result, thissop, "max_edge_length", cookparms.getCookTime(), 0);
743  return result;
744  }
745  bool getLfs_only() const { return myLfs_only; }
746  void setLfs_only(bool val) { myLfs_only = val; }
747  bool opLfs_only(const SOP_NodeVerb::CookParms &cookparms) const
748  {
749  SOP_Node *thissop = cookparms.getNode();
750  if (!thissop) return getLfs_only();
751  bool result;
752  OP_Utils::evalOpParm(result, thissop, "lfs_only", cookparms.getCookTime(), 0);
753  return result;
754  }
755  bool getVisualize_lfs() const { return myVisualize_lfs; }
756  void setVisualize_lfs(bool val) { myVisualize_lfs = val; }
757  bool opVisualize_lfs(const SOP_NodeVerb::CookParms &cookparms) const
758  {
759  SOP_Node *thissop = cookparms.getNode();
760  if (!thissop) return getVisualize_lfs();
761  bool result;
762  OP_Utils::evalOpParm(result, thissop, "visualize_lfs", cookparms.getCookTime(), 0);
763  return result;
764  }
765  UT_SharedPtr<UT_Ramp> getLfs_ramp() const { return myLfs_ramp; }
766  void setLfs_ramp(UT_SharedPtr<UT_Ramp> val) { myLfs_ramp = val; }
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return getLfs_ramp();
772  OP_Utils::evalOpParm(result, thissop, "lfs_ramp", cookparms.getCookTime(), 0);
773  return result;
774  }
775 
776 private:
777  UT_StringHolder myGroup;
778  UT_StringHolder myHard_edges;
779  int64 myIterations;
780  bool myRecompute_normals;
781  fpreal64 mySmoothing_level;
782  fpreal64 myTarget_edge;
783  bool myInput_pts_only;
784  int64 myElement_sizing;
785  fpreal64 myGradation;
786  fpreal64 myDensity;
787  bool myLimit_below;
788  fpreal64 myMin_edge_length;
789  bool myLimit_above;
790  fpreal64 myMax_edge_length;
791  bool myLfs_only;
792  bool myVisualize_lfs;
793  UT_SharedPtr<UT_Ramp> myLfs_ramp;
794 
795 };
void setRecompute_normals(bool val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool getRecompute_normals() const
fpreal64 opSmoothing_level(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setLimit_above(bool val)
int64 getIterations() const
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opVisualize_lfs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
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:62
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setElement_sizing(int64 val)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
fpreal64 getGradation() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setLimit_below(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
bool isParmColorRamp(exint idx) const override
bool operator==(const SOP_RemeshParms &src) const
An output stream object that owns its own string buffer storage.
**But if you need a result
Definition: thread.h:613
void setVisualize_lfs(bool val)
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
int64 getElement_sizing() const
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void save(std::ostream &os) const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool opLimit_above(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opHard_edges(const SOP_NodeVerb::CookParms &cookparms) const
void setMax_edge_length(fpreal64 val)
double fpreal64
Definition: SYS_Types.h:201
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
void setHard_edges(const UT_StringHolder &val)
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, int64 &v)
void setSmoothing_level(fpreal64 val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
fpreal64 getTarget_edge() const
void setGradation(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
bool getLimit_above() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void setIterations(int64 val)
fpreal64 getDensity() const
fpreal64 getMin_edge_length() const
void setGroup(const UT_StringHolder &val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
UT_SharedPtr< UT_Ramp > getLfs_ramp() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setLfs_only(bool val)
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_StringHolder s)
const UT_StringHolder & getGroup() const
long long int64
Definition: SYS_Types.h:116
static void saveData(std::ostream &os, fpreal64 v)
int64 opElement_sizing(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setLfs_ramp(UT_SharedPtr< UT_Ramp > val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 opMin_edge_length(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
fpreal64 getMax_edge_length() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
fpreal64 opGradation(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool opLimit_below(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
bool opLfs_only(const SOP_NodeVerb::CookParms &cookparms) const
void setTarget_edge(fpreal64 val)
fpreal64 opDensity(const SOP_NodeVerb::CookParms &cookparms) const
bool getInput_pts_only() const
static void saveData(std::ostream &os, UT_Vector2D v)
fpreal64 fpreal
Definition: SYS_Types.h:277
void setDensity(fpreal64 val)
fpreal64 opMax_edge_length(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void setMin_edge_length(fpreal64 val)
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 opTarget_edge(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setInput_pts_only(bool val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void saveData(std::ostream &os, UT_Matrix4D v)
#define SOP_API
Definition: SOP_API.h:10
bool getVisualize_lfs() const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
bool operator!=(const SOP_RemeshParms &src) const
static void saveData(std::ostream &os, UT_Vector3D v)
bool getLfs_only() const
static int version()
UT_SharedPtr< UT_Ramp > opLfs_ramp(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, bool &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
const UT_StringHolder & getHard_edges() const
Definition: core.h:1131
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool getLimit_below() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
exint getNestNumParms(TempIndex idx) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
bool opInput_pts_only(const SOP_NodeVerb::CookParms &cookparms) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
static void loadData(UT_IStream &is, UT_Vector2D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool opRecompute_normals(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getSmoothing_level() const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void copyFrom(const OP_NodeParms *src) override