HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Mirror.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_MirrorEnums
24 {
25  enum class Operation
26  {
27  ALL = 0,
28  CLIP
29  };
30 
32  getToken(Operation enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case Operation::ALL: return "all"_sh;
37  case Operation::CLIP: return "clip"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Dirtype
43  {
44  DIRECTION = 0,
45  XFORM
46  };
47 
49  getToken(Dirtype enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case Dirtype::DIRECTION: return "direction"_sh;
54  case Dirtype::XFORM: return "xform"_sh;
55  default: UT_ASSERT(false); return ""_sh;
56  }
57  }
58 
59  enum class Reversenml
60  {
61  NOREVERSE = 0,
62  REVERSE,
63  REVERSEU,
64  REVERSEV
65  };
66 
68  getToken(Reversenml enum_value)
69  {
70  using namespace UT::Literal;
71  switch (enum_value) {
72  case Reversenml::NOREVERSE: return "noreverse"_sh;
73  case Reversenml::REVERSE: return "reverse"_sh;
74  case Reversenml::REVERSEU: return "reverseu"_sh;
75  case Reversenml::REVERSEV: return "reversev"_sh;
76  default: UT_ASSERT(false); return ""_sh;
77  }
78  }
79 
80 }
81 
82 
84 {
85 public:
86  static int version() { return 1; }
87 
89  {
90  myGroup = ""_UTsh;
91  myOperation = 0;
92  myDirtype = 0;
93  myT = UT_Vector3D(0,0,0);
94  myR = UT_Vector3D(0,0,0);
95  myOrigin = UT_Vector3D(0,0,0);
96  myDir = UT_Vector3D(1,0,0);
97  myDist = 0;
98  myReversenml = 1;
99  myKeeporiginal = true;
100  myConsolidatepts = true;
101  myConsolidatetol = 0.0001;
102  myConsolidateunshared = true;
103  myCreateoutputgroup = false;
104  myOutputgroup = "mirror"_UTsh;
105 
106  }
107 
108  explicit SOP_MirrorParms(const SOP_MirrorParms &) = default;
109  SOP_MirrorParms &operator=(const SOP_MirrorParms &) = default;
110  SOP_MirrorParms(SOP_MirrorParms &&) noexcept = default;
111  SOP_MirrorParms &operator=(SOP_MirrorParms &&) noexcept = default;
112 
113  ~SOP_MirrorParms() override {}
114 
115  bool operator==(const SOP_MirrorParms &src) const
116  {
117  if (myGroup != src.myGroup) return false;
118  if (myOperation != src.myOperation) return false;
119  if (myDirtype != src.myDirtype) return false;
120  if (myT != src.myT) return false;
121  if (myR != src.myR) return false;
122  if (myOrigin != src.myOrigin) return false;
123  if (myDir != src.myDir) return false;
124  if (myDist != src.myDist) return false;
125  if (myReversenml != src.myReversenml) return false;
126  if (myKeeporiginal != src.myKeeporiginal) return false;
127  if (myConsolidatepts != src.myConsolidatepts) return false;
128  if (myConsolidatetol != src.myConsolidatetol) return false;
129  if (myConsolidateunshared != src.myConsolidateunshared) return false;
130  if (myCreateoutputgroup != src.myCreateoutputgroup) return false;
131  if (myOutputgroup != src.myOutputgroup) return false;
132 
133 
134  if (baseGetSignature() != src.baseGetSignature()) return false;
135 
136  return true;
137  }
138  bool operator!=(const SOP_MirrorParms &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  myOperation = 0;
154  if (true)
155  graph->evalOpParm(myOperation, nodeidx, "operation", time, graph->isDirect()?nullptr:depnode);
156  myDirtype = 0;
157  if (true)
158  graph->evalOpParm(myDirtype, nodeidx, "dirtype", time, graph->isDirect()?nullptr:depnode);
159  myT = UT_Vector3D(0,0,0);
160  if (true && ( (true&&!(((int64(getDirtype())!=1))||((int64(getDirtype())!=1)))) ) )
161  graph->evalOpParm(myT, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
162  myR = UT_Vector3D(0,0,0);
163  if (true && ( (true&&!(((int64(getDirtype())!=1))||((int64(getDirtype())!=1)))) ) )
164  graph->evalOpParm(myR, nodeidx, "r", time, graph->isDirect()?nullptr:depnode);
165  myOrigin = UT_Vector3D(0,0,0);
166  if (true && ( (true&&!(((int64(getDirtype())!=0))||((int64(getDirtype())!=0)))) ) )
167  graph->evalOpParm(myOrigin, nodeidx, "origin", time, graph->isDirect()?nullptr:depnode);
168  myDir = UT_Vector3D(1,0,0);
169  if (true && ( (true&&!(((int64(getDirtype())!=0))||((int64(getDirtype())!=0)))) ) )
170  graph->evalOpParm(myDir, nodeidx, "dir", time, graph->isDirect()?nullptr:depnode);
171  myDist = 0;
172  if (true)
173  graph->evalOpParm(myDist, nodeidx, "dist", time, graph->isDirect()?nullptr:depnode);
174  myReversenml = 1;
175  if (true)
176  graph->evalOpParm(myReversenml, nodeidx, "reversenml", time, graph->isDirect()?nullptr:depnode);
177  myKeeporiginal = true;
178  if (true)
179  graph->evalOpParm(myKeeporiginal, nodeidx, "keepOriginal", time, graph->isDirect()?nullptr:depnode);
180  myConsolidatepts = true;
181  if (true && ( (true&&!(((getKeeporiginal()==0)&&(int64(getOperation())!=1)))) ) )
182  graph->evalOpParm(myConsolidatepts, nodeidx, "consolidatepts", time, graph->isDirect()?nullptr:depnode);
183  myConsolidatetol = 0.0001;
184  if (true && ( (true&&!(((getKeeporiginal()==0)&&(int64(getOperation())!=1))||((getConsolidatepts()==0)))) ) )
185  graph->evalOpParm(myConsolidatetol, nodeidx, "consolidatetol", time, graph->isDirect()?nullptr:depnode);
186  myConsolidateunshared = true;
187  if (true && ( (true&&!(((getKeeporiginal()==0))||((getConsolidatepts()==0)))) ) )
188  graph->evalOpParm(myConsolidateunshared, nodeidx, "consolidateunshared", time, graph->isDirect()?nullptr:depnode);
189  myCreateoutputgroup = false;
190  if (true)
191  graph->evalOpParm(myCreateoutputgroup, nodeidx, "createoutputgroup", time, graph->isDirect()?nullptr:depnode);
192  myOutputgroup = "mirror"_UTsh;
193  if (true && ( (true&&!(((getCreateoutputgroup()==0)))) ) )
194  graph->evalOpParm(myOutputgroup, nodeidx, "outputgroup", time, graph->isDirect()?nullptr:depnode);
195 
196  }
197 
198 
199  void loadFromOpSubclass(const LoadParms &loadparms) override
200  {
201  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
202  }
203 
204 
205  void copyFrom(const OP_NodeParms *src) override
206  {
207  *this = *((const SOP_MirrorParms *)src);
208  }
209 
210  template <typename T>
211  void
212  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
213  {
214  if (idx.size() < 1)
215  return;
216  UT_ASSERT(idx.size() == instance.size()+1);
217  if (idx.size() != instance.size()+1)
218  return;
219  switch (idx[0])
220  {
221  case 0:
222  coerceValue(value, myGroup);
223  break;
224  case 1:
225  coerceValue(value, myOperation);
226  break;
227  case 2:
228  coerceValue(value, myDirtype);
229  break;
230  case 3:
231  coerceValue(value, myT);
232  break;
233  case 4:
234  coerceValue(value, myR);
235  break;
236  case 5:
237  coerceValue(value, myOrigin);
238  break;
239  case 6:
240  coerceValue(value, myDir);
241  break;
242  case 7:
243  coerceValue(value, myDist);
244  break;
245  case 8:
246  coerceValue(value, myReversenml);
247  break;
248  case 9:
249  coerceValue(value, myKeeporiginal);
250  break;
251  case 10:
252  coerceValue(value, myConsolidatepts);
253  break;
254  case 11:
255  coerceValue(value, myConsolidatetol);
256  break;
257  case 12:
258  coerceValue(value, myConsolidateunshared);
259  break;
260  case 13:
261  coerceValue(value, myCreateoutputgroup);
262  break;
263  case 14:
264  coerceValue(value, myOutputgroup);
265  break;
266 
267  }
268  }
269 
270  bool isParmColorRamp(exint idx) const override
271  {
272  switch (idx)
273  {
274 
275  }
276  return false;
277  }
278 
279  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
294  { doGetParmValue(idx, instance, value); }
295  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
296  { doGetParmValue(idx, instance, value); }
297  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
298  { doGetParmValue(idx, instance, value); }
299  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
300  { doGetParmValue(idx, instance, value); }
301 
302  template <typename T>
303  void
304  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
305  {
306  if (idx.size() < 1)
307  return;
308  UT_ASSERT(idx.size() == instance.size()+1);
309  if (idx.size() != instance.size()+1)
310  return;
311  switch (idx[0])
312  {
313  case 0:
314  coerceValue(myGroup, ( ( value ) ));
315  break;
316  case 1:
317  coerceValue(myOperation, clampMinValue(0, clampMaxValue(1, value ) ));
318  break;
319  case 2:
320  coerceValue(myDirtype, clampMinValue(0, clampMaxValue(1, value ) ));
321  break;
322  case 3:
323  coerceValue(myT, ( ( value ) ));
324  break;
325  case 4:
326  coerceValue(myR, ( ( value ) ));
327  break;
328  case 5:
329  coerceValue(myOrigin, ( ( value ) ));
330  break;
331  case 6:
332  coerceValue(myDir, ( ( value ) ));
333  break;
334  case 7:
335  coerceValue(myDist, ( ( value ) ));
336  break;
337  case 8:
338  coerceValue(myReversenml, clampMinValue(0, clampMaxValue(3, value ) ));
339  break;
340  case 9:
341  coerceValue(myKeeporiginal, ( ( value ) ));
342  break;
343  case 10:
344  coerceValue(myConsolidatepts, ( ( value ) ));
345  break;
346  case 11:
347  coerceValue(myConsolidatetol, ( ( value ) ));
348  break;
349  case 12:
350  coerceValue(myConsolidateunshared, ( ( value ) ));
351  break;
352  case 13:
353  coerceValue(myCreateoutputgroup, ( ( value ) ));
354  break;
355  case 14:
356  coerceValue(myOutputgroup, ( ( value ) ));
357  break;
358 
359  }
360  }
361 
362  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
363  { doSetParmValue(idx, instance, value); }
364  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
365  { doSetParmValue(idx, instance, value); }
366  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
367  { doSetParmValue(idx, instance, value); }
368  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
369  { doSetParmValue(idx, instance, value); }
370  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
371  { doSetParmValue(idx, instance, value); }
372  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
383  { doSetParmValue(idx, instance, value); }
384 
385  exint getNestNumParms(TempIndex idx) const override
386  {
387  if (idx.size() == 0)
388  return 15;
389  switch (idx[0])
390  {
391 
392  }
393  // Invalid
394  return 0;
395  }
396 
397  const char *getNestParmName(TempIndex fieldnum) const override
398  {
399  if (fieldnum.size() < 1)
400  return 0;
401  switch (fieldnum[0])
402  {
403  case 0:
404  return "group";
405  case 1:
406  return "operation";
407  case 2:
408  return "dirtype";
409  case 3:
410  return "t";
411  case 4:
412  return "r";
413  case 5:
414  return "origin";
415  case 6:
416  return "dir";
417  case 7:
418  return "dist";
419  case 8:
420  return "reversenml";
421  case 9:
422  return "keepOriginal";
423  case 10:
424  return "consolidatepts";
425  case 11:
426  return "consolidatetol";
427  case 12:
428  return "consolidateunshared";
429  case 13:
430  return "createoutputgroup";
431  case 14:
432  return "outputgroup";
433 
434  }
435  return 0;
436  }
437 
438  ParmType getNestParmType(TempIndex fieldnum) const override
439  {
440  if (fieldnum.size() < 1)
441  return PARM_UNSUPPORTED;
442  switch (fieldnum[0])
443  {
444  case 0:
445  return PARM_STRING;
446  case 1:
447  return PARM_INTEGER;
448  case 2:
449  return PARM_INTEGER;
450  case 3:
451  return PARM_VECTOR3;
452  case 4:
453  return PARM_VECTOR3;
454  case 5:
455  return PARM_VECTOR3;
456  case 6:
457  return PARM_VECTOR3;
458  case 7:
459  return PARM_FLOAT;
460  case 8:
461  return PARM_INTEGER;
462  case 9:
463  return PARM_INTEGER;
464  case 10:
465  return PARM_INTEGER;
466  case 11:
467  return PARM_FLOAT;
468  case 12:
469  return PARM_INTEGER;
470  case 13:
471  return PARM_INTEGER;
472  case 14:
473  return PARM_STRING;
474 
475  }
476  return PARM_UNSUPPORTED;
477  }
478 
479  // Boiler plate to load individual types.
480  static void loadData(UT_IStream &is, int64 &v)
481  { is.bread(&v, 1); }
482  static void loadData(UT_IStream &is, bool &v)
483  { int64 iv; is.bread(&iv, 1); v = iv; }
484  static void loadData(UT_IStream &is, fpreal64 &v)
485  { is.bread<fpreal64>(&v, 1); }
486  static void loadData(UT_IStream &is, UT_Vector2D &v)
487  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
488  static void loadData(UT_IStream &is, UT_Vector3D &v)
489  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
490  is.bread<fpreal64>(&v.z(), 1); }
491  static void loadData(UT_IStream &is, UT_Vector4D &v)
492  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
493  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
494  static void loadData(UT_IStream &is, UT_Matrix2D &v)
495  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
496  static void loadData(UT_IStream &is, UT_Matrix3D &v)
497  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
498  static void loadData(UT_IStream &is, UT_Matrix4D &v)
499  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
500  static void loadData(UT_IStream &is, UT_Vector2I &v)
501  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
502  static void loadData(UT_IStream &is, UT_Vector3I &v)
503  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
504  is.bread<int64>(&v.z(), 1); }
505  static void loadData(UT_IStream &is, UT_Vector4I &v)
506  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
507  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
509  { is.bread(v); }
511  { UT_StringHolder rampdata;
512  loadData(is, rampdata);
513  if (rampdata.isstring())
514  {
515  v.reset(new UT_Ramp());
516  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
517  v->load(istr);
518  }
519  else v.reset();
520  }
523  loadData(is, data);
524  if (data.isstring())
525  {
526  // Find the data type.
527  const char *colon = UT_StringWrap(data).findChar(':');
528  if (colon)
529  {
530  int typelen = colon - data.buffer();
532  type.strncpy(data.buffer(), typelen);
533  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
534 
535  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
536  }
537  }
538  else v.reset();
539  }
540 
541  static void saveData(std::ostream &os, int64 v)
542  { UTwrite(os, &v); }
543  static void saveData(std::ostream &os, bool v)
544  { int64 iv = v; UTwrite(os, &iv); }
545  static void saveData(std::ostream &os, fpreal64 v)
546  { UTwrite<fpreal64>(os, &v); }
547  static void saveData(std::ostream &os, UT_Vector2D v)
548  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
549  static void saveData(std::ostream &os, UT_Vector3D v)
550  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
551  UTwrite<fpreal64>(os, &v.z()); }
552  static void saveData(std::ostream &os, UT_Vector4D v)
553  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
554  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
555  static void saveData(std::ostream &os, UT_Matrix2D v)
557  static void saveData(std::ostream &os, UT_Matrix3D v)
559  static void saveData(std::ostream &os, UT_Matrix4D v)
561  static void saveData(std::ostream &os, UT_StringHolder s)
562  { UT_StringWrap(s).saveBinary(os); }
563  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
565  UT_OStringStream ostr;
566  if (s) s->save(ostr);
567  result = ostr.str();
568  saveData(os, result);
569  }
570  static void saveData(std::ostream &os, PRM_DataItemHandle s)
572  UT_OStringStream ostr;
573  if (s)
574  {
575  ostr << s->getDataTypeToken();
576  ostr << ":";
577  s->saveBinary(ostr);
578  }
579  result = ostr.str();
580  saveData(os, result);
581  }
582 
583 
584  void save(std::ostream &os) const
585  {
586  int32 v = version();
587  UTwrite(os, &v);
588  saveData(os, myGroup);
589  saveData(os, myOperation);
590  saveData(os, myDirtype);
591  saveData(os, myT);
592  saveData(os, myR);
593  saveData(os, myOrigin);
594  saveData(os, myDir);
595  saveData(os, myDist);
596  saveData(os, myReversenml);
597  saveData(os, myKeeporiginal);
598  saveData(os, myConsolidatepts);
599  saveData(os, myConsolidatetol);
600  saveData(os, myConsolidateunshared);
601  saveData(os, myCreateoutputgroup);
602  saveData(os, myOutputgroup);
603 
604  }
605 
606  bool load(UT_IStream &is)
607  {
608  int32 v;
609  is.bread(&v, 1);
610  if (version() != v)
611  {
612  // Fail incompatible versions
613  return false;
614  }
615  loadData(is, myGroup);
616  loadData(is, myOperation);
617  loadData(is, myDirtype);
618  loadData(is, myT);
619  loadData(is, myR);
620  loadData(is, myOrigin);
621  loadData(is, myDir);
622  loadData(is, myDist);
623  loadData(is, myReversenml);
624  loadData(is, myKeeporiginal);
625  loadData(is, myConsolidatepts);
626  loadData(is, myConsolidatetol);
627  loadData(is, myConsolidateunshared);
628  loadData(is, myCreateoutputgroup);
629  loadData(is, myOutputgroup);
630 
631  return true;
632  }
633 
634  const UT_StringHolder & getGroup() const { return myGroup; }
635  void setGroup(const UT_StringHolder & val) { myGroup = val; }
637  {
638  SOP_Node *thissop = cookparms.getNode();
639  if (!thissop) return getGroup();
641  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
642  return result;
643  }
644  Operation getOperation() const { return Operation(myOperation); }
645  void setOperation(Operation val) { myOperation = int64(val); }
647  {
648  SOP_Node *thissop = cookparms.getNode();
649  if (!thissop) return getOperation();
650  int64 result;
651  OP_Utils::evalOpParm(result, thissop, "operation", cookparms.getCookTime(), 0);
652  return Operation(result);
653  }
654  Dirtype getDirtype() const { return Dirtype(myDirtype); }
655  void setDirtype(Dirtype val) { myDirtype = int64(val); }
656  Dirtype opDirtype(const SOP_NodeVerb::CookParms &cookparms) const
657  {
658  SOP_Node *thissop = cookparms.getNode();
659  if (!thissop) return getDirtype();
660  int64 result;
661  OP_Utils::evalOpParm(result, thissop, "dirtype", cookparms.getCookTime(), 0);
662  return Dirtype(result);
663  }
664  UT_Vector3D getT() const { return myT; }
665  void setT(UT_Vector3D val) { myT = val; }
666  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return getT();
671  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
672  return result;
673  }
674  UT_Vector3D getR() const { return myR; }
675  void setR(UT_Vector3D val) { myR = val; }
676  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
677  {
678  SOP_Node *thissop = cookparms.getNode();
679  if (!thissop) return getR();
681  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
682  return result;
683  }
684  UT_Vector3D getOrigin() const { return myOrigin; }
685  void setOrigin(UT_Vector3D val) { myOrigin = val; }
687  {
688  SOP_Node *thissop = cookparms.getNode();
689  if (!thissop) return getOrigin();
691  OP_Utils::evalOpParm(result, thissop, "origin", cookparms.getCookTime(), 0);
692  return result;
693  }
694  UT_Vector3D getDir() const { return myDir; }
695  void setDir(UT_Vector3D val) { myDir = val; }
696  UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getDir();
701  OP_Utils::evalOpParm(result, thissop, "dir", cookparms.getCookTime(), 0);
702  return result;
703  }
704  fpreal64 getDist() const { return myDist; }
705  void setDist(fpreal64 val) { myDist = val; }
706  fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return getDist();
711  OP_Utils::evalOpParm(result, thissop, "dist", cookparms.getCookTime(), 0);
712  return result;
713  }
714  Reversenml getReversenml() const { return Reversenml(myReversenml); }
715  void setReversenml(Reversenml val) { myReversenml = int64(val); }
717  {
718  SOP_Node *thissop = cookparms.getNode();
719  if (!thissop) return getReversenml();
720  int64 result;
721  OP_Utils::evalOpParm(result, thissop, "reversenml", cookparms.getCookTime(), 0);
722  return Reversenml(result);
723  }
724  bool getKeeporiginal() const { return myKeeporiginal; }
725  void setKeeporiginal(bool val) { myKeeporiginal = val; }
726  bool opKeeporiginal(const SOP_NodeVerb::CookParms &cookparms) const
727  {
728  SOP_Node *thissop = cookparms.getNode();
729  if (!thissop) return getKeeporiginal();
730  bool result;
731  OP_Utils::evalOpParm(result, thissop, "keepOriginal", cookparms.getCookTime(), 0);
732  return result;
733  }
734  bool getConsolidatepts() const { return myConsolidatepts; }
735  void setConsolidatepts(bool val) { myConsolidatepts = val; }
736  bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
737  {
738  SOP_Node *thissop = cookparms.getNode();
739  if (!thissop) return getConsolidatepts();
740  bool result;
741  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
742  return result;
743  }
744  fpreal64 getConsolidatetol() const { return myConsolidatetol; }
745  void setConsolidatetol(fpreal64 val) { myConsolidatetol = val; }
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getConsolidatetol();
751  OP_Utils::evalOpParm(result, thissop, "consolidatetol", cookparms.getCookTime(), 0);
752  return result;
753  }
754  bool getConsolidateunshared() const { return myConsolidateunshared; }
755  void setConsolidateunshared(bool val) { myConsolidateunshared = val; }
756  bool opConsolidateunshared(const SOP_NodeVerb::CookParms &cookparms) const
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getConsolidateunshared();
760  bool result;
761  OP_Utils::evalOpParm(result, thissop, "consolidateunshared", cookparms.getCookTime(), 0);
762  return result;
763  }
764  bool getCreateoutputgroup() const { return myCreateoutputgroup; }
765  void setCreateoutputgroup(bool val) { myCreateoutputgroup = val; }
766  bool opCreateoutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getCreateoutputgroup();
770  bool result;
771  OP_Utils::evalOpParm(result, thissop, "createoutputgroup", cookparms.getCookTime(), 0);
772  return result;
773  }
774  const UT_StringHolder & getOutputgroup() const { return myOutputgroup; }
775  void setOutputgroup(const UT_StringHolder & val) { myOutputgroup = val; }
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getOutputgroup();
781  OP_Utils::evalOpParm(result, thissop, "outputgroup", cookparms.getCookTime(), 0);
782  return result;
783  }
784 
785 private:
786  UT_StringHolder myGroup;
787  int64 myOperation;
788  int64 myDirtype;
789  UT_Vector3D myT;
790  UT_Vector3D myR;
791  UT_Vector3D myOrigin;
792  UT_Vector3D myDir;
793  fpreal64 myDist;
794  int64 myReversenml;
795  bool myKeeporiginal;
796  bool myConsolidatepts;
797  fpreal64 myConsolidatetol;
798  bool myConsolidateunshared;
799  bool myCreateoutputgroup;
800  UT_StringHolder myOutputgroup;
801 
802 };
void setR(UT_Vector3D val)
type
Definition: core.h:556
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setOperation(Operation val)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
UT_Vector3D getR() const
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
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:63
void setReversenml(Reversenml val)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
Dirtype opDirtype(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
void setDist(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
GLdouble s
Definition: glad.h:3009
Operation getOperation() const
An output stream object that owns its own string buffer storage.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setCreateoutputgroup(bool val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
**But if you need a result
Definition: thread.h:622
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
fpreal64 opConsolidatetol(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, bool v)
exint length() const
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) 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
Operation opOperation(const SOP_NodeVerb::CookParms &cookparms) const
bool getConsolidatepts() const
fpreal64 getDist() const
void setConsolidateunshared(bool val)
void setT(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
UT_StringHolder opOutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getOrigin() const
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool opKeeporiginal(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
UT_Vector3T< fpreal64 > UT_Vector3D
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setOutputgroup(const UT_StringHolder &val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
ParmType getNestParmType(TempIndex fieldnum) const override
void setConsolidatepts(bool val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool operator!=(const SOP_MirrorParms &src) const
void setOrigin(UT_Vector3D val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Vector4D v)
UT_Vector3D getDir() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const SOP_MirrorParms &src) const
bool opConsolidateunshared(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getOutputgroup() const
static void saveData(std::ostream &os, UT_StringHolder s)
static int version()
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_Vector3D getT() const
Reversenml getReversenml() const
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool getCreateoutputgroup() const
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setDir(UT_Vector3D val)
Dirtype getDirtype() const
GLboolean r
Definition: glcorearb.h:1222
SYS_FORCE_INLINE UT_StringHolder getToken(Operation enum_value)
void setDirtype(Dirtype val)
void setConsolidatetol(fpreal64 val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool getKeeporiginal() const
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
Reversenml opReversenml(const SOP_NodeVerb::CookParms &cookparms) const
bool getConsolidateunshared() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
static void saveData(std::ostream &os, fpreal64 v)
void save(std::ostream &os) const
SYS_FORCE_INLINE bool isstring() const
fpreal64 getConsolidatetol() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setKeeporiginal(bool val)
bool opCreateoutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663