HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_PolyCut.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 namespace SOP_PolyCutEnums
24 {
25  enum class Type
26  {
27  POINTS = 0,
28  EDGES
29  };
30 
32  getToken(Type enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case Type::POINTS: return "points"_sh;
37  case Type::EDGES: return "edges"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Strategy
43  {
44  REMOVE = 0,
45  CUT
46  };
47 
49  getToken(Strategy enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case Strategy::REMOVE: return "remove"_sh;
54  case Strategy::CUT: return "cut"_sh;
55  default: UT_ASSERT(false); return ""_sh;
56  }
57  }
58 
59  enum class DetectEdgeChanges
60  {
61  ATTRIBCROSSING = 0,
63  };
64 
67  {
68  using namespace UT::Literal;
69  switch (enum_value) {
70  case DetectEdgeChanges::ATTRIBCROSSING: return "attribcrossing"_sh;
71  case DetectEdgeChanges::ATTRIBCHANGE: return "attribchange"_sh;
72  default: UT_ASSERT(false); return ""_sh;
73  }
74  }
75 
76 }
77 
78 
80 {
81 public:
82  static int version() { return 1; }
83 
85  {
86  myPolygons = ""_UTsh;
87  myType = 0;
88  myCutPoints = ""_UTsh;
89  myCutEdges = ""_UTsh;
90  myStrategy = 0;
91  myDetectEdgeChanges = 0;
92  myCutAttrib = ""_UTsh;
93  myCutValue = 0;
94  myCutStringValue = ""_UTsh;
95  myCutThreshold = 1;
96  myKeepClosed = true;
97 
98  }
99 
100  explicit SOP_PolyCutParms(const SOP_PolyCutParms &) = default;
101  SOP_PolyCutParms &operator=(const SOP_PolyCutParms &) = default;
102  SOP_PolyCutParms(SOP_PolyCutParms &&) noexcept = default;
103  SOP_PolyCutParms &operator=(SOP_PolyCutParms &&) noexcept = default;
104 
105  ~SOP_PolyCutParms() override {}
106 
107  bool operator==(const SOP_PolyCutParms &src) const
108  {
109  if (myPolygons != src.myPolygons) return false;
110  if (myType != src.myType) return false;
111  if (myCutPoints != src.myCutPoints) return false;
112  if (myCutEdges != src.myCutEdges) return false;
113  if (myStrategy != src.myStrategy) return false;
114  if (myDetectEdgeChanges != src.myDetectEdgeChanges) return false;
115  if (myCutAttrib != src.myCutAttrib) return false;
116  if (myCutValue != src.myCutValue) return false;
117  if (myCutStringValue != src.myCutStringValue) return false;
118  if (myCutThreshold != src.myCutThreshold) return false;
119  if (myKeepClosed != src.myKeepClosed) return false;
120 
121  return true;
122  }
123  bool operator!=(const SOP_PolyCutParms &src) const
124  {
125  return !operator==(src);
126  }
130 
131 
132 
133  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
134  {
135  myPolygons = ""_UTsh;
136  if (true)
137  graph->evalOpParm(myPolygons, nodeidx, "polygons", time, 0);
138  myType = 0;
139  if (true)
140  graph->evalOpParm(myType, nodeidx, "type", time, 0);
141  myCutPoints = ""_UTsh;
142  if (true && ( (true&&!(((int64(getType())!=0)))) ) )
143  graph->evalOpParm(myCutPoints, nodeidx, "cutpoints", time, 0);
144  myCutEdges = ""_UTsh;
145  if (true && ( (true&&!(((int64(getType())!=1)))) ) )
146  graph->evalOpParm(myCutEdges, nodeidx, "cutedges", time, 0);
147  myStrategy = 0;
148  if (true)
149  graph->evalOpParm(myStrategy, nodeidx, "strategy", time, 0);
150  myDetectEdgeChanges = 0;
151  if (true)
152  graph->evalOpParm(myDetectEdgeChanges, nodeidx, "detectedgechanges", time, 0);
153  myCutAttrib = ""_UTsh;
154  if (true)
155  graph->evalOpParm(myCutAttrib, nodeidx, "cutattrib", time, 0);
156  myCutValue = 0;
157  if (true && ( (true&&!(((int64(getDetectEdgeChanges())!=0))||((getCutAttrib()=="")))) ) )
158  graph->evalOpParm(myCutValue, nodeidx, "cutvalue", time, 0);
159  myCutStringValue = ""_UTsh;
160  if (true && ( (true&&!(((int64(getDetectEdgeChanges())!=0))||((getCutAttrib()=="")))) ) )
161  graph->evalOpParm(myCutStringValue, nodeidx, "cutstringvalue", time, 0);
162  myCutThreshold = 1;
163  if (true && ( (true&&!(((int64(getDetectEdgeChanges())!=1))||((getCutAttrib()=="")))) ) )
164  graph->evalOpParm(myCutThreshold, nodeidx, "cutthreshold", time, 0);
165  myKeepClosed = true;
166  if (true)
167  graph->evalOpParm(myKeepClosed, nodeidx, "keepclosed", time, 0);
168 
169  }
170 
171 
172  void loadFromOpSubclass(const LoadParms &loadparms) override
173  {
174  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
175  }
176 
177 
178  void copyFrom(const OP_NodeParms *src) override
179  {
180  *this = *((const SOP_PolyCutParms *)src);
181  }
182 
183  template <typename T>
184  void
185  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
186  {
187  if (idx.size() < 1)
188  return;
189  UT_ASSERT(idx.size() == instance.size()+1);
190  if (idx.size() != instance.size()+1)
191  return;
192  switch (idx[0])
193  {
194  case 0:
195  coerceValue(value, myPolygons);
196  break;
197  case 1:
198  coerceValue(value, myType);
199  break;
200  case 2:
201  coerceValue(value, myCutPoints);
202  break;
203  case 3:
204  coerceValue(value, myCutEdges);
205  break;
206  case 4:
207  coerceValue(value, myStrategy);
208  break;
209  case 5:
210  coerceValue(value, myDetectEdgeChanges);
211  break;
212  case 6:
213  coerceValue(value, myCutAttrib);
214  break;
215  case 7:
216  coerceValue(value, myCutValue);
217  break;
218  case 8:
219  coerceValue(value, myCutStringValue);
220  break;
221  case 9:
222  coerceValue(value, myCutThreshold);
223  break;
224  case 10:
225  coerceValue(value, myKeepClosed);
226  break;
227 
228  }
229  }
230 
231  bool isParmColorRamp(exint idx) const override
232  {
233  switch (idx)
234  {
235 
236  }
237  return false;
238  }
239 
240  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
241  { doGetParmValue(idx, instance, value); }
242  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
243  { doGetParmValue(idx, instance, value); }
244  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
245  { doGetParmValue(idx, instance, value); }
246  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
247  { doGetParmValue(idx, instance, value); }
248  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
249  { doGetParmValue(idx, instance, value); }
250  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
251  { doGetParmValue(idx, instance, value); }
252  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
253  { doGetParmValue(idx, instance, value); }
254  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
255  { doGetParmValue(idx, instance, value); }
256  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
257  { doGetParmValue(idx, instance, value); }
258  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
259  { doGetParmValue(idx, instance, value); }
260  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
261  { doGetParmValue(idx, instance, value); }
262 
263  template <typename T>
264  void
265  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
266  {
267  if (idx.size() < 1)
268  return;
269  UT_ASSERT(idx.size() == instance.size()+1);
270  if (idx.size() != instance.size()+1)
271  return;
272  switch (idx[0])
273  {
274  case 0:
275  coerceValue(myPolygons, ( ( value ) ));
276  break;
277  case 1:
278  coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
279  break;
280  case 2:
281  coerceValue(myCutPoints, ( ( value ) ));
282  break;
283  case 3:
284  coerceValue(myCutEdges, ( ( value ) ));
285  break;
286  case 4:
287  coerceValue(myStrategy, clampMinValue(0, clampMaxValue(1, value ) ));
288  break;
289  case 5:
290  coerceValue(myDetectEdgeChanges, clampMinValue(0, clampMaxValue(1, value ) ));
291  break;
292  case 6:
293  coerceValue(myCutAttrib, ( ( value ) ));
294  break;
295  case 7:
296  coerceValue(myCutValue, ( ( value ) ));
297  break;
298  case 8:
299  coerceValue(myCutStringValue, ( ( value ) ));
300  break;
301  case 9:
302  coerceValue(myCutThreshold, ( ( value ) ));
303  break;
304  case 10:
305  coerceValue(myKeepClosed, ( ( value ) ));
306  break;
307 
308  }
309  }
310 
311  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
312  { doSetParmValue(idx, instance, value); }
313  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
314  { doSetParmValue(idx, instance, value); }
315  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
316  { doSetParmValue(idx, instance, value); }
317  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
318  { doSetParmValue(idx, instance, value); }
319  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
320  { doSetParmValue(idx, instance, value); }
321  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
322  { doSetParmValue(idx, instance, value); }
323  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
324  { doSetParmValue(idx, instance, value); }
325  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
326  { doSetParmValue(idx, instance, value); }
327  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
328  { doSetParmValue(idx, instance, value); }
329  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
330  { doSetParmValue(idx, instance, value); }
331  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
332  { doSetParmValue(idx, instance, value); }
333 
334  exint getNestNumParms(TempIndex idx) const override
335  {
336  if (idx.size() == 0)
337  return 11;
338  switch (idx[0])
339  {
340 
341  }
342  // Invalid
343  return 0;
344  }
345 
346  const char *getNestParmName(TempIndex fieldnum) const override
347  {
348  if (fieldnum.size() < 1)
349  return 0;
350  switch (fieldnum[0])
351  {
352  case 0:
353  return "polygons";
354  case 1:
355  return "type";
356  case 2:
357  return "cutpoints";
358  case 3:
359  return "cutedges";
360  case 4:
361  return "strategy";
362  case 5:
363  return "detectedgechanges";
364  case 6:
365  return "cutattrib";
366  case 7:
367  return "cutvalue";
368  case 8:
369  return "cutstringvalue";
370  case 9:
371  return "cutthreshold";
372  case 10:
373  return "keepclosed";
374 
375  }
376  return 0;
377  }
378 
379  ParmType getNestParmType(TempIndex fieldnum) const override
380  {
381  if (fieldnum.size() < 1)
382  return PARM_UNSUPPORTED;
383  switch (fieldnum[0])
384  {
385  case 0:
386  return PARM_STRING;
387  case 1:
388  return PARM_INTEGER;
389  case 2:
390  return PARM_STRING;
391  case 3:
392  return PARM_STRING;
393  case 4:
394  return PARM_INTEGER;
395  case 5:
396  return PARM_INTEGER;
397  case 6:
398  return PARM_STRING;
399  case 7:
400  return PARM_FLOAT;
401  case 8:
402  return PARM_STRING;
403  case 9:
404  return PARM_FLOAT;
405  case 10:
406  return PARM_INTEGER;
407 
408  }
409  return PARM_UNSUPPORTED;
410  }
411 
412  // Boiler plate to load individual types.
413  static void loadData(UT_IStream &is, int64 &v)
414  { is.bread(&v, 1); }
415  static void loadData(UT_IStream &is, bool &v)
416  { int64 iv; is.bread(&iv, 1); v = iv; }
417  static void loadData(UT_IStream &is, fpreal64 &v)
418  { is.bread<fpreal64>(&v, 1); }
419  static void loadData(UT_IStream &is, UT_Vector2D &v)
420  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
421  static void loadData(UT_IStream &is, UT_Vector3D &v)
422  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
423  is.bread<fpreal64>(&v.z(), 1); }
424  static void loadData(UT_IStream &is, UT_Vector4D &v)
425  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
426  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
427  static void loadData(UT_IStream &is, UT_Matrix2D &v)
428  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
429  static void loadData(UT_IStream &is, UT_Matrix3D &v)
430  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
431  static void loadData(UT_IStream &is, UT_Matrix4D &v)
432  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
433  static void loadData(UT_IStream &is, UT_Vector2I &v)
434  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
435  static void loadData(UT_IStream &is, UT_Vector3I &v)
436  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
437  is.bread<int64>(&v.z(), 1); }
438  static void loadData(UT_IStream &is, UT_Vector4I &v)
439  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
440  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
442  { is.bread(v); }
444  { UT_StringHolder rampdata;
445  loadData(is, rampdata);
446  if (rampdata.isstring())
447  {
448  v.reset(new UT_Ramp());
449  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
450  v->load(istr);
451  }
452  else v.reset();
453  }
456  loadData(is, data);
457  if (data.isstring())
458  {
459  // Find the data type.
460  const char *colon = UT_StringWrap(data).findChar(':');
461  if (colon)
462  {
463  int typelen = colon - data.buffer();
465  type.strncpy(data.buffer(), typelen);
466  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
467 
468  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
469  }
470  }
471  else v.reset();
472  }
473 
474  static void saveData(std::ostream &os, int64 v)
475  { UTwrite(os, &v); }
476  static void saveData(std::ostream &os, bool v)
477  { int64 iv = v; UTwrite(os, &iv); }
478  static void saveData(std::ostream &os, fpreal64 v)
479  { UTwrite<fpreal64>(os, &v); }
480  static void saveData(std::ostream &os, UT_Vector2D v)
481  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
482  static void saveData(std::ostream &os, UT_Vector3D v)
483  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
484  UTwrite<fpreal64>(os, &v.z()); }
485  static void saveData(std::ostream &os, UT_Vector4D v)
486  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
487  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
488  static void saveData(std::ostream &os, UT_Matrix2D v)
490  static void saveData(std::ostream &os, UT_Matrix3D v)
492  static void saveData(std::ostream &os, UT_Matrix4D v)
494  static void saveData(std::ostream &os, UT_StringHolder s)
495  { UT_StringWrap(s).saveBinary(os); }
496  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
498  UT_OStringStream ostr;
499  if (s) s->save(ostr);
500  result = ostr.str();
501  saveData(os, result);
502  }
503  static void saveData(std::ostream &os, PRM_DataItemHandle s)
505  UT_OStringStream ostr;
506  if (s)
507  {
508  ostr << s->getDataTypeToken();
509  ostr << ":";
510  s->saveBinary(ostr);
511  }
512  result = ostr.str();
513  saveData(os, result);
514  }
515 
516 
517  void save(std::ostream &os) const
518  {
519  int32 v = version();
520  UTwrite(os, &v);
521  saveData(os, myPolygons);
522  saveData(os, myType);
523  saveData(os, myCutPoints);
524  saveData(os, myCutEdges);
525  saveData(os, myStrategy);
526  saveData(os, myDetectEdgeChanges);
527  saveData(os, myCutAttrib);
528  saveData(os, myCutValue);
529  saveData(os, myCutStringValue);
530  saveData(os, myCutThreshold);
531  saveData(os, myKeepClosed);
532 
533  }
534 
535  bool load(UT_IStream &is)
536  {
537  int32 v;
538  is.bread(&v, 1);
539  if (version() != v)
540  {
541  // Fail incompatible versions
542  return false;
543  }
544  loadData(is, myPolygons);
545  loadData(is, myType);
546  loadData(is, myCutPoints);
547  loadData(is, myCutEdges);
548  loadData(is, myStrategy);
549  loadData(is, myDetectEdgeChanges);
550  loadData(is, myCutAttrib);
551  loadData(is, myCutValue);
552  loadData(is, myCutStringValue);
553  loadData(is, myCutThreshold);
554  loadData(is, myKeepClosed);
555 
556  return true;
557  }
558 
559  const UT_StringHolder & getPolygons() const { return myPolygons; }
560  void setPolygons(const UT_StringHolder & val) { myPolygons = val; }
562  {
563  SOP_Node *thissop = cookparms.getNode();
564  if (!thissop) return getPolygons();
566  OP_Utils::evalOpParm(result, thissop, "polygons", cookparms.getCookTime(), 0);
567  return result;
568  }
569  Type getType() const { return Type(myType); }
570  void setType(Type val) { myType = int64(val); }
571  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
572  {
573  SOP_Node *thissop = cookparms.getNode();
574  if (!thissop) return getType();
575  int64 result;
576  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
577  return Type(result);
578  }
579  const UT_StringHolder & getCutPoints() const { return myCutPoints; }
580  void setCutPoints(const UT_StringHolder & val) { myCutPoints = val; }
582  {
583  SOP_Node *thissop = cookparms.getNode();
584  if (!thissop) return getCutPoints();
586  OP_Utils::evalOpParm(result, thissop, "cutpoints", cookparms.getCookTime(), 0);
587  return result;
588  }
589  const UT_StringHolder & getCutEdges() const { return myCutEdges; }
590  void setCutEdges(const UT_StringHolder & val) { myCutEdges = val; }
592  {
593  SOP_Node *thissop = cookparms.getNode();
594  if (!thissop) return getCutEdges();
596  OP_Utils::evalOpParm(result, thissop, "cutedges", cookparms.getCookTime(), 0);
597  return result;
598  }
599  Strategy getStrategy() const { return Strategy(myStrategy); }
600  void setStrategy(Strategy val) { myStrategy = int64(val); }
602  {
603  SOP_Node *thissop = cookparms.getNode();
604  if (!thissop) return getStrategy();
605  int64 result;
606  OP_Utils::evalOpParm(result, thissop, "strategy", cookparms.getCookTime(), 0);
607  return Strategy(result);
608  }
609  DetectEdgeChanges getDetectEdgeChanges() const { return DetectEdgeChanges(myDetectEdgeChanges); }
610  void setDetectEdgeChanges(DetectEdgeChanges val) { myDetectEdgeChanges = int64(val); }
612  {
613  SOP_Node *thissop = cookparms.getNode();
614  if (!thissop) return getDetectEdgeChanges();
615  int64 result;
616  OP_Utils::evalOpParm(result, thissop, "detectedgechanges", cookparms.getCookTime(), 0);
617  return DetectEdgeChanges(result);
618  }
619  const UT_StringHolder & getCutAttrib() const { return myCutAttrib; }
620  void setCutAttrib(const UT_StringHolder & val) { myCutAttrib = val; }
622  {
623  SOP_Node *thissop = cookparms.getNode();
624  if (!thissop) return getCutAttrib();
626  OP_Utils::evalOpParm(result, thissop, "cutattrib", cookparms.getCookTime(), 0);
627  return result;
628  }
629  fpreal64 getCutValue() const { return myCutValue; }
630  void setCutValue(fpreal64 val) { myCutValue = val; }
632  {
633  SOP_Node *thissop = cookparms.getNode();
634  if (!thissop) return getCutValue();
636  OP_Utils::evalOpParm(result, thissop, "cutvalue", cookparms.getCookTime(), 0);
637  return result;
638  }
639  const UT_StringHolder & getCutStringValue() const { return myCutStringValue; }
640  void setCutStringValue(const UT_StringHolder & val) { myCutStringValue = val; }
642  {
643  SOP_Node *thissop = cookparms.getNode();
644  if (!thissop) return getCutStringValue();
646  OP_Utils::evalOpParm(result, thissop, "cutstringvalue", cookparms.getCookTime(), 0);
647  return result;
648  }
649  fpreal64 getCutThreshold() const { return myCutThreshold; }
650  void setCutThreshold(fpreal64 val) { myCutThreshold = val; }
652  {
653  SOP_Node *thissop = cookparms.getNode();
654  if (!thissop) return getCutThreshold();
656  OP_Utils::evalOpParm(result, thissop, "cutthreshold", cookparms.getCookTime(), 0);
657  return result;
658  }
659  bool getKeepClosed() const { return myKeepClosed; }
660  void setKeepClosed(bool val) { myKeepClosed = val; }
661  bool opKeepClosed(const SOP_NodeVerb::CookParms &cookparms) const
662  {
663  SOP_Node *thissop = cookparms.getNode();
664  if (!thissop) return getKeepClosed();
665  bool result;
666  OP_Utils::evalOpParm(result, thissop, "keepclosed", cookparms.getCookTime(), 0);
667  return result;
668  }
669 
670 private:
671  UT_StringHolder myPolygons;
672  int64 myType;
673  UT_StringHolder myCutPoints;
674  UT_StringHolder myCutEdges;
675  int64 myStrategy;
676  int64 myDetectEdgeChanges;
677  UT_StringHolder myCutAttrib;
678  fpreal64 myCutValue;
679  UT_StringHolder myCutStringValue;
680  fpreal64 myCutThreshold;
681  bool myKeepClosed;
682 
683 };
void setKeepClosed(bool val)
void setType(Type val)
const UT_StringHolder & getCutEdges() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setCutThreshold(fpreal64 val)
void setPolygons(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
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
static void loadData(UT_IStream &is, UT_StringHolder &v)
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, int64 &v)
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal64 opCutValue(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCutEdges(const SOP_NodeVerb::CookParms &cookparms) const
void setDetectEdgeChanges(DetectEdgeChanges val)
bool getKeepClosed() const
bool operator==(const SOP_PolyCutParms &src) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, fpreal64 v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
const UT_StringHolder & getPolygons() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
An output stream object that owns its own string buffer storage.
Strategy opStrategy(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
Definition: thread.h:613
Type getType() const
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setCutStringValue(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
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.
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
UT_StringHolder opCutPoints(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setStrategy(Strategy val)
bool operator!=(const SOP_PolyCutParms &src) const
void setCutEdges(const UT_StringHolder &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 getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
exint length() const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & getCutStringValue() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
DetectEdgeChanges opDetectEdgeChanges(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getCutAttrib() const
long long int64
Definition: SYS_Types.h:116
bool isParmColorRamp(exint idx) const override
bool opKeepClosed(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 UT_SharedPtr< UT_Ramp > &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, int64 v)
void setCutAttrib(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
fpreal64 fpreal
Definition: SYS_Types.h:277
void setCutValue(fpreal64 val)
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void loadData(UT_IStream &is, UT_Vector2D &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
UT_StringHolder opCutAttrib(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPolygons(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void saveData(std::ostream &os, UT_Vector3D v)
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal64 getCutValue() const
#define SOP_API
Definition: SOP_API.h:10
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setCutPoints(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_StringHolder opCutStringValue(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
GLboolean r
Definition: glcorearb.h:1222
fpreal64 opCutThreshold(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getCutPoints() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
fpreal64 getCutThreshold() const
static void saveData(std::ostream &os, bool v)
DetectEdgeChanges getDetectEdgeChanges() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
static void loadData(UT_IStream &is, UT_Vector4D &v)
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static int version()
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_Vector2I &v)
Strategy getStrategy() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663