HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_VolumeFFT.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 <OP/OP_Utils.h>
8 #include <PRM/PRM_Parm.h>
9 #include <UT/UT_IStream.h>
10 #include <UT/UT_NTStreamUtil.h>
11 #include <UT/UT_Ramp.h>
12 #include <UT/UT_SharedPtr.h>
13 #include <UT/UT_StringHolder.h>
14 #include <UT/UT_StringStream.h>
15 #include <UT/UT_VectorTypes.h>
16 #include <SYS/SYS_Types.h>
17 
18 using namespace UT::Literal;
19 
20 class DEP_MicroNode;
21 namespace SOP_VolumeFFTEnums
22 {
23  enum class Voxelplane
24  {
25  XY = 0,
26  YZ,
27  ZX
28  };
29 }
30 
31 
33 {
34 public:
35  static int version() { return 1; }
36 
38  {
39  myGroup = ""_sh;
40  myCenterDC = false;
41  myInvert = false;
42  myNormalize = false;
43  mySlices = false;
44  myVoxelplane = 0;
45 
46  }
47 
48  explicit SOP_VolumeFFTParms(const SOP_VolumeFFTParms &) = default;
49 
50  virtual ~SOP_VolumeFFTParms() {}
51 
52  bool operator==(const SOP_VolumeFFTParms &src) const
53  {
54  if (myGroup != src.myGroup) return false;
55  if (myCenterDC != src.myCenterDC) return false;
56  if (myInvert != src.myInvert) return false;
57  if (myNormalize != src.myNormalize) return false;
58  if (mySlices != src.mySlices) return false;
59  if (myVoxelplane != src.myVoxelplane) return false;
60 
61  return true;
62  }
64 
65 
66 
67  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
68  {
69  if (true)
70  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
71  else myGroup = ""_sh;
72  if (true)
73  OP_Utils::evalOpParm(myCenterDC, node, "centerdc", time, 0);
74  else myCenterDC = false;
75  if (true)
76  OP_Utils::evalOpParm(myInvert, node, "invert", time, 0);
77  else myInvert = false;
78  if (true)
79  OP_Utils::evalOpParm(myNormalize, node, "normalize", time, 0);
80  else myNormalize = false;
81  if (true)
82  OP_Utils::evalOpParm(mySlices, node, "slices", time, 0);
83  else mySlices = false;
84  if (true && ( (!(((getSlices()==0)))) ) )
85  OP_Utils::evalOpParm(myVoxelplane, node, "voxelplane", time, 0);
86  else myVoxelplane = 0;
87 
88  }
89 
90 
91  virtual void loadFromOpSubclass(const LoadParms &loadparms)
92  {
93  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
94  }
95 
96 
97  virtual void copyFrom(const SOP_NodeParms *src)
98  {
99  *this = *((const SOP_VolumeFFTParms *)src);
100  }
101 
102  template <typename T>
103  void
104  doGetParmValue(exint idx, T &value) const
105  {
106  switch (idx)
107  {
108  case 0:
109  coerceValue(value, myGroup);
110  break;
111  case 1:
112  coerceValue(value, myCenterDC);
113  break;
114  case 2:
115  coerceValue(value, myInvert);
116  break;
117  case 3:
118  coerceValue(value, myNormalize);
119  break;
120  case 4:
121  coerceValue(value, mySlices);
122  break;
123  case 5:
124  coerceValue(value, myVoxelplane);
125  break;
126 
127  }
128  }
129 
130  void getParmValue(exint idx, exint &value) const
131  { doGetParmValue(idx, value); }
132  void getParmValue(exint idx, fpreal &value) const
133  { doGetParmValue(idx, value); }
135  { doGetParmValue(idx, value); }
137  { doGetParmValue(idx, value); }
139  { doGetParmValue(idx, value); }
141  { doGetParmValue(idx, value); }
143  { doGetParmValue(idx, value); }
145  { doGetParmValue(idx, value); }
147  { doGetParmValue(idx, value); }
149  { doGetParmValue(idx, value); }
151  { doGetParmValue(idx, value); }
152 
153  template <typename T>
154  void
155  doSetParmValue(exint idx, const T &value)
156  {
157  switch (idx)
158  {
159  case 0:
160  coerceValue(myGroup, value);
161  break;
162  case 1:
163  coerceValue(myCenterDC, value);
164  break;
165  case 2:
166  coerceValue(myInvert, value);
167  break;
168  case 3:
169  coerceValue(myNormalize, value);
170  break;
171  case 4:
172  coerceValue(mySlices, value);
173  break;
174  case 5:
175  coerceValue(myVoxelplane, value);
176  break;
177 
178  }
179  }
180 
181  void setParmValue(exint idx, const exint &value)
182  { doSetParmValue(idx, value); }
183  void setParmValue(exint idx, const fpreal &value)
184  { doSetParmValue(idx, value); }
185  void setParmValue(exint idx, const UT_Vector2D &value)
186  { doSetParmValue(idx, value); }
187  void setParmValue(exint idx, const UT_Vector3D &value)
188  { doSetParmValue(idx, value); }
189  void setParmValue(exint idx, const UT_Vector4D &value)
190  { doSetParmValue(idx, value); }
191  void setParmValue(exint idx, const UT_Matrix2D &value)
192  { doSetParmValue(idx, value); }
193  void setParmValue(exint idx, const UT_Matrix3D &value)
194  { doSetParmValue(idx, value); }
195  void setParmValue(exint idx, const UT_Matrix4D &value)
196  { doSetParmValue(idx, value); }
198  { doSetParmValue(idx, value); }
200  { doSetParmValue(idx, value); }
202  { doSetParmValue(idx, value); }
203 
204  virtual exint getNumParms() const
205  {
206  return 6;
207  }
208 
209  virtual const char *getParmName(exint fieldnum) const
210  {
211  switch (fieldnum)
212  {
213  case 0:
214  return "group";
215  case 1:
216  return "centerdc";
217  case 2:
218  return "invert";
219  case 3:
220  return "normalize";
221  case 4:
222  return "slices";
223  case 5:
224  return "voxelplane";
225 
226  }
227  return 0;
228  }
229 
230  virtual ParmType getParmType(exint fieldnum) const
231  {
232  switch (fieldnum)
233  {
234  case 0:
235  return PARM_STRING;
236  case 1:
237  return PARM_INTEGER;
238  case 2:
239  return PARM_INTEGER;
240  case 3:
241  return PARM_INTEGER;
242  case 4:
243  return PARM_INTEGER;
244  case 5:
245  return PARM_INTEGER;
246 
247  }
248  return PARM_UNSUPPORTED;
249  }
250 
251  // Boiler plate to load individual types.
252  static void loadData(UT_IStream &is, int64 &v)
253  { is.bread(&v, 1); }
254  static void loadData(UT_IStream &is, bool &v)
255  { int64 iv; is.bread(&iv, 1); v = iv; }
256  static void loadData(UT_IStream &is, fpreal64 &v)
257  { is.bread<fpreal64>(&v, 1); }
258  static void loadData(UT_IStream &is, UT_Vector2D &v)
259  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
260  static void loadData(UT_IStream &is, UT_Vector3D &v)
261  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
262  is.bread<fpreal64>(&v.z(), 1); }
263  static void loadData(UT_IStream &is, UT_Vector4D &v)
264  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
265  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
266  static void loadData(UT_IStream &is, UT_Matrix2D &v)
267  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
268  static void loadData(UT_IStream &is, UT_Matrix3D &v)
269  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
270  static void loadData(UT_IStream &is, UT_Matrix4D &v)
271  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
272  static void loadData(UT_IStream &is, UT_Vector2I &v)
273  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
274  static void loadData(UT_IStream &is, UT_Vector3I &v)
275  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
276  is.bread<int64>(&v.z(), 1); }
277  static void loadData(UT_IStream &is, UT_Vector4I &v)
278  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
279  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
281  { is.bread(v); }
283  { UT_StringHolder rampdata;
284  loadData(is, rampdata);
285  if (rampdata.isstring())
286  {
287  v.reset(new UT_Ramp());
288  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
289  v->load(istr);
290  }
291  else v.reset();
292  }
295  loadData(is, data);
296  if (data.isstring())
297  {
298  // Find the data type.
299  char *colon = UT_StringWrap(data).findChar(':');
300  if (colon)
301  {
302  int typelen = colon - data.buffer();
304  type.strncpy(data.buffer(), typelen);
305  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
306 
307  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
308  }
309  }
310  else v.reset();
311  }
312 
313  static void saveData(std::ostream &os, int64 v)
314  { UTwrite(os, &v); }
315  static void saveData(std::ostream &os, bool v)
316  { int64 iv = v; UTwrite(os, &iv); }
317  static void saveData(std::ostream &os, fpreal64 v)
318  { UTwrite<fpreal64>(os, &v); }
319  static void saveData(std::ostream &os, UT_Vector2D v)
320  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
321  static void saveData(std::ostream &os, UT_Vector3D v)
322  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
323  UTwrite<fpreal64>(os, &v.z()); }
324  static void saveData(std::ostream &os, UT_Vector4D v)
325  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
326  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
327  static void saveData(std::ostream &os, UT_Matrix2D v)
329  static void saveData(std::ostream &os, UT_Matrix3D v)
331  static void saveData(std::ostream &os, UT_Matrix4D v)
333  static void saveData(std::ostream &os, UT_StringHolder s)
334  { UT_StringWrap(s).saveBinary(os); }
335  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
336  { UT_StringHolder result;
337  UT_OStringStream ostr;
338  if (s) s->save(ostr);
339  result = ostr.str();
340  saveData(os, result);
341  }
342  static void saveData(std::ostream &os, PRM_DataItemHandle s)
343  { UT_StringHolder result;
344  UT_OStringStream ostr;
345  if (s)
346  {
347  ostr << s->getDataTypeToken();
348  ostr << ":";
349  s->saveBinary(ostr);
350  }
351  result = ostr.str();
352  saveData(os, result);
353  }
354 
355 
356  void save(std::ostream &os) const
357  {
358  int32 v = version();
359  UTwrite(os, &v);
360  saveData(os, myGroup);
361  saveData(os, myCenterDC);
362  saveData(os, myInvert);
363  saveData(os, myNormalize);
364  saveData(os, mySlices);
365  saveData(os, myVoxelplane);
366 
367  }
368 
369  bool load(UT_IStream &is)
370  {
371  int32 v;
372  is.bread(&v, 1);
373  if (version() != v)
374  {
375  // Fail incompatible versions
376  return false;
377  }
378  loadData(is, myGroup);
379  loadData(is, myCenterDC);
380  loadData(is, myInvert);
381  loadData(is, myNormalize);
382  loadData(is, mySlices);
383  loadData(is, myVoxelplane);
384 
385  return true;
386  }
387 
388  const UT_StringHolder & getGroup() const { return myGroup; }
389  void setGroup(const UT_StringHolder & val) { myGroup = val; }
391  {
392  SOP_Node *thissop = cookparms.getNode();
393  if (!thissop) return getGroup();
394  UT_StringHolder result;
395  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
396  return result;
397  }
398  bool getCenterDC() const { return myCenterDC; }
399  void setCenterDC(bool val) { myCenterDC = val; }
400  bool opCenterDC(const SOP_NodeVerb::CookParms &cookparms) const
401  {
402  SOP_Node *thissop = cookparms.getNode();
403  if (!thissop) return getCenterDC();
404  bool result;
405  OP_Utils::evalOpParm(result, thissop, "centerdc", cookparms.getCookTime(), 0);
406  return result;
407  }
408  bool getInvert() const { return myInvert; }
409  void setInvert(bool val) { myInvert = val; }
410  bool opInvert(const SOP_NodeVerb::CookParms &cookparms) const
411  {
412  SOP_Node *thissop = cookparms.getNode();
413  if (!thissop) return getInvert();
414  bool result;
415  OP_Utils::evalOpParm(result, thissop, "invert", cookparms.getCookTime(), 0);
416  return result;
417  }
418  bool getNormalize() const { return myNormalize; }
419  void setNormalize(bool val) { myNormalize = val; }
420  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
421  {
422  SOP_Node *thissop = cookparms.getNode();
423  if (!thissop) return getNormalize();
424  bool result;
425  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
426  return result;
427  }
428  bool getSlices() const { return mySlices; }
429  void setSlices(bool val) { mySlices = val; }
430  bool opSlices(const SOP_NodeVerb::CookParms &cookparms) const
431  {
432  SOP_Node *thissop = cookparms.getNode();
433  if (!thissop) return getSlices();
434  bool result;
435  OP_Utils::evalOpParm(result, thissop, "slices", cookparms.getCookTime(), 0);
436  return result;
437  }
438  Voxelplane getVoxelplane() const { return Voxelplane(myVoxelplane); }
439  void setVoxelplane(Voxelplane val) { myVoxelplane = int64(val); }
441  {
442  SOP_Node *thissop = cookparms.getNode();
443  if (!thissop) return getVoxelplane();
444  int64 result;
445  OP_Utils::evalOpParm(result, thissop, "voxelplane", cookparms.getCookTime(), 0);
446  return Voxelplane(result);
447  }
448 
449 private:
450  UT_StringHolder myGroup;
451  bool myCenterDC;
452  bool myInvert;
453  bool myNormalize;
454  bool mySlices;
455  int64 myVoxelplane;
456 
457 };
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setParmValue(exint idx, const UT_Matrix2D &value)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:492
T & z(void)
Definition: UT_Vector4.h:372
void setParmValue(exint idx, const UT_Matrix3D &value)
void doGetParmValue(exint idx, T &value) const
static void loadData(UT_IStream &is, fpreal64 &v)
void getParmValue(exint idx, UT_Vector3D &value) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setCenterDC(bool val)
static void saveData(std::ostream &os, bool v)
exint bread(int32 *buffer, exint asize=1)
fpreal getTime() const
Definition: OP_Context.h:34
const GLdouble * v
Definition: glcorearb.h:836
virtual ParmType getParmType(exint fieldnum) const
void setParmValue(exint idx, const fpreal &value)
bool opInvert(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setParmValue(exint idx, const UT_Vector2D &value)
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
void getParmValue(exint idx, fpreal &value) const
T & x(void)
Definition: UT_Vector2.h:284
static void saveData(std::ostream &os, UT_Vector3D v)
void getParmValue(exint idx, UT_Vector4D &value) const
An output stream object that owns its own string buffer storage.
void getParmValue(exint idx, UT_Vector2D &value) const
static void saveData(std::ostream &os, fpreal64 v)
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
void doSetParmValue(exint idx, const T &value)
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:581
Voxelplane getVoxelplane() const
virtual void copyFrom(const SOP_NodeParms *src)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
virtual const char * getParmName(exint fieldnum) const
void save(std::ostream &os) const
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:585
long long int64
Definition: SYS_Types.h:100
bool getNormalize() const
static void saveData(std::ostream &os, UT_Vector2D v)
void getParmValue(exint idx, exint &value) const
void setParmValue(exint idx, const UT_Vector4D &value)
virtual exint getNumParms() const
static void saveData(std::ostream &os, UT_Matrix2D v)
Voxelplane opVoxelplane(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint length() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_Vector4D v)
int64 exint
Definition: SYS_Types.h:109
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:185
void getParmValue(exint idx, UT_Matrix2D &value) const
void getParmValue(exint idx, UT_Matrix3D &value) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool operator==(const SOP_VolumeFFTParms &src) const
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
GLboolean * data
Definition: glcorearb.h:130
static void loadData(UT_IStream &is, UT_Vector2D &v)
int int32
Definition: SYS_Types.h:28
T & y(void)
Definition: UT_Vector4.h:370
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
virtual void loadFromOpSubclass(const LoadParms &loadparms)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void setVoxelplane(Voxelplane val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:583
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:263
void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setInvert(bool val)
void setGroup(const UT_StringHolder &val)
void getParmValue(exint idx, PRM_DataItemHandle &value) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setSlices(bool val)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_StringHolder s)
GLuint GLfloat * val
Definition: glcorearb.h:1607
#define SOP_API
Definition: SOP_API.h:10
void setParmValue(exint idx, const exint &value)
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
void getParmValue(exint idx, UT_Matrix4D &value) const
const char * buffer() const
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:499
T & x(void)
Definition: UT_Vector4.h:368
static void loadData(UT_IStream &is, int64 &v)
T & y(void)
Definition: UT_Vector2.h:286
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
GLboolean r
Definition: glcorearb.h:1221
bool opSlices(const SOP_NodeVerb::CookParms &cookparms) const
T & w(void)
Definition: UT_Vector4.h:374
void getParmValue(exint idx, UT_StringHolder &value) const
bool opCenterDC(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_StringHolder &value)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, bool &v)
void setNormalize(bool val)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setParmValue(exint idx, const UT_Vector3D &value)
SYS_FORCE_INLINE bool isstring() const
void setParmValue(exint idx, const UT_Matrix4D &value)
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_StringHolder & getGroup() const
void setParmValue(exint idx, const PRM_DataItemHandle &value)
GLenum src
Definition: glcorearb.h:1792