HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_CopyToPoints.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_CopyToPointsEnums
24 {
25  enum class Pivot
26  {
27  ORIGIN = 0,
28  CENTROID
29  };
30 
32  getToken(Pivot enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case Pivot::ORIGIN: return "origin"_sh;
37  case Pivot::CENTROID: return "centroid"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Viewportlod
43  {
44  FULL = 0,
45  POINTS,
46  BOX,
47  CENTROID,
48  HIDDEN
49  };
50 
52  getToken(Viewportlod enum_value)
53  {
54  using namespace UT::Literal;
55  switch (enum_value) {
56  case Viewportlod::FULL: return "full"_sh;
57  case Viewportlod::POINTS: return "points"_sh;
58  case Viewportlod::BOX: return "box"_sh;
59  case Viewportlod::CENTROID: return "centroid"_sh;
60  case Viewportlod::HIDDEN: return "hidden"_sh;
61  default: UT_ASSERT(false); return ""_sh;
62  }
63  }
64 
65 }
66 
67 
69 {
70 public:
71  static int version() { return 1; }
72 
74  {
75  mySourceGroup = ""_UTsh;
76  myTargetGroup = ""_UTsh;
77  myShowguide = true;
78  myPack = false;
79  myPivot = 1;
80  myViewportlod = 0;
81  myTransform = true;
82  myDoAttr = true;
83  mySetpt = "*,^v,^Alpha,^N"_UTsh;
84  myMulpt = "Alpha"_UTsh;
85  myAddpt = "v"_UTsh;
86  mySubpt = ""_UTsh;
87  mySetprim = ""_UTsh;
88  myMulprim = ""_UTsh;
89  myAddprim = ""_UTsh;
90  mySubprim = ""_UTsh;
91  mySetvtx = ""_UTsh;
92  myMulvtx = ""_UTsh;
93  myAddvtx = ""_UTsh;
94  mySubvtx = ""_UTsh;
95 
96  }
97 
98  explicit SOP_CopyToPointsParms(const SOP_CopyToPointsParms &) = default;
100  SOP_CopyToPointsParms(SOP_CopyToPointsParms &&) noexcept = default;
101  SOP_CopyToPointsParms &operator=(SOP_CopyToPointsParms &&) noexcept = default;
102 
103  ~SOP_CopyToPointsParms() override {}
104 
106  {
107  if (mySourceGroup != src.mySourceGroup) return false;
108  if (myTargetGroup != src.myTargetGroup) return false;
109  if (myShowguide != src.myShowguide) return false;
110  if (myPack != src.myPack) return false;
111  if (myPivot != src.myPivot) return false;
112  if (myViewportlod != src.myViewportlod) return false;
113  if (myTransform != src.myTransform) return false;
114  if (myDoAttr != src.myDoAttr) return false;
115  if (mySetpt != src.mySetpt) return false;
116  if (myMulpt != src.myMulpt) return false;
117  if (myAddpt != src.myAddpt) return false;
118  if (mySubpt != src.mySubpt) return false;
119  if (mySetprim != src.mySetprim) return false;
120  if (myMulprim != src.myMulprim) return false;
121  if (myAddprim != src.myAddprim) return false;
122  if (mySubprim != src.mySubprim) return false;
123  if (mySetvtx != src.mySetvtx) return false;
124  if (myMulvtx != src.myMulvtx) return false;
125  if (myAddvtx != src.myAddvtx) return false;
126  if (mySubvtx != src.mySubvtx) return false;
127 
128  return true;
129  }
131  {
132  return !operator==(src);
133  }
136 
137 
138 
139  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
140  {
141  mySourceGroup = ""_UTsh;
142  if (true)
143  graph->evalOpParm(mySourceGroup, nodeidx, "sourcegroup", time, 0);
144  myTargetGroup = ""_UTsh;
145  if (true)
146  graph->evalOpParm(myTargetGroup, nodeidx, "targetgroup", time, 0);
147  myShowguide = true;
148  if (true)
149  graph->evalOpParm(myShowguide, nodeidx, "showguide", time, 0);
150  myPack = false;
151  if (true)
152  graph->evalOpParm(myPack, nodeidx, "pack", time, 0);
153  myPivot = 1;
154  if (true && ( (true&&!(((getPack()==0)))) ) )
155  graph->evalOpParm(myPivot, nodeidx, "pivot", time, 0);
156  myViewportlod = 0;
157  if (true && ( (true&&!(((getPack()==0)))) ) )
158  graph->evalOpParm(myViewportlod, nodeidx, "viewportlod", time, 0);
159  myTransform = true;
160  if (true)
161  graph->evalOpParm(myTransform, nodeidx, "transform", time, 0);
162  myDoAttr = true;
163  if (true)
164  graph->evalOpParm(myDoAttr, nodeidx, "doattr", time, 0);
165  mySetpt = "*,^v,^Alpha,^N"_UTsh;
166  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
167  graph->evalOpParm(mySetpt, nodeidx, "setpt", time, 0);
168  myMulpt = "Alpha"_UTsh;
169  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
170  graph->evalOpParm(myMulpt, nodeidx, "mulpt", time, 0);
171  myAddpt = "v"_UTsh;
172  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
173  graph->evalOpParm(myAddpt, nodeidx, "addpt", time, 0);
174  mySubpt = ""_UTsh;
175  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
176  graph->evalOpParm(mySubpt, nodeidx, "subpt", time, 0);
177  mySetprim = ""_UTsh;
178  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
179  graph->evalOpParm(mySetprim, nodeidx, "setprim", time, 0);
180  myMulprim = ""_UTsh;
181  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
182  graph->evalOpParm(myMulprim, nodeidx, "mulprim", time, 0);
183  myAddprim = ""_UTsh;
184  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
185  graph->evalOpParm(myAddprim, nodeidx, "addprim", time, 0);
186  mySubprim = ""_UTsh;
187  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
188  graph->evalOpParm(mySubprim, nodeidx, "subprim", time, 0);
189  mySetvtx = ""_UTsh;
190  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
191  graph->evalOpParm(mySetvtx, nodeidx, "setvtx", time, 0);
192  myMulvtx = ""_UTsh;
193  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
194  graph->evalOpParm(myMulvtx, nodeidx, "mulvtx", time, 0);
195  myAddvtx = ""_UTsh;
196  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
197  graph->evalOpParm(myAddvtx, nodeidx, "addvtx", time, 0);
198  mySubvtx = ""_UTsh;
199  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
200  graph->evalOpParm(mySubvtx, nodeidx, "subvtx", time, 0);
201 
202  }
203 
204 
205  void loadFromOpSubclass(const LoadParms &loadparms) override
206  {
207  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
208  }
209 
210 
211  void copyFrom(const OP_NodeParms *src) override
212  {
213  *this = *((const SOP_CopyToPointsParms *)src);
214  }
215 
216  template <typename T>
217  void
218  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
219  {
220  if (idx.size() < 1)
221  return;
222  UT_ASSERT(idx.size() == instance.size()+1);
223  if (idx.size() != instance.size()+1)
224  return;
225  switch (idx[0])
226  {
227  case 0:
228  coerceValue(value, mySourceGroup);
229  break;
230  case 1:
231  coerceValue(value, myTargetGroup);
232  break;
233  case 2:
234  coerceValue(value, myShowguide);
235  break;
236  case 3:
237  coerceValue(value, myPack);
238  break;
239  case 4:
240  coerceValue(value, myPivot);
241  break;
242  case 5:
243  coerceValue(value, myViewportlod);
244  break;
245  case 6:
246  coerceValue(value, myTransform);
247  break;
248  case 7:
249  coerceValue(value, myDoAttr);
250  break;
251  case 8:
252  coerceValue(value, mySetpt);
253  break;
254  case 9:
255  coerceValue(value, myMulpt);
256  break;
257  case 10:
258  coerceValue(value, myAddpt);
259  break;
260  case 11:
261  coerceValue(value, mySubpt);
262  break;
263  case 12:
264  coerceValue(value, mySetprim);
265  break;
266  case 13:
267  coerceValue(value, myMulprim);
268  break;
269  case 14:
270  coerceValue(value, myAddprim);
271  break;
272  case 15:
273  coerceValue(value, mySubprim);
274  break;
275  case 16:
276  coerceValue(value, mySetvtx);
277  break;
278  case 17:
279  coerceValue(value, myMulvtx);
280  break;
281  case 18:
282  coerceValue(value, myAddvtx);
283  break;
284  case 19:
285  coerceValue(value, mySubvtx);
286  break;
287 
288  }
289  }
290 
291  bool isParmColorRamp(exint idx) const override
292  {
293  switch (idx)
294  {
295 
296  }
297  return false;
298  }
299 
300  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
315  { doGetParmValue(idx, instance, value); }
316  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
317  { doGetParmValue(idx, instance, value); }
318  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
319  { doGetParmValue(idx, instance, value); }
320  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
321  { doGetParmValue(idx, instance, value); }
322 
323  template <typename T>
324  void
325  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
326  {
327  if (idx.size() < 1)
328  return;
329  UT_ASSERT(idx.size() == instance.size()+1);
330  if (idx.size() != instance.size()+1)
331  return;
332  switch (idx[0])
333  {
334  case 0:
335  coerceValue(mySourceGroup, ( ( value ) ));
336  break;
337  case 1:
338  coerceValue(myTargetGroup, ( ( value ) ));
339  break;
340  case 2:
341  coerceValue(myShowguide, ( ( value ) ));
342  break;
343  case 3:
344  coerceValue(myPack, ( ( value ) ));
345  break;
346  case 4:
347  coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
348  break;
349  case 5:
350  coerceValue(myViewportlod, clampMinValue(0, clampMaxValue(4, value ) ));
351  break;
352  case 6:
353  coerceValue(myTransform, ( ( value ) ));
354  break;
355  case 7:
356  coerceValue(myDoAttr, ( ( value ) ));
357  break;
358  case 8:
359  coerceValue(mySetpt, ( ( value ) ));
360  break;
361  case 9:
362  coerceValue(myMulpt, ( ( value ) ));
363  break;
364  case 10:
365  coerceValue(myAddpt, ( ( value ) ));
366  break;
367  case 11:
368  coerceValue(mySubpt, ( ( value ) ));
369  break;
370  case 12:
371  coerceValue(mySetprim, ( ( value ) ));
372  break;
373  case 13:
374  coerceValue(myMulprim, ( ( value ) ));
375  break;
376  case 14:
377  coerceValue(myAddprim, ( ( value ) ));
378  break;
379  case 15:
380  coerceValue(mySubprim, ( ( value ) ));
381  break;
382  case 16:
383  coerceValue(mySetvtx, ( ( value ) ));
384  break;
385  case 17:
386  coerceValue(myMulvtx, ( ( value ) ));
387  break;
388  case 18:
389  coerceValue(myAddvtx, ( ( value ) ));
390  break;
391  case 19:
392  coerceValue(mySubvtx, ( ( value ) ));
393  break;
394 
395  }
396  }
397 
398  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
399  { doSetParmValue(idx, instance, value); }
400  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
407  { doSetParmValue(idx, instance, value); }
408  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
409  { doSetParmValue(idx, instance, value); }
410  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
417  { doSetParmValue(idx, instance, value); }
418  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
419  { doSetParmValue(idx, instance, value); }
420 
421  exint getNestNumParms(TempIndex idx) const override
422  {
423  if (idx.size() == 0)
424  return 20;
425  switch (idx[0])
426  {
427 
428  }
429  // Invalid
430  return 0;
431  }
432 
433  const char *getNestParmName(TempIndex fieldnum) const override
434  {
435  if (fieldnum.size() < 1)
436  return 0;
437  switch (fieldnum[0])
438  {
439  case 0:
440  return "sourcegroup";
441  case 1:
442  return "targetgroup";
443  case 2:
444  return "showguide";
445  case 3:
446  return "pack";
447  case 4:
448  return "pivot";
449  case 5:
450  return "viewportlod";
451  case 6:
452  return "transform";
453  case 7:
454  return "doattr";
455  case 8:
456  return "setpt";
457  case 9:
458  return "mulpt";
459  case 10:
460  return "addpt";
461  case 11:
462  return "subpt";
463  case 12:
464  return "setprim";
465  case 13:
466  return "mulprim";
467  case 14:
468  return "addprim";
469  case 15:
470  return "subprim";
471  case 16:
472  return "setvtx";
473  case 17:
474  return "mulvtx";
475  case 18:
476  return "addvtx";
477  case 19:
478  return "subvtx";
479 
480  }
481  return 0;
482  }
483 
484  ParmType getNestParmType(TempIndex fieldnum) const override
485  {
486  if (fieldnum.size() < 1)
487  return PARM_UNSUPPORTED;
488  switch (fieldnum[0])
489  {
490  case 0:
491  return PARM_STRING;
492  case 1:
493  return PARM_STRING;
494  case 2:
495  return PARM_INTEGER;
496  case 3:
497  return PARM_INTEGER;
498  case 4:
499  return PARM_INTEGER;
500  case 5:
501  return PARM_INTEGER;
502  case 6:
503  return PARM_INTEGER;
504  case 7:
505  return PARM_INTEGER;
506  case 8:
507  return PARM_STRING;
508  case 9:
509  return PARM_STRING;
510  case 10:
511  return PARM_STRING;
512  case 11:
513  return PARM_STRING;
514  case 12:
515  return PARM_STRING;
516  case 13:
517  return PARM_STRING;
518  case 14:
519  return PARM_STRING;
520  case 15:
521  return PARM_STRING;
522  case 16:
523  return PARM_STRING;
524  case 17:
525  return PARM_STRING;
526  case 18:
527  return PARM_STRING;
528  case 19:
529  return PARM_STRING;
530 
531  }
532  return PARM_UNSUPPORTED;
533  }
534 
535  // Boiler plate to load individual types.
536  static void loadData(UT_IStream &is, int64 &v)
537  { is.bread(&v, 1); }
538  static void loadData(UT_IStream &is, bool &v)
539  { int64 iv; is.bread(&iv, 1); v = iv; }
540  static void loadData(UT_IStream &is, fpreal64 &v)
541  { is.bread<fpreal64>(&v, 1); }
542  static void loadData(UT_IStream &is, UT_Vector2D &v)
543  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
544  static void loadData(UT_IStream &is, UT_Vector3D &v)
545  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
546  is.bread<fpreal64>(&v.z(), 1); }
547  static void loadData(UT_IStream &is, UT_Vector4D &v)
548  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
549  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
550  static void loadData(UT_IStream &is, UT_Matrix2D &v)
551  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
552  static void loadData(UT_IStream &is, UT_Matrix3D &v)
553  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
554  static void loadData(UT_IStream &is, UT_Matrix4D &v)
555  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
556  static void loadData(UT_IStream &is, UT_Vector2I &v)
557  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
558  static void loadData(UT_IStream &is, UT_Vector3I &v)
559  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
560  is.bread<int64>(&v.z(), 1); }
561  static void loadData(UT_IStream &is, UT_Vector4I &v)
562  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
563  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
565  { is.bread(v); }
567  { UT_StringHolder rampdata;
568  loadData(is, rampdata);
569  if (rampdata.isstring())
570  {
571  v.reset(new UT_Ramp());
572  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
573  v->load(istr);
574  }
575  else v.reset();
576  }
579  loadData(is, data);
580  if (data.isstring())
581  {
582  // Find the data type.
583  const char *colon = UT_StringWrap(data).findChar(':');
584  if (colon)
585  {
586  int typelen = colon - data.buffer();
588  type.strncpy(data.buffer(), typelen);
589  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
590 
591  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
592  }
593  }
594  else v.reset();
595  }
596 
597  static void saveData(std::ostream &os, int64 v)
598  { UTwrite(os, &v); }
599  static void saveData(std::ostream &os, bool v)
600  { int64 iv = v; UTwrite(os, &iv); }
601  static void saveData(std::ostream &os, fpreal64 v)
602  { UTwrite<fpreal64>(os, &v); }
603  static void saveData(std::ostream &os, UT_Vector2D v)
604  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
605  static void saveData(std::ostream &os, UT_Vector3D v)
606  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
607  UTwrite<fpreal64>(os, &v.z()); }
608  static void saveData(std::ostream &os, UT_Vector4D v)
609  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
610  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
611  static void saveData(std::ostream &os, UT_Matrix2D v)
613  static void saveData(std::ostream &os, UT_Matrix3D v)
615  static void saveData(std::ostream &os, UT_Matrix4D v)
617  static void saveData(std::ostream &os, UT_StringHolder s)
618  { UT_StringWrap(s).saveBinary(os); }
619  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
621  UT_OStringStream ostr;
622  if (s) s->save(ostr);
623  result = ostr.str();
624  saveData(os, result);
625  }
626  static void saveData(std::ostream &os, PRM_DataItemHandle s)
628  UT_OStringStream ostr;
629  if (s)
630  {
631  ostr << s->getDataTypeToken();
632  ostr << ":";
633  s->saveBinary(ostr);
634  }
635  result = ostr.str();
636  saveData(os, result);
637  }
638 
639 
640  void save(std::ostream &os) const
641  {
642  int32 v = version();
643  UTwrite(os, &v);
644  saveData(os, mySourceGroup);
645  saveData(os, myTargetGroup);
646  saveData(os, myShowguide);
647  saveData(os, myPack);
648  saveData(os, myPivot);
649  saveData(os, myViewportlod);
650  saveData(os, myTransform);
651  saveData(os, myDoAttr);
652  saveData(os, mySetpt);
653  saveData(os, myMulpt);
654  saveData(os, myAddpt);
655  saveData(os, mySubpt);
656  saveData(os, mySetprim);
657  saveData(os, myMulprim);
658  saveData(os, myAddprim);
659  saveData(os, mySubprim);
660  saveData(os, mySetvtx);
661  saveData(os, myMulvtx);
662  saveData(os, myAddvtx);
663  saveData(os, mySubvtx);
664 
665  }
666 
667  bool load(UT_IStream &is)
668  {
669  int32 v;
670  is.bread(&v, 1);
671  if (version() != v)
672  {
673  // Fail incompatible versions
674  return false;
675  }
676  loadData(is, mySourceGroup);
677  loadData(is, myTargetGroup);
678  loadData(is, myShowguide);
679  loadData(is, myPack);
680  loadData(is, myPivot);
681  loadData(is, myViewportlod);
682  loadData(is, myTransform);
683  loadData(is, myDoAttr);
684  loadData(is, mySetpt);
685  loadData(is, myMulpt);
686  loadData(is, myAddpt);
687  loadData(is, mySubpt);
688  loadData(is, mySetprim);
689  loadData(is, myMulprim);
690  loadData(is, myAddprim);
691  loadData(is, mySubprim);
692  loadData(is, mySetvtx);
693  loadData(is, myMulvtx);
694  loadData(is, myAddvtx);
695  loadData(is, mySubvtx);
696 
697  return true;
698  }
699 
700  const UT_StringHolder & getSourceGroup() const { return mySourceGroup; }
701  void setSourceGroup(const UT_StringHolder & val) { mySourceGroup = val; }
703  {
704  SOP_Node *thissop = cookparms.getNode();
705  if (!thissop) return getSourceGroup();
707  OP_Utils::evalOpParm(result, thissop, "sourcegroup", cookparms.getCookTime(), 0);
708  return result;
709  }
710  const UT_StringHolder & getTargetGroup() const { return myTargetGroup; }
711  void setTargetGroup(const UT_StringHolder & val) { myTargetGroup = val; }
713  {
714  SOP_Node *thissop = cookparms.getNode();
715  if (!thissop) return getTargetGroup();
717  OP_Utils::evalOpParm(result, thissop, "targetgroup", cookparms.getCookTime(), 0);
718  return result;
719  }
720  bool getShowguide() const { return myShowguide; }
721  void setShowguide(bool val) { myShowguide = val; }
722  bool opShowguide(const SOP_NodeVerb::CookParms &cookparms) const
723  {
724  SOP_Node *thissop = cookparms.getNode();
725  if (!thissop) return getShowguide();
726  bool result;
727  OP_Utils::evalOpParm(result, thissop, "showguide", cookparms.getCookTime(), 0);
728  return result;
729  }
730  bool getPack() const { return myPack; }
731  void setPack(bool val) { myPack = val; }
732  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
733  {
734  SOP_Node *thissop = cookparms.getNode();
735  if (!thissop) return getPack();
736  bool result;
737  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
738  return result;
739  }
740  Pivot getPivot() const { return Pivot(myPivot); }
741  void setPivot(Pivot val) { myPivot = int64(val); }
742  Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
743  {
744  SOP_Node *thissop = cookparms.getNode();
745  if (!thissop) return getPivot();
746  int64 result;
747  OP_Utils::evalOpParm(result, thissop, "pivot", cookparms.getCookTime(), 0);
748  return Pivot(result);
749  }
750  Viewportlod getViewportlod() const { return Viewportlod(myViewportlod); }
751  void setViewportlod(Viewportlod val) { myViewportlod = int64(val); }
753  {
754  SOP_Node *thissop = cookparms.getNode();
755  if (!thissop) return getViewportlod();
756  int64 result;
757  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
758  return Viewportlod(result);
759  }
760  bool getTransform() const { return myTransform; }
761  void setTransform(bool val) { myTransform = val; }
762  bool opTransform(const SOP_NodeVerb::CookParms &cookparms) const
763  {
764  SOP_Node *thissop = cookparms.getNode();
765  if (!thissop) return getTransform();
766  bool result;
767  OP_Utils::evalOpParm(result, thissop, "transform", cookparms.getCookTime(), 0);
768  return result;
769  }
770  bool getDoAttr() const { return myDoAttr; }
771  void setDoAttr(bool val) { myDoAttr = val; }
772  bool opDoAttr(const SOP_NodeVerb::CookParms &cookparms) const
773  {
774  SOP_Node *thissop = cookparms.getNode();
775  if (!thissop) return getDoAttr();
776  bool result;
777  OP_Utils::evalOpParm(result, thissop, "doattr", cookparms.getCookTime(), 0);
778  return result;
779  }
780  const UT_StringHolder & getSetpt() const { return mySetpt; }
781  void setSetpt(const UT_StringHolder & val) { mySetpt = val; }
783  {
784  SOP_Node *thissop = cookparms.getNode();
785  if (!thissop) return getSetpt();
787  OP_Utils::evalOpParm(result, thissop, "setpt", cookparms.getCookTime(), 0);
788  return result;
789  }
790  const UT_StringHolder & getMulpt() const { return myMulpt; }
791  void setMulpt(const UT_StringHolder & val) { myMulpt = val; }
793  {
794  SOP_Node *thissop = cookparms.getNode();
795  if (!thissop) return getMulpt();
797  OP_Utils::evalOpParm(result, thissop, "mulpt", cookparms.getCookTime(), 0);
798  return result;
799  }
800  const UT_StringHolder & getAddpt() const { return myAddpt; }
801  void setAddpt(const UT_StringHolder & val) { myAddpt = val; }
803  {
804  SOP_Node *thissop = cookparms.getNode();
805  if (!thissop) return getAddpt();
807  OP_Utils::evalOpParm(result, thissop, "addpt", cookparms.getCookTime(), 0);
808  return result;
809  }
810  const UT_StringHolder & getSubpt() const { return mySubpt; }
811  void setSubpt(const UT_StringHolder & val) { mySubpt = val; }
813  {
814  SOP_Node *thissop = cookparms.getNode();
815  if (!thissop) return getSubpt();
817  OP_Utils::evalOpParm(result, thissop, "subpt", cookparms.getCookTime(), 0);
818  return result;
819  }
820  const UT_StringHolder & getSetprim() const { return mySetprim; }
821  void setSetprim(const UT_StringHolder & val) { mySetprim = val; }
823  {
824  SOP_Node *thissop = cookparms.getNode();
825  if (!thissop) return getSetprim();
827  OP_Utils::evalOpParm(result, thissop, "setprim", cookparms.getCookTime(), 0);
828  return result;
829  }
830  const UT_StringHolder & getMulprim() const { return myMulprim; }
831  void setMulprim(const UT_StringHolder & val) { myMulprim = val; }
833  {
834  SOP_Node *thissop = cookparms.getNode();
835  if (!thissop) return getMulprim();
837  OP_Utils::evalOpParm(result, thissop, "mulprim", cookparms.getCookTime(), 0);
838  return result;
839  }
840  const UT_StringHolder & getAddprim() const { return myAddprim; }
841  void setAddprim(const UT_StringHolder & val) { myAddprim = val; }
843  {
844  SOP_Node *thissop = cookparms.getNode();
845  if (!thissop) return getAddprim();
847  OP_Utils::evalOpParm(result, thissop, "addprim", cookparms.getCookTime(), 0);
848  return result;
849  }
850  const UT_StringHolder & getSubprim() const { return mySubprim; }
851  void setSubprim(const UT_StringHolder & val) { mySubprim = val; }
853  {
854  SOP_Node *thissop = cookparms.getNode();
855  if (!thissop) return getSubprim();
857  OP_Utils::evalOpParm(result, thissop, "subprim", cookparms.getCookTime(), 0);
858  return result;
859  }
860  const UT_StringHolder & getSetvtx() const { return mySetvtx; }
861  void setSetvtx(const UT_StringHolder & val) { mySetvtx = val; }
863  {
864  SOP_Node *thissop = cookparms.getNode();
865  if (!thissop) return getSetvtx();
867  OP_Utils::evalOpParm(result, thissop, "setvtx", cookparms.getCookTime(), 0);
868  return result;
869  }
870  const UT_StringHolder & getMulvtx() const { return myMulvtx; }
871  void setMulvtx(const UT_StringHolder & val) { myMulvtx = val; }
873  {
874  SOP_Node *thissop = cookparms.getNode();
875  if (!thissop) return getMulvtx();
877  OP_Utils::evalOpParm(result, thissop, "mulvtx", cookparms.getCookTime(), 0);
878  return result;
879  }
880  const UT_StringHolder & getAddvtx() const { return myAddvtx; }
881  void setAddvtx(const UT_StringHolder & val) { myAddvtx = val; }
883  {
884  SOP_Node *thissop = cookparms.getNode();
885  if (!thissop) return getAddvtx();
887  OP_Utils::evalOpParm(result, thissop, "addvtx", cookparms.getCookTime(), 0);
888  return result;
889  }
890  const UT_StringHolder & getSubvtx() const { return mySubvtx; }
891  void setSubvtx(const UT_StringHolder & val) { mySubvtx = val; }
893  {
894  SOP_Node *thissop = cookparms.getNode();
895  if (!thissop) return getSubvtx();
897  OP_Utils::evalOpParm(result, thissop, "subvtx", cookparms.getCookTime(), 0);
898  return result;
899  }
900 
901 private:
902  UT_StringHolder mySourceGroup;
903  UT_StringHolder myTargetGroup;
904  bool myShowguide;
905  bool myPack;
906  int64 myPivot;
907  int64 myViewportlod;
908  bool myTransform;
909  bool myDoAttr;
910  UT_StringHolder mySetpt;
911  UT_StringHolder myMulpt;
912  UT_StringHolder myAddpt;
913  UT_StringHolder mySubpt;
914  UT_StringHolder mySetprim;
915  UT_StringHolder myMulprim;
916  UT_StringHolder myAddprim;
917  UT_StringHolder mySubprim;
918  UT_StringHolder mySetvtx;
919  UT_StringHolder myMulvtx;
920  UT_StringHolder myAddvtx;
921  UT_StringHolder mySubvtx;
922 
923 };
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opDoAttr(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opSubprim(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator==(const SOP_CopyToPointsParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setSubprim(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
exint bread(int32 *buffer, exint asize=1)
exint getNestNumParms(TempIndex idx) const override
const UT_StringHolder & getSubprim() const
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
const UT_StringHolder & getAddprim() const
void setSubpt(const UT_StringHolder &val)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void loadData(UT_IStream &is, UT_Vector4D &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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
An output stream object that owns its own string buffer storage.
UT_StringHolder opSetvtx(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getAddvtx() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void copyFrom(const OP_NodeParms *src) override
const UT_StringHolder & getAddpt() const
UT_StringHolder opMulvtx(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
Definition: thread.h:613
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, bool &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, int64 v)
void setViewportlod(Viewportlod val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getMulvtx() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
double fpreal64
Definition: SYS_Types.h:201
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
Viewportlod getViewportlod() const
static void saveData(std::ostream &os, fpreal64 v)
UT_StringHolder opTargetGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setSourceGroup(const UT_StringHolder &val)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getMulpt() const
void setAddpt(const UT_StringHolder &val)
UT_StringHolder opAddvtx(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool operator!=(const SOP_CopyToPointsParms &src) const
UT_StringHolder opSubvtx(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getSetpt() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
const UT_StringHolder & getSubvtx() const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
UT_StringHolder opSetprim(const SOP_NodeVerb::CookParms &cookparms) const
void setSetprim(const UT_StringHolder &val)
const UT_StringHolder & getTargetGroup() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setMulprim(const UT_StringHolder &val)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, bool v)
UT_StringHolder opSourceGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
long long int64
Definition: SYS_Types.h:116
const UT_StringHolder & getSetprim() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
void setMulvtx(const UT_StringHolder &val)
void setSetvtx(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setSubvtx(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool opShowguide(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setMulpt(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setAddprim(const UT_StringHolder &val)
UT_StringHolder opSubpt(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opAddpt(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
Viewportlod opViewportlod(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
UT_StringHolder opMulprim(const SOP_NodeVerb::CookParms &cookparms) const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const UT_StringHolder & getSetvtx() const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
bool opTransform(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setSetpt(const UT_StringHolder &val)
#define SOP_API
Definition: SOP_API.h:10
UT_StringHolder opMulpt(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
const UT_StringHolder & getMulprim() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opAddprim(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
static void saveData(std::ostream &os, UT_StringHolder s)
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void saveData(std::ostream &os, UT_Matrix2D v)
const UT_StringHolder & getSubpt() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
type
Definition: core.h:1059
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setTargetGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
static void saveData(std::ostream &os, UT_Matrix4D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Pivot enum_value)
ParmType getNestParmType(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
UT_StringHolder opSetpt(const SOP_NodeVerb::CookParms &cookparms) const
void setAddvtx(const UT_StringHolder &val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
const UT_StringHolder & getSourceGroup() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663