HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  }
63  bool operator!=(const SOP_VolumeFFTParms &src) const
64  {
65  return !operator==(src);
66  }
68 
69 
70 
71  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
72  {
73  if (true)
74  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
75  else myGroup = ""_sh;
76  if (true)
77  OP_Utils::evalOpParm(myCenterDC, node, "centerdc", time, 0);
78  else myCenterDC = false;
79  if (true)
80  OP_Utils::evalOpParm(myInvert, node, "invert", time, 0);
81  else myInvert = false;
82  if (true)
83  OP_Utils::evalOpParm(myNormalize, node, "normalize", time, 0);
84  else myNormalize = false;
85  if (true)
86  OP_Utils::evalOpParm(mySlices, node, "slices", time, 0);
87  else mySlices = false;
88  if (true && ( (!(((getSlices()==0)))) ) )
89  OP_Utils::evalOpParm(myVoxelplane, node, "voxelplane", time, 0);
90  else myVoxelplane = 0;
91 
92  }
93 
94 
95  virtual void loadFromOpSubclass(const LoadParms &loadparms)
96  {
97  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
98  }
99 
100 
101  virtual void copyFrom(const SOP_NodeParms *src)
102  {
103  *this = *((const SOP_VolumeFFTParms *)src);
104  }
105 
106  template <typename T>
107  void
108  doGetParmValue(exint idx, T &value) const
109  {
110  switch (idx)
111  {
112  case 0:
113  coerceValue(value, myGroup);
114  break;
115  case 1:
116  coerceValue(value, myCenterDC);
117  break;
118  case 2:
119  coerceValue(value, myInvert);
120  break;
121  case 3:
122  coerceValue(value, myNormalize);
123  break;
124  case 4:
125  coerceValue(value, mySlices);
126  break;
127  case 5:
128  coerceValue(value, myVoxelplane);
129  break;
130 
131  }
132  }
133 
134  void getParmValue(exint idx, exint &value) const
135  { doGetParmValue(idx, value); }
136  void getParmValue(exint idx, fpreal &value) const
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); }
153  { doGetParmValue(idx, value); }
155  { doGetParmValue(idx, value); }
156 
157  template <typename T>
158  void
159  doSetParmValue(exint idx, const T &value)
160  {
161  switch (idx)
162  {
163  case 0:
164  coerceValue(myGroup, value);
165  break;
166  case 1:
167  coerceValue(myCenterDC, value);
168  break;
169  case 2:
170  coerceValue(myInvert, value);
171  break;
172  case 3:
173  coerceValue(myNormalize, value);
174  break;
175  case 4:
176  coerceValue(mySlices, value);
177  break;
178  case 5:
179  coerceValue(myVoxelplane, value);
180  break;
181 
182  }
183  }
184 
185  void setParmValue(exint idx, const exint &value)
186  { doSetParmValue(idx, value); }
187  void setParmValue(exint idx, const fpreal &value)
188  { doSetParmValue(idx, value); }
189  void setParmValue(exint idx, const UT_Vector2D &value)
190  { doSetParmValue(idx, value); }
191  void setParmValue(exint idx, const UT_Vector3D &value)
192  { doSetParmValue(idx, value); }
193  void setParmValue(exint idx, const UT_Vector4D &value)
194  { doSetParmValue(idx, value); }
195  void setParmValue(exint idx, const UT_Matrix2D &value)
196  { doSetParmValue(idx, value); }
197  void setParmValue(exint idx, const UT_Matrix3D &value)
198  { doSetParmValue(idx, value); }
199  void setParmValue(exint idx, const UT_Matrix4D &value)
200  { doSetParmValue(idx, value); }
202  { doSetParmValue(idx, value); }
204  { doSetParmValue(idx, value); }
206  { doSetParmValue(idx, value); }
207 
208  virtual exint getNumParms() const
209  {
210  return 6;
211  }
212 
213  virtual const char *getParmName(exint fieldnum) const
214  {
215  switch (fieldnum)
216  {
217  case 0:
218  return "group";
219  case 1:
220  return "centerdc";
221  case 2:
222  return "invert";
223  case 3:
224  return "normalize";
225  case 4:
226  return "slices";
227  case 5:
228  return "voxelplane";
229 
230  }
231  return 0;
232  }
233 
234  virtual ParmType getParmType(exint fieldnum) const
235  {
236  switch (fieldnum)
237  {
238  case 0:
239  return PARM_STRING;
240  case 1:
241  return PARM_INTEGER;
242  case 2:
243  return PARM_INTEGER;
244  case 3:
245  return PARM_INTEGER;
246  case 4:
247  return PARM_INTEGER;
248  case 5:
249  return PARM_INTEGER;
250 
251  }
252  return PARM_UNSUPPORTED;
253  }
254 
255  // Boiler plate to load individual types.
256  static void loadData(UT_IStream &is, int64 &v)
257  { is.bread(&v, 1); }
258  static void loadData(UT_IStream &is, bool &v)
259  { int64 iv; is.bread(&iv, 1); v = iv; }
260  static void loadData(UT_IStream &is, fpreal64 &v)
261  { is.bread<fpreal64>(&v, 1); }
262  static void loadData(UT_IStream &is, UT_Vector2D &v)
263  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
264  static void loadData(UT_IStream &is, UT_Vector3D &v)
265  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
266  is.bread<fpreal64>(&v.z(), 1); }
267  static void loadData(UT_IStream &is, UT_Vector4D &v)
268  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
269  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
270  static void loadData(UT_IStream &is, UT_Matrix2D &v)
271  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
272  static void loadData(UT_IStream &is, UT_Matrix3D &v)
273  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
274  static void loadData(UT_IStream &is, UT_Matrix4D &v)
275  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
276  static void loadData(UT_IStream &is, UT_Vector2I &v)
277  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
278  static void loadData(UT_IStream &is, UT_Vector3I &v)
279  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
280  is.bread<int64>(&v.z(), 1); }
281  static void loadData(UT_IStream &is, UT_Vector4I &v)
282  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
283  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
285  { is.bread(v); }
287  { UT_StringHolder rampdata;
288  loadData(is, rampdata);
289  if (rampdata.isstring())
290  {
291  v.reset(new UT_Ramp());
292  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
293  v->load(istr);
294  }
295  else v.reset();
296  }
299  loadData(is, data);
300  if (data.isstring())
301  {
302  // Find the data type.
303  char *colon = UT_StringWrap(data).findChar(':');
304  if (colon)
305  {
306  int typelen = colon - data.buffer();
308  type.strncpy(data.buffer(), typelen);
309  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
310 
311  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
312  }
313  }
314  else v.reset();
315  }
316 
317  static void saveData(std::ostream &os, int64 v)
318  { UTwrite(os, &v); }
319  static void saveData(std::ostream &os, bool v)
320  { int64 iv = v; UTwrite(os, &iv); }
321  static void saveData(std::ostream &os, fpreal64 v)
322  { UTwrite<fpreal64>(os, &v); }
323  static void saveData(std::ostream &os, UT_Vector2D v)
324  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
325  static void saveData(std::ostream &os, UT_Vector3D v)
326  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
327  UTwrite<fpreal64>(os, &v.z()); }
328  static void saveData(std::ostream &os, UT_Vector4D v)
329  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
330  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
331  static void saveData(std::ostream &os, UT_Matrix2D v)
333  static void saveData(std::ostream &os, UT_Matrix3D v)
335  static void saveData(std::ostream &os, UT_Matrix4D v)
337  static void saveData(std::ostream &os, UT_StringHolder s)
338  { UT_StringWrap(s).saveBinary(os); }
339  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
340  { UT_StringHolder result;
341  UT_OStringStream ostr;
342  if (s) s->save(ostr);
343  result = ostr.str();
344  saveData(os, result);
345  }
346  static void saveData(std::ostream &os, PRM_DataItemHandle s)
347  { UT_StringHolder result;
348  UT_OStringStream ostr;
349  if (s)
350  {
351  ostr << s->getDataTypeToken();
352  ostr << ":";
353  s->saveBinary(ostr);
354  }
355  result = ostr.str();
356  saveData(os, result);
357  }
358 
359 
360  void save(std::ostream &os) const
361  {
362  int32 v = version();
363  UTwrite(os, &v);
364  saveData(os, myGroup);
365  saveData(os, myCenterDC);
366  saveData(os, myInvert);
367  saveData(os, myNormalize);
368  saveData(os, mySlices);
369  saveData(os, myVoxelplane);
370 
371  }
372 
373  bool load(UT_IStream &is)
374  {
375  int32 v;
376  is.bread(&v, 1);
377  if (version() != v)
378  {
379  // Fail incompatible versions
380  return false;
381  }
382  loadData(is, myGroup);
383  loadData(is, myCenterDC);
384  loadData(is, myInvert);
385  loadData(is, myNormalize);
386  loadData(is, mySlices);
387  loadData(is, myVoxelplane);
388 
389  return true;
390  }
391 
392  const UT_StringHolder & getGroup() const { return myGroup; }
393  void setGroup(const UT_StringHolder & val) { myGroup = val; }
395  {
396  SOP_Node *thissop = cookparms.getNode();
397  if (!thissop) return getGroup();
398  UT_StringHolder result;
399  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
400  return result;
401  }
402  bool getCenterDC() const { return myCenterDC; }
403  void setCenterDC(bool val) { myCenterDC = val; }
404  bool opCenterDC(const SOP_NodeVerb::CookParms &cookparms) const
405  {
406  SOP_Node *thissop = cookparms.getNode();
407  if (!thissop) return getCenterDC();
408  bool result;
409  OP_Utils::evalOpParm(result, thissop, "centerdc", cookparms.getCookTime(), 0);
410  return result;
411  }
412  bool getInvert() const { return myInvert; }
413  void setInvert(bool val) { myInvert = val; }
414  bool opInvert(const SOP_NodeVerb::CookParms &cookparms) const
415  {
416  SOP_Node *thissop = cookparms.getNode();
417  if (!thissop) return getInvert();
418  bool result;
419  OP_Utils::evalOpParm(result, thissop, "invert", cookparms.getCookTime(), 0);
420  return result;
421  }
422  bool getNormalize() const { return myNormalize; }
423  void setNormalize(bool val) { myNormalize = val; }
424  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
425  {
426  SOP_Node *thissop = cookparms.getNode();
427  if (!thissop) return getNormalize();
428  bool result;
429  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
430  return result;
431  }
432  bool getSlices() const { return mySlices; }
433  void setSlices(bool val) { mySlices = val; }
434  bool opSlices(const SOP_NodeVerb::CookParms &cookparms) const
435  {
436  SOP_Node *thissop = cookparms.getNode();
437  if (!thissop) return getSlices();
438  bool result;
439  OP_Utils::evalOpParm(result, thissop, "slices", cookparms.getCookTime(), 0);
440  return result;
441  }
442  Voxelplane getVoxelplane() const { return Voxelplane(myVoxelplane); }
443  void setVoxelplane(Voxelplane val) { myVoxelplane = int64(val); }
445  {
446  SOP_Node *thissop = cookparms.getNode();
447  if (!thissop) return getVoxelplane();
448  int64 result;
449  OP_Utils::evalOpParm(result, thissop, "voxelplane", cookparms.getCookTime(), 0);
450  return Voxelplane(result);
451  }
452 
453 private:
454  UT_StringHolder myGroup;
455  bool myCenterDC;
456  bool myInvert;
457  bool myNormalize;
458  bool mySlices;
459  int64 myVoxelplane;
460 
461 };
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:494
T & z(void)
Definition: UT_Vector4.h:379
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)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
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
SYS_FORCE_INLINE const char * buffer() const
T & x(void)
Definition: UT_Vector2.h:285
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:498
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:502
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
long long int64
Definition: SYS_Types.h:107
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
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
static void saveData(std::ostream &os, UT_Vector4D v)
int64 exint
Definition: SYS_Types.h:116
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:192
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:35
T & y(void)
Definition: UT_Vector4.h:377
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)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:500
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
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
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
T & x(void)
Definition: UT_Vector4.h:375
static void loadData(UT_IStream &is, int64 &v)
T & y(void)
Definition: UT_Vector2.h:287
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:381
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)
bool operator!=(const SOP_VolumeFFTParms &src) const
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
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)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
const UT_StringHolder & getGroup() const
void setParmValue(exint idx, const PRM_DataItemHandle &value)
GLenum src
Definition: glcorearb.h:1792