HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribMirror.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 using namespace UT::Literal;
23 
24 class DEP_MicroNode;
25 namespace SOP_AttribMirrorEnums
26 {
27  enum class GroupType
28  {
29  VERTICES = 0,
30  POINTS,
31  PRIMS
32  };
33  enum class MirrorOp
34  {
35  SOURCE = 0,
37  };
38  enum class Attrib
39  {
40  COLORATTRIB = 0,
41  UVATTRIB,
43  };
44  enum class AttribMirrorOp
45  {
46  NOMIRROR = 0,
47  UVMIRROR,
50  };
51 }
52 
53 
55 {
56 public:
57  static int version() { return 1; }
58 
60  {
61  myGroup = ""_sh;
62  myGroupType = 0;
63  myMirrorOp = 1;
64  myAttrib = 0;
65  myAttribName = ""_sh;
66  myUseTolerance = false;
67  myTolerance = 0.1;
68  myOrigin = UT_Vector3D(0,0,0);
69  myDist = 0;
70  myDir = UT_Vector3D(1,0,0);
71  myAttribMirrorOp = 0;
72  myUVOrigin = UT_Vector2D(0.5,0.5);
73  myUVAngle = 90;
74  myStringReplace = false;
75  mySearch = "L_*"_sh;
76  myReplace = "R_*"_sh;
77 
78  }
79 
80  explicit SOP_AttribMirrorParms(const SOP_AttribMirrorParms &) = default;
81 
82  ~SOP_AttribMirrorParms() override {}
83 
85  {
86  if (myGroup != src.myGroup) return false;
87  if (myGroupType != src.myGroupType) return false;
88  if (myMirrorOp != src.myMirrorOp) return false;
89  if (myAttrib != src.myAttrib) return false;
90  if (myAttribName != src.myAttribName) return false;
91  if (myUseTolerance != src.myUseTolerance) return false;
92  if (myTolerance != src.myTolerance) return false;
93  if (myOrigin != src.myOrigin) return false;
94  if (myDist != src.myDist) return false;
95  if (myDir != src.myDir) return false;
96  if (myAttribMirrorOp != src.myAttribMirrorOp) return false;
97  if (myUVOrigin != src.myUVOrigin) return false;
98  if (myUVAngle != src.myUVAngle) return false;
99  if (myStringReplace != src.myStringReplace) return false;
100  if (mySearch != src.mySearch) return false;
101  if (myReplace != src.myReplace) return false;
102 
103  return true;
104  }
106  {
107  return !operator==(src);
108  }
113 
114 
115 
116  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
117  {
118  myGroup = ""_sh;
119  if (true)
120  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
121  myGroupType = 0;
122  if (true)
123  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, 0);
124  myMirrorOp = 1;
125  if (true)
126  graph->evalOpParm(myMirrorOp, nodeidx, "usegroupas", time, 0);
127  myAttrib = 0;
128  if (true)
129  graph->evalOpParm(myAttrib, nodeidx, "attrib", time, 0);
130  myAttribName = ""_sh;
131  if (true && ( (true&&!(((int64(getAttrib())!=2)))) ) )
132  graph->evalOpParm(myAttribName, nodeidx, "attribname", time, 0);
133  myUseTolerance = false;
134  if (true)
135  graph->evalOpParm(myUseTolerance, nodeidx, "usetolerance", time, 0);
136  myTolerance = 0.1;
137  if (true && ( (true&&!(((getUseTolerance()==0)))) ) )
138  graph->evalOpParm(myTolerance, nodeidx, "tolerance", time, 0);
139  myOrigin = UT_Vector3D(0,0,0);
140  if (true)
141  graph->evalOpParm(myOrigin, nodeidx, "origin", time, 0);
142  myDist = 0;
143  if (true)
144  graph->evalOpParm(myDist, nodeidx, "dist", time, 0);
145  myDir = UT_Vector3D(1,0,0);
146  if (true)
147  graph->evalOpParm(myDir, nodeidx, "dir", time, 0);
148  myAttribMirrorOp = 0;
149  if (true)
150  graph->evalOpParm(myAttribMirrorOp, nodeidx, "attribmirror", time, 0);
151  myUVOrigin = UT_Vector2D(0.5,0.5);
152  if (true && ( (true&&!(((int64(getAttribMirrorOp())!=1)))) ) )
153  graph->evalOpParm(myUVOrigin, nodeidx, "uvorig", time, 0);
154  myUVAngle = 90;
155  if (true && ( (true&&!(((int64(getAttribMirrorOp())!=1)))) ) )
156  graph->evalOpParm(myUVAngle, nodeidx, "uvangle", time, 0);
157  myStringReplace = false;
158  if (true)
159  graph->evalOpParm(myStringReplace, nodeidx, "stringreplace", time, 0);
160  mySearch = "L_*"_sh;
161  if (true && ( (true&&!(((getStringReplace()==0)))) ) )
162  graph->evalOpParm(mySearch, nodeidx, "search", time, 0);
163  myReplace = "R_*"_sh;
164  if (true && ( (true&&!(((getStringReplace()==0)))) ) )
165  graph->evalOpParm(myReplace, nodeidx, "replace", time, 0);
166 
167  }
168 
169 
170  void loadFromOpSubclass(const LoadParms &loadparms) override
171  {
172  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
173  }
174 
175 
176  void copyFrom(const SOP_NodeParms *src) override
177  {
178  *this = *((const SOP_AttribMirrorParms *)src);
179  }
180 
181  template <typename T>
182  void
183  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
184  {
185  if (idx.size() < 1)
186  return;
187  UT_ASSERT(idx.size() == instance.size()+1);
188  if (idx.size() != instance.size()+1)
189  return;
190  switch (idx[0])
191  {
192  case 0:
193  coerceValue(value, myGroup);
194  break;
195  case 1:
196  coerceValue(value, myGroupType);
197  break;
198  case 2:
199  coerceValue(value, myMirrorOp);
200  break;
201  case 3:
202  coerceValue(value, myAttrib);
203  break;
204  case 4:
205  coerceValue(value, myAttribName);
206  break;
207  case 5:
208  coerceValue(value, myUseTolerance);
209  break;
210  case 6:
211  coerceValue(value, myTolerance);
212  break;
213  case 7:
214  coerceValue(value, myOrigin);
215  break;
216  case 8:
217  coerceValue(value, myDist);
218  break;
219  case 9:
220  coerceValue(value, myDir);
221  break;
222  case 10:
223  coerceValue(value, myAttribMirrorOp);
224  break;
225  case 11:
226  coerceValue(value, myUVOrigin);
227  break;
228  case 12:
229  coerceValue(value, myUVAngle);
230  break;
231  case 13:
232  coerceValue(value, myStringReplace);
233  break;
234  case 14:
235  coerceValue(value, mySearch);
236  break;
237  case 15:
238  coerceValue(value, myReplace);
239  break;
240 
241  }
242  }
243 
244  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
245  { doGetParmValue(idx, instance, value); }
246  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
247  { doGetParmValue(idx, instance, value); }
248  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
249  { doGetParmValue(idx, instance, value); }
250  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
251  { doGetParmValue(idx, instance, value); }
252  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
253  { doGetParmValue(idx, instance, value); }
254  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
255  { doGetParmValue(idx, instance, value); }
256  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
257  { doGetParmValue(idx, instance, value); }
258  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
259  { doGetParmValue(idx, instance, value); }
260  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
261  { doGetParmValue(idx, instance, value); }
262  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
263  { doGetParmValue(idx, instance, value); }
264  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
265  { doGetParmValue(idx, instance, value); }
266 
267  template <typename T>
268  void
269  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
270  {
271  if (idx.size() < 1)
272  return;
273  UT_ASSERT(idx.size() == instance.size()+1);
274  if (idx.size() != instance.size()+1)
275  return;
276  switch (idx[0])
277  {
278  case 0:
279  coerceValue(myGroup, ( ( value ) ));
280  break;
281  case 1:
282  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
283  break;
284  case 2:
285  coerceValue(myMirrorOp, clampMinValue(0, clampMaxValue(1, value ) ));
286  break;
287  case 3:
288  coerceValue(myAttrib, clampMinValue(0, clampMaxValue(2, value ) ));
289  break;
290  case 4:
291  coerceValue(myAttribName, ( ( value ) ));
292  break;
293  case 5:
294  coerceValue(myUseTolerance, ( ( value ) ));
295  break;
296  case 6:
297  coerceValue(myTolerance, ( ( value ) ));
298  break;
299  case 7:
300  coerceValue(myOrigin, ( ( value ) ));
301  break;
302  case 8:
303  coerceValue(myDist, ( ( value ) ));
304  break;
305  case 9:
306  coerceValue(myDir, ( ( value ) ));
307  break;
308  case 10:
309  coerceValue(myAttribMirrorOp, clampMinValue(0, clampMaxValue(3, value ) ));
310  break;
311  case 11:
312  coerceValue(myUVOrigin, ( ( value ) ));
313  break;
314  case 12:
315  coerceValue(myUVAngle, ( ( value ) ));
316  break;
317  case 13:
318  coerceValue(myStringReplace, ( ( value ) ));
319  break;
320  case 14:
321  coerceValue(mySearch, ( ( value ) ));
322  break;
323  case 15:
324  coerceValue(myReplace, ( ( value ) ));
325  break;
326 
327  }
328  }
329 
330  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
335  { doSetParmValue(idx, instance, value); }
336  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
337  { doSetParmValue(idx, instance, value); }
338  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
339  { doSetParmValue(idx, instance, value); }
340  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
341  { doSetParmValue(idx, instance, value); }
342  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
343  { doSetParmValue(idx, instance, value); }
344  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
345  { doSetParmValue(idx, instance, value); }
346  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
347  { doSetParmValue(idx, instance, value); }
348  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
349  { doSetParmValue(idx, instance, value); }
350  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
351  { doSetParmValue(idx, instance, value); }
352 
353  exint getNestNumParms(TempIndex idx) const override
354  {
355  if (idx.size() == 0)
356  return 16;
357  switch (idx[0])
358  {
359 
360  }
361  // Invalid
362  return 0;
363  }
364 
365  const char *getNestParmName(TempIndex fieldnum) const override
366  {
367  if (fieldnum.size() < 1)
368  return 0;
369  switch (fieldnum[0])
370  {
371  case 0:
372  return "group";
373  case 1:
374  return "grouptype";
375  case 2:
376  return "usegroupas";
377  case 3:
378  return "attrib";
379  case 4:
380  return "attribname";
381  case 5:
382  return "usetolerance";
383  case 6:
384  return "tolerance";
385  case 7:
386  return "origin";
387  case 8:
388  return "dist";
389  case 9:
390  return "dir";
391  case 10:
392  return "attribmirror";
393  case 11:
394  return "uvorig";
395  case 12:
396  return "uvangle";
397  case 13:
398  return "stringreplace";
399  case 14:
400  return "search";
401  case 15:
402  return "replace";
403 
404  }
405  return 0;
406  }
407 
408  ParmType getNestParmType(TempIndex fieldnum) const override
409  {
410  if (fieldnum.size() < 1)
411  return PARM_UNSUPPORTED;
412  switch (fieldnum[0])
413  {
414  case 0:
415  return PARM_STRING;
416  case 1:
417  return PARM_INTEGER;
418  case 2:
419  return PARM_INTEGER;
420  case 3:
421  return PARM_INTEGER;
422  case 4:
423  return PARM_STRING;
424  case 5:
425  return PARM_INTEGER;
426  case 6:
427  return PARM_FLOAT;
428  case 7:
429  return PARM_VECTOR3;
430  case 8:
431  return PARM_FLOAT;
432  case 9:
433  return PARM_VECTOR3;
434  case 10:
435  return PARM_INTEGER;
436  case 11:
437  return PARM_VECTOR2;
438  case 12:
439  return PARM_FLOAT;
440  case 13:
441  return PARM_INTEGER;
442  case 14:
443  return PARM_STRING;
444  case 15:
445  return PARM_STRING;
446 
447  }
448  return PARM_UNSUPPORTED;
449  }
450 
451  // Boiler plate to load individual types.
452  static void loadData(UT_IStream &is, int64 &v)
453  { is.bread(&v, 1); }
454  static void loadData(UT_IStream &is, bool &v)
455  { int64 iv; is.bread(&iv, 1); v = iv; }
456  static void loadData(UT_IStream &is, fpreal64 &v)
457  { is.bread<fpreal64>(&v, 1); }
458  static void loadData(UT_IStream &is, UT_Vector2D &v)
459  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
460  static void loadData(UT_IStream &is, UT_Vector3D &v)
461  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
462  is.bread<fpreal64>(&v.z(), 1); }
463  static void loadData(UT_IStream &is, UT_Vector4D &v)
464  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
465  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
466  static void loadData(UT_IStream &is, UT_Matrix2D &v)
467  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
468  static void loadData(UT_IStream &is, UT_Matrix3D &v)
469  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
470  static void loadData(UT_IStream &is, UT_Matrix4D &v)
471  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
472  static void loadData(UT_IStream &is, UT_Vector2I &v)
473  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
474  static void loadData(UT_IStream &is, UT_Vector3I &v)
475  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
476  is.bread<int64>(&v.z(), 1); }
477  static void loadData(UT_IStream &is, UT_Vector4I &v)
478  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
479  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
481  { is.bread(v); }
483  { UT_StringHolder rampdata;
484  loadData(is, rampdata);
485  if (rampdata.isstring())
486  {
487  v.reset(new UT_Ramp());
488  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
489  v->load(istr);
490  }
491  else v.reset();
492  }
495  loadData(is, data);
496  if (data.isstring())
497  {
498  // Find the data type.
499  const char *colon = UT_StringWrap(data).findChar(':');
500  if (colon)
501  {
502  int typelen = colon - data.buffer();
504  type.strncpy(data.buffer(), typelen);
505  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
506 
507  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
508  }
509  }
510  else v.reset();
511  }
512 
513  static void saveData(std::ostream &os, int64 v)
514  { UTwrite(os, &v); }
515  static void saveData(std::ostream &os, bool v)
516  { int64 iv = v; UTwrite(os, &iv); }
517  static void saveData(std::ostream &os, fpreal64 v)
518  { UTwrite<fpreal64>(os, &v); }
519  static void saveData(std::ostream &os, UT_Vector2D v)
520  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
521  static void saveData(std::ostream &os, UT_Vector3D v)
522  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
523  UTwrite<fpreal64>(os, &v.z()); }
524  static void saveData(std::ostream &os, UT_Vector4D v)
525  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
526  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
527  static void saveData(std::ostream &os, UT_Matrix2D v)
529  static void saveData(std::ostream &os, UT_Matrix3D v)
531  static void saveData(std::ostream &os, UT_Matrix4D v)
533  static void saveData(std::ostream &os, UT_StringHolder s)
534  { UT_StringWrap(s).saveBinary(os); }
535  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
537  UT_OStringStream ostr;
538  if (s) s->save(ostr);
539  result = ostr.str();
540  saveData(os, result);
541  }
542  static void saveData(std::ostream &os, PRM_DataItemHandle s)
544  UT_OStringStream ostr;
545  if (s)
546  {
547  ostr << s->getDataTypeToken();
548  ostr << ":";
549  s->saveBinary(ostr);
550  }
551  result = ostr.str();
552  saveData(os, result);
553  }
554 
555 
556  void save(std::ostream &os) const
557  {
558  int32 v = version();
559  UTwrite(os, &v);
560  saveData(os, myGroup);
561  saveData(os, myGroupType);
562  saveData(os, myMirrorOp);
563  saveData(os, myAttrib);
564  saveData(os, myAttribName);
565  saveData(os, myUseTolerance);
566  saveData(os, myTolerance);
567  saveData(os, myOrigin);
568  saveData(os, myDist);
569  saveData(os, myDir);
570  saveData(os, myAttribMirrorOp);
571  saveData(os, myUVOrigin);
572  saveData(os, myUVAngle);
573  saveData(os, myStringReplace);
574  saveData(os, mySearch);
575  saveData(os, myReplace);
576 
577  }
578 
579  bool load(UT_IStream &is)
580  {
581  int32 v;
582  is.bread(&v, 1);
583  if (version() != v)
584  {
585  // Fail incompatible versions
586  return false;
587  }
588  loadData(is, myGroup);
589  loadData(is, myGroupType);
590  loadData(is, myMirrorOp);
591  loadData(is, myAttrib);
592  loadData(is, myAttribName);
593  loadData(is, myUseTolerance);
594  loadData(is, myTolerance);
595  loadData(is, myOrigin);
596  loadData(is, myDist);
597  loadData(is, myDir);
598  loadData(is, myAttribMirrorOp);
599  loadData(is, myUVOrigin);
600  loadData(is, myUVAngle);
601  loadData(is, myStringReplace);
602  loadData(is, mySearch);
603  loadData(is, myReplace);
604 
605  return true;
606  }
607 
608  const UT_StringHolder & getGroup() const { return myGroup; }
609  void setGroup(const UT_StringHolder & val) { myGroup = val; }
611  {
612  SOP_Node *thissop = cookparms.getNode();
613  if (!thissop) return getGroup();
615  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
616  return result;
617  }
618  GroupType getGroupType() const { return GroupType(myGroupType); }
619  void setGroupType(GroupType val) { myGroupType = int64(val); }
621  {
622  SOP_Node *thissop = cookparms.getNode();
623  if (!thissop) return getGroupType();
624  int64 result;
625  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
626  return GroupType(result);
627  }
628  MirrorOp getMirrorOp() const { return MirrorOp(myMirrorOp); }
629  void setMirrorOp(MirrorOp val) { myMirrorOp = int64(val); }
631  {
632  SOP_Node *thissop = cookparms.getNode();
633  if (!thissop) return getMirrorOp();
634  int64 result;
635  OP_Utils::evalOpParm(result, thissop, "usegroupas", cookparms.getCookTime(), 0);
636  return MirrorOp(result);
637  }
638  Attrib getAttrib() const { return Attrib(myAttrib); }
639  void setAttrib(Attrib val) { myAttrib = int64(val); }
640  Attrib opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
641  {
642  SOP_Node *thissop = cookparms.getNode();
643  if (!thissop) return getAttrib();
644  int64 result;
645  OP_Utils::evalOpParm(result, thissop, "attrib", cookparms.getCookTime(), 0);
646  return Attrib(result);
647  }
648  const UT_StringHolder & getAttribName() const { return myAttribName; }
649  void setAttribName(const UT_StringHolder & val) { myAttribName = val; }
651  {
652  SOP_Node *thissop = cookparms.getNode();
653  if (!thissop) return getAttribName();
655  OP_Utils::evalOpParm(result, thissop, "attribname", cookparms.getCookTime(), 0);
656  return result;
657  }
658  bool getUseTolerance() const { return myUseTolerance; }
659  void setUseTolerance(bool val) { myUseTolerance = val; }
660  bool opUseTolerance(const SOP_NodeVerb::CookParms &cookparms) const
661  {
662  SOP_Node *thissop = cookparms.getNode();
663  if (!thissop) return getUseTolerance();
664  bool result;
665  OP_Utils::evalOpParm(result, thissop, "usetolerance", cookparms.getCookTime(), 0);
666  return result;
667  }
668  fpreal64 getTolerance() const { return myTolerance; }
669  void setTolerance(fpreal64 val) { myTolerance = val; }
671  {
672  SOP_Node *thissop = cookparms.getNode();
673  if (!thissop) return getTolerance();
675  OP_Utils::evalOpParm(result, thissop, "tolerance", cookparms.getCookTime(), 0);
676  return result;
677  }
678  UT_Vector3D getOrigin() const { return myOrigin; }
679  void setOrigin(UT_Vector3D val) { myOrigin = val; }
681  {
682  SOP_Node *thissop = cookparms.getNode();
683  if (!thissop) return getOrigin();
685  OP_Utils::evalOpParm(result, thissop, "origin", cookparms.getCookTime(), 0);
686  return result;
687  }
688  fpreal64 getDist() const { return myDist; }
689  void setDist(fpreal64 val) { myDist = val; }
690  fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
691  {
692  SOP_Node *thissop = cookparms.getNode();
693  if (!thissop) return getDist();
695  OP_Utils::evalOpParm(result, thissop, "dist", cookparms.getCookTime(), 0);
696  return result;
697  }
698  UT_Vector3D getDir() const { return myDir; }
699  void setDir(UT_Vector3D val) { myDir = val; }
700  UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
701  {
702  SOP_Node *thissop = cookparms.getNode();
703  if (!thissop) return getDir();
705  OP_Utils::evalOpParm(result, thissop, "dir", cookparms.getCookTime(), 0);
706  return result;
707  }
708  AttribMirrorOp getAttribMirrorOp() const { return AttribMirrorOp(myAttribMirrorOp); }
709  void setAttribMirrorOp(AttribMirrorOp val) { myAttribMirrorOp = int64(val); }
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return getAttribMirrorOp();
714  int64 result;
715  OP_Utils::evalOpParm(result, thissop, "attribmirror", cookparms.getCookTime(), 0);
716  return AttribMirrorOp(result);
717  }
718  UT_Vector2D getUVOrigin() const { return myUVOrigin; }
719  void setUVOrigin(UT_Vector2D val) { myUVOrigin = val; }
721  {
722  SOP_Node *thissop = cookparms.getNode();
723  if (!thissop) return getUVOrigin();
725  OP_Utils::evalOpParm(result, thissop, "uvorig", cookparms.getCookTime(), 0);
726  return result;
727  }
728  fpreal64 getUVAngle() const { return myUVAngle; }
729  void setUVAngle(fpreal64 val) { myUVAngle = val; }
731  {
732  SOP_Node *thissop = cookparms.getNode();
733  if (!thissop) return getUVAngle();
735  OP_Utils::evalOpParm(result, thissop, "uvangle", cookparms.getCookTime(), 0);
736  return result;
737  }
738  bool getStringReplace() const { return myStringReplace; }
739  void setStringReplace(bool val) { myStringReplace = val; }
740  bool opStringReplace(const SOP_NodeVerb::CookParms &cookparms) const
741  {
742  SOP_Node *thissop = cookparms.getNode();
743  if (!thissop) return getStringReplace();
744  bool result;
745  OP_Utils::evalOpParm(result, thissop, "stringreplace", cookparms.getCookTime(), 0);
746  return result;
747  }
748  const UT_StringHolder & getSearch() const { return mySearch; }
749  void setSearch(const UT_StringHolder & val) { mySearch = val; }
751  {
752  SOP_Node *thissop = cookparms.getNode();
753  if (!thissop) return getSearch();
755  OP_Utils::evalOpParm(result, thissop, "search", cookparms.getCookTime(), 0);
756  return result;
757  }
758  const UT_StringHolder & getReplace() const { return myReplace; }
759  void setReplace(const UT_StringHolder & val) { myReplace = val; }
761  {
762  SOP_Node *thissop = cookparms.getNode();
763  if (!thissop) return getReplace();
765  OP_Utils::evalOpParm(result, thissop, "replace", cookparms.getCookTime(), 0);
766  return result;
767  }
768 
769 private:
770  UT_StringHolder myGroup;
771  int64 myGroupType;
772  int64 myMirrorOp;
773  int64 myAttrib;
774  UT_StringHolder myAttribName;
775  bool myUseTolerance;
776  fpreal64 myTolerance;
777  UT_Vector3D myOrigin;
778  fpreal64 myDist;
779  UT_Vector3D myDir;
780  int64 myAttribMirrorOp;
781  UT_Vector2D myUVOrigin;
782  fpreal64 myUVAngle;
783  bool myStringReplace;
784  UT_StringHolder mySearch;
785  UT_StringHolder myReplace;
786 
787 };
fpreal64 opTolerance(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
fpreal64 opUVAngle(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
exint nodeIdx() const
Definition: SOP_NodeVerb.h:102
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:734
bool load(UT_IStream &is)
UT_StringHolder opReplace(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
exint getNestNumParms(TempIndex idx) const override
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
UT_Vector3D getDir() const
fpreal getTime() const
Definition: OP_Context.h:59
static void loadData(UT_IStream &is, UT_Vector3I &v)
UT_Vector2T< fpreal64 > UT_Vector2D
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setUVOrigin(UT_Vector2D val)
const GLfloat * c
Definition: glew.h:16631
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
MirrorOp opMirrorOp(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:656
int64 exint
Definition: SYS_Types.h:125
static void saveData(std::ostream &os, UT_Matrix4D v)
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:101
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
An output stream object that owns its own string buffer storage.
bool opStringReplace(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
GLenum src
Definition: glcorearb.h:1793
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void save(std::ostream &os) const
void setAttribMirrorOp(AttribMirrorOp val)
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, UT_Vector2D v)
void setAttribName(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
UT_Vector2D opUVOrigin(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, int64 v)
UT_Vector2D getUVOrigin() const
double fpreal64
Definition: SYS_Types.h:201
static void saveData(std::ostream &os, UT_Vector4D v)
bool opUseTolerance(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
const UT_StringHolder & getReplace() const
GroupType getGroupType() const
void copyFrom(const SOP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
exint length() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
UT_StringHolder opAttribName(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opSearch(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glcorearb.h:837
const UT_StringHolder & getSearch() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setUVAngle(fpreal64 val)
fpreal64 getTolerance() const
void setGroupType(GroupType val)
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2D &v)
long long int64
Definition: SYS_Types.h:116
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
void setOrigin(UT_Vector3D val)
bool operator!=(const SOP_AttribMirrorParms &src) const
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:287
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & getAttribName() const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:109
void setTolerance(fpreal64 val)
GLboolean * data
Definition: glcorearb.h:131
void setReplace(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
GroupType opGroupType(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_AttribMirrorParms &src) const
void setSearch(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setDir(UT_Vector3D val)
#define SOP_API
Definition: SOP_API.h:10
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:748
ParmType getNestParmType(TempIndex fieldnum) const override
UT_Vector3D getOrigin() const
const char * findChar(int c) const
Definition: UT_String.h:1372
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:153
Definition: core.h:1131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
AttribMirrorOp getAttribMirrorOp() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
const UT_StringHolder & getGroup() const
Attrib opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_Vector3D &v)
GLboolean r
Definition: glcorearb.h:1222
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:654
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
GLdouble s
Definition: glew.h:1395
void setMirrorOp(MirrorOp val)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:107
static void loadData(UT_IStream &is, bool &v)
AttribMirrorOp opAttribMirrorOp(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
static void saveData(std::ostream &os, UT_Vector3D v)
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:652