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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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 
134  if (baseGetSignature() != src.baseGetSignature()) return false;
135 
136  return true;
137  }
138  bool operator!=(const SOP_NormalParms &src) const
139  {
140  return !operator==(src);
141  }
145 
146 
147 
148  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
149  {
150  myGroup = ""_UTsh;
151  if (true)
152  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
153  myGrouptype = 0;
154  if (true)
155  graph->evalOpParm(myGrouptype, nodeidx, "grouptype", time, graph->isDirect()?nullptr:depnode);
156  myOverrideNormal = false;
157  if (true)
158  graph->evalOpParm(myOverrideNormal, nodeidx, "overridenormal", time, graph->isDirect()?nullptr:depnode);
159  myAttribName = "N"_UTsh;
160  if (true && ( (true&&!(((getOverrideNormal()==0)))) ) )
161  graph->evalOpParm(myAttribName, nodeidx, "normalattrib", time, graph->isDirect()?nullptr:depnode);
162  myDoCompute = true;
163  if (true)
164  graph->evalOpParm(myDoCompute, nodeidx, "docompute", time, graph->isDirect()?nullptr:depnode);
165  myType = 1;
166  if (true && ( (true&&!(((getDoCompute()==0)))) ) )
167  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
168  myCuspangle = 60;
169  if (true && ( (true&&!(((getDoCompute()==0))||((int64(getType())!=1)))) ) )
170  graph->evalOpParm(myCuspangle, nodeidx, "cuspangle", time, graph->isDirect()?nullptr:depnode);
171  myMethod = 1;
172  if (true && ( (true&&!(((getDoCompute()==0)))) ) )
173  graph->evalOpParm(myMethod, nodeidx, "method", time, graph->isDirect()?nullptr:depnode);
174  myOrigIfZero = true;
175  if (true && ( (true&&!(((getDoCompute()==0)))) ) )
176  graph->evalOpParm(myOrigIfZero, nodeidx, "origifzero", time, graph->isDirect()?nullptr:depnode);
177  myNormalize = false;
178  if (true && ( (true&&!(((getDoCompute()==1)))) ) )
179  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, graph->isDirect()?nullptr:depnode);
180  myReverse = false;
181  if (true)
182  graph->evalOpParm(myReverse, nodeidx, "reverse", time, graph->isDirect()?nullptr:depnode);
183 
184  }
185 
186 
187  void loadFromOpSubclass(const LoadParms &loadparms) override
188  {
189  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
190  }
191 
192 
193  void copyFrom(const OP_NodeParms *src) override
194  {
195  *this = *((const SOP_NormalParms *)src);
196  }
197 
198  template <typename T>
199  void
200  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
201  {
202  if (idx.size() < 1)
203  return;
204  UT_ASSERT(idx.size() == instance.size()+1);
205  if (idx.size() != instance.size()+1)
206  return;
207  switch (idx[0])
208  {
209  case 0:
210  coerceValue(value, myGroup);
211  break;
212  case 1:
213  coerceValue(value, myGrouptype);
214  break;
215  case 2:
216  coerceValue(value, myOverrideNormal);
217  break;
218  case 3:
219  coerceValue(value, myAttribName);
220  break;
221  case 4:
222  coerceValue(value, myDoCompute);
223  break;
224  case 5:
225  coerceValue(value, myType);
226  break;
227  case 6:
228  coerceValue(value, myCuspangle);
229  break;
230  case 7:
231  coerceValue(value, myMethod);
232  break;
233  case 8:
234  coerceValue(value, myOrigIfZero);
235  break;
236  case 9:
237  coerceValue(value, myNormalize);
238  break;
239  case 10:
240  coerceValue(value, myReverse);
241  break;
242 
243  }
244  }
245 
246  bool isParmColorRamp(exint idx) const override
247  {
248  switch (idx)
249  {
250 
251  }
252  return false;
253  }
254 
255  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
256  { doGetParmValue(idx, instance, value); }
257  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
258  { doGetParmValue(idx, instance, value); }
259  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
260  { doGetParmValue(idx, instance, value); }
261  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
262  { doGetParmValue(idx, instance, value); }
263  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
264  { doGetParmValue(idx, instance, value); }
265  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
266  { doGetParmValue(idx, instance, value); }
267  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
268  { doGetParmValue(idx, instance, value); }
269  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
270  { doGetParmValue(idx, instance, value); }
271  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
276  { doGetParmValue(idx, instance, value); }
277 
278  template <typename T>
279  void
280  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
281  {
282  if (idx.size() < 1)
283  return;
284  UT_ASSERT(idx.size() == instance.size()+1);
285  if (idx.size() != instance.size()+1)
286  return;
287  switch (idx[0])
288  {
289  case 0:
290  coerceValue(myGroup, ( ( value ) ));
291  break;
292  case 1:
293  coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
294  break;
295  case 2:
296  coerceValue(myOverrideNormal, ( ( value ) ));
297  break;
298  case 3:
299  coerceValue(myAttribName, ( ( value ) ));
300  break;
301  case 4:
302  coerceValue(myDoCompute, ( ( value ) ));
303  break;
304  case 5:
305  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
306  break;
307  case 6:
308  coerceValue(myCuspangle, clampMinValue(0, clampMaxValue(180, value ) ));
309  break;
310  case 7:
311  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
312  break;
313  case 8:
314  coerceValue(myOrigIfZero, ( ( value ) ));
315  break;
316  case 9:
317  coerceValue(myNormalize, ( ( value ) ));
318  break;
319  case 10:
320  coerceValue(myReverse, ( ( value ) ));
321  break;
322 
323  }
324  }
325 
326  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
329  { doSetParmValue(idx, instance, value); }
330  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
335  { doSetParmValue(idx, instance, value); }
336  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
337  { doSetParmValue(idx, instance, value); }
338  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
339  { doSetParmValue(idx, instance, value); }
340  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
341  { doSetParmValue(idx, instance, value); }
342  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
343  { doSetParmValue(idx, instance, value); }
344  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
345  { doSetParmValue(idx, instance, value); }
346  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
347  { doSetParmValue(idx, instance, value); }
348 
349  exint getNestNumParms(TempIndex idx) const override
350  {
351  if (idx.size() == 0)
352  return 11;
353  switch (idx[0])
354  {
355 
356  }
357  // Invalid
358  return 0;
359  }
360 
361  const char *getNestParmName(TempIndex fieldnum) const override
362  {
363  if (fieldnum.size() < 1)
364  return 0;
365  switch (fieldnum[0])
366  {
367  case 0:
368  return "group";
369  case 1:
370  return "grouptype";
371  case 2:
372  return "overridenormal";
373  case 3:
374  return "normalattrib";
375  case 4:
376  return "docompute";
377  case 5:
378  return "type";
379  case 6:
380  return "cuspangle";
381  case 7:
382  return "method";
383  case 8:
384  return "origifzero";
385  case 9:
386  return "normalize";
387  case 10:
388  return "reverse";
389 
390  }
391  return 0;
392  }
393 
394  ParmType getNestParmType(TempIndex fieldnum) const override
395  {
396  if (fieldnum.size() < 1)
397  return PARM_UNSUPPORTED;
398  switch (fieldnum[0])
399  {
400  case 0:
401  return PARM_STRING;
402  case 1:
403  return PARM_INTEGER;
404  case 2:
405  return PARM_INTEGER;
406  case 3:
407  return PARM_STRING;
408  case 4:
409  return PARM_INTEGER;
410  case 5:
411  return PARM_INTEGER;
412  case 6:
413  return PARM_FLOAT;
414  case 7:
415  return PARM_INTEGER;
416  case 8:
417  return PARM_INTEGER;
418  case 9:
419  return PARM_INTEGER;
420  case 10:
421  return PARM_INTEGER;
422 
423  }
424  return PARM_UNSUPPORTED;
425  }
426 
427  // Boiler plate to load individual types.
428  static void loadData(UT_IStream &is, int64 &v)
429  { is.bread(&v, 1); }
430  static void loadData(UT_IStream &is, bool &v)
431  { int64 iv; is.bread(&iv, 1); v = iv; }
432  static void loadData(UT_IStream &is, fpreal64 &v)
433  { is.bread<fpreal64>(&v, 1); }
434  static void loadData(UT_IStream &is, UT_Vector2D &v)
435  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
436  static void loadData(UT_IStream &is, UT_Vector3D &v)
437  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
438  is.bread<fpreal64>(&v.z(), 1); }
439  static void loadData(UT_IStream &is, UT_Vector4D &v)
440  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
441  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
442  static void loadData(UT_IStream &is, UT_Matrix2D &v)
443  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
444  static void loadData(UT_IStream &is, UT_Matrix3D &v)
445  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
446  static void loadData(UT_IStream &is, UT_Matrix4D &v)
447  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
448  static void loadData(UT_IStream &is, UT_Vector2I &v)
449  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
450  static void loadData(UT_IStream &is, UT_Vector3I &v)
451  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
452  is.bread<int64>(&v.z(), 1); }
453  static void loadData(UT_IStream &is, UT_Vector4I &v)
454  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
455  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
457  { is.bread(v); }
459  { UT_StringHolder rampdata;
460  loadData(is, rampdata);
461  if (rampdata.isstring())
462  {
463  v.reset(new UT_Ramp());
464  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
465  v->load(istr);
466  }
467  else v.reset();
468  }
471  loadData(is, data);
472  if (data.isstring())
473  {
474  // Find the data type.
475  const char *colon = UT_StringWrap(data).findChar(':');
476  if (colon)
477  {
478  int typelen = colon - data.buffer();
480  type.strncpy(data.buffer(), typelen);
481  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
482 
483  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
484  }
485  }
486  else v.reset();
487  }
488 
489  static void saveData(std::ostream &os, int64 v)
490  { UTwrite(os, &v); }
491  static void saveData(std::ostream &os, bool v)
492  { int64 iv = v; UTwrite(os, &iv); }
493  static void saveData(std::ostream &os, fpreal64 v)
494  { UTwrite<fpreal64>(os, &v); }
495  static void saveData(std::ostream &os, UT_Vector2D v)
496  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
497  static void saveData(std::ostream &os, UT_Vector3D v)
498  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
499  UTwrite<fpreal64>(os, &v.z()); }
500  static void saveData(std::ostream &os, UT_Vector4D v)
501  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
502  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
503  static void saveData(std::ostream &os, UT_Matrix2D v)
505  static void saveData(std::ostream &os, UT_Matrix3D v)
507  static void saveData(std::ostream &os, UT_Matrix4D v)
509  static void saveData(std::ostream &os, UT_StringHolder s)
510  { UT_StringWrap(s).saveBinary(os); }
511  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
513  UT_OStringStream ostr;
514  if (s) s->save(ostr);
515  result = ostr.str();
516  saveData(os, result);
517  }
518  static void saveData(std::ostream &os, PRM_DataItemHandle s)
520  UT_OStringStream ostr;
521  if (s)
522  {
523  ostr << s->getDataTypeToken();
524  ostr << ":";
525  s->saveBinary(ostr);
526  }
527  result = ostr.str();
528  saveData(os, result);
529  }
530 
531 
532  void save(std::ostream &os) const
533  {
534  int32 v = version();
535  UTwrite(os, &v);
536  saveData(os, myGroup);
537  saveData(os, myGrouptype);
538  saveData(os, myOverrideNormal);
539  saveData(os, myAttribName);
540  saveData(os, myDoCompute);
541  saveData(os, myType);
542  saveData(os, myCuspangle);
543  saveData(os, myMethod);
544  saveData(os, myOrigIfZero);
545  saveData(os, myNormalize);
546  saveData(os, myReverse);
547 
548  }
549 
550  bool load(UT_IStream &is)
551  {
552  int32 v;
553  is.bread(&v, 1);
554  if (version() != v)
555  {
556  // Fail incompatible versions
557  return false;
558  }
559  loadData(is, myGroup);
560  loadData(is, myGrouptype);
561  loadData(is, myOverrideNormal);
562  loadData(is, myAttribName);
563  loadData(is, myDoCompute);
564  loadData(is, myType);
565  loadData(is, myCuspangle);
566  loadData(is, myMethod);
567  loadData(is, myOrigIfZero);
568  loadData(is, myNormalize);
569  loadData(is, myReverse);
570 
571  return true;
572  }
573 
574  const UT_StringHolder & getGroup() const { return myGroup; }
575  void setGroup(const UT_StringHolder & val) { myGroup = val; }
577  {
578  SOP_Node *thissop = cookparms.getNode();
579  if (!thissop) return getGroup();
581  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
582  return result;
583  }
584  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
585  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
587  {
588  SOP_Node *thissop = cookparms.getNode();
589  if (!thissop) return getGrouptype();
590  int64 result;
591  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
592  return Grouptype(result);
593  }
594  bool getOverrideNormal() const { return myOverrideNormal; }
595  void setOverrideNormal(bool val) { myOverrideNormal = val; }
596  bool opOverrideNormal(const SOP_NodeVerb::CookParms &cookparms) const
597  {
598  SOP_Node *thissop = cookparms.getNode();
599  if (!thissop) return getOverrideNormal();
600  bool result;
601  OP_Utils::evalOpParm(result, thissop, "overridenormal", cookparms.getCookTime(), 0);
602  return result;
603  }
604  const UT_StringHolder & getAttribName() const { return myAttribName; }
605  void setAttribName(const UT_StringHolder & val) { myAttribName = val; }
607  {
608  SOP_Node *thissop = cookparms.getNode();
609  if (!thissop) return getAttribName();
611  OP_Utils::evalOpParm(result, thissop, "normalattrib", cookparms.getCookTime(), 0);
612  return result;
613  }
614  bool getDoCompute() const { return myDoCompute; }
615  void setDoCompute(bool val) { myDoCompute = val; }
616  bool opDoCompute(const SOP_NodeVerb::CookParms &cookparms) const
617  {
618  SOP_Node *thissop = cookparms.getNode();
619  if (!thissop) return getDoCompute();
620  bool result;
621  OP_Utils::evalOpParm(result, thissop, "docompute", cookparms.getCookTime(), 0);
622  return result;
623  }
624  Type getType() const { return Type(myType); }
625  void setType(Type val) { myType = int64(val); }
626  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
627  {
628  SOP_Node *thissop = cookparms.getNode();
629  if (!thissop) return getType();
630  int64 result;
631  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
632  return Type(result);
633  }
634  fpreal64 getCuspangle() const { return myCuspangle; }
635  void setCuspangle(fpreal64 val) { myCuspangle = val; }
637  {
638  SOP_Node *thissop = cookparms.getNode();
639  if (!thissop) return getCuspangle();
641  OP_Utils::evalOpParm(result, thissop, "cuspangle", cookparms.getCookTime(), 0);
642  return result;
643  }
644  Method getMethod() const { return Method(myMethod); }
645  void setMethod(Method val) { myMethod = int64(val); }
646  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
647  {
648  SOP_Node *thissop = cookparms.getNode();
649  if (!thissop) return getMethod();
650  int64 result;
651  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
652  return Method(result);
653  }
654  bool getOrigIfZero() const { return myOrigIfZero; }
655  void setOrigIfZero(bool val) { myOrigIfZero = val; }
656  bool opOrigIfZero(const SOP_NodeVerb::CookParms &cookparms) const
657  {
658  SOP_Node *thissop = cookparms.getNode();
659  if (!thissop) return getOrigIfZero();
660  bool result;
661  OP_Utils::evalOpParm(result, thissop, "origifzero", cookparms.getCookTime(), 0);
662  return result;
663  }
664  bool getNormalize() const { return myNormalize; }
665  void setNormalize(bool val) { myNormalize = val; }
666  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return getNormalize();
670  bool result;
671  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
672  return result;
673  }
674  bool getReverse() const { return myReverse; }
675  void setReverse(bool val) { myReverse = val; }
676  bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
677  {
678  SOP_Node *thissop = cookparms.getNode();
679  if (!thissop) return getReverse();
680  bool result;
681  OP_Utils::evalOpParm(result, thissop, "reverse", cookparms.getCookTime(), 0);
682  return result;
683  }
684 
685 private:
686  UT_StringHolder myGroup;
687  int64 myGrouptype;
688  bool myOverrideNormal;
689  UT_StringHolder myAttribName;
690  bool myDoCompute;
691  int64 myType;
692  fpreal64 myCuspangle;
693  int64 myMethod;
694  bool myOrigIfZero;
695  bool myNormalize;
696  bool myReverse;
697 
698 };
bool getDoCompute() const
type
Definition: core.h:556
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:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
static void saveData(std::ostream &os, UT_Matrix4D v)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void saveData(std::ostream &os, UT_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
fpreal64 opCuspangle(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, PRM_DataItemHandle s)
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