HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeResize.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_VolumeResizeEnums
24 {
25  enum class Combine
26  {
27  REPLACE = 0,
28  UNION,
29  INTERSECT
30  };
31 
33  getToken(Combine enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Combine::REPLACE: return "replace"_sh;
38  case Combine::UNION: return "union"_sh;
39  case Combine::INTERSECT: return "intersect"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44 }
45 
46 
48 {
49 public:
50  static int version() { return 1; }
51 
53  {
54  myGroup = ""_UTsh;
55  myExtracttile = false;
56  myTilecount = UT_Vector3I(2,2,2);
57  myTilenum = 0;
58  myCombine = 0;
59  mySize = UT_Vector3D(1,1,1);
60  myT = UT_Vector3D(0,0,0);
61  myTileminpad = UT_Vector3I(0,0,0);
62  myTilemaxpad = UT_Vector3I(0,0,0);
63  myVoxelpad = UT_Vector3D(0,0,0);
64  myUsepoints = true;
65  myKeepdata = true;
66  myAllowextrap = false;
67  myUseclipplane = false;
68  myClipcenter = UT_Vector3D(0,0,0);
69  myClipdir = UT_Vector3D(0,0,1);
70  myUsemaxres = true;
71  myMaxres = UT_Vector3I(512,512,512);
72  myDetect2d = true;
73 
74  }
75 
76  explicit SOP_VolumeResizeParms(const SOP_VolumeResizeParms &) = default;
78  SOP_VolumeResizeParms(SOP_VolumeResizeParms &&) noexcept = default;
79  SOP_VolumeResizeParms &operator=(SOP_VolumeResizeParms &&) noexcept = default;
80 
81  ~SOP_VolumeResizeParms() override {}
82 
84  {
85  if (myGroup != src.myGroup) return false;
86  if (myExtracttile != src.myExtracttile) return false;
87  if (myTilecount != src.myTilecount) return false;
88  if (myTilenum != src.myTilenum) return false;
89  if (myCombine != src.myCombine) return false;
90  if (mySize != src.mySize) return false;
91  if (myT != src.myT) return false;
92  if (myTileminpad != src.myTileminpad) return false;
93  if (myTilemaxpad != src.myTilemaxpad) return false;
94  if (myVoxelpad != src.myVoxelpad) return false;
95  if (myUsepoints != src.myUsepoints) return false;
96  if (myKeepdata != src.myKeepdata) return false;
97  if (myAllowextrap != src.myAllowextrap) return false;
98  if (myUseclipplane != src.myUseclipplane) return false;
99  if (myClipcenter != src.myClipcenter) return false;
100  if (myClipdir != src.myClipdir) return false;
101  if (myUsemaxres != src.myUsemaxres) return false;
102  if (myMaxres != src.myMaxres) return false;
103  if (myDetect2d != src.myDetect2d) return false;
104 
105 
106  if (baseGetSignature() != src.baseGetSignature()) return false;
107 
108  return true;
109  }
111  {
112  return !operator==(src);
113  }
115 
116 
117 
118  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
119  {
120  myGroup = ""_UTsh;
121  if (true)
122  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
123  myExtracttile = false;
124  if (true)
125  graph->evalOpParm(myExtracttile, nodeidx, "extracttile", time, graph->isDirect()?nullptr:depnode);
126  myTilecount = UT_Vector3I(2,2,2);
127  if (true && ( (true&&!(((getExtracttile()==0)))) ) )
128  graph->evalOpParm(myTilecount, nodeidx, "tilecount", time, graph->isDirect()?nullptr:depnode);
129  myTilenum = 0;
130  if (true && ( (true&&!(((getExtracttile()==0)))) ) )
131  graph->evalOpParm(myTilenum, nodeidx, "tilenum", time, graph->isDirect()?nullptr:depnode);
132  myCombine = 0;
133  if (true && ( (true&&!(((getExtracttile()==1)))) ) )
134  graph->evalOpParm(myCombine, nodeidx, "combine", time, graph->isDirect()?nullptr:depnode);
135  mySize = UT_Vector3D(1,1,1);
136  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==1))||((getExtracttile()==1)))) ) )
137  graph->evalOpParm(mySize, nodeidx, "size", time, graph->isDirect()?nullptr:depnode);
138  myT = UT_Vector3D(0,0,0);
139  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==1))||((getExtracttile()==1)))) ) )
140  graph->evalOpParm(myT, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
141  myTileminpad = UT_Vector3I(0,0,0);
142  if (true && ( (true&&!(((getExtracttile()==0)))) ) )
143  graph->evalOpParm(myTileminpad, nodeidx, "tileminpad", time, graph->isDirect()?nullptr:depnode);
144  myTilemaxpad = UT_Vector3I(0,0,0);
145  if (true && ( (true&&!(((getExtracttile()==0)))) ) )
146  graph->evalOpParm(myTilemaxpad, nodeidx, "tilemaxpad", time, graph->isDirect()?nullptr:depnode);
147  myVoxelpad = UT_Vector3D(0,0,0);
148  if (true)
149  graph->evalOpParm(myVoxelpad, nodeidx, "voxelpad", time, graph->isDirect()?nullptr:depnode);
150  myUsepoints = true;
151  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==0))||((getExtracttile()==1)))) ) )
152  graph->evalOpParm(myUsepoints, nodeidx, "usepoints", time, graph->isDirect()?nullptr:depnode);
153  myKeepdata = true;
154  if (true)
155  graph->evalOpParm(myKeepdata, nodeidx, "keepdata", time, graph->isDirect()?nullptr:depnode);
156  myAllowextrap = false;
157  if (true && ( (true&&!(((getExtracttile()==0)))) ) )
158  graph->evalOpParm(myAllowextrap, nodeidx, "allowextrap", time, graph->isDirect()?nullptr:depnode);
159  myUseclipplane = false;
160  if (true && ( (true&&!(((getExtracttile()==1)))) ) )
161  graph->evalOpParm(myUseclipplane, nodeidx, "useclipplane", time, graph->isDirect()?nullptr:depnode);
162  myClipcenter = UT_Vector3D(0,0,0);
163  if (true && ( (true&&!(((getUseclipplane()==0))||((getExtracttile()==1)))) ) )
164  graph->evalOpParm(myClipcenter, nodeidx, "clipcenter", time, graph->isDirect()?nullptr:depnode);
165  myClipdir = UT_Vector3D(0,0,1);
166  if (true && ( (true&&!(((getUseclipplane()==0))||((getExtracttile()==1)))) ) )
167  graph->evalOpParm(myClipdir, nodeidx, "clipdir", time, graph->isDirect()?nullptr:depnode);
168  myUsemaxres = true;
169  if (true && ( (true&&!(((getExtracttile()==1)))) ) )
170  graph->evalOpParm(myUsemaxres, nodeidx, "usemaxres", time, graph->isDirect()?nullptr:depnode);
171  myMaxres = UT_Vector3I(512,512,512);
172  if (true && ( (true&&!(((getUsemaxres()==0))||((getExtracttile()==1)))) ) )
173  graph->evalOpParm(myMaxres, nodeidx, "maxres", time, graph->isDirect()?nullptr:depnode);
174  myDetect2d = true;
175  if (true)
176  graph->evalOpParm(myDetect2d, nodeidx, "detect2d", time, graph->isDirect()?nullptr:depnode);
177 
178  }
179 
180 
181  void loadFromOpSubclass(const LoadParms &loadparms) override
182  {
183  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
184  }
185 
186 
187  void copyFrom(const OP_NodeParms *src) override
188  {
189  *this = *((const SOP_VolumeResizeParms *)src);
190  }
191 
192  template <typename T>
193  void
194  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
195  {
196  if (idx.size() < 1)
197  return;
198  UT_ASSERT(idx.size() == instance.size()+1);
199  if (idx.size() != instance.size()+1)
200  return;
201  switch (idx[0])
202  {
203  case 0:
204  coerceValue(value, myGroup);
205  break;
206  case 1:
207  coerceValue(value, myExtracttile);
208  break;
209  case 2:
210  coerceValue(value, myTilecount);
211  break;
212  case 3:
213  coerceValue(value, myTilenum);
214  break;
215  case 4:
216  coerceValue(value, myCombine);
217  break;
218  case 5:
219  coerceValue(value, mySize);
220  break;
221  case 6:
222  coerceValue(value, myT);
223  break;
224  case 7:
225  coerceValue(value, myTileminpad);
226  break;
227  case 8:
228  coerceValue(value, myTilemaxpad);
229  break;
230  case 9:
231  coerceValue(value, myVoxelpad);
232  break;
233  case 10:
234  coerceValue(value, myUsepoints);
235  break;
236  case 11:
237  coerceValue(value, myKeepdata);
238  break;
239  case 12:
240  coerceValue(value, myAllowextrap);
241  break;
242  case 13:
243  coerceValue(value, myUseclipplane);
244  break;
245  case 14:
246  coerceValue(value, myClipcenter);
247  break;
248  case 15:
249  coerceValue(value, myClipdir);
250  break;
251  case 16:
252  coerceValue(value, myUsemaxres);
253  break;
254  case 17:
255  coerceValue(value, myMaxres);
256  break;
257  case 18:
258  coerceValue(value, myDetect2d);
259  break;
260 
261  }
262  }
263 
264  bool isParmColorRamp(exint idx) const override
265  {
266  switch (idx)
267  {
268 
269  }
270  return false;
271  }
272 
273  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
294  { doGetParmValue(idx, instance, value); }
295 
296  template <typename T>
297  void
298  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
299  {
300  if (idx.size() < 1)
301  return;
302  UT_ASSERT(idx.size() == instance.size()+1);
303  if (idx.size() != instance.size()+1)
304  return;
305  switch (idx[0])
306  {
307  case 0:
308  coerceValue(myGroup, ( ( value ) ));
309  break;
310  case 1:
311  coerceValue(myExtracttile, ( ( value ) ));
312  break;
313  case 2:
314  coerceValue(myTilecount, clampMinValue(1, ( value ) ));
315  break;
316  case 3:
317  coerceValue(myTilenum, ( ( value ) ));
318  break;
319  case 4:
320  coerceValue(myCombine, clampMinValue(0, clampMaxValue(2, value ) ));
321  break;
322  case 5:
323  coerceValue(mySize, clampMinValue(0, ( value ) ));
324  break;
325  case 6:
326  coerceValue(myT, ( ( value ) ));
327  break;
328  case 7:
329  coerceValue(myTileminpad, ( ( value ) ));
330  break;
331  case 8:
332  coerceValue(myTilemaxpad, ( ( value ) ));
333  break;
334  case 9:
335  coerceValue(myVoxelpad, ( ( value ) ));
336  break;
337  case 10:
338  coerceValue(myUsepoints, ( ( value ) ));
339  break;
340  case 11:
341  coerceValue(myKeepdata, ( ( value ) ));
342  break;
343  case 12:
344  coerceValue(myAllowextrap, ( ( value ) ));
345  break;
346  case 13:
347  coerceValue(myUseclipplane, ( ( value ) ));
348  break;
349  case 14:
350  coerceValue(myClipcenter, ( ( value ) ));
351  break;
352  case 15:
353  coerceValue(myClipdir, ( ( value ) ));
354  break;
355  case 16:
356  coerceValue(myUsemaxres, ( ( value ) ));
357  break;
358  case 17:
359  coerceValue(myMaxres, ( ( value ) ));
360  break;
361  case 18:
362  coerceValue(myDetect2d, ( ( value ) ));
363  break;
364 
365  }
366  }
367 
368  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
369  { doSetParmValue(idx, instance, value); }
370  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
371  { doSetParmValue(idx, instance, value); }
372  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
383  { doSetParmValue(idx, instance, value); }
384  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
385  { doSetParmValue(idx, instance, value); }
386  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
389  { doSetParmValue(idx, instance, value); }
390 
391  exint getNestNumParms(TempIndex idx) const override
392  {
393  if (idx.size() == 0)
394  return 19;
395  switch (idx[0])
396  {
397 
398  }
399  // Invalid
400  return 0;
401  }
402 
403  const char *getNestParmName(TempIndex fieldnum) const override
404  {
405  if (fieldnum.size() < 1)
406  return 0;
407  switch (fieldnum[0])
408  {
409  case 0:
410  return "group";
411  case 1:
412  return "extracttile";
413  case 2:
414  return "tilecount";
415  case 3:
416  return "tilenum";
417  case 4:
418  return "combine";
419  case 5:
420  return "size";
421  case 6:
422  return "t";
423  case 7:
424  return "tileminpad";
425  case 8:
426  return "tilemaxpad";
427  case 9:
428  return "voxelpad";
429  case 10:
430  return "usepoints";
431  case 11:
432  return "keepdata";
433  case 12:
434  return "allowextrap";
435  case 13:
436  return "useclipplane";
437  case 14:
438  return "clipcenter";
439  case 15:
440  return "clipdir";
441  case 16:
442  return "usemaxres";
443  case 17:
444  return "maxres";
445  case 18:
446  return "detect2d";
447 
448  }
449  return 0;
450  }
451 
452  ParmType getNestParmType(TempIndex fieldnum) const override
453  {
454  if (fieldnum.size() < 1)
455  return PARM_UNSUPPORTED;
456  switch (fieldnum[0])
457  {
458  case 0:
459  return PARM_STRING;
460  case 1:
461  return PARM_INTEGER;
462  case 2:
463  return PARM_VECTOR3;
464  case 3:
465  return PARM_INTEGER;
466  case 4:
467  return PARM_INTEGER;
468  case 5:
469  return PARM_VECTOR3;
470  case 6:
471  return PARM_VECTOR3;
472  case 7:
473  return PARM_VECTOR3;
474  case 8:
475  return PARM_VECTOR3;
476  case 9:
477  return PARM_VECTOR3;
478  case 10:
479  return PARM_INTEGER;
480  case 11:
481  return PARM_INTEGER;
482  case 12:
483  return PARM_INTEGER;
484  case 13:
485  return PARM_INTEGER;
486  case 14:
487  return PARM_VECTOR3;
488  case 15:
489  return PARM_VECTOR3;
490  case 16:
491  return PARM_INTEGER;
492  case 17:
493  return PARM_VECTOR3;
494  case 18:
495  return PARM_INTEGER;
496 
497  }
498  return PARM_UNSUPPORTED;
499  }
500 
501  // Boiler plate to load individual types.
502  static void loadData(UT_IStream &is, int64 &v)
503  { is.bread(&v, 1); }
504  static void loadData(UT_IStream &is, bool &v)
505  { int64 iv; is.bread(&iv, 1); v = iv; }
506  static void loadData(UT_IStream &is, fpreal64 &v)
507  { is.bread<fpreal64>(&v, 1); }
508  static void loadData(UT_IStream &is, UT_Vector2D &v)
509  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
510  static void loadData(UT_IStream &is, UT_Vector3D &v)
511  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
512  is.bread<fpreal64>(&v.z(), 1); }
513  static void loadData(UT_IStream &is, UT_Vector4D &v)
514  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
515  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
516  static void loadData(UT_IStream &is, UT_Matrix2D &v)
517  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
518  static void loadData(UT_IStream &is, UT_Matrix3D &v)
519  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
520  static void loadData(UT_IStream &is, UT_Matrix4D &v)
521  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
522  static void loadData(UT_IStream &is, UT_Vector2I &v)
523  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
524  static void loadData(UT_IStream &is, UT_Vector3I &v)
525  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
526  is.bread<int64>(&v.z(), 1); }
527  static void loadData(UT_IStream &is, UT_Vector4I &v)
528  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
529  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
531  { is.bread(v); }
533  { UT_StringHolder rampdata;
534  loadData(is, rampdata);
535  if (rampdata.isstring())
536  {
537  v.reset(new UT_Ramp());
538  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
539  v->load(istr);
540  }
541  else v.reset();
542  }
545  loadData(is, data);
546  if (data.isstring())
547  {
548  // Find the data type.
549  const char *colon = UT_StringWrap(data).findChar(':');
550  if (colon)
551  {
552  int typelen = colon - data.buffer();
554  type.strncpy(data.buffer(), typelen);
555  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
556 
557  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
558  }
559  }
560  else v.reset();
561  }
562 
563  static void saveData(std::ostream &os, int64 v)
564  { UTwrite(os, &v); }
565  static void saveData(std::ostream &os, bool v)
566  { int64 iv = v; UTwrite(os, &iv); }
567  static void saveData(std::ostream &os, fpreal64 v)
568  { UTwrite<fpreal64>(os, &v); }
569  static void saveData(std::ostream &os, UT_Vector2D v)
570  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
571  static void saveData(std::ostream &os, UT_Vector3D v)
572  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
573  UTwrite<fpreal64>(os, &v.z()); }
574  static void saveData(std::ostream &os, UT_Vector4D v)
575  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
576  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
577  static void saveData(std::ostream &os, UT_Matrix2D v)
579  static void saveData(std::ostream &os, UT_Matrix3D v)
581  static void saveData(std::ostream &os, UT_Matrix4D v)
583  static void saveData(std::ostream &os, UT_StringHolder s)
584  { UT_StringWrap(s).saveBinary(os); }
585  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
587  UT_OStringStream ostr;
588  if (s) s->save(ostr);
589  result = ostr.str();
590  saveData(os, result);
591  }
592  static void saveData(std::ostream &os, PRM_DataItemHandle s)
594  UT_OStringStream ostr;
595  if (s)
596  {
597  ostr << s->getDataTypeToken();
598  ostr << ":";
599  s->saveBinary(ostr);
600  }
601  result = ostr.str();
602  saveData(os, result);
603  }
604 
605 
606  void save(std::ostream &os) const
607  {
608  int32 v = version();
609  UTwrite(os, &v);
610  saveData(os, myGroup);
611  saveData(os, myExtracttile);
612  saveData(os, myTilecount);
613  saveData(os, myTilenum);
614  saveData(os, myCombine);
615  saveData(os, mySize);
616  saveData(os, myT);
617  saveData(os, myTileminpad);
618  saveData(os, myTilemaxpad);
619  saveData(os, myVoxelpad);
620  saveData(os, myUsepoints);
621  saveData(os, myKeepdata);
622  saveData(os, myAllowextrap);
623  saveData(os, myUseclipplane);
624  saveData(os, myClipcenter);
625  saveData(os, myClipdir);
626  saveData(os, myUsemaxres);
627  saveData(os, myMaxres);
628  saveData(os, myDetect2d);
629 
630  }
631 
632  bool load(UT_IStream &is)
633  {
634  int32 v;
635  is.bread(&v, 1);
636  if (version() != v)
637  {
638  // Fail incompatible versions
639  return false;
640  }
641  loadData(is, myGroup);
642  loadData(is, myExtracttile);
643  loadData(is, myTilecount);
644  loadData(is, myTilenum);
645  loadData(is, myCombine);
646  loadData(is, mySize);
647  loadData(is, myT);
648  loadData(is, myTileminpad);
649  loadData(is, myTilemaxpad);
650  loadData(is, myVoxelpad);
651  loadData(is, myUsepoints);
652  loadData(is, myKeepdata);
653  loadData(is, myAllowextrap);
654  loadData(is, myUseclipplane);
655  loadData(is, myClipcenter);
656  loadData(is, myClipdir);
657  loadData(is, myUsemaxres);
658  loadData(is, myMaxres);
659  loadData(is, myDetect2d);
660 
661  return true;
662  }
663 
664  const UT_StringHolder & getGroup() const { return myGroup; }
665  void setGroup(const UT_StringHolder & val) { myGroup = val; }
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return getGroup();
671  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
672  return result;
673  }
674  bool getExtracttile() const { return myExtracttile; }
675  void setExtracttile(bool val) { myExtracttile = val; }
676  bool opExtracttile(const SOP_NodeVerb::CookParms &cookparms) const
677  {
678  SOP_Node *thissop = cookparms.getNode();
679  if (!thissop) return getExtracttile();
680  bool result;
681  OP_Utils::evalOpParm(result, thissop, "extracttile", cookparms.getCookTime(), 0);
682  return result;
683  }
684  UT_Vector3I getTilecount() const { return myTilecount; }
685  void setTilecount(UT_Vector3I val) { myTilecount = val; }
687  {
688  SOP_Node *thissop = cookparms.getNode();
689  if (!thissop) return getTilecount();
691  OP_Utils::evalOpParm(result, thissop, "tilecount", cookparms.getCookTime(), 0);
692  return result;
693  }
694  int64 getTilenum() const { return myTilenum; }
695  void setTilenum(int64 val) { myTilenum = val; }
696  int64 opTilenum(const SOP_NodeVerb::CookParms &cookparms) const
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getTilenum();
700  int64 result;
701  OP_Utils::evalOpParm(result, thissop, "tilenum", cookparms.getCookTime(), 0);
702  return result;
703  }
704  Combine getCombine() const { return Combine(myCombine); }
705  void setCombine(Combine val) { myCombine = int64(val); }
706  Combine opCombine(const SOP_NodeVerb::CookParms &cookparms) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return getCombine();
710  int64 result;
711  OP_Utils::evalOpParm(result, thissop, "combine", cookparms.getCookTime(), 0);
712  return Combine(result);
713  }
714  UT_Vector3D getSize() const { return mySize; }
715  void setSize(UT_Vector3D val) { mySize = val; }
717  {
718  SOP_Node *thissop = cookparms.getNode();
719  if (!thissop) return getSize();
721  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
722  return result;
723  }
724  UT_Vector3D getT() const { return myT; }
725  void setT(UT_Vector3D val) { myT = val; }
726  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
727  {
728  SOP_Node *thissop = cookparms.getNode();
729  if (!thissop) return getT();
731  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
732  return result;
733  }
734  UT_Vector3I getTileminpad() const { return myTileminpad; }
735  void setTileminpad(UT_Vector3I val) { myTileminpad = val; }
737  {
738  SOP_Node *thissop = cookparms.getNode();
739  if (!thissop) return getTileminpad();
741  OP_Utils::evalOpParm(result, thissop, "tileminpad", cookparms.getCookTime(), 0);
742  return result;
743  }
744  UT_Vector3I getTilemaxpad() const { return myTilemaxpad; }
745  void setTilemaxpad(UT_Vector3I val) { myTilemaxpad = val; }
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getTilemaxpad();
751  OP_Utils::evalOpParm(result, thissop, "tilemaxpad", cookparms.getCookTime(), 0);
752  return result;
753  }
754  UT_Vector3D getVoxelpad() const { return myVoxelpad; }
755  void setVoxelpad(UT_Vector3D val) { myVoxelpad = val; }
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getVoxelpad();
761  OP_Utils::evalOpParm(result, thissop, "voxelpad", cookparms.getCookTime(), 0);
762  return result;
763  }
764  bool getUsepoints() const { return myUsepoints; }
765  void setUsepoints(bool val) { myUsepoints = val; }
766  bool opUsepoints(const SOP_NodeVerb::CookParms &cookparms) const
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getUsepoints();
770  bool result;
771  OP_Utils::evalOpParm(result, thissop, "usepoints", cookparms.getCookTime(), 0);
772  return result;
773  }
774  bool getKeepdata() const { return myKeepdata; }
775  void setKeepdata(bool val) { myKeepdata = val; }
776  bool opKeepdata(const SOP_NodeVerb::CookParms &cookparms) const
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getKeepdata();
780  bool result;
781  OP_Utils::evalOpParm(result, thissop, "keepdata", cookparms.getCookTime(), 0);
782  return result;
783  }
784  bool getAllowextrap() const { return myAllowextrap; }
785  void setAllowextrap(bool val) { myAllowextrap = val; }
786  bool opAllowextrap(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getAllowextrap();
790  bool result;
791  OP_Utils::evalOpParm(result, thissop, "allowextrap", cookparms.getCookTime(), 0);
792  return result;
793  }
794  bool getUseclipplane() const { return myUseclipplane; }
795  void setUseclipplane(bool val) { myUseclipplane = val; }
796  bool opUseclipplane(const SOP_NodeVerb::CookParms &cookparms) const
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getUseclipplane();
800  bool result;
801  OP_Utils::evalOpParm(result, thissop, "useclipplane", cookparms.getCookTime(), 0);
802  return result;
803  }
804  UT_Vector3D getClipcenter() const { return myClipcenter; }
805  void setClipcenter(UT_Vector3D val) { myClipcenter = val; }
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getClipcenter();
811  OP_Utils::evalOpParm(result, thissop, "clipcenter", cookparms.getCookTime(), 0);
812  return result;
813  }
814  UT_Vector3D getClipdir() const { return myClipdir; }
815  void setClipdir(UT_Vector3D val) { myClipdir = val; }
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getClipdir();
821  OP_Utils::evalOpParm(result, thissop, "clipdir", cookparms.getCookTime(), 0);
822  return result;
823  }
824  bool getUsemaxres() const { return myUsemaxres; }
825  void setUsemaxres(bool val) { myUsemaxres = val; }
826  bool opUsemaxres(const SOP_NodeVerb::CookParms &cookparms) const
827  {
828  SOP_Node *thissop = cookparms.getNode();
829  if (!thissop) return getUsemaxres();
830  bool result;
831  OP_Utils::evalOpParm(result, thissop, "usemaxres", cookparms.getCookTime(), 0);
832  return result;
833  }
834  UT_Vector3I getMaxres() const { return myMaxres; }
835  void setMaxres(UT_Vector3I val) { myMaxres = val; }
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return getMaxres();
841  OP_Utils::evalOpParm(result, thissop, "maxres", cookparms.getCookTime(), 0);
842  return result;
843  }
844  bool getDetect2d() const { return myDetect2d; }
845  void setDetect2d(bool val) { myDetect2d = val; }
846  bool opDetect2d(const SOP_NodeVerb::CookParms &cookparms) const
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return getDetect2d();
850  bool result;
851  OP_Utils::evalOpParm(result, thissop, "detect2d", cookparms.getCookTime(), 0);
852  return result;
853  }
854 
855 private:
856  UT_StringHolder myGroup;
857  bool myExtracttile;
858  UT_Vector3I myTilecount;
859  int64 myTilenum;
860  int64 myCombine;
861  UT_Vector3D mySize;
862  UT_Vector3D myT;
863  UT_Vector3I myTileminpad;
864  UT_Vector3I myTilemaxpad;
865  UT_Vector3D myVoxelpad;
866  bool myUsepoints;
867  bool myKeepdata;
868  bool myAllowextrap;
869  bool myUseclipplane;
870  UT_Vector3D myClipcenter;
871  UT_Vector3D myClipdir;
872  bool myUsemaxres;
873  UT_Vector3I myMaxres;
874  bool myDetect2d;
875 
876 };
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
type
Definition: core.h:556
UT_Vector3D opVoxelpad(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setVoxelpad(UT_Vector3D val)
Combine opCombine(const SOP_NodeVerb::CookParms &cookparms) const
bool opExtracttile(const SOP_NodeVerb::CookParms &cookparms) const
int64 opTilenum(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool opAllowextrap(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
exint getNestNumParms(TempIndex idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, int64 &v)
ParmType getNestParmType(TempIndex fieldnum) const override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void setMaxres(UT_Vector3I val)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
SYS_FORCE_INLINE const char * buffer() const
bool opKeepdata(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
GLdouble s
Definition: glad.h:3009
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, bool &v)
bool operator==(const SOP_VolumeResizeParms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
**But if you need a result
Definition: thread.h:622
UT_Vector3T< int64 > UT_Vector3I
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, fpreal64 v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
UT_Vector3D opClipcenter(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I opTilemaxpad(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
UT_Vector3D getT() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
UT_Vector3D opClipdir(const SOP_NodeVerb::CookParms &cookparms) const
void setSize(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint length() const
UT_Vector3I getTilemaxpad() const
SYS_FORCE_INLINE UT_StringHolder getToken(Combine enum_value)
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
static void saveData(std::ostream &os, UT_Matrix4D v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void setTilecount(UT_Vector3I val)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_Vector3D getSize() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
long long int64
Definition: SYS_Types.h:116
void setClipcenter(UT_Vector3D val)
UT_Vector3D opSize(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
void copyFrom(const OP_NodeParms *src) override
const char * getNestParmName(TempIndex fieldnum) const override
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
UT_Vector3I opMaxres(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
GT_API const UT_StringHolder version
UT_Vector3D getVoxelpad() const
UT_Vector3I opTilecount(const SOP_NodeVerb::CookParms &cookparms) const
bool opDetect2d(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setTileminpad(UT_Vector3I val)
UT_Vector3I getTilecount() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_Vector3D getClipdir() const
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void loadData(UT_IStream &is, UT_Vector2D &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setClipdir(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
UT_Vector3I getMaxres() const
#define SOP_API
Definition: SOP_API.h:10
bool opUsemaxres(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void setGroup(const UT_StringHolder &val)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void saveData(std::ostream &os, UT_Matrix3D v)
bool opUseclipplane(const SOP_NodeVerb::CookParms &cookparms) const
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool operator!=(const SOP_VolumeResizeParms &src) const
UT_Vector3I opTileminpad(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void saveData(std::ostream &os, bool v)
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I getTileminpad() const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
UT_Vector3D getClipcenter() const
void setTilemaxpad(UT_Vector3I val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
bool opUsepoints(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void setT(UT_Vector3D val)
static void saveData(std::ostream &os, int64 v)