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 <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 
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_Ramp::buildFromDefault("1pos ( 0 ) 1c ( 0 0 1 ) 1interp ( linear ) 2pos ( 1 ) 2c ( 1 0 0 ) 2interp ( linear )");
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 
80  if (baseGetSignature() != src.baseGetSignature()) return false;
81 
82  return true;
83  }
84  bool operator!=(const SOP_RemeshParms &src) const
85  {
86  return !operator==(src);
87  }
88 
89 
90 
91  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
92  {
93  myGroup = ""_UTsh;
94  if (true)
95  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
96  myHard_edges = ""_UTsh;
97  if (true)
98  graph->evalOpParm(myHard_edges, nodeidx, "hard_edges", time, graph->isDirect()?nullptr:depnode);
99  myIterations = 1;
100  if (true)
101  graph->evalOpParm(myIterations, nodeidx, "iterations", time, graph->isDirect()?nullptr:depnode);
102  myRecompute_normals = false;
103  if (true)
104  graph->evalOpParm(myRecompute_normals, nodeidx, "recompute_normals", time, graph->isDirect()?nullptr:depnode);
105  mySmoothing_level = 0;
106  if (true)
107  graph->evalOpParm(mySmoothing_level, nodeidx, "smoothing_level", time, graph->isDirect()?nullptr:depnode);
108  myTarget_edge = 0.2;
109  if (true)
110  graph->evalOpParm(myTarget_edge, nodeidx, "target_edge", time, graph->isDirect()?nullptr:depnode);
111  myInput_pts_only = false;
112  if (true)
113  graph->evalOpParm(myInput_pts_only, nodeidx, "input_pts_only", time, graph->isDirect()?nullptr:depnode);
114  myElement_sizing = 0;
115  if (true)
116  graph->evalOpParm(myElement_sizing, nodeidx, "element_sizing", time, graph->isDirect()?nullptr:depnode);
117  myGradation = 0.25;
118  if (true)
119  graph->evalOpParm(myGradation, nodeidx, "gradation", time, graph->isDirect()?nullptr:depnode);
120  myDensity = 1;
121  if (true)
122  graph->evalOpParm(myDensity, nodeidx, "density", time, graph->isDirect()?nullptr:depnode);
123  myLimit_below = false;
124  if (true)
125  graph->evalOpParm(myLimit_below, nodeidx, "limit_below", time, graph->isDirect()?nullptr:depnode);
126  myMin_edge_length = 1e-05;
127  if (true && ( (true&&!(((getLimit_below()==0)))) ) )
128  graph->evalOpParm(myMin_edge_length, nodeidx, "min_edge_length", time, graph->isDirect()?nullptr:depnode);
129  myLimit_above = false;
130  if (true)
131  graph->evalOpParm(myLimit_above, nodeidx, "limit_above", time, graph->isDirect()?nullptr:depnode);
132  myMax_edge_length = 10000;
133  if (true && ( (true&&!(((getLimit_above()==0)))) ) )
134  graph->evalOpParm(myMax_edge_length, nodeidx, "max_edge_length", time, graph->isDirect()?nullptr:depnode);
135  myLfs_only = false;
136  if (true)
137  graph->evalOpParm(myLfs_only, nodeidx, "lfs_only", time, graph->isDirect()?nullptr:depnode);
138  myVisualize_lfs = false;
139  if (true)
140  graph->evalOpParm(myVisualize_lfs, nodeidx, "visualize_lfs", time, graph->isDirect()?nullptr:depnode);
141  myLfs_ramp = UT_Ramp::buildFromDefault("1pos ( 0 ) 1c ( 0 0 1 ) 1interp ( linear ) 2pos ( 1 ) 2c ( 1 0 0 ) 2interp ( linear )");
142  if (true && ( (true&&!(((getVisualize_lfs()==0)))) ) )
143  graph->evalOpParm(myLfs_ramp, nodeidx, "lfs_ramp", time, graph->isDirect()?nullptr:depnode);
144 
145  }
146 
147 
148  void loadFromOpSubclass(const LoadParms &loadparms) override
149  {
150  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
151  }
152 
153 
154  void copyFrom(const OP_NodeParms *src) override
155  {
156  *this = *((const SOP_RemeshParms *)src);
157  }
158 
159  template <typename T>
160  void
161  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
162  {
163  if (idx.size() < 1)
164  return;
165  UT_ASSERT(idx.size() == instance.size()+1);
166  if (idx.size() != instance.size()+1)
167  return;
168  switch (idx[0])
169  {
170  case 0:
171  coerceValue(value, myGroup);
172  break;
173  case 1:
174  coerceValue(value, myHard_edges);
175  break;
176  case 2:
177  coerceValue(value, myIterations);
178  break;
179  case 3:
180  coerceValue(value, myRecompute_normals);
181  break;
182  case 4:
183  coerceValue(value, mySmoothing_level);
184  break;
185  case 5:
186  coerceValue(value, myTarget_edge);
187  break;
188  case 6:
189  coerceValue(value, myInput_pts_only);
190  break;
191  case 7:
192  coerceValue(value, myElement_sizing);
193  break;
194  case 8:
195  coerceValue(value, myGradation);
196  break;
197  case 9:
198  coerceValue(value, myDensity);
199  break;
200  case 10:
201  coerceValue(value, myLimit_below);
202  break;
203  case 11:
204  coerceValue(value, myMin_edge_length);
205  break;
206  case 12:
207  coerceValue(value, myLimit_above);
208  break;
209  case 13:
210  coerceValue(value, myMax_edge_length);
211  break;
212  case 14:
213  coerceValue(value, myLfs_only);
214  break;
215  case 15:
216  coerceValue(value, myVisualize_lfs);
217  break;
218  case 16:
219  coerceValue(value, myLfs_ramp);
220  break;
221 
222  }
223  }
224 
225  bool isParmColorRamp(exint idx) const override
226  {
227  switch (idx)
228  {
229  case 16:
230  return true;
231  }
232  return false;
233  }
234 
235  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
236  { doGetParmValue(idx, instance, value); }
237  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
238  { doGetParmValue(idx, instance, value); }
239  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
240  { doGetParmValue(idx, instance, value); }
241  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
242  { doGetParmValue(idx, instance, value); }
243  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
244  { doGetParmValue(idx, instance, value); }
245  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
246  { doGetParmValue(idx, instance, value); }
247  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
248  { doGetParmValue(idx, instance, value); }
249  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
250  { doGetParmValue(idx, instance, value); }
251  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
252  { doGetParmValue(idx, instance, value); }
253  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
254  { doGetParmValue(idx, instance, value); }
255  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
256  { doGetParmValue(idx, instance, value); }
257 
258  template <typename T>
259  void
260  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
261  {
262  if (idx.size() < 1)
263  return;
264  UT_ASSERT(idx.size() == instance.size()+1);
265  if (idx.size() != instance.size()+1)
266  return;
267  switch (idx[0])
268  {
269  case 0:
270  coerceValue(myGroup, ( ( value ) ));
271  break;
272  case 1:
273  coerceValue(myHard_edges, ( ( value ) ));
274  break;
275  case 2:
276  coerceValue(myIterations, clampMinValue(0, ( value ) ));
277  break;
278  case 3:
279  coerceValue(myRecompute_normals, ( ( value ) ));
280  break;
281  case 4:
282  coerceValue(mySmoothing_level, clampMinValue(0, ( value ) ));
283  break;
284  case 5:
285  coerceValue(myTarget_edge, clampMinValue(0.001, ( value ) ));
286  break;
287  case 6:
288  coerceValue(myInput_pts_only, ( ( value ) ));
289  break;
290  case 7:
291  coerceValue(myElement_sizing, ( ( value ) ));
292  break;
293  case 8:
294  coerceValue(myGradation, clampMinValue(0, clampMaxValue(1, value ) ));
295  break;
296  case 9:
297  coerceValue(myDensity, clampMinValue(0.001, ( value ) ));
298  break;
299  case 10:
300  coerceValue(myLimit_below, ( ( value ) ));
301  break;
302  case 11:
303  coerceValue(myMin_edge_length, ( ( value ) ));
304  break;
305  case 12:
306  coerceValue(myLimit_above, ( ( value ) ));
307  break;
308  case 13:
309  coerceValue(myMax_edge_length, ( ( value ) ));
310  break;
311  case 14:
312  coerceValue(myLfs_only, ( ( value ) ));
313  break;
314  case 15:
315  coerceValue(myVisualize_lfs, ( ( value ) ));
316  break;
317  case 16:
318  coerceValue(myLfs_ramp, clampMinValue(1, ( value ) ));
319  break;
320 
321  }
322  }
323 
324  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
325  { doSetParmValue(idx, instance, value); }
326  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
329  { doSetParmValue(idx, instance, value); }
330  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
335  { doSetParmValue(idx, instance, value); }
336  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
337  { doSetParmValue(idx, instance, value); }
338  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
339  { doSetParmValue(idx, instance, value); }
340  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
341  { doSetParmValue(idx, instance, value); }
342  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
343  { doSetParmValue(idx, instance, value); }
344  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
345  { doSetParmValue(idx, instance, value); }
346 
347  exint getNestNumParms(TempIndex idx) const override
348  {
349  if (idx.size() == 0)
350  return 17;
351  switch (idx[0])
352  {
353 
354  }
355  // Invalid
356  return 0;
357  }
358 
359  const char *getNestParmName(TempIndex fieldnum) const override
360  {
361  if (fieldnum.size() < 1)
362  return 0;
363  switch (fieldnum[0])
364  {
365  case 0:
366  return "group";
367  case 1:
368  return "hard_edges";
369  case 2:
370  return "iterations";
371  case 3:
372  return "recompute_normals";
373  case 4:
374  return "smoothing_level";
375  case 5:
376  return "target_edge";
377  case 6:
378  return "input_pts_only";
379  case 7:
380  return "element_sizing";
381  case 8:
382  return "gradation";
383  case 9:
384  return "density";
385  case 10:
386  return "limit_below";
387  case 11:
388  return "min_edge_length";
389  case 12:
390  return "limit_above";
391  case 13:
392  return "max_edge_length";
393  case 14:
394  return "lfs_only";
395  case 15:
396  return "visualize_lfs";
397  case 16:
398  return "lfs_ramp";
399 
400  }
401  return 0;
402  }
403 
404  ParmType getNestParmType(TempIndex fieldnum) const override
405  {
406  if (fieldnum.size() < 1)
407  return PARM_UNSUPPORTED;
408  switch (fieldnum[0])
409  {
410  case 0:
411  return PARM_STRING;
412  case 1:
413  return PARM_STRING;
414  case 2:
415  return PARM_INTEGER;
416  case 3:
417  return PARM_INTEGER;
418  case 4:
419  return PARM_FLOAT;
420  case 5:
421  return PARM_FLOAT;
422  case 6:
423  return PARM_INTEGER;
424  case 7:
425  return PARM_INTEGER;
426  case 8:
427  return PARM_FLOAT;
428  case 9:
429  return PARM_FLOAT;
430  case 10:
431  return PARM_INTEGER;
432  case 11:
433  return PARM_FLOAT;
434  case 12:
435  return PARM_INTEGER;
436  case 13:
437  return PARM_FLOAT;
438  case 14:
439  return PARM_INTEGER;
440  case 15:
441  return PARM_INTEGER;
442  case 16:
443  return PARM_RAMP;
444 
445  }
446  return PARM_UNSUPPORTED;
447  }
448 
449  // Boiler plate to load individual types.
450  static void loadData(UT_IStream &is, int64 &v)
451  { is.bread(&v, 1); }
452  static void loadData(UT_IStream &is, bool &v)
453  { int64 iv; is.bread(&iv, 1); v = iv; }
454  static void loadData(UT_IStream &is, fpreal64 &v)
455  { is.bread<fpreal64>(&v, 1); }
456  static void loadData(UT_IStream &is, UT_Vector2D &v)
457  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
458  static void loadData(UT_IStream &is, UT_Vector3D &v)
459  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
460  is.bread<fpreal64>(&v.z(), 1); }
461  static void loadData(UT_IStream &is, UT_Vector4D &v)
462  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
463  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
464  static void loadData(UT_IStream &is, UT_Matrix2D &v)
465  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
466  static void loadData(UT_IStream &is, UT_Matrix3D &v)
467  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
468  static void loadData(UT_IStream &is, UT_Matrix4D &v)
469  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
470  static void loadData(UT_IStream &is, UT_Vector2I &v)
471  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
472  static void loadData(UT_IStream &is, UT_Vector3I &v)
473  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
474  is.bread<int64>(&v.z(), 1); }
475  static void loadData(UT_IStream &is, UT_Vector4I &v)
476  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
477  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
479  { is.bread(v); }
481  { UT_StringHolder rampdata;
482  loadData(is, rampdata);
483  if (rampdata.isstring())
484  {
485  v.reset(new UT_Ramp());
486  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
487  v->load(istr);
488  }
489  else v.reset();
490  }
493  loadData(is, data);
494  if (data.isstring())
495  {
496  // Find the data type.
497  const char *colon = UT_StringWrap(data).findChar(':');
498  if (colon)
499  {
500  int typelen = colon - data.buffer();
502  type.strncpy(data.buffer(), typelen);
503  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
504 
505  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
506  }
507  }
508  else v.reset();
509  }
510 
511  static void saveData(std::ostream &os, int64 v)
512  { UTwrite(os, &v); }
513  static void saveData(std::ostream &os, bool v)
514  { int64 iv = v; UTwrite(os, &iv); }
515  static void saveData(std::ostream &os, fpreal64 v)
516  { UTwrite<fpreal64>(os, &v); }
517  static void saveData(std::ostream &os, UT_Vector2D v)
518  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
519  static void saveData(std::ostream &os, UT_Vector3D v)
520  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
521  UTwrite<fpreal64>(os, &v.z()); }
522  static void saveData(std::ostream &os, UT_Vector4D v)
523  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
524  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
525  static void saveData(std::ostream &os, UT_Matrix2D v)
527  static void saveData(std::ostream &os, UT_Matrix3D v)
529  static void saveData(std::ostream &os, UT_Matrix4D v)
531  static void saveData(std::ostream &os, UT_StringHolder s)
532  { UT_StringWrap(s).saveBinary(os); }
533  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
535  UT_OStringStream ostr;
536  if (s) s->save(ostr);
537  result = ostr.str();
538  saveData(os, result);
539  }
540  static void saveData(std::ostream &os, PRM_DataItemHandle s)
542  UT_OStringStream ostr;
543  if (s)
544  {
545  ostr << s->getDataTypeToken();
546  ostr << ":";
547  s->saveBinary(ostr);
548  }
549  result = ostr.str();
550  saveData(os, result);
551  }
552 
553 
554  void save(std::ostream &os) const
555  {
556  int32 v = version();
557  UTwrite(os, &v);
558  saveData(os, myGroup);
559  saveData(os, myHard_edges);
560  saveData(os, myIterations);
561  saveData(os, myRecompute_normals);
562  saveData(os, mySmoothing_level);
563  saveData(os, myTarget_edge);
564  saveData(os, myInput_pts_only);
565  saveData(os, myElement_sizing);
566  saveData(os, myGradation);
567  saveData(os, myDensity);
568  saveData(os, myLimit_below);
569  saveData(os, myMin_edge_length);
570  saveData(os, myLimit_above);
571  saveData(os, myMax_edge_length);
572  saveData(os, myLfs_only);
573  saveData(os, myVisualize_lfs);
574  saveData(os, myLfs_ramp);
575 
576  }
577 
578  bool load(UT_IStream &is)
579  {
580  int32 v;
581  is.bread(&v, 1);
582  if (version() != v)
583  {
584  // Fail incompatible versions
585  return false;
586  }
587  loadData(is, myGroup);
588  loadData(is, myHard_edges);
589  loadData(is, myIterations);
590  loadData(is, myRecompute_normals);
591  loadData(is, mySmoothing_level);
592  loadData(is, myTarget_edge);
593  loadData(is, myInput_pts_only);
594  loadData(is, myElement_sizing);
595  loadData(is, myGradation);
596  loadData(is, myDensity);
597  loadData(is, myLimit_below);
598  loadData(is, myMin_edge_length);
599  loadData(is, myLimit_above);
600  loadData(is, myMax_edge_length);
601  loadData(is, myLfs_only);
602  loadData(is, myVisualize_lfs);
603  loadData(is, myLfs_ramp);
604 
605  return true;
606  }
607 
608  const UT_StringHolder & getGroup() const { return myGroup; }
609  void setGroup(const UT_StringHolder & val) { myGroup = val; }
611  {
612  SOP_Node *thissop = cookparms.getNode();
613  if (!thissop) return getGroup();
615  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
616  return result;
617  }
618  const UT_StringHolder & getHard_edges() const { return myHard_edges; }
619  void setHard_edges(const UT_StringHolder & val) { myHard_edges = val; }
621  {
622  SOP_Node *thissop = cookparms.getNode();
623  if (!thissop) return getHard_edges();
625  OP_Utils::evalOpParm(result, thissop, "hard_edges", cookparms.getCookTime(), 0);
626  return result;
627  }
628  int64 getIterations() const { return myIterations; }
629  void setIterations(int64 val) { myIterations = val; }
631  {
632  SOP_Node *thissop = cookparms.getNode();
633  if (!thissop) return getIterations();
634  int64 result;
635  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
636  return result;
637  }
638  bool getRecompute_normals() const { return myRecompute_normals; }
639  void setRecompute_normals(bool val) { myRecompute_normals = val; }
640  bool opRecompute_normals(const SOP_NodeVerb::CookParms &cookparms) const
641  {
642  SOP_Node *thissop = cookparms.getNode();
643  if (!thissop) return getRecompute_normals();
644  bool result;
645  OP_Utils::evalOpParm(result, thissop, "recompute_normals", cookparms.getCookTime(), 0);
646  return result;
647  }
648  fpreal64 getSmoothing_level() const { return mySmoothing_level; }
649  void setSmoothing_level(fpreal64 val) { mySmoothing_level = val; }
651  {
652  SOP_Node *thissop = cookparms.getNode();
653  if (!thissop) return getSmoothing_level();
655  OP_Utils::evalOpParm(result, thissop, "smoothing_level", cookparms.getCookTime(), 0);
656  return result;
657  }
658  fpreal64 getTarget_edge() const { return myTarget_edge; }
659  void setTarget_edge(fpreal64 val) { myTarget_edge = val; }
661  {
662  SOP_Node *thissop = cookparms.getNode();
663  if (!thissop) return getTarget_edge();
665  OP_Utils::evalOpParm(result, thissop, "target_edge", cookparms.getCookTime(), 0);
666  return result;
667  }
668  bool getInput_pts_only() const { return myInput_pts_only; }
669  void setInput_pts_only(bool val) { myInput_pts_only = val; }
670  bool opInput_pts_only(const SOP_NodeVerb::CookParms &cookparms) const
671  {
672  SOP_Node *thissop = cookparms.getNode();
673  if (!thissop) return getInput_pts_only();
674  bool result;
675  OP_Utils::evalOpParm(result, thissop, "input_pts_only", cookparms.getCookTime(), 0);
676  return result;
677  }
678  int64 getElement_sizing() const { return myElement_sizing; }
679  void setElement_sizing(int64 val) { myElement_sizing = val; }
681  {
682  SOP_Node *thissop = cookparms.getNode();
683  if (!thissop) return getElement_sizing();
684  int64 result;
685  OP_Utils::evalOpParm(result, thissop, "element_sizing", cookparms.getCookTime(), 0);
686  return result;
687  }
688  fpreal64 getGradation() const { return myGradation; }
689  void setGradation(fpreal64 val) { myGradation = val; }
691  {
692  SOP_Node *thissop = cookparms.getNode();
693  if (!thissop) return getGradation();
695  OP_Utils::evalOpParm(result, thissop, "gradation", cookparms.getCookTime(), 0);
696  return result;
697  }
698  fpreal64 getDensity() const { return myDensity; }
699  void setDensity(fpreal64 val) { myDensity = val; }
701  {
702  SOP_Node *thissop = cookparms.getNode();
703  if (!thissop) return getDensity();
705  OP_Utils::evalOpParm(result, thissop, "density", cookparms.getCookTime(), 0);
706  return result;
707  }
708  bool getLimit_below() const { return myLimit_below; }
709  void setLimit_below(bool val) { myLimit_below = val; }
710  bool opLimit_below(const SOP_NodeVerb::CookParms &cookparms) const
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return getLimit_below();
714  bool result;
715  OP_Utils::evalOpParm(result, thissop, "limit_below", cookparms.getCookTime(), 0);
716  return result;
717  }
718  fpreal64 getMin_edge_length() const { return myMin_edge_length; }
719  void setMin_edge_length(fpreal64 val) { myMin_edge_length = val; }
721  {
722  SOP_Node *thissop = cookparms.getNode();
723  if (!thissop) return getMin_edge_length();
725  OP_Utils::evalOpParm(result, thissop, "min_edge_length", cookparms.getCookTime(), 0);
726  return result;
727  }
728  bool getLimit_above() const { return myLimit_above; }
729  void setLimit_above(bool val) { myLimit_above = val; }
730  bool opLimit_above(const SOP_NodeVerb::CookParms &cookparms) const
731  {
732  SOP_Node *thissop = cookparms.getNode();
733  if (!thissop) return getLimit_above();
734  bool result;
735  OP_Utils::evalOpParm(result, thissop, "limit_above", cookparms.getCookTime(), 0);
736  return result;
737  }
738  fpreal64 getMax_edge_length() const { return myMax_edge_length; }
739  void setMax_edge_length(fpreal64 val) { myMax_edge_length = val; }
741  {
742  SOP_Node *thissop = cookparms.getNode();
743  if (!thissop) return getMax_edge_length();
745  OP_Utils::evalOpParm(result, thissop, "max_edge_length", cookparms.getCookTime(), 0);
746  return result;
747  }
748  bool getLfs_only() const { return myLfs_only; }
749  void setLfs_only(bool val) { myLfs_only = val; }
750  bool opLfs_only(const SOP_NodeVerb::CookParms &cookparms) const
751  {
752  SOP_Node *thissop = cookparms.getNode();
753  if (!thissop) return getLfs_only();
754  bool result;
755  OP_Utils::evalOpParm(result, thissop, "lfs_only", cookparms.getCookTime(), 0);
756  return result;
757  }
758  bool getVisualize_lfs() const { return myVisualize_lfs; }
759  void setVisualize_lfs(bool val) { myVisualize_lfs = val; }
760  bool opVisualize_lfs(const SOP_NodeVerb::CookParms &cookparms) const
761  {
762  SOP_Node *thissop = cookparms.getNode();
763  if (!thissop) return getVisualize_lfs();
764  bool result;
765  OP_Utils::evalOpParm(result, thissop, "visualize_lfs", cookparms.getCookTime(), 0);
766  return result;
767  }
768  UT_SharedPtr<UT_Ramp> getLfs_ramp() const { return myLfs_ramp; }
769  void setLfs_ramp(UT_SharedPtr<UT_Ramp> val) { myLfs_ramp = val; }
771  {
772  SOP_Node *thissop = cookparms.getNode();
773  if (!thissop) return getLfs_ramp();
775  OP_Utils::evalOpParm(result, thissop, "lfs_ramp", cookparms.getCookTime(), 0);
776  return result;
777  }
778 
779 private:
780  UT_StringHolder myGroup;
781  UT_StringHolder myHard_edges;
782  int64 myIterations;
783  bool myRecompute_normals;
784  fpreal64 mySmoothing_level;
785  fpreal64 myTarget_edge;
786  bool myInput_pts_only;
787  int64 myElement_sizing;
788  fpreal64 myGradation;
789  fpreal64 myDensity;
790  bool myLimit_below;
791  fpreal64 myMin_edge_length;
792  bool myLimit_above;
793  fpreal64 myMax_edge_length;
794  bool myLfs_only;
795  bool myVisualize_lfs;
796  UT_SharedPtr<UT_Ramp> myLfs_ramp;
797 
798 };
void setRecompute_normals(bool val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
type
Definition: core.h:556
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)
static UT_SharedPtr< UT_Ramp > buildFromDefault(const char *def)
Returns a ramp constructed from the canonical default strings.
int64 getIterations() const
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:324
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:63
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
void setVisualize_lfs(bool val)
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:317
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
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
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:303
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:310
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
const UT_StringHolder & getHard_edges() const
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
static void loadData(UT_IStream &is, UT_Matrix4D &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, UT_Vector4D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
exint getNestNumParms(TempIndex idx) const override
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