HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Normal.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_NormalEnums
24 {
25  enum class Grouptype
26  {
27  GUESS = 0,
28  VERTICES,
29  EDGES,
30  POINTS,
31  PRIMS
32  };
33 
35  getToken(Grouptype enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case Grouptype::GUESS: return "guess"_sh;
40  case Grouptype::VERTICES: return "vertices"_sh;
41  case Grouptype::EDGES: return "edges"_sh;
42  case Grouptype::POINTS: return "points"_sh;
43  case Grouptype::PRIMS: return "prims"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class Type
49  {
50  TYPEPOINT = 0,
51  TYPEVERTEX,
52  TYPEPRIM,
54  };
55 
57  getToken(Type enum_value)
58  {
59  using namespace UT::Literal;
60  switch (enum_value) {
61  case Type::TYPEPOINT: return "typepoint"_sh;
62  case Type::TYPEVERTEX: return "typevertex"_sh;
63  case Type::TYPEPRIM: return "typeprim"_sh;
64  case Type::TYPEDETAIL: return "typedetail"_sh;
65  default: UT_ASSERT(false); return ""_sh;
66  }
67  }
68 
69  enum class Method
70  {
71  UNIFORM = 0,
72  ANGLE,
73  AREA
74  };
75 
77  getToken(Method enum_value)
78  {
79  using namespace UT::Literal;
80  switch (enum_value) {
81  case Method::UNIFORM: return "uniform"_sh;
82  case Method::ANGLE: return "angle"_sh;
83  case Method::AREA: return "area"_sh;
84  default: UT_ASSERT(false); return ""_sh;
85  }
86  }
87 
88 }
89 
90 
92 {
93 public:
94  static int version() { return 1; }
95 
97  {
98  myGroup = ""_UTsh;
99  myGrouptype = 0;
100  myOverrideNormal = false;
101  myAttribName = "N"_UTsh;
102  myDoCompute = true;
103  myType = 1;
104  myCuspangle = 60;
105  myMethod = 1;
106  myOrigIfZero = true;
107  myNormalize = false;
108  myReverse = false;
109 
110  }
111 
112  explicit SOP_NormalParms(const SOP_NormalParms &) = default;
113  SOP_NormalParms &operator=(const SOP_NormalParms &) = default;
114  SOP_NormalParms(SOP_NormalParms &&) noexcept = default;
115  SOP_NormalParms &operator=(SOP_NormalParms &&) noexcept = default;
116 
117  ~SOP_NormalParms() override {}
118 
119  bool operator==(const SOP_NormalParms &src) const
120  {
121  if (myGroup != src.myGroup) return false;
122  if (myGrouptype != src.myGrouptype) return false;
123  if (myOverrideNormal != src.myOverrideNormal) return false;
124  if (myAttribName != src.myAttribName) return false;
125  if (myDoCompute != src.myDoCompute) return false;
126  if (myType != src.myType) return false;
127  if (myCuspangle != src.myCuspangle) return false;
128  if (myMethod != src.myMethod) return false;
129  if (myOrigIfZero != src.myOrigIfZero) return false;
130  if (myNormalize != src.myNormalize) return false;
131  if (myReverse != src.myReverse) return false;
132 
133  return true;
134  }
135  bool operator!=(const SOP_NormalParms &src) const
136  {
137  return !operator==(src);
138  }
142 
143 
144 
145  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
146  {
147  myGroup = ""_UTsh;
148  if (true)
149  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
150  myGrouptype = 0;
151  if (true)
152  graph->evalOpParm(myGrouptype, nodeidx, "grouptype", time, 0);
153  myOverrideNormal = false;
154  if (true)
155  graph->evalOpParm(myOverrideNormal, nodeidx, "overridenormal", time, 0);
156  myAttribName = "N"_UTsh;
157  if (true && ( (true&&!(((getOverrideNormal()==0)))) ) )
158  graph->evalOpParm(myAttribName, nodeidx, "normalattrib", time, 0);
159  myDoCompute = true;
160  if (true)
161  graph->evalOpParm(myDoCompute, nodeidx, "docompute", time, 0);
162  myType = 1;
163  if (true && ( (true&&!(((getDoCompute()==0)))) ) )
164  graph->evalOpParm(myType, nodeidx, "type", time, 0);
165  myCuspangle = 60;
166  if (true && ( (true&&!(((getDoCompute()==0))||((int64(getType())!=1)))) ) )
167  graph->evalOpParm(myCuspangle, nodeidx, "cuspangle", time, 0);
168  myMethod = 1;
169  if (true && ( (true&&!(((getDoCompute()==0)))) ) )
170  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
171  myOrigIfZero = true;
172  if (true && ( (true&&!(((getDoCompute()==0)))) ) )
173  graph->evalOpParm(myOrigIfZero, nodeidx, "origifzero", time, 0);
174  myNormalize = false;
175  if (true && ( (true&&!(((getDoCompute()==1)))) ) )
176  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, 0);
177  myReverse = false;
178  if (true)
179  graph->evalOpParm(myReverse, nodeidx, "reverse", time, 0);
180 
181  }
182 
183 
184  void loadFromOpSubclass(const LoadParms &loadparms) override
185  {
186  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
187  }
188 
189 
190  void copyFrom(const OP_NodeParms *src) override
191  {
192  *this = *((const SOP_NormalParms *)src);
193  }
194 
195  template <typename T>
196  void
197  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
198  {
199  if (idx.size() < 1)
200  return;
201  UT_ASSERT(idx.size() == instance.size()+1);
202  if (idx.size() != instance.size()+1)
203  return;
204  switch (idx[0])
205  {
206  case 0:
207  coerceValue(value, myGroup);
208  break;
209  case 1:
210  coerceValue(value, myGrouptype);
211  break;
212  case 2:
213  coerceValue(value, myOverrideNormal);
214  break;
215  case 3:
216  coerceValue(value, myAttribName);
217  break;
218  case 4:
219  coerceValue(value, myDoCompute);
220  break;
221  case 5:
222  coerceValue(value, myType);
223  break;
224  case 6:
225  coerceValue(value, myCuspangle);
226  break;
227  case 7:
228  coerceValue(value, myMethod);
229  break;
230  case 8:
231  coerceValue(value, myOrigIfZero);
232  break;
233  case 9:
234  coerceValue(value, myNormalize);
235  break;
236  case 10:
237  coerceValue(value, myReverse);
238  break;
239 
240  }
241  }
242 
243  bool isParmColorRamp(exint idx) const override
244  {
245  switch (idx)
246  {
247 
248  }
249  return false;
250  }
251 
252  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
253  { doGetParmValue(idx, instance, value); }
254  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
255  { doGetParmValue(idx, instance, value); }
256  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
257  { doGetParmValue(idx, instance, value); }
258  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
259  { doGetParmValue(idx, instance, value); }
260  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
261  { doGetParmValue(idx, instance, value); }
262  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
263  { doGetParmValue(idx, instance, value); }
264  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
265  { doGetParmValue(idx, instance, value); }
266  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
273  { doGetParmValue(idx, instance, value); }
274 
275  template <typename T>
276  void
277  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
278  {
279  if (idx.size() < 1)
280  return;
281  UT_ASSERT(idx.size() == instance.size()+1);
282  if (idx.size() != instance.size()+1)
283  return;
284  switch (idx[0])
285  {
286  case 0:
287  coerceValue(myGroup, ( ( value ) ));
288  break;
289  case 1:
290  coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
291  break;
292  case 2:
293  coerceValue(myOverrideNormal, ( ( value ) ));
294  break;
295  case 3:
296  coerceValue(myAttribName, ( ( value ) ));
297  break;
298  case 4:
299  coerceValue(myDoCompute, ( ( value ) ));
300  break;
301  case 5:
302  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
303  break;
304  case 6:
305  coerceValue(myCuspangle, clampMinValue(0, clampMaxValue(180, value ) ));
306  break;
307  case 7:
308  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
309  break;
310  case 8:
311  coerceValue(myOrigIfZero, ( ( value ) ));
312  break;
313  case 9:
314  coerceValue(myNormalize, ( ( value ) ));
315  break;
316  case 10:
317  coerceValue(myReverse, ( ( value ) ));
318  break;
319 
320  }
321  }
322 
323  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
324  { doSetParmValue(idx, instance, value); }
325  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
326  { doSetParmValue(idx, instance, value); }
327  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
328  { doSetParmValue(idx, instance, value); }
329  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
330  { doSetParmValue(idx, instance, value); }
331  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
332  { doSetParmValue(idx, instance, value); }
333  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
334  { doSetParmValue(idx, instance, value); }
335  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
336  { doSetParmValue(idx, instance, value); }
337  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
338  { doSetParmValue(idx, instance, value); }
339  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
340  { doSetParmValue(idx, instance, value); }
341  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
342  { doSetParmValue(idx, instance, value); }
343  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
344  { doSetParmValue(idx, instance, value); }
345 
346  exint getNestNumParms(TempIndex idx) const override
347  {
348  if (idx.size() == 0)
349  return 11;
350  switch (idx[0])
351  {
352 
353  }
354  // Invalid
355  return 0;
356  }
357 
358  const char *getNestParmName(TempIndex fieldnum) const override
359  {
360  if (fieldnum.size() < 1)
361  return 0;
362  switch (fieldnum[0])
363  {
364  case 0:
365  return "group";
366  case 1:
367  return "grouptype";
368  case 2:
369  return "overridenormal";
370  case 3:
371  return "normalattrib";
372  case 4:
373  return "docompute";
374  case 5:
375  return "type";
376  case 6:
377  return "cuspangle";
378  case 7:
379  return "method";
380  case 8:
381  return "origifzero";
382  case 9:
383  return "normalize";
384  case 10:
385  return "reverse";
386 
387  }
388  return 0;
389  }
390 
391  ParmType getNestParmType(TempIndex fieldnum) const override
392  {
393  if (fieldnum.size() < 1)
394  return PARM_UNSUPPORTED;
395  switch (fieldnum[0])
396  {
397  case 0:
398  return PARM_STRING;
399  case 1:
400  return PARM_INTEGER;
401  case 2:
402  return PARM_INTEGER;
403  case 3:
404  return PARM_STRING;
405  case 4:
406  return PARM_INTEGER;
407  case 5:
408  return PARM_INTEGER;
409  case 6:
410  return PARM_FLOAT;
411  case 7:
412  return PARM_INTEGER;
413  case 8:
414  return PARM_INTEGER;
415  case 9:
416  return PARM_INTEGER;
417  case 10:
418  return PARM_INTEGER;
419 
420  }
421  return PARM_UNSUPPORTED;
422  }
423 
424  // Boiler plate to load individual types.
425  static void loadData(UT_IStream &is, int64 &v)
426  { is.bread(&v, 1); }
427  static void loadData(UT_IStream &is, bool &v)
428  { int64 iv; is.bread(&iv, 1); v = iv; }
429  static void loadData(UT_IStream &is, fpreal64 &v)
430  { is.bread<fpreal64>(&v, 1); }
431  static void loadData(UT_IStream &is, UT_Vector2D &v)
432  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
433  static void loadData(UT_IStream &is, UT_Vector3D &v)
434  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
435  is.bread<fpreal64>(&v.z(), 1); }
436  static void loadData(UT_IStream &is, UT_Vector4D &v)
437  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
438  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
439  static void loadData(UT_IStream &is, UT_Matrix2D &v)
440  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
441  static void loadData(UT_IStream &is, UT_Matrix3D &v)
442  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
443  static void loadData(UT_IStream &is, UT_Matrix4D &v)
444  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
445  static void loadData(UT_IStream &is, UT_Vector2I &v)
446  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
447  static void loadData(UT_IStream &is, UT_Vector3I &v)
448  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
449  is.bread<int64>(&v.z(), 1); }
450  static void loadData(UT_IStream &is, UT_Vector4I &v)
451  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
452  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
454  { is.bread(v); }
456  { UT_StringHolder rampdata;
457  loadData(is, rampdata);
458  if (rampdata.isstring())
459  {
460  v.reset(new UT_Ramp());
461  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
462  v->load(istr);
463  }
464  else v.reset();
465  }
468  loadData(is, data);
469  if (data.isstring())
470  {
471  // Find the data type.
472  const char *colon = UT_StringWrap(data).findChar(':');
473  if (colon)
474  {
475  int typelen = colon - data.buffer();
477  type.strncpy(data.buffer(), typelen);
478  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
479 
480  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
481  }
482  }
483  else v.reset();
484  }
485 
486  static void saveData(std::ostream &os, int64 v)
487  { UTwrite(os, &v); }
488  static void saveData(std::ostream &os, bool v)
489  { int64 iv = v; UTwrite(os, &iv); }
490  static void saveData(std::ostream &os, fpreal64 v)
491  { UTwrite<fpreal64>(os, &v); }
492  static void saveData(std::ostream &os, UT_Vector2D v)
493  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
494  static void saveData(std::ostream &os, UT_Vector3D v)
495  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
496  UTwrite<fpreal64>(os, &v.z()); }
497  static void saveData(std::ostream &os, UT_Vector4D v)
498  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
499  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
500  static void saveData(std::ostream &os, UT_Matrix2D v)
502  static void saveData(std::ostream &os, UT_Matrix3D v)
504  static void saveData(std::ostream &os, UT_Matrix4D v)
506  static void saveData(std::ostream &os, UT_StringHolder s)
507  { UT_StringWrap(s).saveBinary(os); }
508  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
510  UT_OStringStream ostr;
511  if (s) s->save(ostr);
512  result = ostr.str();
513  saveData(os, result);
514  }
515  static void saveData(std::ostream &os, PRM_DataItemHandle s)
517  UT_OStringStream ostr;
518  if (s)
519  {
520  ostr << s->getDataTypeToken();
521  ostr << ":";
522  s->saveBinary(ostr);
523  }
524  result = ostr.str();
525  saveData(os, result);
526  }
527 
528 
529  void save(std::ostream &os) const
530  {
531  int32 v = version();
532  UTwrite(os, &v);
533  saveData(os, myGroup);
534  saveData(os, myGrouptype);
535  saveData(os, myOverrideNormal);
536  saveData(os, myAttribName);
537  saveData(os, myDoCompute);
538  saveData(os, myType);
539  saveData(os, myCuspangle);
540  saveData(os, myMethod);
541  saveData(os, myOrigIfZero);
542  saveData(os, myNormalize);
543  saveData(os, myReverse);
544 
545  }
546 
547  bool load(UT_IStream &is)
548  {
549  int32 v;
550  is.bread(&v, 1);
551  if (version() != v)
552  {
553  // Fail incompatible versions
554  return false;
555  }
556  loadData(is, myGroup);
557  loadData(is, myGrouptype);
558  loadData(is, myOverrideNormal);
559  loadData(is, myAttribName);
560  loadData(is, myDoCompute);
561  loadData(is, myType);
562  loadData(is, myCuspangle);
563  loadData(is, myMethod);
564  loadData(is, myOrigIfZero);
565  loadData(is, myNormalize);
566  loadData(is, myReverse);
567 
568  return true;
569  }
570 
571  const UT_StringHolder & getGroup() const { return myGroup; }
572  void setGroup(const UT_StringHolder & val) { myGroup = val; }
574  {
575  SOP_Node *thissop = cookparms.getNode();
576  if (!thissop) return getGroup();
578  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
579  return result;
580  }
581  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
582  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
584  {
585  SOP_Node *thissop = cookparms.getNode();
586  if (!thissop) return getGrouptype();
587  int64 result;
588  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
589  return Grouptype(result);
590  }
591  bool getOverrideNormal() const { return myOverrideNormal; }
592  void setOverrideNormal(bool val) { myOverrideNormal = val; }
593  bool opOverrideNormal(const SOP_NodeVerb::CookParms &cookparms) const
594  {
595  SOP_Node *thissop = cookparms.getNode();
596  if (!thissop) return getOverrideNormal();
597  bool result;
598  OP_Utils::evalOpParm(result, thissop, "overridenormal", cookparms.getCookTime(), 0);
599  return result;
600  }
601  const UT_StringHolder & getAttribName() const { return myAttribName; }
602  void setAttribName(const UT_StringHolder & val) { myAttribName = val; }
604  {
605  SOP_Node *thissop = cookparms.getNode();
606  if (!thissop) return getAttribName();
608  OP_Utils::evalOpParm(result, thissop, "normalattrib", cookparms.getCookTime(), 0);
609  return result;
610  }
611  bool getDoCompute() const { return myDoCompute; }
612  void setDoCompute(bool val) { myDoCompute = val; }
613  bool opDoCompute(const SOP_NodeVerb::CookParms &cookparms) const
614  {
615  SOP_Node *thissop = cookparms.getNode();
616  if (!thissop) return getDoCompute();
617  bool result;
618  OP_Utils::evalOpParm(result, thissop, "docompute", cookparms.getCookTime(), 0);
619  return result;
620  }
621  Type getType() const { return Type(myType); }
622  void setType(Type val) { myType = int64(val); }
623  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
624  {
625  SOP_Node *thissop = cookparms.getNode();
626  if (!thissop) return getType();
627  int64 result;
628  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
629  return Type(result);
630  }
631  fpreal64 getCuspangle() const { return myCuspangle; }
632  void setCuspangle(fpreal64 val) { myCuspangle = val; }
634  {
635  SOP_Node *thissop = cookparms.getNode();
636  if (!thissop) return getCuspangle();
638  OP_Utils::evalOpParm(result, thissop, "cuspangle", cookparms.getCookTime(), 0);
639  return result;
640  }
641  Method getMethod() const { return Method(myMethod); }
642  void setMethod(Method val) { myMethod = int64(val); }
643  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
644  {
645  SOP_Node *thissop = cookparms.getNode();
646  if (!thissop) return getMethod();
647  int64 result;
648  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
649  return Method(result);
650  }
651  bool getOrigIfZero() const { return myOrigIfZero; }
652  void setOrigIfZero(bool val) { myOrigIfZero = val; }
653  bool opOrigIfZero(const SOP_NodeVerb::CookParms &cookparms) const
654  {
655  SOP_Node *thissop = cookparms.getNode();
656  if (!thissop) return getOrigIfZero();
657  bool result;
658  OP_Utils::evalOpParm(result, thissop, "origifzero", cookparms.getCookTime(), 0);
659  return result;
660  }
661  bool getNormalize() const { return myNormalize; }
662  void setNormalize(bool val) { myNormalize = val; }
663  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
664  {
665  SOP_Node *thissop = cookparms.getNode();
666  if (!thissop) return getNormalize();
667  bool result;
668  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
669  return result;
670  }
671  bool getReverse() const { return myReverse; }
672  void setReverse(bool val) { myReverse = val; }
673  bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
674  {
675  SOP_Node *thissop = cookparms.getNode();
676  if (!thissop) return getReverse();
677  bool result;
678  OP_Utils::evalOpParm(result, thissop, "reverse", cookparms.getCookTime(), 0);
679  return result;
680  }
681 
682 private:
683  UT_StringHolder myGroup;
684  int64 myGrouptype;
685  bool myOverrideNormal;
686  UT_StringHolder myAttribName;
687  bool myDoCompute;
688  int64 myType;
689  fpreal64 myCuspangle;
690  int64 myMethod;
691  bool myOrigIfZero;
692  bool myNormalize;
693  bool myReverse;
694 
695 };
bool getDoCompute() const
void save(std::ostream &os) const
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
bool getOrigIfZero() const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNormalize(bool val)
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
static void loadData(UT_IStream &is, UT_Matrix4D &v)
fpreal getTime() const
Definition: OP_Context.h:62
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
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setGrouptype(Grouptype val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void copyFrom(const OP_NodeParms *src) override
bool opDoCompute(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
Definition: thread.h:613
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool operator==(const SOP_NormalParms &src) const
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.
static void saveData(std::ostream &os, fpreal64 v)
void setCuspangle(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setReverse(bool val)
void setOverrideNormal(bool val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setType(Type val)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
double fpreal64
Definition: SYS_Types.h:201
void setAttribName(const UT_StringHolder &val)
bool opOverrideNormal(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool opOrigIfZero(const SOP_NodeVerb::CookParms &cookparms) const
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Method getMethod() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
exint length() const
void setGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
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
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static int version()
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, int64 &v)
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool getNormalize() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setOrigIfZero(bool val)
Grouptype getGrouptype() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void loadFromOpSubclass(const LoadParms &loadparms) override
bool getReverse() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, int64 v)
bool getOverrideNormal() const
UT_StringHolder opAttribName(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
void setMethod(Method val)
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void setDoCompute(bool val)
LeafData & operator=(const LeafData &)=delete
const char * getNestParmName(TempIndex fieldnum) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
GLuint GLfloat * val
Definition: glcorearb.h:1608
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
#define SOP_API
Definition: SOP_API.h:10
ParmType getNestParmType(TempIndex fieldnum) const override
bool load(UT_IStream &is)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_Matrix4D v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
static void saveData(std::ostream &os, UT_Matrix3D v)
GLboolean r
Definition: glcorearb.h:1222
static void loadData(UT_IStream &is, UT_Vector4I &v)
Type getType() const
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
fpreal64 opCuspangle(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
const UT_StringHolder & getAttribName() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
fpreal64 getCuspangle() const
SYS_FORCE_INLINE bool isstring() const
bool operator!=(const SOP_NormalParms &src) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
const UT_StringHolder & getGroup() const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663