HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AgentUnpack.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_NodeVerb.h>
7 #include <SOP/SOP_GraphProxy.h>
8 
9 #include <OP/OP_Utils.h>
10 #include <PRM/PRM_Parm.h>
11 #include <UT/UT_IStream.h>
12 #include <UT/UT_NTStreamUtil.h>
13 #include <UT/UT_Ramp.h>
14 #include <UT/UT_SharedPtr.h>
15 #include <UT/UT_StringHolder.h>
16 #include <UT/UT_StringStream.h>
17 #include <UT/UT_VectorTypes.h>
18 #include <SYS/SYS_Types.h>
19 
20 using namespace UT::Literal;
21 
22 class DEP_MicroNode;
23 namespace SOP_AgentUnpackEnums
24 {
25  enum class Output
26  {
27  DEFORMED = 0,
28  REST,
29  JOINTS,
30  SKELETON,
32  };
33 }
34 
35 
37 {
38 public:
39  static int version() { return 1; }
40  struct Filters
41  {
45 
46 
48  {
49  jointnames = ""_sh;
50  percentage = 100;
51  seed = 1;
52 
53  }
54 
55  bool operator==(const Filters &src) const
56  {
57  if (jointnames != src.jointnames) return false;
58  if (percentage != src.percentage) return false;
59  if (seed != src.seed) return false;
60 
61  return true;
62  }
63  bool operator!=(const Filters &src) const
64  {
65  return !operator==(src);
66  }
67 
68  };
69 
71  {
73 
74  buf.strcat("[ ");
75  for (int i = 0; i < list.entries(); i++)
76  {
77  if (i)
78  buf.strcat(", ");
79  buf.strcat("( ");
80  buf.append("");
81  { UT_String tmp; tmp = UT_StringWrap(list(i).jointnames).makeQuotedString('"'); buf.strcat(tmp); }
82  buf.append(", ");
83  buf.appendSprintf("%f", (list(i).percentage));
84  buf.append(", ");
85  buf.appendSprintf("%f", (list(i).seed));
86 
87  buf.strcat(" )");
88  }
89  buf.strcat(" ]");
90 
92  return result;
93  }
94 
96  {
97  myGroup = ""_sh;
98  myOutput = 0;
99  myApplyAgentXform = true;
100  myApplyJointXforms = true;
101  myShapeFilter = "*"_sh;
102  myLimitIterations = true;
103  myIterations = 1;
104  myAddShapeDeformerAttrib = false;
105  myShapeDeformerAttrib = "agentshapedeformer"_sh;
106  myAddXformNameAttrib = false;
107  myXformNameAttrib = "agenttransformname"_sh;
108  myClipNames = ""_sh;
109  myTransferAttributes = ""_sh;
110  myTransferGroups = ""_sh;
111  mySkeletonColor = UT_Vector3D(0.0,0.09,1.0);
112 
113  }
114 
115  explicit SOP_AgentUnpackParms(const SOP_AgentUnpackParms &) = default;
116 
117  ~SOP_AgentUnpackParms() override {}
118 
120  {
121  if (myGroup != src.myGroup) return false;
122  if (myOutput != src.myOutput) return false;
123  if (myApplyAgentXform != src.myApplyAgentXform) return false;
124  if (myApplyJointXforms != src.myApplyJointXforms) return false;
125  if (myShapeFilter != src.myShapeFilter) return false;
126  if (myLimitIterations != src.myLimitIterations) return false;
127  if (myIterations != src.myIterations) return false;
128  if (myAddShapeDeformerAttrib != src.myAddShapeDeformerAttrib) return false;
129  if (myShapeDeformerAttrib != src.myShapeDeformerAttrib) return false;
130  if (myAddXformNameAttrib != src.myAddXformNameAttrib) return false;
131  if (myXformNameAttrib != src.myXformNameAttrib) return false;
132  if (myClipNames != src.myClipNames) return false;
133  if (myTransferAttributes != src.myTransferAttributes) return false;
134  if (myTransferGroups != src.myTransferGroups) return false;
135  if (myFilters != src.myFilters) return false;
136  if (mySkeletonColor != src.mySkeletonColor) return false;
137 
138  return true;
139  }
141  {
142  return !operator==(src);
143  }
145 
146 
147 
148  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
149  {
150  myGroup = ""_sh;
151  if (true)
152  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
153  myOutput = 0;
154  if (true)
155  graph->evalOpParm(myOutput, nodeidx, "output", time, 0);
156  myApplyAgentXform = true;
157  if (true && ( (!(((int64(getOutput())==4))||((int64(getOutput())==4)))) ) )
158  graph->evalOpParm(myApplyAgentXform, nodeidx, "applyagentxform", time, 0);
159  myApplyJointXforms = true;
160  if (true && ( (!(((int64(getOutput())==0))||((int64(getOutput())==4))||((int64(getOutput())==0))||((int64(getOutput())==4)))) ) )
161  graph->evalOpParm(myApplyJointXforms, nodeidx, "applyjointxforms", time, 0);
162  myShapeFilter = "*"_sh;
163  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
164  graph->evalOpParm(myShapeFilter, nodeidx, "shapefilter", time, 0);
165  myLimitIterations = true;
166  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
167  graph->evalOpParm(myLimitIterations, nodeidx, "limititerations", time, 0);
168  myIterations = 1;
169  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((getLimitIterations()==0))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
170  graph->evalOpParm(myIterations, nodeidx, "iterations", time, 0);
171  myAddShapeDeformerAttrib = false;
172  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
173  graph->evalOpParm(myAddShapeDeformerAttrib, nodeidx, "addshapedeformerattrib", time, 0);
174  myShapeDeformerAttrib = "agentshapedeformer"_sh;
175  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((getAddShapeDeformerAttrib()==0))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
176  graph->evalOpParm(myShapeDeformerAttrib, nodeidx, "shapedeformerattrib", time, 0);
177  myAddXformNameAttrib = false;
178  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
179  graph->evalOpParm(myAddXformNameAttrib, nodeidx, "addxformnameattrib", time, 0);
180  myXformNameAttrib = "agenttransformname"_sh;
181  if (true && ( (!(((int64(getOutput())!=0)&&(int64(getOutput())!=1))||((getAddXformNameAttrib()==0))||((int64(getOutput())!=0)&&(int64(getOutput())!=1)))) ) )
182  graph->evalOpParm(myXformNameAttrib, nodeidx, "xformnameattrib", time, 0);
183  myClipNames = ""_sh;
184  if (true && ( (!(((int64(getOutput())!=4))||((int64(getOutput())!=4)))) ) )
185  graph->evalOpParm(myClipNames, nodeidx, "clipnames", time, 0);
186  myTransferAttributes = ""_sh;
187  if (true)
188  graph->evalOpParm(myTransferAttributes, nodeidx, "transferattributes", time, 0);
189  myTransferGroups = ""_sh;
190  if (true)
191  graph->evalOpParm(myTransferGroups, nodeidx, "transfergroups", time, 0);
192  if (true && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) )
193  {
194  int64 length = 0;
195  graph->evalOpParm(length, nodeidx, "numjointfilters", time, 0);
196  myFilters.entries(length);
197  for (exint i = 0; i < length; i++)
198  {
199  int parmidx = i+1;
200  auto && _curentry = myFilters(i);
201  (void) _curentry;
202  myFilters(i).jointnames = ""_sh;
203  if (true && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) )
204  graph->evalOpParmInst(myFilters(i).jointnames, nodeidx, "jointnames#", &parmidx, time, 0);
205  myFilters(i).percentage = 100;
206  if (true && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) )
207  graph->evalOpParmInst(myFilters(i).percentage, nodeidx, "percentage#", &parmidx, time, 0);
208  myFilters(i).seed = 1;
209  if (true && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) && ( (!(((int64(getOutput())!=2))||((int64(getOutput())!=2)))) ) )
210  graph->evalOpParmInst(myFilters(i).seed, nodeidx, "seed#", &parmidx, time, 0);
211 
212  }
213  }
214  else
215  myFilters.clear();
216  mySkeletonColor = UT_Vector3D(0.0,0.09,1.0);
217  if (true && ( (!(((int64(getOutput())!=3)&&(int64(getOutput())!=4))||((int64(getOutput())!=3)&&(int64(getOutput())!=4)))) ) )
218  graph->evalOpParm(mySkeletonColor, nodeidx, "skeletoncolor", time, 0);
219 
220  }
221 
222 
223  void loadFromOpSubclass(const LoadParms &loadparms) override
224  {
225  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
226  }
227 
228 
229  void copyFrom(const SOP_NodeParms *src) override
230  {
231  *this = *((const SOP_AgentUnpackParms *)src);
232  }
233 
234  template <typename T>
235  void
236  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
237  {
238  if (idx.size() < 1)
239  return;
240  UT_ASSERT(idx.size() == instance.size()+1);
241  if (idx.size() != instance.size()+1)
242  return;
243  switch (idx[0])
244  {
245  case 0:
246  coerceValue(value, myGroup);
247  break;
248  case 1:
249  coerceValue(value, myOutput);
250  break;
251  case 2:
252  coerceValue(value, myApplyAgentXform);
253  break;
254  case 3:
255  coerceValue(value, myApplyJointXforms);
256  break;
257  case 4:
258  coerceValue(value, myShapeFilter);
259  break;
260  case 5:
261  coerceValue(value, myLimitIterations);
262  break;
263  case 6:
264  coerceValue(value, myIterations);
265  break;
266  case 7:
267  coerceValue(value, myAddShapeDeformerAttrib);
268  break;
269  case 8:
270  coerceValue(value, myShapeDeformerAttrib);
271  break;
272  case 9:
273  coerceValue(value, myAddXformNameAttrib);
274  break;
275  case 10:
276  coerceValue(value, myXformNameAttrib);
277  break;
278  case 11:
279  coerceValue(value, myClipNames);
280  break;
281  case 12:
282  coerceValue(value, myTransferAttributes);
283  break;
284  case 13:
285  coerceValue(value, myTransferGroups);
286  break;
287  case 14:
288  if (idx.size() == 1)
289  coerceValue(value, myFilters.entries());
290  else if (instance[0] < myFilters.entries())
291  {
292  auto && _data = myFilters(instance[0]);
293  switch (idx[1])
294  {
295  case 0:
296  coerceValue(value, _data.jointnames);
297  break;
298  case 1:
299  coerceValue(value, _data.percentage);
300  break;
301  case 2:
302  coerceValue(value, _data.seed);
303  break;
304 
305  }
306  }
307  break;
308  case 15:
309  coerceValue(value, mySkeletonColor);
310  break;
311 
312  }
313  }
314 
315  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
316  { doGetParmValue(idx, instance, value); }
317  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
318  { doGetParmValue(idx, instance, value); }
319  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
320  { doGetParmValue(idx, instance, value); }
321  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
324  { doGetParmValue(idx, instance, value); }
325  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
326  { doGetParmValue(idx, instance, value); }
327  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
328  { doGetParmValue(idx, instance, value); }
329  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
330  { doGetParmValue(idx, instance, value); }
331  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
332  { doGetParmValue(idx, instance, value); }
333  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
334  { doGetParmValue(idx, instance, value); }
335  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
336  { doGetParmValue(idx, instance, value); }
337 
338  template <typename T>
339  void
340  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
341  {
342  if (idx.size() < 1)
343  return;
344  UT_ASSERT(idx.size() == instance.size()+1);
345  if (idx.size() != instance.size()+1)
346  return;
347  switch (idx[0])
348  {
349  case 0:
350  coerceValue(myGroup, value);
351  break;
352  case 1:
353  coerceValue(myOutput, value);
354  break;
355  case 2:
356  coerceValue(myApplyAgentXform, value);
357  break;
358  case 3:
359  coerceValue(myApplyJointXforms, value);
360  break;
361  case 4:
362  coerceValue(myShapeFilter, value);
363  break;
364  case 5:
365  coerceValue(myLimitIterations, value);
366  break;
367  case 6:
368  coerceValue(myIterations, value);
369  break;
370  case 7:
371  coerceValue(myAddShapeDeformerAttrib, value);
372  break;
373  case 8:
374  coerceValue(myShapeDeformerAttrib, value);
375  break;
376  case 9:
377  coerceValue(myAddXformNameAttrib, value);
378  break;
379  case 10:
380  coerceValue(myXformNameAttrib, value);
381  break;
382  case 11:
383  coerceValue(myClipNames, value);
384  break;
385  case 12:
386  coerceValue(myTransferAttributes, value);
387  break;
388  case 13:
389  coerceValue(myTransferGroups, value);
390  break;
391  case 14:
392  if (idx.size() == 1)
393  {
394  exint newsize;
395  coerceValue(newsize, value);
396  myFilters.setSize(newsize);
397  }
398  else
399  {
400  myFilters.setSizeIfNeeded(instance[0]+1);
401  auto && _data = myFilters(instance[0]);
402  switch (idx[1])
403  {
404  case 0:
405  coerceValue(_data.jointnames, value);
406  break;
407  case 1:
408  coerceValue(_data.percentage, value);
409  break;
410  case 2:
411  coerceValue(_data.seed, value);
412  break;
413 
414  }
415  }
416  break;
417  case 15:
418  coerceValue(mySkeletonColor, value);
419  break;
420 
421  }
422  }
423 
424  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
425  { doSetParmValue(idx, instance, value); }
426  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
427  { doSetParmValue(idx, instance, value); }
428  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
429  { doSetParmValue(idx, instance, value); }
430  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
431  { doSetParmValue(idx, instance, value); }
432  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
433  { doSetParmValue(idx, instance, value); }
434  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
435  { doSetParmValue(idx, instance, value); }
436  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
437  { doSetParmValue(idx, instance, value); }
438  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
439  { doSetParmValue(idx, instance, value); }
440  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
441  { doSetParmValue(idx, instance, value); }
442  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
443  { doSetParmValue(idx, instance, value); }
444  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
445  { doSetParmValue(idx, instance, value); }
446 
447  exint getNestNumParms(TempIndex idx) const override
448  {
449  if (idx.size() == 0)
450  return 16;
451  switch (idx[0])
452  {
453  case 14:
454  return 3;
455 
456  }
457  // Invalid
458  return 0;
459  }
460 
461  const char *getNestParmName(TempIndex fieldnum) const override
462  {
463  if (fieldnum.size() < 1)
464  return 0;
465  switch (fieldnum[0])
466  {
467  case 0:
468  return "group";
469  case 1:
470  return "output";
471  case 2:
472  return "applyagentxform";
473  case 3:
474  return "applyjointxforms";
475  case 4:
476  return "shapefilter";
477  case 5:
478  return "limititerations";
479  case 6:
480  return "iterations";
481  case 7:
482  return "addshapedeformerattrib";
483  case 8:
484  return "shapedeformerattrib";
485  case 9:
486  return "addxformnameattrib";
487  case 10:
488  return "xformnameattrib";
489  case 11:
490  return "clipnames";
491  case 12:
492  return "transferattributes";
493  case 13:
494  return "transfergroups";
495  case 14:
496  if (fieldnum.size() == 1)
497  return "numjointfilters";
498  switch (fieldnum[1])
499  {
500  case 0:
501  return "jointnames#";
502  case 1:
503  return "percentage#";
504  case 2:
505  return "seed#";
506 
507  }
508  return 0;
509  case 15:
510  return "skeletoncolor";
511 
512  }
513  return 0;
514  }
515 
516  ParmType getNestParmType(TempIndex fieldnum) const override
517  {
518  if (fieldnum.size() < 1)
519  return PARM_UNSUPPORTED;
520  switch (fieldnum[0])
521  {
522  case 0:
523  return PARM_STRING;
524  case 1:
525  return PARM_INTEGER;
526  case 2:
527  return PARM_INTEGER;
528  case 3:
529  return PARM_INTEGER;
530  case 4:
531  return PARM_STRING;
532  case 5:
533  return PARM_INTEGER;
534  case 6:
535  return PARM_INTEGER;
536  case 7:
537  return PARM_INTEGER;
538  case 8:
539  return PARM_STRING;
540  case 9:
541  return PARM_INTEGER;
542  case 10:
543  return PARM_STRING;
544  case 11:
545  return PARM_STRING;
546  case 12:
547  return PARM_STRING;
548  case 13:
549  return PARM_STRING;
550  case 14:
551  if (fieldnum.size() == 1)
552  return PARM_MULTIPARM;
553  switch (fieldnum[1])
554  {
555  case 0:
556  return PARM_STRING;
557  case 1:
558  return PARM_FLOAT;
559  case 2:
560  return PARM_FLOAT;
561 
562  }
563  return PARM_UNSUPPORTED;
564  case 15:
565  return PARM_VECTOR3;
566 
567  }
568  return PARM_UNSUPPORTED;
569  }
570 
571  // Boiler plate to load individual types.
572  static void loadData(UT_IStream &is, int64 &v)
573  { is.bread(&v, 1); }
574  static void loadData(UT_IStream &is, bool &v)
575  { int64 iv; is.bread(&iv, 1); v = iv; }
576  static void loadData(UT_IStream &is, fpreal64 &v)
577  { is.bread<fpreal64>(&v, 1); }
578  static void loadData(UT_IStream &is, UT_Vector2D &v)
579  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
580  static void loadData(UT_IStream &is, UT_Vector3D &v)
581  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
582  is.bread<fpreal64>(&v.z(), 1); }
583  static void loadData(UT_IStream &is, UT_Vector4D &v)
584  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
585  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
586  static void loadData(UT_IStream &is, UT_Matrix2D &v)
587  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
588  static void loadData(UT_IStream &is, UT_Matrix3D &v)
589  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
590  static void loadData(UT_IStream &is, UT_Matrix4D &v)
591  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
592  static void loadData(UT_IStream &is, UT_Vector2I &v)
593  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
594  static void loadData(UT_IStream &is, UT_Vector3I &v)
595  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
596  is.bread<int64>(&v.z(), 1); }
597  static void loadData(UT_IStream &is, UT_Vector4I &v)
598  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
599  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
601  { is.bread(v); }
603  { UT_StringHolder rampdata;
604  loadData(is, rampdata);
605  if (rampdata.isstring())
606  {
607  v.reset(new UT_Ramp());
608  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
609  v->load(istr);
610  }
611  else v.reset();
612  }
615  loadData(is, data);
616  if (data.isstring())
617  {
618  // Find the data type.
619  const char *colon = UT_StringWrap(data).findChar(':');
620  if (colon)
621  {
622  int typelen = colon - data.buffer();
624  type.strncpy(data.buffer(), typelen);
625  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
626 
627  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
628  }
629  }
630  else v.reset();
631  }
632 
633  static void saveData(std::ostream &os, int64 v)
634  { UTwrite(os, &v); }
635  static void saveData(std::ostream &os, bool v)
636  { int64 iv = v; UTwrite(os, &iv); }
637  static void saveData(std::ostream &os, fpreal64 v)
638  { UTwrite<fpreal64>(os, &v); }
639  static void saveData(std::ostream &os, UT_Vector2D v)
640  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
641  static void saveData(std::ostream &os, UT_Vector3D v)
642  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
643  UTwrite<fpreal64>(os, &v.z()); }
644  static void saveData(std::ostream &os, UT_Vector4D v)
645  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
646  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
647  static void saveData(std::ostream &os, UT_Matrix2D v)
649  static void saveData(std::ostream &os, UT_Matrix3D v)
651  static void saveData(std::ostream &os, UT_Matrix4D v)
653  static void saveData(std::ostream &os, UT_StringHolder s)
654  { UT_StringWrap(s).saveBinary(os); }
655  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
657  UT_OStringStream ostr;
658  if (s) s->save(ostr);
659  result = ostr.str();
660  saveData(os, result);
661  }
662  static void saveData(std::ostream &os, PRM_DataItemHandle s)
664  UT_OStringStream ostr;
665  if (s)
666  {
667  ostr << s->getDataTypeToken();
668  ostr << ":";
669  s->saveBinary(ostr);
670  }
671  result = ostr.str();
672  saveData(os, result);
673  }
674 
675 
676  void save(std::ostream &os) const
677  {
678  int32 v = version();
679  UTwrite(os, &v);
680  saveData(os, myGroup);
681  saveData(os, myOutput);
682  saveData(os, myApplyAgentXform);
683  saveData(os, myApplyJointXforms);
684  saveData(os, myShapeFilter);
685  saveData(os, myLimitIterations);
686  saveData(os, myIterations);
687  saveData(os, myAddShapeDeformerAttrib);
688  saveData(os, myShapeDeformerAttrib);
689  saveData(os, myAddXformNameAttrib);
690  saveData(os, myXformNameAttrib);
691  saveData(os, myClipNames);
692  saveData(os, myTransferAttributes);
693  saveData(os, myTransferGroups);
694  {
695  int64 length = myFilters.entries();
696  UTwrite(os, &length);
697  for (exint i = 0; i < length; i++)
698  {
699  saveData(os, myFilters(i).jointnames);
700  saveData(os, myFilters(i).percentage);
701  saveData(os, myFilters(i).seed);
702 
703  }
704  }
705  saveData(os, mySkeletonColor);
706 
707  }
708 
709  bool load(UT_IStream &is)
710  {
711  int32 v;
712  is.bread(&v, 1);
713  if (version() != v)
714  {
715  // Fail incompatible versions
716  return false;
717  }
718  loadData(is, myGroup);
719  loadData(is, myOutput);
720  loadData(is, myApplyAgentXform);
721  loadData(is, myApplyJointXforms);
722  loadData(is, myShapeFilter);
723  loadData(is, myLimitIterations);
724  loadData(is, myIterations);
725  loadData(is, myAddShapeDeformerAttrib);
726  loadData(is, myShapeDeformerAttrib);
727  loadData(is, myAddXformNameAttrib);
728  loadData(is, myXformNameAttrib);
729  loadData(is, myClipNames);
730  loadData(is, myTransferAttributes);
731  loadData(is, myTransferGroups);
732  {
733  int64 length;
734  is.read(&length, 1);
735  myFilters.entries(length);
736  for (exint i = 0; i < length; i++)
737  {
738  loadData(is, myFilters(i).jointnames);
739  loadData(is, myFilters(i).percentage);
740  loadData(is, myFilters(i).seed);
741 
742  }
743  }
744  loadData(is, mySkeletonColor);
745 
746  return true;
747  }
748 
749  const UT_StringHolder & getGroup() const { return myGroup; }
750  void setGroup(const UT_StringHolder & val) { myGroup = val; }
752  {
753  SOP_Node *thissop = cookparms.getNode();
754  if (!thissop) return getGroup();
756  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
757  return result;
758  }
759  Output getOutput() const { return Output(myOutput); }
760  void setOutput(Output val) { myOutput = int64(val); }
761  Output opOutput(const SOP_NodeVerb::CookParms &cookparms) const
762  {
763  SOP_Node *thissop = cookparms.getNode();
764  if (!thissop) return getOutput();
765  int64 result;
766  OP_Utils::evalOpParm(result, thissop, "output", cookparms.getCookTime(), 0);
767  return Output(result);
768  }
769  bool getApplyAgentXform() const { return myApplyAgentXform; }
770  void setApplyAgentXform(bool val) { myApplyAgentXform = val; }
771  bool opApplyAgentXform(const SOP_NodeVerb::CookParms &cookparms) const
772  {
773  SOP_Node *thissop = cookparms.getNode();
774  if (!thissop) return getApplyAgentXform();
775  bool result;
776  OP_Utils::evalOpParm(result, thissop, "applyagentxform", cookparms.getCookTime(), 0);
777  return result;
778  }
779  bool getApplyJointXforms() const { return myApplyJointXforms; }
780  void setApplyJointXforms(bool val) { myApplyJointXforms = val; }
781  bool opApplyJointXforms(const SOP_NodeVerb::CookParms &cookparms) const
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return getApplyJointXforms();
785  bool result;
786  OP_Utils::evalOpParm(result, thissop, "applyjointxforms", cookparms.getCookTime(), 0);
787  return result;
788  }
789  const UT_StringHolder & getShapeFilter() const { return myShapeFilter; }
790  void setShapeFilter(const UT_StringHolder & val) { myShapeFilter = val; }
792  {
793  SOP_Node *thissop = cookparms.getNode();
794  if (!thissop) return getShapeFilter();
796  OP_Utils::evalOpParm(result, thissop, "shapefilter", cookparms.getCookTime(), 0);
797  return result;
798  }
799  bool getLimitIterations() const { return myLimitIterations; }
800  void setLimitIterations(bool val) { myLimitIterations = val; }
801  bool opLimitIterations(const SOP_NodeVerb::CookParms &cookparms) const
802  {
803  SOP_Node *thissop = cookparms.getNode();
804  if (!thissop) return getLimitIterations();
805  bool result;
806  OP_Utils::evalOpParm(result, thissop, "limititerations", cookparms.getCookTime(), 0);
807  return result;
808  }
809  int64 getIterations() const { return myIterations; }
810  void setIterations(int64 val) { myIterations = val; }
812  {
813  SOP_Node *thissop = cookparms.getNode();
814  if (!thissop) return getIterations();
815  int64 result;
816  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
817  return result;
818  }
819  bool getAddShapeDeformerAttrib() const { return myAddShapeDeformerAttrib; }
820  void setAddShapeDeformerAttrib(bool val) { myAddShapeDeformerAttrib = val; }
822  {
823  SOP_Node *thissop = cookparms.getNode();
824  if (!thissop) return getAddShapeDeformerAttrib();
825  bool result;
826  OP_Utils::evalOpParm(result, thissop, "addshapedeformerattrib", cookparms.getCookTime(), 0);
827  return result;
828  }
829  const UT_StringHolder & getShapeDeformerAttrib() const { return myShapeDeformerAttrib; }
830  void setShapeDeformerAttrib(const UT_StringHolder & val) { myShapeDeformerAttrib = val; }
832  {
833  SOP_Node *thissop = cookparms.getNode();
834  if (!thissop) return getShapeDeformerAttrib();
836  OP_Utils::evalOpParm(result, thissop, "shapedeformerattrib", cookparms.getCookTime(), 0);
837  return result;
838  }
839  bool getAddXformNameAttrib() const { return myAddXformNameAttrib; }
840  void setAddXformNameAttrib(bool val) { myAddXformNameAttrib = val; }
841  bool opAddXformNameAttrib(const SOP_NodeVerb::CookParms &cookparms) const
842  {
843  SOP_Node *thissop = cookparms.getNode();
844  if (!thissop) return getAddXformNameAttrib();
845  bool result;
846  OP_Utils::evalOpParm(result, thissop, "addxformnameattrib", cookparms.getCookTime(), 0);
847  return result;
848  }
849  const UT_StringHolder & getXformNameAttrib() const { return myXformNameAttrib; }
850  void setXformNameAttrib(const UT_StringHolder & val) { myXformNameAttrib = val; }
852  {
853  SOP_Node *thissop = cookparms.getNode();
854  if (!thissop) return getXformNameAttrib();
856  OP_Utils::evalOpParm(result, thissop, "xformnameattrib", cookparms.getCookTime(), 0);
857  return result;
858  }
859  const UT_StringHolder & getClipNames() const { return myClipNames; }
860  void setClipNames(const UT_StringHolder & val) { myClipNames = val; }
862  {
863  SOP_Node *thissop = cookparms.getNode();
864  if (!thissop) return getClipNames();
866  OP_Utils::evalOpParm(result, thissop, "clipnames", cookparms.getCookTime(), 0);
867  return result;
868  }
869  const UT_StringHolder & getTransferAttributes() const { return myTransferAttributes; }
870  void setTransferAttributes(const UT_StringHolder & val) { myTransferAttributes = val; }
872  {
873  SOP_Node *thissop = cookparms.getNode();
874  if (!thissop) return getTransferAttributes();
876  OP_Utils::evalOpParm(result, thissop, "transferattributes", cookparms.getCookTime(), 0);
877  return result;
878  }
879  const UT_StringHolder & getTransferGroups() const { return myTransferGroups; }
880  void setTransferGroups(const UT_StringHolder & val) { myTransferGroups = val; }
882  {
883  SOP_Node *thissop = cookparms.getNode();
884  if (!thissop) return getTransferGroups();
886  OP_Utils::evalOpParm(result, thissop, "transfergroups", cookparms.getCookTime(), 0);
887  return result;
888  }
889  const UT_Array<Filters> &getFilters() const { return myFilters; }
890  void setFilters(const UT_Array<Filters> &val) { myFilters = val; }
891  exint opFilters(const SOP_NodeVerb::CookParms &cookparms) const
892  {
893  SOP_Node *thissop = cookparms.getNode();
894  if (!thissop) return getFilters().entries();
895  exint result;
896  OP_Utils::evalOpParm(result, thissop, "numjointfilters", cookparms.getCookTime(), 0);
897  return result;
898  }
900  {
901  SOP_Node *thissop = cookparms.getNode();
902  if (!thissop) return (myFilters(_idx).jointnames);
903  int _parmidx = _idx + 1;
905  OP_Utils::evalOpParmInst(result, thissop, "jointnames#", &_parmidx, cookparms.getCookTime(), 0);
906  return (result);
907  }
909  {
910  SOP_Node *thissop = cookparms.getNode();
911  if (!thissop) return (myFilters(_idx).percentage);
912  int _parmidx = _idx + 1;
914  OP_Utils::evalOpParmInst(result, thissop, "percentage#", &_parmidx, cookparms.getCookTime(), 0);
915  return (result);
916  }
917  fpreal64 opFilters_seed(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
918  {
919  SOP_Node *thissop = cookparms.getNode();
920  if (!thissop) return (myFilters(_idx).seed);
921  int _parmidx = _idx + 1;
923  OP_Utils::evalOpParmInst(result, thissop, "seed#", &_parmidx, cookparms.getCookTime(), 0);
924  return (result);
925  }
926 
927  UT_Vector3D getSkeletonColor() const { return mySkeletonColor; }
928  void setSkeletonColor(UT_Vector3D val) { mySkeletonColor = val; }
930  {
931  SOP_Node *thissop = cookparms.getNode();
932  if (!thissop) return getSkeletonColor();
934  OP_Utils::evalOpParm(result, thissop, "skeletoncolor", cookparms.getCookTime(), 0);
935  return result;
936  }
937 
938 private:
939  UT_StringHolder myGroup;
940  int64 myOutput;
941  bool myApplyAgentXform;
942  bool myApplyJointXforms;
943  UT_StringHolder myShapeFilter;
944  bool myLimitIterations;
945  int64 myIterations;
946  bool myAddShapeDeformerAttrib;
947  UT_StringHolder myShapeDeformerAttrib;
948  bool myAddXformNameAttrib;
949  UT_StringHolder myXformNameAttrib;
950  UT_StringHolder myClipNames;
951  UT_StringHolder myTransferAttributes;
952  UT_StringHolder myTransferGroups;
953  UT_Array<Filters> myFilters;
954  UT_Vector3D mySkeletonColor;
955 
956 };
GLdouble s
Definition: glew.h:1390
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setFilters(const UT_Array< Filters > &val)
Output opOutput(const SOP_NodeVerb::CookParms &cookparms) const
void setApplyAgentXform(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
const UT_StringHolder & getTransferGroups() const
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool operator!=(const SOP_AgentUnpackParms &src) const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, int *inst, fpreal time, DEP_MicroNode *depnode) const =0
void setClipNames(const UT_StringHolder &val)
UT_StringHolder opShapeFilter(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
const UT_Array< Filters > & getFilters() const
fpreal64 opFilters_seed(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal getTime() const
Definition: OP_Context.h:60
GLuint const GLfloat * val
Definition: glew.h:2794
const UT_StringHolder & getShapeDeformerAttrib() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opApplyJointXforms(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const Filters &src) const
int64 exint
Definition: SYS_Types.h:125
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
void setApplyJointXforms(bool val)
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
exint getNestNumParms(TempIndex idx) const override
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setTransferAttributes(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
const GLdouble * v
Definition: glew.h:1391
UT_StringHolder opTransferAttributes(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void copyFrom(const SOP_NodeParms *src) override
void setGroup(const UT_StringHolder &val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
bool opAddXformNameAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
exint opFilters(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opFilters_jointnames(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void saveData(std::ostream &os, UT_Vector3D v)
void setAddXformNameAttrib(bool val)
UT_StringHolder opClipNames(const SOP_NodeVerb::CookParms &cookparms) const
double fpreal64
Definition: SYS_Types.h:201
void setLimitIterations(bool val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
const UT_StringHolder & getTransferAttributes() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
const UT_StringHolder & getXformNameAttrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const UT_StringHolder & getGroup() const
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
UT_Vector3D opSkeletonColor(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
exint length() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
bool getAddXformNameAttrib() const
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:284
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, int64 &v)
void
Definition: png.h:1083
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const GLfloat * c
Definition: glew.h:16296
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
void setShapeFilter(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
long long int64
Definition: SYS_Types.h:116
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Vector4D v)
UT_Vector3T< fpreal64 > UT_Vector3D
void save(std::ostream &os) const
const UT_StringHolder & getShapeFilter() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
static void saveData(std::ostream &os, UT_StringHolder s)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:460
void setSkeletonColor(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator!=(const Filters &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
SYS_FORCE_INLINE void append(char character)
void setTransferGroups(const UT_StringHolder &val)
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
const UT_StringHolder & getClipNames() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setXformNameAttrib(const UT_StringHolder &val)
#define SOP_API
Definition: SOP_API.h:10
bool operator==(const SOP_AgentUnpackParms &src) const
UT_StringHolder createString(const UT_Array< Filters > &list) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool getAddShapeDeformerAttrib() const
bool opAddShapeDeformerAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setShapeDeformerAttrib(const UT_StringHolder &val)
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
GLuint64EXT * result
Definition: glew.h:14007
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void setAddShapeDeformerAttrib(bool val)
UT_Vector3D getSkeletonColor() const
bool opLimitIterations(const SOP_NodeVerb::CookParms &cookparms) const
bool opApplyAgentXform(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
UT_StringHolder opTransferGroups(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opShapeDeformerAttrib(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
Definition: glew.h:1849
UT_StringHolder opXformNameAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
static void loadData(UT_IStream &is, UT_Matrix2D &v)
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
fpreal64 opFilters_percentage(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)