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 <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_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 
129  if (baseGetSignature() != src.baseGetSignature()) return false;
130 
131  return true;
132  }
134  {
135  return !operator==(src);
136  }
139 
140 
141 
142  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
143  {
144  mySourceGroup = ""_UTsh;
145  if (true)
146  graph->evalOpParm(mySourceGroup, nodeidx, "sourcegroup", time, graph->isDirect()?nullptr:depnode);
147  myTargetGroup = ""_UTsh;
148  if (true)
149  graph->evalOpParm(myTargetGroup, nodeidx, "targetgroup", time, graph->isDirect()?nullptr:depnode);
150  myShowguide = true;
151  if (true)
152  graph->evalOpParm(myShowguide, nodeidx, "showguide", time, graph->isDirect()?nullptr:depnode);
153  myPack = false;
154  if (true)
155  graph->evalOpParm(myPack, nodeidx, "pack", time, graph->isDirect()?nullptr:depnode);
156  myPivot = 1;
157  if (true && ( (true&&!(((getPack()==0)))) ) )
158  graph->evalOpParm(myPivot, nodeidx, "pivot", time, graph->isDirect()?nullptr:depnode);
159  myViewportlod = 0;
160  if (true && ( (true&&!(((getPack()==0)))) ) )
161  graph->evalOpParm(myViewportlod, nodeidx, "viewportlod", time, graph->isDirect()?nullptr:depnode);
162  myTransform = true;
163  if (true)
164  graph->evalOpParm(myTransform, nodeidx, "transform", time, graph->isDirect()?nullptr:depnode);
165  myDoAttr = true;
166  if (true)
167  graph->evalOpParm(myDoAttr, nodeidx, "doattr", time, graph->isDirect()?nullptr:depnode);
168  mySetpt = "*,^v,^Alpha,^N"_UTsh;
169  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
170  graph->evalOpParm(mySetpt, nodeidx, "setpt", time, graph->isDirect()?nullptr:depnode);
171  myMulpt = "Alpha"_UTsh;
172  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
173  graph->evalOpParm(myMulpt, nodeidx, "mulpt", time, graph->isDirect()?nullptr:depnode);
174  myAddpt = "v"_UTsh;
175  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
176  graph->evalOpParm(myAddpt, nodeidx, "addpt", time, graph->isDirect()?nullptr:depnode);
177  mySubpt = ""_UTsh;
178  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
179  graph->evalOpParm(mySubpt, nodeidx, "subpt", time, graph->isDirect()?nullptr:depnode);
180  mySetprim = ""_UTsh;
181  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
182  graph->evalOpParm(mySetprim, nodeidx, "setprim", time, graph->isDirect()?nullptr:depnode);
183  myMulprim = ""_UTsh;
184  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
185  graph->evalOpParm(myMulprim, nodeidx, "mulprim", time, graph->isDirect()?nullptr:depnode);
186  myAddprim = ""_UTsh;
187  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
188  graph->evalOpParm(myAddprim, nodeidx, "addprim", time, graph->isDirect()?nullptr:depnode);
189  mySubprim = ""_UTsh;
190  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
191  graph->evalOpParm(mySubprim, nodeidx, "subprim", time, graph->isDirect()?nullptr:depnode);
192  mySetvtx = ""_UTsh;
193  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
194  graph->evalOpParm(mySetvtx, nodeidx, "setvtx", time, graph->isDirect()?nullptr:depnode);
195  myMulvtx = ""_UTsh;
196  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
197  graph->evalOpParm(myMulvtx, nodeidx, "mulvtx", time, graph->isDirect()?nullptr:depnode);
198  myAddvtx = ""_UTsh;
199  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
200  graph->evalOpParm(myAddvtx, nodeidx, "addvtx", time, graph->isDirect()?nullptr:depnode);
201  mySubvtx = ""_UTsh;
202  if (true && ( (true&&!(((getDoAttr()==0)))) ) )
203  graph->evalOpParm(mySubvtx, nodeidx, "subvtx", time, graph->isDirect()?nullptr:depnode);
204 
205  }
206 
207 
208  void loadFromOpSubclass(const LoadParms &loadparms) override
209  {
210  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
211  }
212 
213 
214  void copyFrom(const OP_NodeParms *src) override
215  {
216  *this = *((const SOP_CopyToPointsParms *)src);
217  }
218 
219  template <typename T>
220  void
221  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
222  {
223  if (idx.size() < 1)
224  return;
225  UT_ASSERT(idx.size() == instance.size()+1);
226  if (idx.size() != instance.size()+1)
227  return;
228  switch (idx[0])
229  {
230  case 0:
231  coerceValue(value, mySourceGroup);
232  break;
233  case 1:
234  coerceValue(value, myTargetGroup);
235  break;
236  case 2:
237  coerceValue(value, myShowguide);
238  break;
239  case 3:
240  coerceValue(value, myPack);
241  break;
242  case 4:
243  coerceValue(value, myPivot);
244  break;
245  case 5:
246  coerceValue(value, myViewportlod);
247  break;
248  case 6:
249  coerceValue(value, myTransform);
250  break;
251  case 7:
252  coerceValue(value, myDoAttr);
253  break;
254  case 8:
255  coerceValue(value, mySetpt);
256  break;
257  case 9:
258  coerceValue(value, myMulpt);
259  break;
260  case 10:
261  coerceValue(value, myAddpt);
262  break;
263  case 11:
264  coerceValue(value, mySubpt);
265  break;
266  case 12:
267  coerceValue(value, mySetprim);
268  break;
269  case 13:
270  coerceValue(value, myMulprim);
271  break;
272  case 14:
273  coerceValue(value, myAddprim);
274  break;
275  case 15:
276  coerceValue(value, mySubprim);
277  break;
278  case 16:
279  coerceValue(value, mySetvtx);
280  break;
281  case 17:
282  coerceValue(value, myMulvtx);
283  break;
284  case 18:
285  coerceValue(value, myAddvtx);
286  break;
287  case 19:
288  coerceValue(value, mySubvtx);
289  break;
290 
291  }
292  }
293 
294  bool isParmColorRamp(exint idx) const override
295  {
296  switch (idx)
297  {
298 
299  }
300  return false;
301  }
302 
303  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
304  { doGetParmValue(idx, instance, value); }
305  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
306  { doGetParmValue(idx, instance, value); }
307  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
308  { doGetParmValue(idx, instance, value); }
309  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
312  { doGetParmValue(idx, instance, value); }
313  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
314  { doGetParmValue(idx, instance, value); }
315  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
316  { doGetParmValue(idx, instance, value); }
317  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
318  { doGetParmValue(idx, instance, value); }
319  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
320  { doGetParmValue(idx, instance, value); }
321  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
324  { doGetParmValue(idx, instance, value); }
325 
326  template <typename T>
327  void
328  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
329  {
330  if (idx.size() < 1)
331  return;
332  UT_ASSERT(idx.size() == instance.size()+1);
333  if (idx.size() != instance.size()+1)
334  return;
335  switch (idx[0])
336  {
337  case 0:
338  coerceValue(mySourceGroup, ( ( value ) ));
339  break;
340  case 1:
341  coerceValue(myTargetGroup, ( ( value ) ));
342  break;
343  case 2:
344  coerceValue(myShowguide, ( ( value ) ));
345  break;
346  case 3:
347  coerceValue(myPack, ( ( value ) ));
348  break;
349  case 4:
350  coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
351  break;
352  case 5:
353  coerceValue(myViewportlod, clampMinValue(0, clampMaxValue(4, value ) ));
354  break;
355  case 6:
356  coerceValue(myTransform, ( ( value ) ));
357  break;
358  case 7:
359  coerceValue(myDoAttr, ( ( value ) ));
360  break;
361  case 8:
362  coerceValue(mySetpt, ( ( value ) ));
363  break;
364  case 9:
365  coerceValue(myMulpt, ( ( value ) ));
366  break;
367  case 10:
368  coerceValue(myAddpt, ( ( value ) ));
369  break;
370  case 11:
371  coerceValue(mySubpt, ( ( value ) ));
372  break;
373  case 12:
374  coerceValue(mySetprim, ( ( value ) ));
375  break;
376  case 13:
377  coerceValue(myMulprim, ( ( value ) ));
378  break;
379  case 14:
380  coerceValue(myAddprim, ( ( value ) ));
381  break;
382  case 15:
383  coerceValue(mySubprim, ( ( value ) ));
384  break;
385  case 16:
386  coerceValue(mySetvtx, ( ( value ) ));
387  break;
388  case 17:
389  coerceValue(myMulvtx, ( ( value ) ));
390  break;
391  case 18:
392  coerceValue(myAddvtx, ( ( value ) ));
393  break;
394  case 19:
395  coerceValue(mySubvtx, ( ( value ) ));
396  break;
397 
398  }
399  }
400 
401  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
418  { doSetParmValue(idx, instance, value); }
419  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
420  { doSetParmValue(idx, instance, value); }
421  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
422  { doSetParmValue(idx, instance, value); }
423 
424  exint getNestNumParms(TempIndex idx) const override
425  {
426  if (idx.size() == 0)
427  return 20;
428  switch (idx[0])
429  {
430 
431  }
432  // Invalid
433  return 0;
434  }
435 
436  const char *getNestParmName(TempIndex fieldnum) const override
437  {
438  if (fieldnum.size() < 1)
439  return 0;
440  switch (fieldnum[0])
441  {
442  case 0:
443  return "sourcegroup";
444  case 1:
445  return "targetgroup";
446  case 2:
447  return "showguide";
448  case 3:
449  return "pack";
450  case 4:
451  return "pivot";
452  case 5:
453  return "viewportlod";
454  case 6:
455  return "transform";
456  case 7:
457  return "doattr";
458  case 8:
459  return "setpt";
460  case 9:
461  return "mulpt";
462  case 10:
463  return "addpt";
464  case 11:
465  return "subpt";
466  case 12:
467  return "setprim";
468  case 13:
469  return "mulprim";
470  case 14:
471  return "addprim";
472  case 15:
473  return "subprim";
474  case 16:
475  return "setvtx";
476  case 17:
477  return "mulvtx";
478  case 18:
479  return "addvtx";
480  case 19:
481  return "subvtx";
482 
483  }
484  return 0;
485  }
486 
487  ParmType getNestParmType(TempIndex fieldnum) const override
488  {
489  if (fieldnum.size() < 1)
490  return PARM_UNSUPPORTED;
491  switch (fieldnum[0])
492  {
493  case 0:
494  return PARM_STRING;
495  case 1:
496  return PARM_STRING;
497  case 2:
498  return PARM_INTEGER;
499  case 3:
500  return PARM_INTEGER;
501  case 4:
502  return PARM_INTEGER;
503  case 5:
504  return PARM_INTEGER;
505  case 6:
506  return PARM_INTEGER;
507  case 7:
508  return PARM_INTEGER;
509  case 8:
510  return PARM_STRING;
511  case 9:
512  return PARM_STRING;
513  case 10:
514  return PARM_STRING;
515  case 11:
516  return PARM_STRING;
517  case 12:
518  return PARM_STRING;
519  case 13:
520  return PARM_STRING;
521  case 14:
522  return PARM_STRING;
523  case 15:
524  return PARM_STRING;
525  case 16:
526  return PARM_STRING;
527  case 17:
528  return PARM_STRING;
529  case 18:
530  return PARM_STRING;
531  case 19:
532  return PARM_STRING;
533 
534  }
535  return PARM_UNSUPPORTED;
536  }
537 
538  // Boiler plate to load individual types.
539  static void loadData(UT_IStream &is, int64 &v)
540  { is.bread(&v, 1); }
541  static void loadData(UT_IStream &is, bool &v)
542  { int64 iv; is.bread(&iv, 1); v = iv; }
543  static void loadData(UT_IStream &is, fpreal64 &v)
544  { is.bread<fpreal64>(&v, 1); }
545  static void loadData(UT_IStream &is, UT_Vector2D &v)
546  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
547  static void loadData(UT_IStream &is, UT_Vector3D &v)
548  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
549  is.bread<fpreal64>(&v.z(), 1); }
550  static void loadData(UT_IStream &is, UT_Vector4D &v)
551  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
552  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
553  static void loadData(UT_IStream &is, UT_Matrix2D &v)
554  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
555  static void loadData(UT_IStream &is, UT_Matrix3D &v)
556  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
557  static void loadData(UT_IStream &is, UT_Matrix4D &v)
558  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
559  static void loadData(UT_IStream &is, UT_Vector2I &v)
560  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
561  static void loadData(UT_IStream &is, UT_Vector3I &v)
562  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
563  is.bread<int64>(&v.z(), 1); }
564  static void loadData(UT_IStream &is, UT_Vector4I &v)
565  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
566  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
568  { is.bread(v); }
570  { UT_StringHolder rampdata;
571  loadData(is, rampdata);
572  if (rampdata.isstring())
573  {
574  v.reset(new UT_Ramp());
575  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
576  v->load(istr);
577  }
578  else v.reset();
579  }
582  loadData(is, data);
583  if (data.isstring())
584  {
585  // Find the data type.
586  const char *colon = UT_StringWrap(data).findChar(':');
587  if (colon)
588  {
589  int typelen = colon - data.buffer();
591  type.strncpy(data.buffer(), typelen);
592  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
593 
594  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
595  }
596  }
597  else v.reset();
598  }
599 
600  static void saveData(std::ostream &os, int64 v)
601  { UTwrite(os, &v); }
602  static void saveData(std::ostream &os, bool v)
603  { int64 iv = v; UTwrite(os, &iv); }
604  static void saveData(std::ostream &os, fpreal64 v)
605  { UTwrite<fpreal64>(os, &v); }
606  static void saveData(std::ostream &os, UT_Vector2D v)
607  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
608  static void saveData(std::ostream &os, UT_Vector3D v)
609  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
610  UTwrite<fpreal64>(os, &v.z()); }
611  static void saveData(std::ostream &os, UT_Vector4D v)
612  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
613  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
614  static void saveData(std::ostream &os, UT_Matrix2D v)
616  static void saveData(std::ostream &os, UT_Matrix3D v)
618  static void saveData(std::ostream &os, UT_Matrix4D v)
620  static void saveData(std::ostream &os, UT_StringHolder s)
621  { UT_StringWrap(s).saveBinary(os); }
622  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
624  UT_OStringStream ostr;
625  if (s) s->save(ostr);
626  result = ostr.str();
627  saveData(os, result);
628  }
629  static void saveData(std::ostream &os, PRM_DataItemHandle s)
631  UT_OStringStream ostr;
632  if (s)
633  {
634  ostr << s->getDataTypeToken();
635  ostr << ":";
636  s->saveBinary(ostr);
637  }
638  result = ostr.str();
639  saveData(os, result);
640  }
641 
642 
643  void save(std::ostream &os) const
644  {
645  int32 v = version();
646  UTwrite(os, &v);
647  saveData(os, mySourceGroup);
648  saveData(os, myTargetGroup);
649  saveData(os, myShowguide);
650  saveData(os, myPack);
651  saveData(os, myPivot);
652  saveData(os, myViewportlod);
653  saveData(os, myTransform);
654  saveData(os, myDoAttr);
655  saveData(os, mySetpt);
656  saveData(os, myMulpt);
657  saveData(os, myAddpt);
658  saveData(os, mySubpt);
659  saveData(os, mySetprim);
660  saveData(os, myMulprim);
661  saveData(os, myAddprim);
662  saveData(os, mySubprim);
663  saveData(os, mySetvtx);
664  saveData(os, myMulvtx);
665  saveData(os, myAddvtx);
666  saveData(os, mySubvtx);
667 
668  }
669 
670  bool load(UT_IStream &is)
671  {
672  int32 v;
673  is.bread(&v, 1);
674  if (version() != v)
675  {
676  // Fail incompatible versions
677  return false;
678  }
679  loadData(is, mySourceGroup);
680  loadData(is, myTargetGroup);
681  loadData(is, myShowguide);
682  loadData(is, myPack);
683  loadData(is, myPivot);
684  loadData(is, myViewportlod);
685  loadData(is, myTransform);
686  loadData(is, myDoAttr);
687  loadData(is, mySetpt);
688  loadData(is, myMulpt);
689  loadData(is, myAddpt);
690  loadData(is, mySubpt);
691  loadData(is, mySetprim);
692  loadData(is, myMulprim);
693  loadData(is, myAddprim);
694  loadData(is, mySubprim);
695  loadData(is, mySetvtx);
696  loadData(is, myMulvtx);
697  loadData(is, myAddvtx);
698  loadData(is, mySubvtx);
699 
700  return true;
701  }
702 
703  const UT_StringHolder & getSourceGroup() const { return mySourceGroup; }
704  void setSourceGroup(const UT_StringHolder & val) { mySourceGroup = val; }
706  {
707  SOP_Node *thissop = cookparms.getNode();
708  if (!thissop) return getSourceGroup();
710  OP_Utils::evalOpParm(result, thissop, "sourcegroup", cookparms.getCookTime(), 0);
711  return result;
712  }
713  const UT_StringHolder & getTargetGroup() const { return myTargetGroup; }
714  void setTargetGroup(const UT_StringHolder & val) { myTargetGroup = val; }
716  {
717  SOP_Node *thissop = cookparms.getNode();
718  if (!thissop) return getTargetGroup();
720  OP_Utils::evalOpParm(result, thissop, "targetgroup", cookparms.getCookTime(), 0);
721  return result;
722  }
723  bool getShowguide() const { return myShowguide; }
724  void setShowguide(bool val) { myShowguide = val; }
725  bool opShowguide(const SOP_NodeVerb::CookParms &cookparms) const
726  {
727  SOP_Node *thissop = cookparms.getNode();
728  if (!thissop) return getShowguide();
729  bool result;
730  OP_Utils::evalOpParm(result, thissop, "showguide", cookparms.getCookTime(), 0);
731  return result;
732  }
733  bool getPack() const { return myPack; }
734  void setPack(bool val) { myPack = val; }
735  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
736  {
737  SOP_Node *thissop = cookparms.getNode();
738  if (!thissop) return getPack();
739  bool result;
740  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
741  return result;
742  }
743  Pivot getPivot() const { return Pivot(myPivot); }
744  void setPivot(Pivot val) { myPivot = int64(val); }
745  Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return getPivot();
749  int64 result;
750  OP_Utils::evalOpParm(result, thissop, "pivot", cookparms.getCookTime(), 0);
751  return Pivot(result);
752  }
753  Viewportlod getViewportlod() const { return Viewportlod(myViewportlod); }
754  void setViewportlod(Viewportlod val) { myViewportlod = int64(val); }
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return getViewportlod();
759  int64 result;
760  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
761  return Viewportlod(result);
762  }
763  bool getTransform() const { return myTransform; }
764  void setTransform(bool val) { myTransform = val; }
765  bool opTransform(const SOP_NodeVerb::CookParms &cookparms) const
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getTransform();
769  bool result;
770  OP_Utils::evalOpParm(result, thissop, "transform", cookparms.getCookTime(), 0);
771  return result;
772  }
773  bool getDoAttr() const { return myDoAttr; }
774  void setDoAttr(bool val) { myDoAttr = val; }
775  bool opDoAttr(const SOP_NodeVerb::CookParms &cookparms) const
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getDoAttr();
779  bool result;
780  OP_Utils::evalOpParm(result, thissop, "doattr", cookparms.getCookTime(), 0);
781  return result;
782  }
783  const UT_StringHolder & getSetpt() const { return mySetpt; }
784  void setSetpt(const UT_StringHolder & val) { mySetpt = val; }
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getSetpt();
790  OP_Utils::evalOpParm(result, thissop, "setpt", cookparms.getCookTime(), 0);
791  return result;
792  }
793  const UT_StringHolder & getMulpt() const { return myMulpt; }
794  void setMulpt(const UT_StringHolder & val) { myMulpt = val; }
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getMulpt();
800  OP_Utils::evalOpParm(result, thissop, "mulpt", cookparms.getCookTime(), 0);
801  return result;
802  }
803  const UT_StringHolder & getAddpt() const { return myAddpt; }
804  void setAddpt(const UT_StringHolder & val) { myAddpt = val; }
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getAddpt();
810  OP_Utils::evalOpParm(result, thissop, "addpt", cookparms.getCookTime(), 0);
811  return result;
812  }
813  const UT_StringHolder & getSubpt() const { return mySubpt; }
814  void setSubpt(const UT_StringHolder & val) { mySubpt = val; }
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getSubpt();
820  OP_Utils::evalOpParm(result, thissop, "subpt", cookparms.getCookTime(), 0);
821  return result;
822  }
823  const UT_StringHolder & getSetprim() const { return mySetprim; }
824  void setSetprim(const UT_StringHolder & val) { mySetprim = val; }
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getSetprim();
830  OP_Utils::evalOpParm(result, thissop, "setprim", cookparms.getCookTime(), 0);
831  return result;
832  }
833  const UT_StringHolder & getMulprim() const { return myMulprim; }
834  void setMulprim(const UT_StringHolder & val) { myMulprim = val; }
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getMulprim();
840  OP_Utils::evalOpParm(result, thissop, "mulprim", cookparms.getCookTime(), 0);
841  return result;
842  }
843  const UT_StringHolder & getAddprim() const { return myAddprim; }
844  void setAddprim(const UT_StringHolder & val) { myAddprim = val; }
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getAddprim();
850  OP_Utils::evalOpParm(result, thissop, "addprim", cookparms.getCookTime(), 0);
851  return result;
852  }
853  const UT_StringHolder & getSubprim() const { return mySubprim; }
854  void setSubprim(const UT_StringHolder & val) { mySubprim = val; }
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getSubprim();
860  OP_Utils::evalOpParm(result, thissop, "subprim", cookparms.getCookTime(), 0);
861  return result;
862  }
863  const UT_StringHolder & getSetvtx() const { return mySetvtx; }
864  void setSetvtx(const UT_StringHolder & val) { mySetvtx = val; }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getSetvtx();
870  OP_Utils::evalOpParm(result, thissop, "setvtx", cookparms.getCookTime(), 0);
871  return result;
872  }
873  const UT_StringHolder & getMulvtx() const { return myMulvtx; }
874  void setMulvtx(const UT_StringHolder & val) { myMulvtx = val; }
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return getMulvtx();
880  OP_Utils::evalOpParm(result, thissop, "mulvtx", cookparms.getCookTime(), 0);
881  return result;
882  }
883  const UT_StringHolder & getAddvtx() const { return myAddvtx; }
884  void setAddvtx(const UT_StringHolder & val) { myAddvtx = val; }
886  {
887  SOP_Node *thissop = cookparms.getNode();
888  if (!thissop) return getAddvtx();
890  OP_Utils::evalOpParm(result, thissop, "addvtx", cookparms.getCookTime(), 0);
891  return result;
892  }
893  const UT_StringHolder & getSubvtx() const { return mySubvtx; }
894  void setSubvtx(const UT_StringHolder & val) { mySubvtx = val; }
896  {
897  SOP_Node *thissop = cookparms.getNode();
898  if (!thissop) return getSubvtx();
900  OP_Utils::evalOpParm(result, thissop, "subvtx", cookparms.getCookTime(), 0);
901  return result;
902  }
903 
904 private:
905  UT_StringHolder mySourceGroup;
906  UT_StringHolder myTargetGroup;
907  bool myShowguide;
908  bool myPack;
909  int64 myPivot;
910  int64 myViewportlod;
911  bool myTransform;
912  bool myDoAttr;
913  UT_StringHolder mySetpt;
914  UT_StringHolder myMulpt;
915  UT_StringHolder myAddpt;
916  UT_StringHolder mySubpt;
917  UT_StringHolder mySetprim;
918  UT_StringHolder myMulprim;
919  UT_StringHolder myAddprim;
920  UT_StringHolder mySubprim;
921  UT_StringHolder mySetvtx;
922  UT_StringHolder myMulvtx;
923  UT_StringHolder myAddvtx;
924  UT_StringHolder mySubvtx;
925 
926 };
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
type
Definition: core.h:556
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:63
const UT_StringHolder & getAddprim() const
void setSubpt(const UT_StringHolder &val)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setTargetGroup(const UT_StringHolder &val)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, UT_Vector4I &v)
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