HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Sort.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_NodeVerb.h>
7 #include <SOP/SOP_GraphProxy.h>
8 
9 #include <OP/OP_Utils.h>
10 #include <PRM/PRM_Parm.h>
11 #include <UT/UT_IStream.h>
12 #include <UT/UT_NTStreamUtil.h>
13 #include <UT/UT_Ramp.h>
14 #include <UT/UT_SharedPtr.h>
15 #include <UT/UT_StringHolder.h>
16 #include <UT/UT_StringStream.h>
17 #include <UT/UT_VectorTypes.h>
18 #include <SYS/SYS_Types.h>
19 
20 using namespace UT::Literal;
21 
22 class DEP_MicroNode;
23 namespace SOP_SortEnums
24 {
25  enum class Ptsort
26  {
27  NONE = 0,
28  VTXORD,
29  BYX,
30  BYY,
31  BYZ,
32  REV,
33  SEED,
34  SHIF,
35  PROX,
36  VECTOR,
37  EXPRESSION,
38  SPATIAL,
39  ATTRIBUTE
40  };
41  enum class Primsort
42  {
43  NONE = 0,
44  BYX,
45  BYY,
46  BYZ,
47  REV,
48  SEED,
49  SHIF,
50  PROX,
51  VECTOR,
52  EXPRESSION,
53  SPATIAL,
54  ATTRIBUTE
55  };
56 }
57 
58 
60 {
61 public:
62  static int version() { return 1; }
63 
65  {
66  myPtsort = 0;
67  myPointseed = 0;
68  myPointoffset = 0;
69  myPointprox = UT_Vector3D(0,0,0);
70  myPointobjpath = ""_sh;
71  myPointdir = UT_Vector3D(0,1,0);
72  myPointexpr = 0;
73  myPointattrib = ""_sh;
74  myPointattribcomp = 0;
75  myPointreverse = false;
76  myPrimsort = 0;
77  myPrimseed = 0;
78  myPrimoffset = 0;
79  myPrimprox = UT_Vector3D(0,0,0);
80  myPrimobjpath = ""_sh;
81  myPrimdir = UT_Vector3D(0,1,0);
82  myPrimexpr = 0;
83  myPrimattrib = ""_sh;
84  myPrimattribcomp = 0;
85  myPrimreverse = false;
86  myVertexPrimOrder = true;
87 
88  }
89 
90  explicit SOP_SortParms(const SOP_SortParms &) = default;
91 
92  ~SOP_SortParms() override {}
93 
94  bool operator==(const SOP_SortParms &src) const
95  {
96  if (myPtsort != src.myPtsort) return false;
97  if (myPointseed != src.myPointseed) return false;
98  if (myPointoffset != src.myPointoffset) return false;
99  if (myPointprox != src.myPointprox) return false;
100  if (myPointobjpath != src.myPointobjpath) return false;
101  if (myPointdir != src.myPointdir) return false;
102  if (myPointexpr != src.myPointexpr) return false;
103  if (myPointattrib != src.myPointattrib) return false;
104  if (myPointattribcomp != src.myPointattribcomp) return false;
105  if (myPointreverse != src.myPointreverse) return false;
106  if (myPrimsort != src.myPrimsort) return false;
107  if (myPrimseed != src.myPrimseed) return false;
108  if (myPrimoffset != src.myPrimoffset) return false;
109  if (myPrimprox != src.myPrimprox) return false;
110  if (myPrimobjpath != src.myPrimobjpath) return false;
111  if (myPrimdir != src.myPrimdir) return false;
112  if (myPrimexpr != src.myPrimexpr) return false;
113  if (myPrimattrib != src.myPrimattrib) return false;
114  if (myPrimattribcomp != src.myPrimattribcomp) return false;
115  if (myPrimreverse != src.myPrimreverse) return false;
116  if (myVertexPrimOrder != src.myVertexPrimOrder) return false;
117 
118  return true;
119  }
120  bool operator!=(const SOP_SortParms &src) const
121  {
122  return !operator==(src);
123  }
126 
127 
128 
129  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
130  {
131  myPtsort = 0;
132  if (true)
133  graph->evalOpParm(myPtsort, nodeidx, "ptsort", time, 0);
134  myPointseed = 0;
135  if (true && ( (!(((int64(getPtsort())!=6)))) ) )
136  graph->evalOpParm(myPointseed, nodeidx, "pointseed", time, 0);
137  myPointoffset = 0;
138  if (true && ( (!(((int64(getPtsort())!=7)))) ) )
139  graph->evalOpParm(myPointoffset, nodeidx, "pointoffset", time, 0);
140  myPointprox = UT_Vector3D(0,0,0);
141  if (true && ( (!(((int64(getPtsort())!=8)))) ) )
142  graph->evalOpParm(myPointprox, nodeidx, "pointprox", time, 0);
143  myPointobjpath = ""_sh;
144  if (true && ( (!(((int64(getPtsort())!=9)))) ) )
145  graph->evalOpParm(myPointobjpath, nodeidx, "pointobjpath", time, 0);
146  myPointdir = UT_Vector3D(0,1,0);
147  if (true && ( (!(((int64(getPtsort())!=9)))) ) )
148  graph->evalOpParm(myPointdir, nodeidx, "pointdir", time, 0);
149  myPointexpr = 0;
150  if (true && ( (!(((int64(getPtsort())!=10)))) ) )
151  graph->evalOpParm(myPointexpr, nodeidx, "pointexpr", time, 0);
152  myPointattrib = ""_sh;
153  if (true && ( (!(((int64(getPtsort())!=12)))) ) )
154  graph->evalOpParm(myPointattrib, nodeidx, "pointattrib", time, 0);
155  myPointattribcomp = 0;
156  if (true && ( (!(((int64(getPtsort())!=12)))) ) )
157  graph->evalOpParm(myPointattribcomp, nodeidx, "pointattribcomp", time, 0);
158  myPointreverse = false;
159  if (true)
160  graph->evalOpParm(myPointreverse, nodeidx, "pointreverse", time, 0);
161  myPrimsort = 0;
162  if (true)
163  graph->evalOpParm(myPrimsort, nodeidx, "primsort", time, 0);
164  myPrimseed = 0;
165  if (true && ( (!(((int64(getPrimsort())!=5)))) ) )
166  graph->evalOpParm(myPrimseed, nodeidx, "primseed", time, 0);
167  myPrimoffset = 0;
168  if (true && ( (!(((int64(getPrimsort())!=6)))) ) )
169  graph->evalOpParm(myPrimoffset, nodeidx, "primoffset", time, 0);
170  myPrimprox = UT_Vector3D(0,0,0);
171  if (true && ( (!(((int64(getPrimsort())!=7)))) ) )
172  graph->evalOpParm(myPrimprox, nodeidx, "primprox", time, 0);
173  myPrimobjpath = ""_sh;
174  if (true && ( (!(((int64(getPrimsort())!=8)))) ) )
175  graph->evalOpParm(myPrimobjpath, nodeidx, "primobjpath", time, 0);
176  myPrimdir = UT_Vector3D(0,1,0);
177  if (true && ( (!(((int64(getPrimsort())!=8)))) ) )
178  graph->evalOpParm(myPrimdir, nodeidx, "primdir", time, 0);
179  myPrimexpr = 0;
180  if (true && ( (!(((int64(getPrimsort())!=9)))) ) )
181  graph->evalOpParm(myPrimexpr, nodeidx, "primexpr", time, 0);
182  myPrimattrib = ""_sh;
183  if (true && ( (!(((int64(getPrimsort())!=11)))) ) )
184  graph->evalOpParm(myPrimattrib, nodeidx, "primattrib", time, 0);
185  myPrimattribcomp = 0;
186  if (true && ( (!(((int64(getPrimsort())!=11)))) ) )
187  graph->evalOpParm(myPrimattribcomp, nodeidx, "primattribcomp", time, 0);
188  myPrimreverse = false;
189  if (true)
190  graph->evalOpParm(myPrimreverse, nodeidx, "primreverse", time, 0);
191  myVertexPrimOrder = true;
192  if (true)
193  graph->evalOpParm(myVertexPrimOrder, nodeidx, "vertexprimorder", time, 0);
194 
195  }
196 
197 
198  void loadFromOpSubclass(const LoadParms &loadparms) override
199  {
200  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
201  }
202 
203 
204  void copyFrom(const SOP_NodeParms *src) override
205  {
206  *this = *((const SOP_SortParms *)src);
207  }
208 
209  template <typename T>
210  void
211  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
212  {
213  if (idx.size() < 1)
214  return;
215  UT_ASSERT(idx.size() == instance.size()+1);
216  if (idx.size() != instance.size()+1)
217  return;
218  switch (idx[0])
219  {
220  case 0:
221  coerceValue(value, myPtsort);
222  break;
223  case 1:
224  coerceValue(value, myPointseed);
225  break;
226  case 2:
227  coerceValue(value, myPointoffset);
228  break;
229  case 3:
230  coerceValue(value, myPointprox);
231  break;
232  case 4:
233  coerceValue(value, myPointobjpath);
234  break;
235  case 5:
236  coerceValue(value, myPointdir);
237  break;
238  case 6:
239  coerceValue(value, myPointexpr);
240  break;
241  case 7:
242  coerceValue(value, myPointattrib);
243  break;
244  case 8:
245  coerceValue(value, myPointattribcomp);
246  break;
247  case 9:
248  coerceValue(value, myPointreverse);
249  break;
250  case 10:
251  coerceValue(value, myPrimsort);
252  break;
253  case 11:
254  coerceValue(value, myPrimseed);
255  break;
256  case 12:
257  coerceValue(value, myPrimoffset);
258  break;
259  case 13:
260  coerceValue(value, myPrimprox);
261  break;
262  case 14:
263  coerceValue(value, myPrimobjpath);
264  break;
265  case 15:
266  coerceValue(value, myPrimdir);
267  break;
268  case 16:
269  coerceValue(value, myPrimexpr);
270  break;
271  case 17:
272  coerceValue(value, myPrimattrib);
273  break;
274  case 18:
275  coerceValue(value, myPrimattribcomp);
276  break;
277  case 19:
278  coerceValue(value, myPrimreverse);
279  break;
280  case 20:
281  coerceValue(value, myVertexPrimOrder);
282  break;
283 
284  }
285  }
286 
287  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
294  { doGetParmValue(idx, instance, value); }
295  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
296  { doGetParmValue(idx, instance, value); }
297  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
298  { doGetParmValue(idx, instance, value); }
299  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
300  { doGetParmValue(idx, instance, value); }
301  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
302  { doGetParmValue(idx, instance, value); }
303  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
304  { doGetParmValue(idx, instance, value); }
305  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
306  { doGetParmValue(idx, instance, value); }
307  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
308  { doGetParmValue(idx, instance, value); }
309 
310  template <typename T>
311  void
312  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
313  {
314  if (idx.size() < 1)
315  return;
316  UT_ASSERT(idx.size() == instance.size()+1);
317  if (idx.size() != instance.size()+1)
318  return;
319  switch (idx[0])
320  {
321  case 0:
322  coerceValue(myPtsort, value);
323  break;
324  case 1:
325  coerceValue(myPointseed, value);
326  break;
327  case 2:
328  coerceValue(myPointoffset, value);
329  break;
330  case 3:
331  coerceValue(myPointprox, value);
332  break;
333  case 4:
334  coerceValue(myPointobjpath, value);
335  break;
336  case 5:
337  coerceValue(myPointdir, value);
338  break;
339  case 6:
340  coerceValue(myPointexpr, value);
341  break;
342  case 7:
343  coerceValue(myPointattrib, value);
344  break;
345  case 8:
346  coerceValue(myPointattribcomp, value);
347  break;
348  case 9:
349  coerceValue(myPointreverse, value);
350  break;
351  case 10:
352  coerceValue(myPrimsort, value);
353  break;
354  case 11:
355  coerceValue(myPrimseed, value);
356  break;
357  case 12:
358  coerceValue(myPrimoffset, value);
359  break;
360  case 13:
361  coerceValue(myPrimprox, value);
362  break;
363  case 14:
364  coerceValue(myPrimobjpath, value);
365  break;
366  case 15:
367  coerceValue(myPrimdir, value);
368  break;
369  case 16:
370  coerceValue(myPrimexpr, value);
371  break;
372  case 17:
373  coerceValue(myPrimattrib, value);
374  break;
375  case 18:
376  coerceValue(myPrimattribcomp, value);
377  break;
378  case 19:
379  coerceValue(myPrimreverse, value);
380  break;
381  case 20:
382  coerceValue(myVertexPrimOrder, value);
383  break;
384 
385  }
386  }
387 
388  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
391  { doSetParmValue(idx, instance, value); }
392  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
393  { doSetParmValue(idx, instance, value); }
394  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
395  { doSetParmValue(idx, instance, value); }
396  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
397  { doSetParmValue(idx, instance, value); }
398  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
399  { doSetParmValue(idx, instance, value); }
400  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
407  { doSetParmValue(idx, instance, value); }
408  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
409  { doSetParmValue(idx, instance, value); }
410 
411  exint getNestNumParms(TempIndex idx) const override
412  {
413  if (idx.size() == 0)
414  return 21;
415  switch (idx[0])
416  {
417 
418  }
419  // Invalid
420  return 0;
421  }
422 
423  const char *getNestParmName(TempIndex fieldnum) const override
424  {
425  if (fieldnum.size() < 1)
426  return 0;
427  switch (fieldnum[0])
428  {
429  case 0:
430  return "ptsort";
431  case 1:
432  return "pointseed";
433  case 2:
434  return "pointoffset";
435  case 3:
436  return "pointprox";
437  case 4:
438  return "pointobjpath";
439  case 5:
440  return "pointdir";
441  case 6:
442  return "pointexpr";
443  case 7:
444  return "pointattrib";
445  case 8:
446  return "pointattribcomp";
447  case 9:
448  return "pointreverse";
449  case 10:
450  return "primsort";
451  case 11:
452  return "primseed";
453  case 12:
454  return "primoffset";
455  case 13:
456  return "primprox";
457  case 14:
458  return "primobjpath";
459  case 15:
460  return "primdir";
461  case 16:
462  return "primexpr";
463  case 17:
464  return "primattrib";
465  case 18:
466  return "primattribcomp";
467  case 19:
468  return "primreverse";
469  case 20:
470  return "vertexprimorder";
471 
472  }
473  return 0;
474  }
475 
476  ParmType getNestParmType(TempIndex fieldnum) const override
477  {
478  if (fieldnum.size() < 1)
479  return PARM_UNSUPPORTED;
480  switch (fieldnum[0])
481  {
482  case 0:
483  return PARM_INTEGER;
484  case 1:
485  return PARM_INTEGER;
486  case 2:
487  return PARM_INTEGER;
488  case 3:
489  return PARM_VECTOR3;
490  case 4:
491  return PARM_STRING;
492  case 5:
493  return PARM_VECTOR3;
494  case 6:
495  return PARM_FLOAT;
496  case 7:
497  return PARM_STRING;
498  case 8:
499  return PARM_INTEGER;
500  case 9:
501  return PARM_INTEGER;
502  case 10:
503  return PARM_INTEGER;
504  case 11:
505  return PARM_INTEGER;
506  case 12:
507  return PARM_INTEGER;
508  case 13:
509  return PARM_VECTOR3;
510  case 14:
511  return PARM_STRING;
512  case 15:
513  return PARM_VECTOR3;
514  case 16:
515  return PARM_FLOAT;
516  case 17:
517  return PARM_STRING;
518  case 18:
519  return PARM_INTEGER;
520  case 19:
521  return PARM_INTEGER;
522  case 20:
523  return PARM_INTEGER;
524 
525  }
526  return PARM_UNSUPPORTED;
527  }
528 
529  // Boiler plate to load individual types.
530  static void loadData(UT_IStream &is, int64 &v)
531  { is.bread(&v, 1); }
532  static void loadData(UT_IStream &is, bool &v)
533  { int64 iv; is.bread(&iv, 1); v = iv; }
534  static void loadData(UT_IStream &is, fpreal64 &v)
535  { is.bread<fpreal64>(&v, 1); }
536  static void loadData(UT_IStream &is, UT_Vector2D &v)
537  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
538  static void loadData(UT_IStream &is, UT_Vector3D &v)
539  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
540  is.bread<fpreal64>(&v.z(), 1); }
541  static void loadData(UT_IStream &is, UT_Vector4D &v)
542  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
543  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
544  static void loadData(UT_IStream &is, UT_Matrix2D &v)
545  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
546  static void loadData(UT_IStream &is, UT_Matrix3D &v)
547  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
548  static void loadData(UT_IStream &is, UT_Matrix4D &v)
549  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
550  static void loadData(UT_IStream &is, UT_Vector2I &v)
551  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
552  static void loadData(UT_IStream &is, UT_Vector3I &v)
553  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
554  is.bread<int64>(&v.z(), 1); }
555  static void loadData(UT_IStream &is, UT_Vector4I &v)
556  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
557  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
559  { is.bread(v); }
561  { UT_StringHolder rampdata;
562  loadData(is, rampdata);
563  if (rampdata.isstring())
564  {
565  v.reset(new UT_Ramp());
566  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
567  v->load(istr);
568  }
569  else v.reset();
570  }
573  loadData(is, data);
574  if (data.isstring())
575  {
576  // Find the data type.
577  const char *colon = UT_StringWrap(data).findChar(':');
578  if (colon)
579  {
580  int typelen = colon - data.buffer();
582  type.strncpy(data.buffer(), typelen);
583  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
584 
585  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
586  }
587  }
588  else v.reset();
589  }
590 
591  static void saveData(std::ostream &os, int64 v)
592  { UTwrite(os, &v); }
593  static void saveData(std::ostream &os, bool v)
594  { int64 iv = v; UTwrite(os, &iv); }
595  static void saveData(std::ostream &os, fpreal64 v)
596  { UTwrite<fpreal64>(os, &v); }
597  static void saveData(std::ostream &os, UT_Vector2D v)
598  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
599  static void saveData(std::ostream &os, UT_Vector3D v)
600  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
601  UTwrite<fpreal64>(os, &v.z()); }
602  static void saveData(std::ostream &os, UT_Vector4D v)
603  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
604  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
605  static void saveData(std::ostream &os, UT_Matrix2D v)
607  static void saveData(std::ostream &os, UT_Matrix3D v)
609  static void saveData(std::ostream &os, UT_Matrix4D v)
611  static void saveData(std::ostream &os, UT_StringHolder s)
612  { UT_StringWrap(s).saveBinary(os); }
613  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
615  UT_OStringStream ostr;
616  if (s) s->save(ostr);
617  result = ostr.str();
618  saveData(os, result);
619  }
620  static void saveData(std::ostream &os, PRM_DataItemHandle s)
622  UT_OStringStream ostr;
623  if (s)
624  {
625  ostr << s->getDataTypeToken();
626  ostr << ":";
627  s->saveBinary(ostr);
628  }
629  result = ostr.str();
630  saveData(os, result);
631  }
632 
633 
634  void save(std::ostream &os) const
635  {
636  int32 v = version();
637  UTwrite(os, &v);
638  saveData(os, myPtsort);
639  saveData(os, myPointseed);
640  saveData(os, myPointoffset);
641  saveData(os, myPointprox);
642  saveData(os, myPointobjpath);
643  saveData(os, myPointdir);
644  saveData(os, myPointexpr);
645  saveData(os, myPointattrib);
646  saveData(os, myPointattribcomp);
647  saveData(os, myPointreverse);
648  saveData(os, myPrimsort);
649  saveData(os, myPrimseed);
650  saveData(os, myPrimoffset);
651  saveData(os, myPrimprox);
652  saveData(os, myPrimobjpath);
653  saveData(os, myPrimdir);
654  saveData(os, myPrimexpr);
655  saveData(os, myPrimattrib);
656  saveData(os, myPrimattribcomp);
657  saveData(os, myPrimreverse);
658  saveData(os, myVertexPrimOrder);
659 
660  }
661 
662  bool load(UT_IStream &is)
663  {
664  int32 v;
665  is.bread(&v, 1);
666  if (version() != v)
667  {
668  // Fail incompatible versions
669  return false;
670  }
671  loadData(is, myPtsort);
672  loadData(is, myPointseed);
673  loadData(is, myPointoffset);
674  loadData(is, myPointprox);
675  loadData(is, myPointobjpath);
676  loadData(is, myPointdir);
677  loadData(is, myPointexpr);
678  loadData(is, myPointattrib);
679  loadData(is, myPointattribcomp);
680  loadData(is, myPointreverse);
681  loadData(is, myPrimsort);
682  loadData(is, myPrimseed);
683  loadData(is, myPrimoffset);
684  loadData(is, myPrimprox);
685  loadData(is, myPrimobjpath);
686  loadData(is, myPrimdir);
687  loadData(is, myPrimexpr);
688  loadData(is, myPrimattrib);
689  loadData(is, myPrimattribcomp);
690  loadData(is, myPrimreverse);
691  loadData(is, myVertexPrimOrder);
692 
693  return true;
694  }
695 
696  Ptsort getPtsort() const { return Ptsort(myPtsort); }
697  void setPtsort(Ptsort val) { myPtsort = int64(val); }
698  Ptsort opPtsort(const SOP_NodeVerb::CookParms &cookparms) const
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getPtsort();
702  int64 result;
703  OP_Utils::evalOpParm(result, thissop, "ptsort", cookparms.getCookTime(), 0);
704  return Ptsort(result);
705  }
706  int64 getPointseed() const { return myPointseed; }
707  void setPointseed(int64 val) { myPointseed = val; }
708  int64 opPointseed(const SOP_NodeVerb::CookParms &cookparms) const
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getPointseed();
712  int64 result;
713  OP_Utils::evalOpParm(result, thissop, "pointseed", cookparms.getCookTime(), 0);
714  return result;
715  }
716  int64 getPointoffset() const { return myPointoffset; }
717  void setPointoffset(int64 val) { myPointoffset = val; }
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getPointoffset();
722  int64 result;
723  OP_Utils::evalOpParm(result, thissop, "pointoffset", cookparms.getCookTime(), 0);
724  return result;
725  }
726  UT_Vector3D getPointprox() const { return myPointprox; }
727  void setPointprox(UT_Vector3D val) { myPointprox = val; }
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getPointprox();
733  OP_Utils::evalOpParm(result, thissop, "pointprox", cookparms.getCookTime(), 0);
734  return result;
735  }
736  const UT_StringHolder & getPointobjpath() const { return myPointobjpath; }
737  void setPointobjpath(const UT_StringHolder & val) { myPointobjpath = val; }
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getPointobjpath();
743  OP_Utils::evalOpParm(result, thissop, "pointobjpath", cookparms.getCookTime(), 0);
744  return result;
745  }
746  UT_Vector3D getPointdir() const { return myPointdir; }
747  void setPointdir(UT_Vector3D val) { myPointdir = val; }
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getPointdir();
753  OP_Utils::evalOpParm(result, thissop, "pointdir", cookparms.getCookTime(), 0);
754  return result;
755  }
756  fpreal64 getPointexpr() const { return myPointexpr; }
757  void setPointexpr(fpreal64 val) { myPointexpr = val; }
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getPointexpr();
763  OP_Utils::evalOpParm(result, thissop, "pointexpr", cookparms.getCookTime(), 0);
764  return result;
765  }
766  const UT_StringHolder & getPointattrib() const { return myPointattrib; }
767  void setPointattrib(const UT_StringHolder & val) { myPointattrib = val; }
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getPointattrib();
773  OP_Utils::evalOpParm(result, thissop, "pointattrib", cookparms.getCookTime(), 0);
774  return result;
775  }
776  int64 getPointattribcomp() const { return myPointattribcomp; }
777  void setPointattribcomp(int64 val) { myPointattribcomp = val; }
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getPointattribcomp();
782  int64 result;
783  OP_Utils::evalOpParm(result, thissop, "pointattribcomp", cookparms.getCookTime(), 0);
784  return result;
785  }
786  bool getPointreverse() const { return myPointreverse; }
787  void setPointreverse(bool val) { myPointreverse = val; }
788  bool opPointreverse(const SOP_NodeVerb::CookParms &cookparms) const
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getPointreverse();
792  bool result;
793  OP_Utils::evalOpParm(result, thissop, "pointreverse", cookparms.getCookTime(), 0);
794  return result;
795  }
796  Primsort getPrimsort() const { return Primsort(myPrimsort); }
797  void setPrimsort(Primsort val) { myPrimsort = int64(val); }
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getPrimsort();
802  int64 result;
803  OP_Utils::evalOpParm(result, thissop, "primsort", cookparms.getCookTime(), 0);
804  return Primsort(result);
805  }
806  int64 getPrimseed() const { return myPrimseed; }
807  void setPrimseed(int64 val) { myPrimseed = val; }
808  int64 opPrimseed(const SOP_NodeVerb::CookParms &cookparms) const
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return getPrimseed();
812  int64 result;
813  OP_Utils::evalOpParm(result, thissop, "primseed", cookparms.getCookTime(), 0);
814  return result;
815  }
816  int64 getPrimoffset() const { return myPrimoffset; }
817  void setPrimoffset(int64 val) { myPrimoffset = val; }
819  {
820  SOP_Node *thissop = cookparms.getNode();
821  if (!thissop) return getPrimoffset();
822  int64 result;
823  OP_Utils::evalOpParm(result, thissop, "primoffset", cookparms.getCookTime(), 0);
824  return result;
825  }
826  UT_Vector3D getPrimprox() const { return myPrimprox; }
827  void setPrimprox(UT_Vector3D val) { myPrimprox = val; }
829  {
830  SOP_Node *thissop = cookparms.getNode();
831  if (!thissop) return getPrimprox();
833  OP_Utils::evalOpParm(result, thissop, "primprox", cookparms.getCookTime(), 0);
834  return result;
835  }
836  const UT_StringHolder & getPrimobjpath() const { return myPrimobjpath; }
837  void setPrimobjpath(const UT_StringHolder & val) { myPrimobjpath = val; }
839  {
840  SOP_Node *thissop = cookparms.getNode();
841  if (!thissop) return getPrimobjpath();
843  OP_Utils::evalOpParm(result, thissop, "primobjpath", cookparms.getCookTime(), 0);
844  return result;
845  }
846  UT_Vector3D getPrimdir() const { return myPrimdir; }
847  void setPrimdir(UT_Vector3D val) { myPrimdir = val; }
849  {
850  SOP_Node *thissop = cookparms.getNode();
851  if (!thissop) return getPrimdir();
853  OP_Utils::evalOpParm(result, thissop, "primdir", cookparms.getCookTime(), 0);
854  return result;
855  }
856  fpreal64 getPrimexpr() const { return myPrimexpr; }
857  void setPrimexpr(fpreal64 val) { myPrimexpr = val; }
859  {
860  SOP_Node *thissop = cookparms.getNode();
861  if (!thissop) return getPrimexpr();
863  OP_Utils::evalOpParm(result, thissop, "primexpr", cookparms.getCookTime(), 0);
864  return result;
865  }
866  const UT_StringHolder & getPrimattrib() const { return myPrimattrib; }
867  void setPrimattrib(const UT_StringHolder & val) { myPrimattrib = val; }
869  {
870  SOP_Node *thissop = cookparms.getNode();
871  if (!thissop) return getPrimattrib();
873  OP_Utils::evalOpParm(result, thissop, "primattrib", cookparms.getCookTime(), 0);
874  return result;
875  }
876  int64 getPrimattribcomp() const { return myPrimattribcomp; }
877  void setPrimattribcomp(int64 val) { myPrimattribcomp = val; }
879  {
880  SOP_Node *thissop = cookparms.getNode();
881  if (!thissop) return getPrimattribcomp();
882  int64 result;
883  OP_Utils::evalOpParm(result, thissop, "primattribcomp", cookparms.getCookTime(), 0);
884  return result;
885  }
886  bool getPrimreverse() const { return myPrimreverse; }
887  void setPrimreverse(bool val) { myPrimreverse = val; }
888  bool opPrimreverse(const SOP_NodeVerb::CookParms &cookparms) const
889  {
890  SOP_Node *thissop = cookparms.getNode();
891  if (!thissop) return getPrimreverse();
892  bool result;
893  OP_Utils::evalOpParm(result, thissop, "primreverse", cookparms.getCookTime(), 0);
894  return result;
895  }
896  bool getVertexPrimOrder() const { return myVertexPrimOrder; }
897  void setVertexPrimOrder(bool val) { myVertexPrimOrder = val; }
898  bool opVertexPrimOrder(const SOP_NodeVerb::CookParms &cookparms) const
899  {
900  SOP_Node *thissop = cookparms.getNode();
901  if (!thissop) return getVertexPrimOrder();
902  bool result;
903  OP_Utils::evalOpParm(result, thissop, "vertexprimorder", cookparms.getCookTime(), 0);
904  return result;
905  }
906 
907 private:
908  int64 myPtsort;
909  int64 myPointseed;
910  int64 myPointoffset;
911  UT_Vector3D myPointprox;
912  UT_StringHolder myPointobjpath;
913  UT_Vector3D myPointdir;
914  fpreal64 myPointexpr;
915  UT_StringHolder myPointattrib;
916  int64 myPointattribcomp;
917  bool myPointreverse;
918  int64 myPrimsort;
919  int64 myPrimseed;
920  int64 myPrimoffset;
921  UT_Vector3D myPrimprox;
922  UT_StringHolder myPrimobjpath;
923  UT_Vector3D myPrimdir;
924  fpreal64 myPrimexpr;
925  UT_StringHolder myPrimattrib;
926  int64 myPrimattribcomp;
927  bool myPrimreverse;
928  bool myVertexPrimOrder;
929 
930 };
GLdouble s
Definition: glew.h:1390
void setPointreverse(bool val)
void setPointobjpath(const UT_StringHolder &val)
int64 opPrimattribcomp(const SOP_NodeVerb::CookParms &cookparms) const
bool getVertexPrimOrder() const
int64 getPointseed() const
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, int64 &v)
UT_Vector3D getPrimdir() const
void save(std::ostream &os) const
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
void setPrimreverse(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setPointexpr(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 opPointattribcomp(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_SortParms &src) const
const UT_StringHolder & getPointobjpath() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
GLuint const GLfloat * val
Definition: glew.h:2794
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, fpreal64 v)
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 getPrimexpr() const
Primsort opPrimsort(const SOP_NodeVerb::CookParms &cookparms) const
int64 exint
Definition: SYS_Types.h:125
void setPointoffset(int64 val)
SYS_FORCE_INLINE const char * buffer() const
int64 getPointattribcomp() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
UT_Vector3D opPointprox(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setPrimexpr(fpreal64 val)
int64 opPrimoffset(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_StringHolder opPrimobjpath(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glew.h:1391
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool opPrimreverse(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
Ptsort getPtsort() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setPointattribcomp(int64 val)
void setPrimattribcomp(int64 val)
fpreal64 opPointexpr(const SOP_NodeVerb::CookParms &cookparms) const
Primsort getPrimsort() const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_Vector3D opPointdir(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
double fpreal64
Definition: SYS_Types.h:201
bool opVertexPrimOrder(const SOP_NodeVerb::CookParms &cookparms) const
void setPointdir(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool getPointreverse() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
int64 opPointoffset(const SOP_NodeVerb::CookParms &cookparms) const
void setPrimseed(int64 val)
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
static void saveData(std::ostream &os, UT_Vector3D v)
exint length() const
UT_Vector3D getPointprox() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
const UT_StringHolder & getPrimattrib() const
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
static void loadData(UT_IStream &is, UT_Vector4I &v)
int64 getPrimattribcomp() const
int64 getPrimseed() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
const GLfloat * c
Definition: glew.h:16296
static int version()
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
long long int64
Definition: SYS_Types.h:116
void setPrimdir(UT_Vector3D val)
int64 getPointoffset() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
Ptsort opPtsort(const SOP_NodeVerb::CookParms &cookparms) const
void setPointattrib(const UT_StringHolder &val)
UT_StringHolder opPrimattrib(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
bool load(UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool getPrimreverse() const
UT_Vector3D getPointdir() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void setPtsort(Ptsort val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
int64 opPrimseed(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
int64 getPrimoffset() const
UT_Vector3D opPrimprox(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getPointattrib() const
UT_StringHolder opPointattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setPrimobjpath(const UT_StringHolder &val)
void setPrimoffset(int64 val)
void setPrimprox(UT_Vector3D val)
const UT_StringHolder & getPrimobjpath() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
int64 opPointseed(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
static void saveData(std::ostream &os, UT_Matrix2D v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
~SOP_SortParms() override
void setPrimsort(Primsort val)
void setVertexPrimOrder(bool val)
#define SOP_API
Definition: SOP_API.h:10
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, int64 v)
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal64 opPrimexpr(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
bool opPointreverse(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
GLuint64EXT * result
Definition: glew.h:14007
void setPrimattrib(const UT_StringHolder &val)
void loadFromOpSubclass(const LoadParms &loadparms) override
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void copyFrom(const SOP_NodeParms *src) override
UT_Vector3D getPrimprox() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setPointseed(int64 val)
void setPointprox(UT_Vector3D val)
bool operator!=(const SOP_SortParms &src) const
GLsizei const GLfloat * value
Definition: glew.h:1849
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_StringHolder opPointobjpath(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
fpreal64 getPointexpr() const
UT_Vector3D opPrimdir(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override