HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_PCA.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_PCAEnums
24 {
25  enum class DataType
26  {
27  POINT = 0,
28  VOLUME
29  };
30 
32  getToken(DataType enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case DataType::POINT: return "point"_sh;
37  case DataType::VOLUME: return "volume"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Mode
43  {
44  ANALYSE = 0,
45  SCREE,
46  PROJECT,
48  };
49 
51  getToken(Mode enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case Mode::ANALYSE: return "analyse"_sh;
56  case Mode::SCREE: return "scree"_sh;
57  case Mode::PROJECT: return "project"_sh;
58  case Mode::RECONSTRUCT: return "reconstruct"_sh;
59  default: UT_ASSERT(false); return ""_sh;
60  }
61  }
62 
63 }
64 
65 
67 {
68 public:
69  static int version() { return 1; }
70 
72  {
73  myDataType = 0;
74  myAttribs = "P"_UTsh;
75  myStride = 1024;
76  myMode = 0;
77  myIncludeMeanWeight = true;
78  mySkip = 0;
79  myComp = 10;
80  myXscale = 0.1;
81  myYscale = 1;
82  myPropcolor = UT_Vector3D(1,1,0);
83  myCumcolor = UT_Vector3D(0,1,1);
84 
85  }
86 
87  explicit SOP_PCAParms(const SOP_PCAParms &) = default;
88  SOP_PCAParms &operator=(const SOP_PCAParms &) = default;
89  SOP_PCAParms(SOP_PCAParms &&) noexcept = default;
90  SOP_PCAParms &operator=(SOP_PCAParms &&) noexcept = default;
91 
92  ~SOP_PCAParms() override {}
93 
94  bool operator==(const SOP_PCAParms &src) const
95  {
96  if (myDataType != src.myDataType) return false;
97  if (myAttribs != src.myAttribs) return false;
98  if (myStride != src.myStride) return false;
99  if (myMode != src.myMode) return false;
100  if (myIncludeMeanWeight != src.myIncludeMeanWeight) return false;
101  if (mySkip != src.mySkip) return false;
102  if (myComp != src.myComp) return false;
103  if (myXscale != src.myXscale) return false;
104  if (myYscale != src.myYscale) return false;
105  if (myPropcolor != src.myPropcolor) return false;
106  if (myCumcolor != src.myCumcolor) return false;
107 
108  return true;
109  }
110  bool operator!=(const SOP_PCAParms &src) const
111  {
112  return !operator==(src);
113  }
116 
117 
118 
119  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
120  {
121  myDataType = 0;
122  if (true)
123  graph->evalOpParm(myDataType, nodeidx, "datatype", time, 0);
124  myAttribs = "P"_UTsh;
125  if (true && ( (true&&!(((int64(getDataType())!=0)))) ) )
126  graph->evalOpParm(myAttribs, nodeidx, "attribs", time, 0);
127  myStride = 1024;
128  if (true && ( (true&&!(((int64(getDataType())!=0)))) ) )
129  graph->evalOpParm(myStride, nodeidx, "stride", time, 0);
130  myMode = 0;
131  if (true)
132  graph->evalOpParm(myMode, nodeidx, "mode", time, 0);
133  myIncludeMeanWeight = true;
134  if (true && ( (true&&!(((int64(getMode())==0))||((int64(getMode())==1)))) ) )
135  graph->evalOpParm(myIncludeMeanWeight, nodeidx, "includemeanweight", time, 0);
136  mySkip = 0;
137  if (true && ( (true&&!(((int64(getMode())!=1)))) ) )
138  graph->evalOpParm(mySkip, nodeidx, "skip", time, 0);
139  myComp = 10;
140  if (true && ( (true&&!(((int64(getMode())!=0)&&(int64(getMode())!=1)))) ) )
141  graph->evalOpParm(myComp, nodeidx, "comp", time, 0);
142  myXscale = 0.1;
143  if (true && ( (true&&!(((int64(getMode())!=1)))) ) )
144  graph->evalOpParm(myXscale, nodeidx, "xscale", time, 0);
145  myYscale = 1;
146  if (true && ( (true&&!(((int64(getMode())!=1)))) ) )
147  graph->evalOpParm(myYscale, nodeidx, "yscale", time, 0);
148  myPropcolor = UT_Vector3D(1,1,0);
149  if (true && ( (true&&!(((int64(getMode())!=1)))) ) )
150  graph->evalOpParm(myPropcolor, nodeidx, "propcolor", time, 0);
151  myCumcolor = UT_Vector3D(0,1,1);
152  if (true && ( (true&&!(((int64(getMode())!=1)))) ) )
153  graph->evalOpParm(myCumcolor, nodeidx, "cumcolor", time, 0);
154 
155  }
156 
157 
158  void loadFromOpSubclass(const LoadParms &loadparms) override
159  {
160  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
161  }
162 
163 
164  void copyFrom(const OP_NodeParms *src) override
165  {
166  *this = *((const SOP_PCAParms *)src);
167  }
168 
169  template <typename T>
170  void
171  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
172  {
173  if (idx.size() < 1)
174  return;
175  UT_ASSERT(idx.size() == instance.size()+1);
176  if (idx.size() != instance.size()+1)
177  return;
178  switch (idx[0])
179  {
180  case 0:
181  coerceValue(value, myDataType);
182  break;
183  case 1:
184  coerceValue(value, myAttribs);
185  break;
186  case 2:
187  coerceValue(value, myStride);
188  break;
189  case 3:
190  coerceValue(value, myMode);
191  break;
192  case 4:
193  coerceValue(value, myIncludeMeanWeight);
194  break;
195  case 5:
196  coerceValue(value, mySkip);
197  break;
198  case 6:
199  coerceValue(value, myComp);
200  break;
201  case 7:
202  coerceValue(value, myXscale);
203  break;
204  case 8:
205  coerceValue(value, myYscale);
206  break;
207  case 9:
208  coerceValue(value, myPropcolor);
209  break;
210  case 10:
211  coerceValue(value, myCumcolor);
212  break;
213 
214  }
215  }
216 
217  bool isParmColorRamp(exint idx) const override
218  {
219  switch (idx)
220  {
221 
222  }
223  return false;
224  }
225 
226  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
227  { doGetParmValue(idx, instance, value); }
228  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
229  { doGetParmValue(idx, instance, value); }
230  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
231  { doGetParmValue(idx, instance, value); }
232  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
233  { doGetParmValue(idx, instance, value); }
234  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
235  { doGetParmValue(idx, instance, value); }
236  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
237  { doGetParmValue(idx, instance, value); }
238  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
239  { doGetParmValue(idx, instance, value); }
240  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
241  { doGetParmValue(idx, instance, value); }
242  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
243  { doGetParmValue(idx, instance, value); }
244  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
245  { doGetParmValue(idx, instance, value); }
246  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
247  { doGetParmValue(idx, instance, value); }
248 
249  template <typename T>
250  void
251  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
252  {
253  if (idx.size() < 1)
254  return;
255  UT_ASSERT(idx.size() == instance.size()+1);
256  if (idx.size() != instance.size()+1)
257  return;
258  switch (idx[0])
259  {
260  case 0:
261  coerceValue(myDataType, clampMinValue(0, clampMaxValue(1, value ) ));
262  break;
263  case 1:
264  coerceValue(myAttribs, ( ( value ) ));
265  break;
266  case 2:
267  coerceValue(myStride, clampMinValue(1, ( value ) ));
268  break;
269  case 3:
270  coerceValue(myMode, clampMinValue(0, clampMaxValue(3, value ) ));
271  break;
272  case 4:
273  coerceValue(myIncludeMeanWeight, ( ( value ) ));
274  break;
275  case 5:
276  coerceValue(mySkip, clampMinValue(0, ( value ) ));
277  break;
278  case 6:
279  coerceValue(myComp, clampMinValue(0, ( value ) ));
280  break;
281  case 7:
282  coerceValue(myXscale, clampMinValue(0, ( value ) ));
283  break;
284  case 8:
285  coerceValue(myYscale, clampMinValue(0, ( value ) ));
286  break;
287  case 9:
288  coerceValue(myPropcolor, ( ( value ) ));
289  break;
290  case 10:
291  coerceValue(myCumcolor, ( ( value ) ));
292  break;
293 
294  }
295  }
296 
297  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
298  { doSetParmValue(idx, instance, value); }
299  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
300  { doSetParmValue(idx, instance, value); }
301  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
302  { doSetParmValue(idx, instance, value); }
303  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
304  { doSetParmValue(idx, instance, value); }
305  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
306  { doSetParmValue(idx, instance, value); }
307  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
308  { doSetParmValue(idx, instance, value); }
309  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
310  { doSetParmValue(idx, instance, value); }
311  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
312  { doSetParmValue(idx, instance, value); }
313  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
314  { doSetParmValue(idx, instance, value); }
315  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
316  { doSetParmValue(idx, instance, value); }
317  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
318  { doSetParmValue(idx, instance, value); }
319 
320  exint getNestNumParms(TempIndex idx) const override
321  {
322  if (idx.size() == 0)
323  return 11;
324  switch (idx[0])
325  {
326 
327  }
328  // Invalid
329  return 0;
330  }
331 
332  const char *getNestParmName(TempIndex fieldnum) const override
333  {
334  if (fieldnum.size() < 1)
335  return 0;
336  switch (fieldnum[0])
337  {
338  case 0:
339  return "datatype";
340  case 1:
341  return "attribs";
342  case 2:
343  return "stride";
344  case 3:
345  return "mode";
346  case 4:
347  return "includemeanweight";
348  case 5:
349  return "skip";
350  case 6:
351  return "comp";
352  case 7:
353  return "xscale";
354  case 8:
355  return "yscale";
356  case 9:
357  return "propcolor";
358  case 10:
359  return "cumcolor";
360 
361  }
362  return 0;
363  }
364 
365  ParmType getNestParmType(TempIndex fieldnum) const override
366  {
367  if (fieldnum.size() < 1)
368  return PARM_UNSUPPORTED;
369  switch (fieldnum[0])
370  {
371  case 0:
372  return PARM_INTEGER;
373  case 1:
374  return PARM_STRING;
375  case 2:
376  return PARM_INTEGER;
377  case 3:
378  return PARM_INTEGER;
379  case 4:
380  return PARM_INTEGER;
381  case 5:
382  return PARM_INTEGER;
383  case 6:
384  return PARM_INTEGER;
385  case 7:
386  return PARM_FLOAT;
387  case 8:
388  return PARM_FLOAT;
389  case 9:
390  return PARM_VECTOR3;
391  case 10:
392  return PARM_VECTOR3;
393 
394  }
395  return PARM_UNSUPPORTED;
396  }
397 
398  // Boiler plate to load individual types.
399  static void loadData(UT_IStream &is, int64 &v)
400  { is.bread(&v, 1); }
401  static void loadData(UT_IStream &is, bool &v)
402  { int64 iv; is.bread(&iv, 1); v = iv; }
403  static void loadData(UT_IStream &is, fpreal64 &v)
404  { is.bread<fpreal64>(&v, 1); }
405  static void loadData(UT_IStream &is, UT_Vector2D &v)
406  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
407  static void loadData(UT_IStream &is, UT_Vector3D &v)
408  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
409  is.bread<fpreal64>(&v.z(), 1); }
410  static void loadData(UT_IStream &is, UT_Vector4D &v)
411  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
412  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
413  static void loadData(UT_IStream &is, UT_Matrix2D &v)
414  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
415  static void loadData(UT_IStream &is, UT_Matrix3D &v)
416  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
417  static void loadData(UT_IStream &is, UT_Matrix4D &v)
418  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
419  static void loadData(UT_IStream &is, UT_Vector2I &v)
420  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
421  static void loadData(UT_IStream &is, UT_Vector3I &v)
422  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
423  is.bread<int64>(&v.z(), 1); }
424  static void loadData(UT_IStream &is, UT_Vector4I &v)
425  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
426  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
428  { is.bread(v); }
430  { UT_StringHolder rampdata;
431  loadData(is, rampdata);
432  if (rampdata.isstring())
433  {
434  v.reset(new UT_Ramp());
435  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
436  v->load(istr);
437  }
438  else v.reset();
439  }
442  loadData(is, data);
443  if (data.isstring())
444  {
445  // Find the data type.
446  const char *colon = UT_StringWrap(data).findChar(':');
447  if (colon)
448  {
449  int typelen = colon - data.buffer();
451  type.strncpy(data.buffer(), typelen);
452  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
453 
454  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
455  }
456  }
457  else v.reset();
458  }
459 
460  static void saveData(std::ostream &os, int64 v)
461  { UTwrite(os, &v); }
462  static void saveData(std::ostream &os, bool v)
463  { int64 iv = v; UTwrite(os, &iv); }
464  static void saveData(std::ostream &os, fpreal64 v)
465  { UTwrite<fpreal64>(os, &v); }
466  static void saveData(std::ostream &os, UT_Vector2D v)
467  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
468  static void saveData(std::ostream &os, UT_Vector3D v)
469  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
470  UTwrite<fpreal64>(os, &v.z()); }
471  static void saveData(std::ostream &os, UT_Vector4D v)
472  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
473  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
474  static void saveData(std::ostream &os, UT_Matrix2D v)
476  static void saveData(std::ostream &os, UT_Matrix3D v)
478  static void saveData(std::ostream &os, UT_Matrix4D v)
480  static void saveData(std::ostream &os, UT_StringHolder s)
481  { UT_StringWrap(s).saveBinary(os); }
482  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
484  UT_OStringStream ostr;
485  if (s) s->save(ostr);
486  result = ostr.str();
487  saveData(os, result);
488  }
489  static void saveData(std::ostream &os, PRM_DataItemHandle s)
491  UT_OStringStream ostr;
492  if (s)
493  {
494  ostr << s->getDataTypeToken();
495  ostr << ":";
496  s->saveBinary(ostr);
497  }
498  result = ostr.str();
499  saveData(os, result);
500  }
501 
502 
503  void save(std::ostream &os) const
504  {
505  int32 v = version();
506  UTwrite(os, &v);
507  saveData(os, myDataType);
508  saveData(os, myAttribs);
509  saveData(os, myStride);
510  saveData(os, myMode);
511  saveData(os, myIncludeMeanWeight);
512  saveData(os, mySkip);
513  saveData(os, myComp);
514  saveData(os, myXscale);
515  saveData(os, myYscale);
516  saveData(os, myPropcolor);
517  saveData(os, myCumcolor);
518 
519  }
520 
521  bool load(UT_IStream &is)
522  {
523  int32 v;
524  is.bread(&v, 1);
525  if (version() != v)
526  {
527  // Fail incompatible versions
528  return false;
529  }
530  loadData(is, myDataType);
531  loadData(is, myAttribs);
532  loadData(is, myStride);
533  loadData(is, myMode);
534  loadData(is, myIncludeMeanWeight);
535  loadData(is, mySkip);
536  loadData(is, myComp);
537  loadData(is, myXscale);
538  loadData(is, myYscale);
539  loadData(is, myPropcolor);
540  loadData(is, myCumcolor);
541 
542  return true;
543  }
544 
545  DataType getDataType() const { return DataType(myDataType); }
546  void setDataType(DataType val) { myDataType = int64(val); }
548  {
549  SOP_Node *thissop = cookparms.getNode();
550  if (!thissop) return getDataType();
551  int64 result;
552  OP_Utils::evalOpParm(result, thissop, "datatype", cookparms.getCookTime(), 0);
553  return DataType(result);
554  }
555  const UT_StringHolder & getAttribs() const { return myAttribs; }
556  void setAttribs(const UT_StringHolder & val) { myAttribs = val; }
558  {
559  SOP_Node *thissop = cookparms.getNode();
560  if (!thissop) return getAttribs();
562  OP_Utils::evalOpParm(result, thissop, "attribs", cookparms.getCookTime(), 0);
563  return result;
564  }
565  int64 getStride() const { return myStride; }
566  void setStride(int64 val) { myStride = val; }
567  int64 opStride(const SOP_NodeVerb::CookParms &cookparms) const
568  {
569  SOP_Node *thissop = cookparms.getNode();
570  if (!thissop) return getStride();
571  int64 result;
572  OP_Utils::evalOpParm(result, thissop, "stride", cookparms.getCookTime(), 0);
573  return result;
574  }
575  Mode getMode() const { return Mode(myMode); }
576  void setMode(Mode val) { myMode = int64(val); }
577  Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
578  {
579  SOP_Node *thissop = cookparms.getNode();
580  if (!thissop) return getMode();
581  int64 result;
582  OP_Utils::evalOpParm(result, thissop, "mode", cookparms.getCookTime(), 0);
583  return Mode(result);
584  }
585  bool getIncludeMeanWeight() const { return myIncludeMeanWeight; }
586  void setIncludeMeanWeight(bool val) { myIncludeMeanWeight = val; }
587  bool opIncludeMeanWeight(const SOP_NodeVerb::CookParms &cookparms) const
588  {
589  SOP_Node *thissop = cookparms.getNode();
590  if (!thissop) return getIncludeMeanWeight();
591  bool result;
592  OP_Utils::evalOpParm(result, thissop, "includemeanweight", cookparms.getCookTime(), 0);
593  return result;
594  }
595  int64 getSkip() const { return mySkip; }
596  void setSkip(int64 val) { mySkip = val; }
597  int64 opSkip(const SOP_NodeVerb::CookParms &cookparms) const
598  {
599  SOP_Node *thissop = cookparms.getNode();
600  if (!thissop) return getSkip();
601  int64 result;
602  OP_Utils::evalOpParm(result, thissop, "skip", cookparms.getCookTime(), 0);
603  return result;
604  }
605  int64 getComp() const { return myComp; }
606  void setComp(int64 val) { myComp = val; }
607  int64 opComp(const SOP_NodeVerb::CookParms &cookparms) const
608  {
609  SOP_Node *thissop = cookparms.getNode();
610  if (!thissop) return getComp();
611  int64 result;
612  OP_Utils::evalOpParm(result, thissop, "comp", cookparms.getCookTime(), 0);
613  return result;
614  }
615  fpreal64 getXscale() const { return myXscale; }
616  void setXscale(fpreal64 val) { myXscale = val; }
617  fpreal64 opXscale(const SOP_NodeVerb::CookParms &cookparms) const
618  {
619  SOP_Node *thissop = cookparms.getNode();
620  if (!thissop) return getXscale();
622  OP_Utils::evalOpParm(result, thissop, "xscale", cookparms.getCookTime(), 0);
623  return result;
624  }
625  fpreal64 getYscale() const { return myYscale; }
626  void setYscale(fpreal64 val) { myYscale = val; }
627  fpreal64 opYscale(const SOP_NodeVerb::CookParms &cookparms) const
628  {
629  SOP_Node *thissop = cookparms.getNode();
630  if (!thissop) return getYscale();
632  OP_Utils::evalOpParm(result, thissop, "yscale", cookparms.getCookTime(), 0);
633  return result;
634  }
635  UT_Vector3D getPropcolor() const { return myPropcolor; }
636  void setPropcolor(UT_Vector3D val) { myPropcolor = val; }
638  {
639  SOP_Node *thissop = cookparms.getNode();
640  if (!thissop) return getPropcolor();
642  OP_Utils::evalOpParm(result, thissop, "propcolor", cookparms.getCookTime(), 0);
643  return result;
644  }
645  UT_Vector3D getCumcolor() const { return myCumcolor; }
646  void setCumcolor(UT_Vector3D val) { myCumcolor = val; }
648  {
649  SOP_Node *thissop = cookparms.getNode();
650  if (!thissop) return getCumcolor();
652  OP_Utils::evalOpParm(result, thissop, "cumcolor", cookparms.getCookTime(), 0);
653  return result;
654  }
655 
656 private:
657  int64 myDataType;
658  UT_StringHolder myAttribs;
659  int64 myStride;
660  int64 myMode;
661  bool myIncludeMeanWeight;
662  int64 mySkip;
663  int64 myComp;
664  fpreal64 myXscale;
665  fpreal64 myYscale;
666  UT_Vector3D myPropcolor;
667  UT_Vector3D myCumcolor;
668 
669 };
static void loadData(UT_IStream &is, UT_Vector2D &v)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
void setMode(Mode val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const char * getNestParmName(TempIndex fieldnum) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
int64 getStride() const
static void saveData(std::ostream &os, UT_Vector3D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(DataType enum_value)
Definition: SOP_PCA.proto.h:32
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool operator!=(const SOP_PCAParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
DataType getDataType() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, bool &v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_Vector3D getCumcolor() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void setDataType(DataType val)
An output stream object that owns its own string buffer storage.
bool operator==(const SOP_PCAParms &src) const
Definition: SOP_PCA.proto.h:94
**But if you need a result
Definition: thread.h:613
int64 getComp() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
const UT_StringHolder & getAttribs() const
bool load(UT_IStream &is)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setPropcolor(UT_Vector3D val)
void save(std::ostream &os) const
DataType opDataType(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
double fpreal64
Definition: SYS_Types.h:201
bool opIncludeMeanWeight(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
int64 getSkip() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
bool isParmColorRamp(exint idx) const override
UT_Vector3D getPropcolor() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_Vector3D opPropcolor(const SOP_NodeVerb::CookParms &cookparms) const
int64 opStride(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal64 opXscale(const SOP_NodeVerb::CookParms &cookparms) const
void setStride(int64 val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
fpreal64 getYscale() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_StringHolder opAttribs(const SOP_NodeVerb::CookParms &cookparms) const
Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
long long int64
Definition: SYS_Types.h:116
UT_Vector3T< fpreal64 > UT_Vector3D
ParmType getNestParmType(TempIndex fieldnum) const override
int64 opComp(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setAttribs(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
static int version()
Definition: SOP_PCA.proto.h:69
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, bool v)
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setYscale(fpreal64 val)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
fpreal64 opYscale(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_Vector4I &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setCumcolor(UT_Vector3D val)
int64 opSkip(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
void setXscale(fpreal64 val)
fpreal64 getXscale() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setSkip(int64 val)
GLboolean r
Definition: glcorearb.h:1222
static void saveData(std::ostream &os, fpreal64 v)
bool getIncludeMeanWeight() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
Mode getMode() const
UT_Vector3D opCumcolor(const SOP_NodeVerb::CookParms &cookparms) const
void setIncludeMeanWeight(bool val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setComp(int64 val)
GLenum src
Definition: glcorearb.h:1793
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663