HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_GroupCopy.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myPrimitives = true;
32  myPrimgroups = ""_UTsh;
33  myPrimnameprefix = ""_UTsh;
34  myEnableMatchByPrimAttrib = false;
35  myMatchByPrimAttrib = "name"_UTsh;
36  myPoints = true;
37  myPointgroups = ""_UTsh;
38  myPointnameprefix = ""_UTsh;
39  myEnableMatchByPointAttrib = false;
40  myMatchByPointAttrib = "id"_UTsh;
41  myEdges = true;
42  myEdgegroups = ""_UTsh;
43  myEdgenameprefix = ""_UTsh;
44  myVertices = false;
45  myVertexgroups = ""_UTsh;
46  myVertexnameprefix = ""_UTsh;
47  myEnableMatchByVertexAttrib = false;
48  myMatchByVertexAttrib = "id"_UTsh;
49  myGroupnameconflict = "skipgroup"_UTsh;
50  myCopyemptygroups = true;
51 
52  }
53 
54  explicit SOP_GroupCopyParms(const SOP_GroupCopyParms &) = default;
56  SOP_GroupCopyParms(SOP_GroupCopyParms &&) noexcept = default;
57  SOP_GroupCopyParms &operator=(SOP_GroupCopyParms &&) noexcept = default;
58 
59  ~SOP_GroupCopyParms() override {}
60 
61  bool operator==(const SOP_GroupCopyParms &src) const
62  {
63  if (myPrimitives != src.myPrimitives) return false;
64  if (myPrimgroups != src.myPrimgroups) return false;
65  if (myPrimnameprefix != src.myPrimnameprefix) return false;
66  if (myEnableMatchByPrimAttrib != src.myEnableMatchByPrimAttrib) return false;
67  if (myMatchByPrimAttrib != src.myMatchByPrimAttrib) return false;
68  if (myPoints != src.myPoints) return false;
69  if (myPointgroups != src.myPointgroups) return false;
70  if (myPointnameprefix != src.myPointnameprefix) return false;
71  if (myEnableMatchByPointAttrib != src.myEnableMatchByPointAttrib) return false;
72  if (myMatchByPointAttrib != src.myMatchByPointAttrib) return false;
73  if (myEdges != src.myEdges) return false;
74  if (myEdgegroups != src.myEdgegroups) return false;
75  if (myEdgenameprefix != src.myEdgenameprefix) return false;
76  if (myVertices != src.myVertices) return false;
77  if (myVertexgroups != src.myVertexgroups) return false;
78  if (myVertexnameprefix != src.myVertexnameprefix) return false;
79  if (myEnableMatchByVertexAttrib != src.myEnableMatchByVertexAttrib) return false;
80  if (myMatchByVertexAttrib != src.myMatchByVertexAttrib) return false;
81  if (myGroupnameconflict != src.myGroupnameconflict) return false;
82  if (myCopyemptygroups != src.myCopyemptygroups) return false;
83 
84 
85  if (baseGetSignature() != src.baseGetSignature()) return false;
86 
87  return true;
88  }
89  bool operator!=(const SOP_GroupCopyParms &src) const
90  {
91  return !operator==(src);
92  }
93 
94 
95 
96  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
97  {
98  myPrimitives = true;
99  if (true)
100  graph->evalOpParm(myPrimitives, nodeidx, "primitives", time, graph->isDirect()?nullptr:depnode);
101  myPrimgroups = ""_UTsh;
102  if (true && ( (true&&!(((getPrimitives()==0)))) ) )
103  graph->evalOpParm(myPrimgroups, nodeidx, "primgroups", time, graph->isDirect()?nullptr:depnode);
104  myPrimnameprefix = ""_UTsh;
105  if (true && ( (true&&!(((getPrimitives()==0)))) ) )
106  graph->evalOpParm(myPrimnameprefix, nodeidx, "primnameprefix", time, graph->isDirect()?nullptr:depnode);
107  myEnableMatchByPrimAttrib = false;
108  if (true && ( (true&&!(((getPrimitives()==0)))) ) )
109  graph->evalOpParm(myEnableMatchByPrimAttrib, nodeidx, "enablematchbyprimattrib", time, graph->isDirect()?nullptr:depnode);
110  myMatchByPrimAttrib = "name"_UTsh;
111  if (true && ( (true&&!(((getPrimitives()==0))||((getEnableMatchByPrimAttrib()==0)))) ) )
112  graph->evalOpParm(myMatchByPrimAttrib, nodeidx, "matchbyprimattrib", time, graph->isDirect()?nullptr:depnode);
113  myPoints = true;
114  if (true)
115  graph->evalOpParm(myPoints, nodeidx, "points", time, graph->isDirect()?nullptr:depnode);
116  myPointgroups = ""_UTsh;
117  if (true && ( (true&&!(((getPoints()==0)))) ) )
118  graph->evalOpParm(myPointgroups, nodeidx, "pointgroups", time, graph->isDirect()?nullptr:depnode);
119  myPointnameprefix = ""_UTsh;
120  if (true && ( (true&&!(((getPoints()==0)))) ) )
121  graph->evalOpParm(myPointnameprefix, nodeidx, "pointnameprefix", time, graph->isDirect()?nullptr:depnode);
122  myEnableMatchByPointAttrib = false;
123  if (true && ( (true&&!(((getPoints()==0)))) ) )
124  graph->evalOpParm(myEnableMatchByPointAttrib, nodeidx, "enablematchbypointattrib", time, graph->isDirect()?nullptr:depnode);
125  myMatchByPointAttrib = "id"_UTsh;
126  if (true && ( (true&&!(((getPoints()==0))||((getEnableMatchByPointAttrib()==0)))) ) )
127  graph->evalOpParm(myMatchByPointAttrib, nodeidx, "matchbypointattrib", time, graph->isDirect()?nullptr:depnode);
128  myEdges = true;
129  if (true)
130  graph->evalOpParm(myEdges, nodeidx, "edges", time, graph->isDirect()?nullptr:depnode);
131  myEdgegroups = ""_UTsh;
132  if (true && ( (true&&!(((getEdges()==0)))) ) )
133  graph->evalOpParm(myEdgegroups, nodeidx, "edgegroups", time, graph->isDirect()?nullptr:depnode);
134  myEdgenameprefix = ""_UTsh;
135  if (true && ( (true&&!(((getEdges()==0)))) ) )
136  graph->evalOpParm(myEdgenameprefix, nodeidx, "edgenameprefix", time, graph->isDirect()?nullptr:depnode);
137  myVertices = false;
138  if (true)
139  graph->evalOpParm(myVertices, nodeidx, "vertices", time, graph->isDirect()?nullptr:depnode);
140  myVertexgroups = ""_UTsh;
141  if (true && ( (true&&!(((getVertices()==0)))) ) )
142  graph->evalOpParm(myVertexgroups, nodeidx, "vertexgroups", time, graph->isDirect()?nullptr:depnode);
143  myVertexnameprefix = ""_UTsh;
144  if (true && ( (true&&!(((getVertices()==0)))) ) )
145  graph->evalOpParm(myVertexnameprefix, nodeidx, "vertexnameprefix", time, graph->isDirect()?nullptr:depnode);
146  myEnableMatchByVertexAttrib = false;
147  if (true && ( (true&&!(((getVertices()==0)))) ) )
148  graph->evalOpParm(myEnableMatchByVertexAttrib, nodeidx, "enablematchbyvertexattrib", time, graph->isDirect()?nullptr:depnode);
149  myMatchByVertexAttrib = "id"_UTsh;
150  if (true && ( (true&&!(((getVertices()==0))||((getEnableMatchByVertexAttrib()==0)))) ) )
151  graph->evalOpParm(myMatchByVertexAttrib, nodeidx, "matchbyvertexattrib", time, graph->isDirect()?nullptr:depnode);
152  myGroupnameconflict = "skipgroup"_UTsh;
153  if (true)
154  graph->evalOpParm(myGroupnameconflict, nodeidx, "groupnameconflict", time, graph->isDirect()?nullptr:depnode);
155  myCopyemptygroups = true;
156  if (true)
157  graph->evalOpParm(myCopyemptygroups, nodeidx, "copyemptygroups", time, graph->isDirect()?nullptr:depnode);
158 
159  }
160 
161 
162  void loadFromOpSubclass(const LoadParms &loadparms) override
163  {
164  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
165  }
166 
167 
168  void copyFrom(const OP_NodeParms *src) override
169  {
170  *this = *((const SOP_GroupCopyParms *)src);
171  }
172 
173  template <typename T>
174  void
175  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
176  {
177  if (idx.size() < 1)
178  return;
179  UT_ASSERT(idx.size() == instance.size()+1);
180  if (idx.size() != instance.size()+1)
181  return;
182  switch (idx[0])
183  {
184  case 0:
185  coerceValue(value, myPrimitives);
186  break;
187  case 1:
188  coerceValue(value, myPrimgroups);
189  break;
190  case 2:
191  coerceValue(value, myPrimnameprefix);
192  break;
193  case 3:
194  coerceValue(value, myEnableMatchByPrimAttrib);
195  break;
196  case 4:
197  coerceValue(value, myMatchByPrimAttrib);
198  break;
199  case 5:
200  coerceValue(value, myPoints);
201  break;
202  case 6:
203  coerceValue(value, myPointgroups);
204  break;
205  case 7:
206  coerceValue(value, myPointnameprefix);
207  break;
208  case 8:
209  coerceValue(value, myEnableMatchByPointAttrib);
210  break;
211  case 9:
212  coerceValue(value, myMatchByPointAttrib);
213  break;
214  case 10:
215  coerceValue(value, myEdges);
216  break;
217  case 11:
218  coerceValue(value, myEdgegroups);
219  break;
220  case 12:
221  coerceValue(value, myEdgenameprefix);
222  break;
223  case 13:
224  coerceValue(value, myVertices);
225  break;
226  case 14:
227  coerceValue(value, myVertexgroups);
228  break;
229  case 15:
230  coerceValue(value, myVertexnameprefix);
231  break;
232  case 16:
233  coerceValue(value, myEnableMatchByVertexAttrib);
234  break;
235  case 17:
236  coerceValue(value, myMatchByVertexAttrib);
237  break;
238  case 18:
239  coerceValue(value, myGroupnameconflict);
240  break;
241  case 19:
242  coerceValue(value, myCopyemptygroups);
243  break;
244 
245  }
246  }
247 
248  bool isParmColorRamp(exint idx) const override
249  {
250  switch (idx)
251  {
252 
253  }
254  return false;
255  }
256 
257  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
258  { doGetParmValue(idx, instance, value); }
259  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
260  { doGetParmValue(idx, instance, value); }
261  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
262  { doGetParmValue(idx, instance, value); }
263  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
264  { doGetParmValue(idx, instance, value); }
265  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
266  { doGetParmValue(idx, instance, value); }
267  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
268  { doGetParmValue(idx, instance, value); }
269  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
270  { doGetParmValue(idx, instance, value); }
271  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
278  { doGetParmValue(idx, instance, value); }
279 
280  template <typename T>
281  void
282  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
283  {
284  if (idx.size() < 1)
285  return;
286  UT_ASSERT(idx.size() == instance.size()+1);
287  if (idx.size() != instance.size()+1)
288  return;
289  switch (idx[0])
290  {
291  case 0:
292  coerceValue(myPrimitives, ( ( value ) ));
293  break;
294  case 1:
295  coerceValue(myPrimgroups, ( ( value ) ));
296  break;
297  case 2:
298  coerceValue(myPrimnameprefix, ( ( value ) ));
299  break;
300  case 3:
301  coerceValue(myEnableMatchByPrimAttrib, ( ( value ) ));
302  break;
303  case 4:
304  coerceValue(myMatchByPrimAttrib, ( ( value ) ));
305  break;
306  case 5:
307  coerceValue(myPoints, ( ( value ) ));
308  break;
309  case 6:
310  coerceValue(myPointgroups, ( ( value ) ));
311  break;
312  case 7:
313  coerceValue(myPointnameprefix, ( ( value ) ));
314  break;
315  case 8:
316  coerceValue(myEnableMatchByPointAttrib, ( ( value ) ));
317  break;
318  case 9:
319  coerceValue(myMatchByPointAttrib, ( ( value ) ));
320  break;
321  case 10:
322  coerceValue(myEdges, ( ( value ) ));
323  break;
324  case 11:
325  coerceValue(myEdgegroups, ( ( value ) ));
326  break;
327  case 12:
328  coerceValue(myEdgenameprefix, ( ( value ) ));
329  break;
330  case 13:
331  coerceValue(myVertices, ( ( value ) ));
332  break;
333  case 14:
334  coerceValue(myVertexgroups, ( ( value ) ));
335  break;
336  case 15:
337  coerceValue(myVertexnameprefix, ( ( value ) ));
338  break;
339  case 16:
340  coerceValue(myEnableMatchByVertexAttrib, ( ( value ) ));
341  break;
342  case 17:
343  coerceValue(myMatchByVertexAttrib, ( ( value ) ));
344  break;
345  case 18:
346  coerceValue(myGroupnameconflict, ( ( value ) ));
347  break;
348  case 19:
349  coerceValue(myCopyemptygroups, ( ( value ) ));
350  break;
351 
352  }
353  }
354 
355  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
360  { doSetParmValue(idx, instance, value); }
361  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
362  { doSetParmValue(idx, instance, value); }
363  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
364  { doSetParmValue(idx, instance, value); }
365  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
366  { doSetParmValue(idx, instance, value); }
367  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
368  { doSetParmValue(idx, instance, value); }
369  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
370  { doSetParmValue(idx, instance, value); }
371  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
372  { doSetParmValue(idx, instance, value); }
373  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
374  { doSetParmValue(idx, instance, value); }
375  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
376  { doSetParmValue(idx, instance, value); }
377 
378  exint getNestNumParms(TempIndex idx) const override
379  {
380  if (idx.size() == 0)
381  return 20;
382  switch (idx[0])
383  {
384 
385  }
386  // Invalid
387  return 0;
388  }
389 
390  const char *getNestParmName(TempIndex fieldnum) const override
391  {
392  if (fieldnum.size() < 1)
393  return 0;
394  switch (fieldnum[0])
395  {
396  case 0:
397  return "primitives";
398  case 1:
399  return "primgroups";
400  case 2:
401  return "primnameprefix";
402  case 3:
403  return "enablematchbyprimattrib";
404  case 4:
405  return "matchbyprimattrib";
406  case 5:
407  return "points";
408  case 6:
409  return "pointgroups";
410  case 7:
411  return "pointnameprefix";
412  case 8:
413  return "enablematchbypointattrib";
414  case 9:
415  return "matchbypointattrib";
416  case 10:
417  return "edges";
418  case 11:
419  return "edgegroups";
420  case 12:
421  return "edgenameprefix";
422  case 13:
423  return "vertices";
424  case 14:
425  return "vertexgroups";
426  case 15:
427  return "vertexnameprefix";
428  case 16:
429  return "enablematchbyvertexattrib";
430  case 17:
431  return "matchbyvertexattrib";
432  case 18:
433  return "groupnameconflict";
434  case 19:
435  return "copyemptygroups";
436 
437  }
438  return 0;
439  }
440 
441  ParmType getNestParmType(TempIndex fieldnum) const override
442  {
443  if (fieldnum.size() < 1)
444  return PARM_UNSUPPORTED;
445  switch (fieldnum[0])
446  {
447  case 0:
448  return PARM_INTEGER;
449  case 1:
450  return PARM_STRING;
451  case 2:
452  return PARM_STRING;
453  case 3:
454  return PARM_INTEGER;
455  case 4:
456  return PARM_STRING;
457  case 5:
458  return PARM_INTEGER;
459  case 6:
460  return PARM_STRING;
461  case 7:
462  return PARM_STRING;
463  case 8:
464  return PARM_INTEGER;
465  case 9:
466  return PARM_STRING;
467  case 10:
468  return PARM_INTEGER;
469  case 11:
470  return PARM_STRING;
471  case 12:
472  return PARM_STRING;
473  case 13:
474  return PARM_INTEGER;
475  case 14:
476  return PARM_STRING;
477  case 15:
478  return PARM_STRING;
479  case 16:
480  return PARM_INTEGER;
481  case 17:
482  return PARM_STRING;
483  case 18:
484  return PARM_STRING;
485  case 19:
486  return PARM_INTEGER;
487 
488  }
489  return PARM_UNSUPPORTED;
490  }
491 
492  // Boiler plate to load individual types.
493  static void loadData(UT_IStream &is, int64 &v)
494  { is.bread(&v, 1); }
495  static void loadData(UT_IStream &is, bool &v)
496  { int64 iv; is.bread(&iv, 1); v = iv; }
497  static void loadData(UT_IStream &is, fpreal64 &v)
498  { is.bread<fpreal64>(&v, 1); }
499  static void loadData(UT_IStream &is, UT_Vector2D &v)
500  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
501  static void loadData(UT_IStream &is, UT_Vector3D &v)
502  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
503  is.bread<fpreal64>(&v.z(), 1); }
504  static void loadData(UT_IStream &is, UT_Vector4D &v)
505  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
506  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
507  static void loadData(UT_IStream &is, UT_Matrix2D &v)
508  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
509  static void loadData(UT_IStream &is, UT_Matrix3D &v)
510  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
511  static void loadData(UT_IStream &is, UT_Matrix4D &v)
512  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
513  static void loadData(UT_IStream &is, UT_Vector2I &v)
514  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
515  static void loadData(UT_IStream &is, UT_Vector3I &v)
516  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
517  is.bread<int64>(&v.z(), 1); }
518  static void loadData(UT_IStream &is, UT_Vector4I &v)
519  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
520  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
522  { is.bread(v); }
524  { UT_StringHolder rampdata;
525  loadData(is, rampdata);
526  if (rampdata.isstring())
527  {
528  v.reset(new UT_Ramp());
529  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
530  v->load(istr);
531  }
532  else v.reset();
533  }
536  loadData(is, data);
537  if (data.isstring())
538  {
539  // Find the data type.
540  const char *colon = UT_StringWrap(data).findChar(':');
541  if (colon)
542  {
543  int typelen = colon - data.buffer();
545  type.strncpy(data.buffer(), typelen);
546  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
547 
548  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
549  }
550  }
551  else v.reset();
552  }
553 
554  static void saveData(std::ostream &os, int64 v)
555  { UTwrite(os, &v); }
556  static void saveData(std::ostream &os, bool v)
557  { int64 iv = v; UTwrite(os, &iv); }
558  static void saveData(std::ostream &os, fpreal64 v)
559  { UTwrite<fpreal64>(os, &v); }
560  static void saveData(std::ostream &os, UT_Vector2D v)
561  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
562  static void saveData(std::ostream &os, UT_Vector3D v)
563  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
564  UTwrite<fpreal64>(os, &v.z()); }
565  static void saveData(std::ostream &os, UT_Vector4D v)
566  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
567  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
568  static void saveData(std::ostream &os, UT_Matrix2D v)
570  static void saveData(std::ostream &os, UT_Matrix3D v)
572  static void saveData(std::ostream &os, UT_Matrix4D v)
574  static void saveData(std::ostream &os, UT_StringHolder s)
575  { UT_StringWrap(s).saveBinary(os); }
576  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
578  UT_OStringStream ostr;
579  if (s) s->save(ostr);
580  result = ostr.str();
581  saveData(os, result);
582  }
583  static void saveData(std::ostream &os, PRM_DataItemHandle s)
585  UT_OStringStream ostr;
586  if (s)
587  {
588  ostr << s->getDataTypeToken();
589  ostr << ":";
590  s->saveBinary(ostr);
591  }
592  result = ostr.str();
593  saveData(os, result);
594  }
595 
596 
597  void save(std::ostream &os) const
598  {
599  int32 v = version();
600  UTwrite(os, &v);
601  saveData(os, myPrimitives);
602  saveData(os, myPrimgroups);
603  saveData(os, myPrimnameprefix);
604  saveData(os, myEnableMatchByPrimAttrib);
605  saveData(os, myMatchByPrimAttrib);
606  saveData(os, myPoints);
607  saveData(os, myPointgroups);
608  saveData(os, myPointnameprefix);
609  saveData(os, myEnableMatchByPointAttrib);
610  saveData(os, myMatchByPointAttrib);
611  saveData(os, myEdges);
612  saveData(os, myEdgegroups);
613  saveData(os, myEdgenameprefix);
614  saveData(os, myVertices);
615  saveData(os, myVertexgroups);
616  saveData(os, myVertexnameprefix);
617  saveData(os, myEnableMatchByVertexAttrib);
618  saveData(os, myMatchByVertexAttrib);
619  saveData(os, myGroupnameconflict);
620  saveData(os, myCopyemptygroups);
621 
622  }
623 
624  bool load(UT_IStream &is)
625  {
626  int32 v;
627  is.bread(&v, 1);
628  if (version() != v)
629  {
630  // Fail incompatible versions
631  return false;
632  }
633  loadData(is, myPrimitives);
634  loadData(is, myPrimgroups);
635  loadData(is, myPrimnameprefix);
636  loadData(is, myEnableMatchByPrimAttrib);
637  loadData(is, myMatchByPrimAttrib);
638  loadData(is, myPoints);
639  loadData(is, myPointgroups);
640  loadData(is, myPointnameprefix);
641  loadData(is, myEnableMatchByPointAttrib);
642  loadData(is, myMatchByPointAttrib);
643  loadData(is, myEdges);
644  loadData(is, myEdgegroups);
645  loadData(is, myEdgenameprefix);
646  loadData(is, myVertices);
647  loadData(is, myVertexgroups);
648  loadData(is, myVertexnameprefix);
649  loadData(is, myEnableMatchByVertexAttrib);
650  loadData(is, myMatchByVertexAttrib);
651  loadData(is, myGroupnameconflict);
652  loadData(is, myCopyemptygroups);
653 
654  return true;
655  }
656 
657  bool getPrimitives() const { return myPrimitives; }
658  void setPrimitives(bool val) { myPrimitives = val; }
659  bool opPrimitives(const SOP_NodeVerb::CookParms &cookparms) const
660  {
661  SOP_Node *thissop = cookparms.getNode();
662  if (!thissop) return getPrimitives();
663  bool result;
664  OP_Utils::evalOpParm(result, thissop, "primitives", cookparms.getCookTime(), 0);
665  return result;
666  }
667  const UT_StringHolder & getPrimgroups() const { return myPrimgroups; }
668  void setPrimgroups(const UT_StringHolder & val) { myPrimgroups = val; }
670  {
671  SOP_Node *thissop = cookparms.getNode();
672  if (!thissop) return getPrimgroups();
674  OP_Utils::evalOpParm(result, thissop, "primgroups", cookparms.getCookTime(), 0);
675  return result;
676  }
677  const UT_StringHolder & getPrimnameprefix() const { return myPrimnameprefix; }
678  void setPrimnameprefix(const UT_StringHolder & val) { myPrimnameprefix = val; }
680  {
681  SOP_Node *thissop = cookparms.getNode();
682  if (!thissop) return getPrimnameprefix();
684  OP_Utils::evalOpParm(result, thissop, "primnameprefix", cookparms.getCookTime(), 0);
685  return result;
686  }
687  bool getEnableMatchByPrimAttrib() const { return myEnableMatchByPrimAttrib; }
688  void setEnableMatchByPrimAttrib(bool val) { myEnableMatchByPrimAttrib = val; }
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getEnableMatchByPrimAttrib();
693  bool result;
694  OP_Utils::evalOpParm(result, thissop, "enablematchbyprimattrib", cookparms.getCookTime(), 0);
695  return result;
696  }
697  const UT_StringHolder & getMatchByPrimAttrib() const { return myMatchByPrimAttrib; }
698  void setMatchByPrimAttrib(const UT_StringHolder & val) { myMatchByPrimAttrib = val; }
700  {
701  SOP_Node *thissop = cookparms.getNode();
702  if (!thissop) return getMatchByPrimAttrib();
704  OP_Utils::evalOpParm(result, thissop, "matchbyprimattrib", cookparms.getCookTime(), 0);
705  return result;
706  }
707  bool getPoints() const { return myPoints; }
708  void setPoints(bool val) { myPoints = val; }
709  bool opPoints(const SOP_NodeVerb::CookParms &cookparms) const
710  {
711  SOP_Node *thissop = cookparms.getNode();
712  if (!thissop) return getPoints();
713  bool result;
714  OP_Utils::evalOpParm(result, thissop, "points", cookparms.getCookTime(), 0);
715  return result;
716  }
717  const UT_StringHolder & getPointgroups() const { return myPointgroups; }
718  void setPointgroups(const UT_StringHolder & val) { myPointgroups = val; }
720  {
721  SOP_Node *thissop = cookparms.getNode();
722  if (!thissop) return getPointgroups();
724  OP_Utils::evalOpParm(result, thissop, "pointgroups", cookparms.getCookTime(), 0);
725  return result;
726  }
727  const UT_StringHolder & getPointnameprefix() const { return myPointnameprefix; }
728  void setPointnameprefix(const UT_StringHolder & val) { myPointnameprefix = val; }
730  {
731  SOP_Node *thissop = cookparms.getNode();
732  if (!thissop) return getPointnameprefix();
734  OP_Utils::evalOpParm(result, thissop, "pointnameprefix", cookparms.getCookTime(), 0);
735  return result;
736  }
737  bool getEnableMatchByPointAttrib() const { return myEnableMatchByPointAttrib; }
738  void setEnableMatchByPointAttrib(bool val) { myEnableMatchByPointAttrib = val; }
740  {
741  SOP_Node *thissop = cookparms.getNode();
742  if (!thissop) return getEnableMatchByPointAttrib();
743  bool result;
744  OP_Utils::evalOpParm(result, thissop, "enablematchbypointattrib", cookparms.getCookTime(), 0);
745  return result;
746  }
747  const UT_StringHolder & getMatchByPointAttrib() const { return myMatchByPointAttrib; }
748  void setMatchByPointAttrib(const UT_StringHolder & val) { myMatchByPointAttrib = val; }
750  {
751  SOP_Node *thissop = cookparms.getNode();
752  if (!thissop) return getMatchByPointAttrib();
754  OP_Utils::evalOpParm(result, thissop, "matchbypointattrib", cookparms.getCookTime(), 0);
755  return result;
756  }
757  bool getEdges() const { return myEdges; }
758  void setEdges(bool val) { myEdges = val; }
759  bool opEdges(const SOP_NodeVerb::CookParms &cookparms) const
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getEdges();
763  bool result;
764  OP_Utils::evalOpParm(result, thissop, "edges", cookparms.getCookTime(), 0);
765  return result;
766  }
767  const UT_StringHolder & getEdgegroups() const { return myEdgegroups; }
768  void setEdgegroups(const UT_StringHolder & val) { myEdgegroups = val; }
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getEdgegroups();
774  OP_Utils::evalOpParm(result, thissop, "edgegroups", cookparms.getCookTime(), 0);
775  return result;
776  }
777  const UT_StringHolder & getEdgenameprefix() const { return myEdgenameprefix; }
778  void setEdgenameprefix(const UT_StringHolder & val) { myEdgenameprefix = val; }
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return getEdgenameprefix();
784  OP_Utils::evalOpParm(result, thissop, "edgenameprefix", cookparms.getCookTime(), 0);
785  return result;
786  }
787  bool getVertices() const { return myVertices; }
788  void setVertices(bool val) { myVertices = val; }
789  bool opVertices(const SOP_NodeVerb::CookParms &cookparms) const
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getVertices();
793  bool result;
794  OP_Utils::evalOpParm(result, thissop, "vertices", cookparms.getCookTime(), 0);
795  return result;
796  }
797  const UT_StringHolder & getVertexgroups() const { return myVertexgroups; }
798  void setVertexgroups(const UT_StringHolder & val) { myVertexgroups = val; }
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getVertexgroups();
804  OP_Utils::evalOpParm(result, thissop, "vertexgroups", cookparms.getCookTime(), 0);
805  return result;
806  }
807  const UT_StringHolder & getVertexnameprefix() const { return myVertexnameprefix; }
808  void setVertexnameprefix(const UT_StringHolder & val) { myVertexnameprefix = val; }
810  {
811  SOP_Node *thissop = cookparms.getNode();
812  if (!thissop) return getVertexnameprefix();
814  OP_Utils::evalOpParm(result, thissop, "vertexnameprefix", cookparms.getCookTime(), 0);
815  return result;
816  }
817  bool getEnableMatchByVertexAttrib() const { return myEnableMatchByVertexAttrib; }
818  void setEnableMatchByVertexAttrib(bool val) { myEnableMatchByVertexAttrib = val; }
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getEnableMatchByVertexAttrib();
823  bool result;
824  OP_Utils::evalOpParm(result, thissop, "enablematchbyvertexattrib", cookparms.getCookTime(), 0);
825  return result;
826  }
827  const UT_StringHolder & getMatchByVertexAttrib() const { return myMatchByVertexAttrib; }
828  void setMatchByVertexAttrib(const UT_StringHolder & val) { myMatchByVertexAttrib = val; }
830  {
831  SOP_Node *thissop = cookparms.getNode();
832  if (!thissop) return getMatchByVertexAttrib();
834  OP_Utils::evalOpParm(result, thissop, "matchbyvertexattrib", cookparms.getCookTime(), 0);
835  return result;
836  }
837  const UT_StringHolder & getGroupnameconflict() const { return myGroupnameconflict; }
838  void setGroupnameconflict(const UT_StringHolder & val) { myGroupnameconflict = val; }
840  {
841  SOP_Node *thissop = cookparms.getNode();
842  if (!thissop) return getGroupnameconflict();
844  OP_Utils::evalOpParm(result, thissop, "groupnameconflict", cookparms.getCookTime(), 0);
845  return result;
846  }
847  bool getCopyemptygroups() const { return myCopyemptygroups; }
848  void setCopyemptygroups(bool val) { myCopyemptygroups = val; }
849  bool opCopyemptygroups(const SOP_NodeVerb::CookParms &cookparms) const
850  {
851  SOP_Node *thissop = cookparms.getNode();
852  if (!thissop) return getCopyemptygroups();
853  bool result;
854  OP_Utils::evalOpParm(result, thissop, "copyemptygroups", cookparms.getCookTime(), 0);
855  return result;
856  }
857 
858 private:
859  bool myPrimitives;
860  UT_StringHolder myPrimgroups;
861  UT_StringHolder myPrimnameprefix;
862  bool myEnableMatchByPrimAttrib;
863  UT_StringHolder myMatchByPrimAttrib;
864  bool myPoints;
865  UT_StringHolder myPointgroups;
866  UT_StringHolder myPointnameprefix;
867  bool myEnableMatchByPointAttrib;
868  UT_StringHolder myMatchByPointAttrib;
869  bool myEdges;
870  UT_StringHolder myEdgegroups;
871  UT_StringHolder myEdgenameprefix;
872  bool myVertices;
873  UT_StringHolder myVertexgroups;
874  UT_StringHolder myVertexnameprefix;
875  bool myEnableMatchByVertexAttrib;
876  UT_StringHolder myMatchByVertexAttrib;
877  UT_StringHolder myGroupnameconflict;
878  bool myCopyemptygroups;
879 
880 };
type
Definition: core.h:556
void setEdgegroups(const UT_StringHolder &val)
bool getEnableMatchByVertexAttrib() const
UT_StringHolder opEdgenameprefix(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_GroupCopyParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setEnableMatchByPointAttrib(bool val)
static void saveData(std::ostream &os, UT_Vector2D v)
void setPoints(bool val)
static void loadData(UT_IStream &is, fpreal64 &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
const UT_StringHolder & getEdgenameprefix() const
static void saveData(std::ostream &os, int64 v)
UT_StringHolder opMatchByPointAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getPrimgroups() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
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_StringHolder opMatchByVertexAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void setPrimnameprefix(const UT_StringHolder &val)
const char * getNestParmName(TempIndex fieldnum) const override
bool getEnableMatchByPrimAttrib() const
bool isParmColorRamp(exint idx) const override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
UT_StringHolder opPointnameprefix(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_StringHolder & getPointnameprefix() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
**But if you need a result
Definition: thread.h:622
const UT_StringHolder & getVertexnameprefix() const
void setEdgenameprefix(const UT_StringHolder &val)
bool opCopyemptygroups(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
bool load(UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool opEnableMatchByPointAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
void setEnableMatchByVertexAttrib(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
UT_StringHolder opEdgegroups(const SOP_NodeVerb::CookParms &cookparms) const
void setMatchByVertexAttrib(const UT_StringHolder &val)
const UT_StringHolder & getVertexgroups() const
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool getPrimitives() const
bool getCopyemptygroups() const
bool opEdges(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getGroupnameconflict() const
UT_StringHolder opPrimnameprefix(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
const UT_StringHolder & getMatchByPointAttrib() const
static void saveData(std::ostream &os, UT_Vector4D v)
bool operator!=(const SOP_GroupCopyParms &src) const
exint length() const
ParmType getNestParmType(TempIndex fieldnum) const override
void setVertices(bool val)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool opEnableMatchByVertexAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setVertexnameprefix(const UT_StringHolder &val)
bool opPrimitives(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
long long int64
Definition: SYS_Types.h:116
UT_StringHolder opGroupnameconflict(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setGroupnameconflict(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setVertexgroups(const UT_StringHolder &val)
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_StringHolder opVertexnameprefix(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
void setPointnameprefix(const UT_StringHolder &val)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
GT_API const UT_StringHolder version
bool opVertices(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
void setPrimgroups(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setPointgroups(const UT_StringHolder &val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:310
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setMatchByPrimAttrib(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_StringHolder opMatchByPrimAttrib(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
const UT_StringHolder & getEdgegroups() const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
void setPrimitives(bool val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
bool getEnableMatchByPointAttrib() const
UT_StringHolder opPointgroups(const SOP_NodeVerb::CookParms &cookparms) const
void setMatchByPointAttrib(const UT_StringHolder &val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#define SOP_API
Definition: SOP_API.h:10
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
const UT_StringHolder & getMatchByPrimAttrib() const
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GLboolean r
Definition: glcorearb.h:1222
bool opPoints(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const UT_StringHolder & getPointgroups() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setCopyemptygroups(bool val)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opEnableMatchByPrimAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
UT_StringHolder opPrimgroups(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, UT_StringHolder s)
const UT_StringHolder & getMatchByVertexAttrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, fpreal64 v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
UT_StringHolder opVertexgroups(const SOP_NodeVerb::CookParms &cookparms) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setEnableMatchByPrimAttrib(bool val)
const UT_StringHolder & getPrimnameprefix() const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663