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