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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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 
122  if (baseGetSignature() != src.baseGetSignature()) return false;
123 
124  return true;
125  }
126  bool operator!=(const SOP_PolyCutParms &src) const
127  {
128  return !operator==(src);
129  }
133 
134 
135 
136  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
137  {
138  myPolygons = ""_UTsh;
139  if (true)
140  graph->evalOpParm(myPolygons, nodeidx, "polygons", time, graph->isDirect()?nullptr:depnode);
141  myType = 0;
142  if (true)
143  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
144  myCutPoints = ""_UTsh;
145  if (true && ( (true&&!(((int64(getType())!=0)))) ) )
146  graph->evalOpParm(myCutPoints, nodeidx, "cutpoints", time, graph->isDirect()?nullptr:depnode);
147  myCutEdges = ""_UTsh;
148  if (true && ( (true&&!(((int64(getType())!=1)))) ) )
149  graph->evalOpParm(myCutEdges, nodeidx, "cutedges", time, graph->isDirect()?nullptr:depnode);
150  myStrategy = 0;
151  if (true)
152  graph->evalOpParm(myStrategy, nodeidx, "strategy", time, graph->isDirect()?nullptr:depnode);
153  myDetectEdgeChanges = 0;
154  if (true)
155  graph->evalOpParm(myDetectEdgeChanges, nodeidx, "detectedgechanges", time, graph->isDirect()?nullptr:depnode);
156  myCutAttrib = ""_UTsh;
157  if (true)
158  graph->evalOpParm(myCutAttrib, nodeidx, "cutattrib", time, graph->isDirect()?nullptr:depnode);
159  myCutValue = 0;
160  if (true && ( (true&&!(((int64(getDetectEdgeChanges())!=0))||((getCutAttrib()=="")))) ) )
161  graph->evalOpParm(myCutValue, nodeidx, "cutvalue", time, graph->isDirect()?nullptr:depnode);
162  myCutStringValue = ""_UTsh;
163  if (true && ( (true&&!(((int64(getDetectEdgeChanges())!=0))||((getCutAttrib()=="")))) ) )
164  graph->evalOpParm(myCutStringValue, nodeidx, "cutstringvalue", time, graph->isDirect()?nullptr:depnode);
165  myCutThreshold = 1;
166  if (true && ( (true&&!(((int64(getDetectEdgeChanges())!=1))||((getCutAttrib()=="")))) ) )
167  graph->evalOpParm(myCutThreshold, nodeidx, "cutthreshold", time, graph->isDirect()?nullptr:depnode);
168  myKeepClosed = true;
169  if (true)
170  graph->evalOpParm(myKeepClosed, nodeidx, "keepclosed", time, graph->isDirect()?nullptr:depnode);
171 
172  }
173 
174 
175  void loadFromOpSubclass(const LoadParms &loadparms) override
176  {
177  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
178  }
179 
180 
181  void copyFrom(const OP_NodeParms *src) override
182  {
183  *this = *((const SOP_PolyCutParms *)src);
184  }
185 
186  template <typename T>
187  void
188  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
189  {
190  if (idx.size() < 1)
191  return;
192  UT_ASSERT(idx.size() == instance.size()+1);
193  if (idx.size() != instance.size()+1)
194  return;
195  switch (idx[0])
196  {
197  case 0:
198  coerceValue(value, myPolygons);
199  break;
200  case 1:
201  coerceValue(value, myType);
202  break;
203  case 2:
204  coerceValue(value, myCutPoints);
205  break;
206  case 3:
207  coerceValue(value, myCutEdges);
208  break;
209  case 4:
210  coerceValue(value, myStrategy);
211  break;
212  case 5:
213  coerceValue(value, myDetectEdgeChanges);
214  break;
215  case 6:
216  coerceValue(value, myCutAttrib);
217  break;
218  case 7:
219  coerceValue(value, myCutValue);
220  break;
221  case 8:
222  coerceValue(value, myCutStringValue);
223  break;
224  case 9:
225  coerceValue(value, myCutThreshold);
226  break;
227  case 10:
228  coerceValue(value, myKeepClosed);
229  break;
230 
231  }
232  }
233 
234  bool isParmColorRamp(exint idx) const override
235  {
236  switch (idx)
237  {
238 
239  }
240  return false;
241  }
242 
243  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
244  { doGetParmValue(idx, instance, value); }
245  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
246  { doGetParmValue(idx, instance, value); }
247  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
248  { doGetParmValue(idx, instance, value); }
249  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
250  { doGetParmValue(idx, instance, value); }
251  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
252  { doGetParmValue(idx, instance, value); }
253  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
254  { doGetParmValue(idx, instance, value); }
255  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
256  { doGetParmValue(idx, instance, value); }
257  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
258  { doGetParmValue(idx, instance, value); }
259  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
260  { doGetParmValue(idx, instance, value); }
261  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
262  { doGetParmValue(idx, instance, value); }
263  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
264  { doGetParmValue(idx, instance, value); }
265 
266  template <typename T>
267  void
268  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
269  {
270  if (idx.size() < 1)
271  return;
272  UT_ASSERT(idx.size() == instance.size()+1);
273  if (idx.size() != instance.size()+1)
274  return;
275  switch (idx[0])
276  {
277  case 0:
278  coerceValue(myPolygons, ( ( value ) ));
279  break;
280  case 1:
281  coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
282  break;
283  case 2:
284  coerceValue(myCutPoints, ( ( value ) ));
285  break;
286  case 3:
287  coerceValue(myCutEdges, ( ( value ) ));
288  break;
289  case 4:
290  coerceValue(myStrategy, clampMinValue(0, clampMaxValue(1, value ) ));
291  break;
292  case 5:
293  coerceValue(myDetectEdgeChanges, clampMinValue(0, clampMaxValue(1, value ) ));
294  break;
295  case 6:
296  coerceValue(myCutAttrib, ( ( value ) ));
297  break;
298  case 7:
299  coerceValue(myCutValue, ( ( value ) ));
300  break;
301  case 8:
302  coerceValue(myCutStringValue, ( ( value ) ));
303  break;
304  case 9:
305  coerceValue(myCutThreshold, ( ( value ) ));
306  break;
307  case 10:
308  coerceValue(myKeepClosed, ( ( value ) ));
309  break;
310 
311  }
312  }
313 
314  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
315  { doSetParmValue(idx, instance, value); }
316  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
317  { doSetParmValue(idx, instance, value); }
318  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
319  { doSetParmValue(idx, instance, value); }
320  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
321  { doSetParmValue(idx, instance, value); }
322  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
323  { doSetParmValue(idx, instance, value); }
324  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
325  { doSetParmValue(idx, instance, value); }
326  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
329  { doSetParmValue(idx, instance, value); }
330  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
335  { doSetParmValue(idx, instance, value); }
336 
337  exint getNestNumParms(TempIndex idx) const override
338  {
339  if (idx.size() == 0)
340  return 11;
341  switch (idx[0])
342  {
343 
344  }
345  // Invalid
346  return 0;
347  }
348 
349  const char *getNestParmName(TempIndex fieldnum) const override
350  {
351  if (fieldnum.size() < 1)
352  return 0;
353  switch (fieldnum[0])
354  {
355  case 0:
356  return "polygons";
357  case 1:
358  return "type";
359  case 2:
360  return "cutpoints";
361  case 3:
362  return "cutedges";
363  case 4:
364  return "strategy";
365  case 5:
366  return "detectedgechanges";
367  case 6:
368  return "cutattrib";
369  case 7:
370  return "cutvalue";
371  case 8:
372  return "cutstringvalue";
373  case 9:
374  return "cutthreshold";
375  case 10:
376  return "keepclosed";
377 
378  }
379  return 0;
380  }
381 
382  ParmType getNestParmType(TempIndex fieldnum) const override
383  {
384  if (fieldnum.size() < 1)
385  return PARM_UNSUPPORTED;
386  switch (fieldnum[0])
387  {
388  case 0:
389  return PARM_STRING;
390  case 1:
391  return PARM_INTEGER;
392  case 2:
393  return PARM_STRING;
394  case 3:
395  return PARM_STRING;
396  case 4:
397  return PARM_INTEGER;
398  case 5:
399  return PARM_INTEGER;
400  case 6:
401  return PARM_STRING;
402  case 7:
403  return PARM_FLOAT;
404  case 8:
405  return PARM_STRING;
406  case 9:
407  return PARM_FLOAT;
408  case 10:
409  return PARM_INTEGER;
410 
411  }
412  return PARM_UNSUPPORTED;
413  }
414 
415  // Boiler plate to load individual types.
416  static void loadData(UT_IStream &is, int64 &v)
417  { is.bread(&v, 1); }
418  static void loadData(UT_IStream &is, bool &v)
419  { int64 iv; is.bread(&iv, 1); v = iv; }
420  static void loadData(UT_IStream &is, fpreal64 &v)
421  { is.bread<fpreal64>(&v, 1); }
422  static void loadData(UT_IStream &is, UT_Vector2D &v)
423  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
424  static void loadData(UT_IStream &is, UT_Vector3D &v)
425  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
426  is.bread<fpreal64>(&v.z(), 1); }
427  static void loadData(UT_IStream &is, UT_Vector4D &v)
428  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
429  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
430  static void loadData(UT_IStream &is, UT_Matrix2D &v)
431  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
432  static void loadData(UT_IStream &is, UT_Matrix3D &v)
433  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
434  static void loadData(UT_IStream &is, UT_Matrix4D &v)
435  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
436  static void loadData(UT_IStream &is, UT_Vector2I &v)
437  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
438  static void loadData(UT_IStream &is, UT_Vector3I &v)
439  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
440  is.bread<int64>(&v.z(), 1); }
441  static void loadData(UT_IStream &is, UT_Vector4I &v)
442  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
443  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
445  { is.bread(v); }
447  { UT_StringHolder rampdata;
448  loadData(is, rampdata);
449  if (rampdata.isstring())
450  {
451  v.reset(new UT_Ramp());
452  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
453  v->load(istr);
454  }
455  else v.reset();
456  }
459  loadData(is, data);
460  if (data.isstring())
461  {
462  // Find the data type.
463  const char *colon = UT_StringWrap(data).findChar(':');
464  if (colon)
465  {
466  int typelen = colon - data.buffer();
468  type.strncpy(data.buffer(), typelen);
469  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
470 
471  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
472  }
473  }
474  else v.reset();
475  }
476 
477  static void saveData(std::ostream &os, int64 v)
478  { UTwrite(os, &v); }
479  static void saveData(std::ostream &os, bool v)
480  { int64 iv = v; UTwrite(os, &iv); }
481  static void saveData(std::ostream &os, fpreal64 v)
482  { UTwrite<fpreal64>(os, &v); }
483  static void saveData(std::ostream &os, UT_Vector2D v)
484  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
485  static void saveData(std::ostream &os, UT_Vector3D v)
486  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
487  UTwrite<fpreal64>(os, &v.z()); }
488  static void saveData(std::ostream &os, UT_Vector4D v)
489  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
490  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
491  static void saveData(std::ostream &os, UT_Matrix2D v)
493  static void saveData(std::ostream &os, UT_Matrix3D v)
495  static void saveData(std::ostream &os, UT_Matrix4D v)
497  static void saveData(std::ostream &os, UT_StringHolder s)
498  { UT_StringWrap(s).saveBinary(os); }
499  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
501  UT_OStringStream ostr;
502  if (s) s->save(ostr);
503  result = ostr.str();
504  saveData(os, result);
505  }
506  static void saveData(std::ostream &os, PRM_DataItemHandle s)
508  UT_OStringStream ostr;
509  if (s)
510  {
511  ostr << s->getDataTypeToken();
512  ostr << ":";
513  s->saveBinary(ostr);
514  }
515  result = ostr.str();
516  saveData(os, result);
517  }
518 
519 
520  void save(std::ostream &os) const
521  {
522  int32 v = version();
523  UTwrite(os, &v);
524  saveData(os, myPolygons);
525  saveData(os, myType);
526  saveData(os, myCutPoints);
527  saveData(os, myCutEdges);
528  saveData(os, myStrategy);
529  saveData(os, myDetectEdgeChanges);
530  saveData(os, myCutAttrib);
531  saveData(os, myCutValue);
532  saveData(os, myCutStringValue);
533  saveData(os, myCutThreshold);
534  saveData(os, myKeepClosed);
535 
536  }
537 
538  bool load(UT_IStream &is)
539  {
540  int32 v;
541  is.bread(&v, 1);
542  if (version() != v)
543  {
544  // Fail incompatible versions
545  return false;
546  }
547  loadData(is, myPolygons);
548  loadData(is, myType);
549  loadData(is, myCutPoints);
550  loadData(is, myCutEdges);
551  loadData(is, myStrategy);
552  loadData(is, myDetectEdgeChanges);
553  loadData(is, myCutAttrib);
554  loadData(is, myCutValue);
555  loadData(is, myCutStringValue);
556  loadData(is, myCutThreshold);
557  loadData(is, myKeepClosed);
558 
559  return true;
560  }
561 
562  const UT_StringHolder & getPolygons() const { return myPolygons; }
563  void setPolygons(const UT_StringHolder & val) { myPolygons = val; }
565  {
566  SOP_Node *thissop = cookparms.getNode();
567  if (!thissop) return getPolygons();
569  OP_Utils::evalOpParm(result, thissop, "polygons", cookparms.getCookTime(), 0);
570  return result;
571  }
572  Type getType() const { return Type(myType); }
573  void setType(Type val) { myType = int64(val); }
574  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
575  {
576  SOP_Node *thissop = cookparms.getNode();
577  if (!thissop) return getType();
578  int64 result;
579  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
580  return Type(result);
581  }
582  const UT_StringHolder & getCutPoints() const { return myCutPoints; }
583  void setCutPoints(const UT_StringHolder & val) { myCutPoints = val; }
585  {
586  SOP_Node *thissop = cookparms.getNode();
587  if (!thissop) return getCutPoints();
589  OP_Utils::evalOpParm(result, thissop, "cutpoints", cookparms.getCookTime(), 0);
590  return result;
591  }
592  const UT_StringHolder & getCutEdges() const { return myCutEdges; }
593  void setCutEdges(const UT_StringHolder & val) { myCutEdges = val; }
595  {
596  SOP_Node *thissop = cookparms.getNode();
597  if (!thissop) return getCutEdges();
599  OP_Utils::evalOpParm(result, thissop, "cutedges", cookparms.getCookTime(), 0);
600  return result;
601  }
602  Strategy getStrategy() const { return Strategy(myStrategy); }
603  void setStrategy(Strategy val) { myStrategy = int64(val); }
605  {
606  SOP_Node *thissop = cookparms.getNode();
607  if (!thissop) return getStrategy();
608  int64 result;
609  OP_Utils::evalOpParm(result, thissop, "strategy", cookparms.getCookTime(), 0);
610  return Strategy(result);
611  }
612  DetectEdgeChanges getDetectEdgeChanges() const { return DetectEdgeChanges(myDetectEdgeChanges); }
613  void setDetectEdgeChanges(DetectEdgeChanges val) { myDetectEdgeChanges = int64(val); }
615  {
616  SOP_Node *thissop = cookparms.getNode();
617  if (!thissop) return getDetectEdgeChanges();
618  int64 result;
619  OP_Utils::evalOpParm(result, thissop, "detectedgechanges", cookparms.getCookTime(), 0);
620  return DetectEdgeChanges(result);
621  }
622  const UT_StringHolder & getCutAttrib() const { return myCutAttrib; }
623  void setCutAttrib(const UT_StringHolder & val) { myCutAttrib = val; }
625  {
626  SOP_Node *thissop = cookparms.getNode();
627  if (!thissop) return getCutAttrib();
629  OP_Utils::evalOpParm(result, thissop, "cutattrib", cookparms.getCookTime(), 0);
630  return result;
631  }
632  fpreal64 getCutValue() const { return myCutValue; }
633  void setCutValue(fpreal64 val) { myCutValue = val; }
635  {
636  SOP_Node *thissop = cookparms.getNode();
637  if (!thissop) return getCutValue();
639  OP_Utils::evalOpParm(result, thissop, "cutvalue", cookparms.getCookTime(), 0);
640  return result;
641  }
642  const UT_StringHolder & getCutStringValue() const { return myCutStringValue; }
643  void setCutStringValue(const UT_StringHolder & val) { myCutStringValue = val; }
645  {
646  SOP_Node *thissop = cookparms.getNode();
647  if (!thissop) return getCutStringValue();
649  OP_Utils::evalOpParm(result, thissop, "cutstringvalue", cookparms.getCookTime(), 0);
650  return result;
651  }
652  fpreal64 getCutThreshold() const { return myCutThreshold; }
653  void setCutThreshold(fpreal64 val) { myCutThreshold = val; }
655  {
656  SOP_Node *thissop = cookparms.getNode();
657  if (!thissop) return getCutThreshold();
659  OP_Utils::evalOpParm(result, thissop, "cutthreshold", cookparms.getCookTime(), 0);
660  return result;
661  }
662  bool getKeepClosed() const { return myKeepClosed; }
663  void setKeepClosed(bool val) { myKeepClosed = val; }
664  bool opKeepClosed(const SOP_NodeVerb::CookParms &cookparms) const
665  {
666  SOP_Node *thissop = cookparms.getNode();
667  if (!thissop) return getKeepClosed();
668  bool result;
669  OP_Utils::evalOpParm(result, thissop, "keepclosed", cookparms.getCookTime(), 0);
670  return result;
671  }
672 
673 private:
674  UT_StringHolder myPolygons;
675  int64 myType;
676  UT_StringHolder myCutPoints;
677  UT_StringHolder myCutEdges;
678  int64 myStrategy;
679  int64 myDetectEdgeChanges;
680  UT_StringHolder myCutAttrib;
681  fpreal64 myCutValue;
682  UT_StringHolder myCutStringValue;
683  fpreal64 myCutThreshold;
684  bool myKeepClosed;
685 
686 };
void setKeepClosed(bool val)
type
Definition: core.h:556
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:63
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
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
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 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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
fpreal64 getCutThreshold() const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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)
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