HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeSplice.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 
23 {
24 public:
25  static int version() { return 1; }
26 
28  {
29  myGroup = ""_sh;
30  myDeleteorig = false;
31 
32  }
33 
34  explicit SOP_VolumeSpliceParms(const SOP_VolumeSpliceParms &) = default;
35 
37 
39  {
40  if (myGroup != src.myGroup) return false;
41  if (myDeleteorig != src.myDeleteorig) return false;
42 
43  return true;
44  }
46  {
47  return !operator==(src);
48  }
49 
50 
51 
52  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
53  {
54  if (true)
55  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
56  else myGroup = ""_sh;
57  if (true)
58  OP_Utils::evalOpParm(myDeleteorig, node, "deleteorig", time, 0);
59  else myDeleteorig = false;
60 
61  }
62 
63 
64  virtual void loadFromOpSubclass(const LoadParms &loadparms)
65  {
66  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
67  }
68 
69 
70  virtual void copyFrom(const SOP_NodeParms *src)
71  {
72  *this = *((const SOP_VolumeSpliceParms *)src);
73  }
74 
75  template <typename T>
76  void
77  doGetParmValue(exint idx, T &value) const
78  {
79  switch (idx)
80  {
81  case 0:
82  coerceValue(value, myGroup);
83  break;
84  case 1:
85  coerceValue(value, myDeleteorig);
86  break;
87 
88  }
89  }
90 
91  void getParmValue(exint idx, exint &value) const
92  { doGetParmValue(idx, value); }
93  void getParmValue(exint idx, fpreal &value) const
94  { doGetParmValue(idx, value); }
95  void getParmValue(exint idx, UT_Vector2D &value) const
96  { doGetParmValue(idx, value); }
97  void getParmValue(exint idx, UT_Vector3D &value) const
98  { doGetParmValue(idx, value); }
99  void getParmValue(exint idx, UT_Vector4D &value) const
100  { doGetParmValue(idx, value); }
102  { doGetParmValue(idx, value); }
104  { doGetParmValue(idx, value); }
106  { doGetParmValue(idx, value); }
108  { doGetParmValue(idx, value); }
110  { doGetParmValue(idx, value); }
112  { doGetParmValue(idx, value); }
113 
114  template <typename T>
115  void
116  doSetParmValue(exint idx, const T &value)
117  {
118  switch (idx)
119  {
120  case 0:
121  coerceValue(myGroup, value);
122  break;
123  case 1:
124  coerceValue(myDeleteorig, value);
125  break;
126 
127  }
128  }
129 
130  void setParmValue(exint idx, const exint &value)
131  { doSetParmValue(idx, value); }
132  void setParmValue(exint idx, const fpreal &value)
133  { doSetParmValue(idx, value); }
134  void setParmValue(exint idx, const UT_Vector2D &value)
135  { doSetParmValue(idx, value); }
136  void setParmValue(exint idx, const UT_Vector3D &value)
137  { doSetParmValue(idx, value); }
138  void setParmValue(exint idx, const UT_Vector4D &value)
139  { doSetParmValue(idx, value); }
140  void setParmValue(exint idx, const UT_Matrix2D &value)
141  { doSetParmValue(idx, value); }
142  void setParmValue(exint idx, const UT_Matrix3D &value)
143  { doSetParmValue(idx, value); }
144  void setParmValue(exint idx, const UT_Matrix4D &value)
145  { doSetParmValue(idx, value); }
147  { doSetParmValue(idx, value); }
149  { doSetParmValue(idx, value); }
151  { doSetParmValue(idx, value); }
152 
153  virtual exint getNumParms() const
154  {
155  return 2;
156  }
157 
158  virtual const char *getParmName(exint fieldnum) const
159  {
160  switch (fieldnum)
161  {
162  case 0:
163  return "group";
164  case 1:
165  return "deleteorig";
166 
167  }
168  return 0;
169  }
170 
171  virtual ParmType getParmType(exint fieldnum) const
172  {
173  switch (fieldnum)
174  {
175  case 0:
176  return PARM_STRING;
177  case 1:
178  return PARM_INTEGER;
179 
180  }
181  return PARM_UNSUPPORTED;
182  }
183 
184  // Boiler plate to load individual types.
185  static void loadData(UT_IStream &is, int64 &v)
186  { is.bread(&v, 1); }
187  static void loadData(UT_IStream &is, bool &v)
188  { int64 iv; is.bread(&iv, 1); v = iv; }
189  static void loadData(UT_IStream &is, fpreal64 &v)
190  { is.bread<fpreal64>(&v, 1); }
191  static void loadData(UT_IStream &is, UT_Vector2D &v)
192  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
193  static void loadData(UT_IStream &is, UT_Vector3D &v)
194  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
195  is.bread<fpreal64>(&v.z(), 1); }
196  static void loadData(UT_IStream &is, UT_Vector4D &v)
197  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
198  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
199  static void loadData(UT_IStream &is, UT_Matrix2D &v)
200  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
201  static void loadData(UT_IStream &is, UT_Matrix3D &v)
202  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
203  static void loadData(UT_IStream &is, UT_Matrix4D &v)
204  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
205  static void loadData(UT_IStream &is, UT_Vector2I &v)
206  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
207  static void loadData(UT_IStream &is, UT_Vector3I &v)
208  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
209  is.bread<int64>(&v.z(), 1); }
210  static void loadData(UT_IStream &is, UT_Vector4I &v)
211  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
212  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
214  { is.bread(v); }
216  { UT_StringHolder rampdata;
217  loadData(is, rampdata);
218  if (rampdata.isstring())
219  {
220  v.reset(new UT_Ramp());
221  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
222  v->load(istr);
223  }
224  else v.reset();
225  }
228  loadData(is, data);
229  if (data.isstring())
230  {
231  // Find the data type.
232  char *colon = UT_StringWrap(data).findChar(':');
233  if (colon)
234  {
235  int typelen = colon - data.buffer();
237  type.strncpy(data.buffer(), typelen);
238  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
239 
240  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
241  }
242  }
243  else v.reset();
244  }
245 
246  static void saveData(std::ostream &os, int64 v)
247  { UTwrite(os, &v); }
248  static void saveData(std::ostream &os, bool v)
249  { int64 iv = v; UTwrite(os, &iv); }
250  static void saveData(std::ostream &os, fpreal64 v)
251  { UTwrite<fpreal64>(os, &v); }
252  static void saveData(std::ostream &os, UT_Vector2D v)
253  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
254  static void saveData(std::ostream &os, UT_Vector3D v)
255  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
256  UTwrite<fpreal64>(os, &v.z()); }
257  static void saveData(std::ostream &os, UT_Vector4D v)
258  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
259  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
260  static void saveData(std::ostream &os, UT_Matrix2D v)
262  static void saveData(std::ostream &os, UT_Matrix3D v)
264  static void saveData(std::ostream &os, UT_Matrix4D v)
266  static void saveData(std::ostream &os, UT_StringHolder s)
267  { UT_StringWrap(s).saveBinary(os); }
268  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
269  { UT_StringHolder result;
270  UT_OStringStream ostr;
271  if (s) s->save(ostr);
272  result = ostr.str();
273  saveData(os, result);
274  }
275  static void saveData(std::ostream &os, PRM_DataItemHandle s)
276  { UT_StringHolder result;
277  UT_OStringStream ostr;
278  if (s)
279  {
280  ostr << s->getDataTypeToken();
281  ostr << ":";
282  s->saveBinary(ostr);
283  }
284  result = ostr.str();
285  saveData(os, result);
286  }
287 
288 
289  void save(std::ostream &os) const
290  {
291  int32 v = version();
292  UTwrite(os, &v);
293  saveData(os, myGroup);
294  saveData(os, myDeleteorig);
295 
296  }
297 
298  bool load(UT_IStream &is)
299  {
300  int32 v;
301  is.bread(&v, 1);
302  if (version() != v)
303  {
304  // Fail incompatible versions
305  return false;
306  }
307  loadData(is, myGroup);
308  loadData(is, myDeleteorig);
309 
310  return true;
311  }
312 
313  const UT_StringHolder & getGroup() const { return myGroup; }
314  void setGroup(const UT_StringHolder & val) { myGroup = val; }
316  {
317  SOP_Node *thissop = cookparms.getNode();
318  if (!thissop) return getGroup();
319  UT_StringHolder result;
320  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
321  return result;
322  }
323  bool getDeleteorig() const { return myDeleteorig; }
324  void setDeleteorig(bool val) { myDeleteorig = val; }
325  bool opDeleteorig(const SOP_NodeVerb::CookParms &cookparms) const
326  {
327  SOP_Node *thissop = cookparms.getNode();
328  if (!thissop) return getDeleteorig();
329  bool result;
330  OP_Utils::evalOpParm(result, thissop, "deleteorig", cookparms.getCookTime(), 0);
331  return result;
332  }
333 
334 private:
335  UT_StringHolder myGroup;
336  bool myDeleteorig;
337 
338 };
void setParmValue(exint idx, const UT_Vector2D &value)
static void loadData(UT_IStream &is, fpreal64 &v)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:494
T & z(void)
Definition: UT_Vector4.h:379
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const SOP_VolumeSpliceParms &src) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
void setGroup(const UT_StringHolder &val)
void setParmValue(exint idx, const fpreal &value)
fpreal getTime() const
Definition: OP_Context.h:60
const GLdouble * v
Definition: glcorearb.h:836
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, int64 v)
void getParmValue(exint idx, UT_Matrix3D &value) const
SYS_FORCE_INLINE const char * buffer() const
T & x(void)
Definition: UT_Vector2.h:285
void getParmValue(exint idx, PRM_DataItemHandle &value) const
An output stream object that owns its own string buffer storage.
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
virtual exint getNumParms() const
void setParmValue(exint idx, const UT_Matrix4D &value)
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:498
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void doSetParmValue(exint idx, const T &value)
void setParmValue(exint idx, const UT_Matrix2D &value)
virtual const char * getParmName(exint fieldnum) const
static void loadData(UT_IStream &is, bool &v)
bool operator!=(const SOP_VolumeSpliceParms &src) const
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
static void saveData(std::ostream &os, UT_StringHolder s)
virtual void loadFromOpSubclass(const LoadParms &loadparms)
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
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setParmValue(exint idx, const UT_Matrix3D &value)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool opDeleteorig(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector4D v)
exint length() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
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 loadData(UT_IStream &is, PRM_DataItemHandle &v)
int64 exint
Definition: SYS_Types.h:116
void getParmValue(exint idx, exint &value) const
void getParmValue(exint idx, UT_Matrix4D &value) const
void setParmValue(exint idx, const exint &value)
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:192
static void saveData(std::ostream &os, UT_Vector3D v)
void save(std::ostream &os) const
static void saveData(std::ostream &os, UT_Matrix4D v)
GLboolean * data
Definition: glcorearb.h:130
const UT_StringHolder & getGroup() const
int int32
Definition: SYS_Types.h:35
T & y(void)
Definition: UT_Vector4.h:377
static void loadData(UT_IStream &is, UT_Vector3D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void doGetParmValue(exint idx, T &value) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
static void saveData(std::ostream &os, UT_Matrix3D v)
void getParmValue(exint idx, UT_Vector4D &value) const
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
void getParmValue(exint idx, UT_Vector2D &value) const
virtual void copyFrom(const SOP_NodeParms *src)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void loadData(UT_IStream &is, UT_Matrix3D &v)
GLuint GLfloat * val
Definition: glcorearb.h:1607
#define SOP_API
Definition: SOP_API.h:10
void getParmValue(exint idx, UT_StringHolder &value) const
void getParmValue(exint idx, UT_Vector3D &value) const
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
bool load(UT_IStream &is)
T & x(void)
Definition: UT_Vector4.h:375
T & y(void)
Definition: UT_Vector2.h:287
void setParmValue(exint idx, const UT_Vector3D &value)
void getParmValue(exint idx, fpreal &value) const
GLboolean r
Definition: glcorearb.h:1221
T & w(void)
Definition: UT_Vector4.h:381
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
void setParmValue(exint idx, const PRM_DataItemHandle &value)
void getParmValue(exint idx, UT_Matrix2D &value) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
SYS_FORCE_INLINE bool isstring() const
virtual ParmType getParmType(exint fieldnum) const
void setParmValue(exint idx, const UT_StringHolder &value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setParmValue(exint idx, const UT_Vector4D &value)
GLenum src
Definition: glcorearb.h:1792