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 <SOP/SOP_GraphProxy.h>
8 
9 #include <OP/OP_Utils.h>
10 #include <PRM/PRM_Parm.h>
11 #include <UT/UT_IStream.h>
12 #include <UT/UT_NTStreamUtil.h>
13 #include <UT/UT_Ramp.h>
14 #include <UT/UT_SharedPtr.h>
15 #include <UT/UT_StringHolder.h>
16 #include <UT/UT_StringStream.h>
17 #include <UT/UT_VectorTypes.h>
18 #include <SYS/SYS_Types.h>
19 
20 using namespace UT::Literal;
21 
22 class DEP_MicroNode;
23 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myGroup = ""_sh;
32  myDeleteorig = true;
33 
34  }
35 
36  explicit SOP_VolumeSpliceParms(const SOP_VolumeSpliceParms &) = default;
37 
38  ~SOP_VolumeSpliceParms() override {}
39 
41  {
42  if (myGroup != src.myGroup) return false;
43  if (myDeleteorig != src.myDeleteorig) return false;
44 
45  return true;
46  }
48  {
49  return !operator==(src);
50  }
51 
52 
53 
54  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
55  {
56  myGroup = ""_sh;
57  if (true)
58  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
59  myDeleteorig = true;
60  if (true)
61  graph->evalOpParm(myDeleteorig, nodeidx, "deleteorig", time, 0);
62 
63  }
64 
65 
66  void loadFromOpSubclass(const LoadParms &loadparms) override
67  {
68  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
69  }
70 
71 
72  void copyFrom(const SOP_NodeParms *src) override
73  {
74  *this = *((const SOP_VolumeSpliceParms *)src);
75  }
76 
77  template <typename T>
78  void
79  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
80  {
81  if (idx.size() < 1)
82  return;
83  UT_ASSERT(idx.size() == instance.size()+1);
84  if (idx.size() != instance.size()+1)
85  return;
86  switch (idx[0])
87  {
88  case 0:
89  coerceValue(value, myGroup);
90  break;
91  case 1:
92  coerceValue(value, myDeleteorig);
93  break;
94 
95  }
96  }
97 
98  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
99  { doGetParmValue(idx, instance, value); }
100  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
101  { doGetParmValue(idx, instance, value); }
102  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
103  { doGetParmValue(idx, instance, value); }
104  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
105  { doGetParmValue(idx, instance, value); }
106  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
107  { doGetParmValue(idx, instance, value); }
108  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
109  { doGetParmValue(idx, instance, value); }
110  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
111  { doGetParmValue(idx, instance, value); }
112  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
113  { doGetParmValue(idx, instance, value); }
114  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
115  { doGetParmValue(idx, instance, value); }
116  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
117  { doGetParmValue(idx, instance, value); }
118  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
119  { doGetParmValue(idx, instance, value); }
120 
121  template <typename T>
122  void
123  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
124  {
125  if (idx.size() < 1)
126  return;
127  UT_ASSERT(idx.size() == instance.size()+1);
128  if (idx.size() != instance.size()+1)
129  return;
130  switch (idx[0])
131  {
132  case 0:
133  coerceValue(myGroup, value);
134  break;
135  case 1:
136  coerceValue(myDeleteorig, value);
137  break;
138 
139  }
140  }
141 
142  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
143  { doSetParmValue(idx, instance, value); }
144  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
145  { doSetParmValue(idx, instance, value); }
146  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
147  { doSetParmValue(idx, instance, value); }
148  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
149  { doSetParmValue(idx, instance, value); }
150  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
151  { doSetParmValue(idx, instance, value); }
152  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
153  { doSetParmValue(idx, instance, value); }
154  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
155  { doSetParmValue(idx, instance, value); }
156  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
157  { doSetParmValue(idx, instance, value); }
158  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
159  { doSetParmValue(idx, instance, value); }
160  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
161  { doSetParmValue(idx, instance, value); }
162  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
163  { doSetParmValue(idx, instance, value); }
164 
165  exint getNestNumParms(TempIndex idx) const override
166  {
167  if (idx.size() == 0)
168  return 2;
169  switch (idx[0])
170  {
171 
172  }
173  // Invalid
174  return 0;
175  }
176 
177  const char *getNestParmName(TempIndex fieldnum) const override
178  {
179  if (fieldnum.size() < 1)
180  return 0;
181  switch (fieldnum[0])
182  {
183  case 0:
184  return "group";
185  case 1:
186  return "deleteorig";
187 
188  }
189  return 0;
190  }
191 
192  ParmType getNestParmType(TempIndex fieldnum) const override
193  {
194  if (fieldnum.size() < 1)
195  return PARM_UNSUPPORTED;
196  switch (fieldnum[0])
197  {
198  case 0:
199  return PARM_STRING;
200  case 1:
201  return PARM_INTEGER;
202 
203  }
204  return PARM_UNSUPPORTED;
205  }
206 
207  // Boiler plate to load individual types.
208  static void loadData(UT_IStream &is, int64 &v)
209  { is.bread(&v, 1); }
210  static void loadData(UT_IStream &is, bool &v)
211  { int64 iv; is.bread(&iv, 1); v = iv; }
212  static void loadData(UT_IStream &is, fpreal64 &v)
213  { is.bread<fpreal64>(&v, 1); }
214  static void loadData(UT_IStream &is, UT_Vector2D &v)
215  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
216  static void loadData(UT_IStream &is, UT_Vector3D &v)
217  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
218  is.bread<fpreal64>(&v.z(), 1); }
219  static void loadData(UT_IStream &is, UT_Vector4D &v)
220  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
221  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
222  static void loadData(UT_IStream &is, UT_Matrix2D &v)
223  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
224  static void loadData(UT_IStream &is, UT_Matrix3D &v)
225  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
226  static void loadData(UT_IStream &is, UT_Matrix4D &v)
227  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
228  static void loadData(UT_IStream &is, UT_Vector2I &v)
229  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
230  static void loadData(UT_IStream &is, UT_Vector3I &v)
231  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
232  is.bread<int64>(&v.z(), 1); }
233  static void loadData(UT_IStream &is, UT_Vector4I &v)
234  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
235  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
237  { is.bread(v); }
239  { UT_StringHolder rampdata;
240  loadData(is, rampdata);
241  if (rampdata.isstring())
242  {
243  v.reset(new UT_Ramp());
244  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
245  v->load(istr);
246  }
247  else v.reset();
248  }
251  loadData(is, data);
252  if (data.isstring())
253  {
254  // Find the data type.
255  const char *colon = UT_StringWrap(data).findChar(':');
256  if (colon)
257  {
258  int typelen = colon - data.buffer();
260  type.strncpy(data.buffer(), typelen);
261  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
262 
263  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
264  }
265  }
266  else v.reset();
267  }
268 
269  static void saveData(std::ostream &os, int64 v)
270  { UTwrite(os, &v); }
271  static void saveData(std::ostream &os, bool v)
272  { int64 iv = v; UTwrite(os, &iv); }
273  static void saveData(std::ostream &os, fpreal64 v)
274  { UTwrite<fpreal64>(os, &v); }
275  static void saveData(std::ostream &os, UT_Vector2D v)
276  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
277  static void saveData(std::ostream &os, UT_Vector3D v)
278  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
279  UTwrite<fpreal64>(os, &v.z()); }
280  static void saveData(std::ostream &os, UT_Vector4D v)
281  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
282  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
283  static void saveData(std::ostream &os, UT_Matrix2D v)
285  static void saveData(std::ostream &os, UT_Matrix3D v)
287  static void saveData(std::ostream &os, UT_Matrix4D v)
289  static void saveData(std::ostream &os, UT_StringHolder s)
290  { UT_StringWrap(s).saveBinary(os); }
291  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
293  UT_OStringStream ostr;
294  if (s) s->save(ostr);
295  result = ostr.str();
296  saveData(os, result);
297  }
298  static void saveData(std::ostream &os, PRM_DataItemHandle s)
300  UT_OStringStream ostr;
301  if (s)
302  {
303  ostr << s->getDataTypeToken();
304  ostr << ":";
305  s->saveBinary(ostr);
306  }
307  result = ostr.str();
308  saveData(os, result);
309  }
310 
311 
312  void save(std::ostream &os) const
313  {
314  int32 v = version();
315  UTwrite(os, &v);
316  saveData(os, myGroup);
317  saveData(os, myDeleteorig);
318 
319  }
320 
321  bool load(UT_IStream &is)
322  {
323  int32 v;
324  is.bread(&v, 1);
325  if (version() != v)
326  {
327  // Fail incompatible versions
328  return false;
329  }
330  loadData(is, myGroup);
331  loadData(is, myDeleteorig);
332 
333  return true;
334  }
335 
336  const UT_StringHolder & getGroup() const { return myGroup; }
337  void setGroup(const UT_StringHolder & val) { myGroup = val; }
339  {
340  SOP_Node *thissop = cookparms.getNode();
341  if (!thissop) return getGroup();
343  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
344  return result;
345  }
346  bool getDeleteorig() const { return myDeleteorig; }
347  void setDeleteorig(bool val) { myDeleteorig = val; }
348  bool opDeleteorig(const SOP_NodeVerb::CookParms &cookparms) const
349  {
350  SOP_Node *thissop = cookparms.getNode();
351  if (!thissop) return getDeleteorig();
352  bool result;
353  OP_Utils::evalOpParm(result, thissop, "deleteorig", cookparms.getCookTime(), 0);
354  return result;
355  }
356 
357 private:
358  UT_StringHolder myGroup;
359  bool myDeleteorig;
360 
361 };
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLdouble s
Definition: glew.h:1390
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
static void loadData(UT_IStream &is, fpreal64 &v)
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator==(const SOP_VolumeSpliceParms &src) const
exint bread(int32 *buffer, exint asize=1)
void copyFrom(const SOP_NodeParms *src) override
GT_API const UT_StringHolder time
void setGroup(const UT_StringHolder &val)
fpreal getTime() const
Definition: OP_Context.h:60
GLuint const GLfloat * val
Definition: glew.h:2794
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, int64 v)
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const GLdouble * v
Definition: glew.h:1391
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
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, bool v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, bool &v)
bool operator!=(const SOP_VolumeSpliceParms &src) const
static void saveData(std::ostream &os, UT_StringHolder s)
double fpreal64
Definition: SYS_Types.h:201
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool opDeleteorig(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
exint length() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
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)
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void save(std::ostream &os) const
const GLfloat * c
Definition: glew.h:16296
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
long long int64
Definition: SYS_Types.h:116
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
const UT_StringHolder & getGroup() const
exint getNestNumParms(TempIndex idx) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
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 setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal64 fpreal
Definition: SYS_Types.h:277
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void loadData(UT_IStream &is, UT_Matrix3D &v)
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
#define SOP_API
Definition: SOP_API.h:10
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
bool load(UT_IStream &is)
GLuint64EXT * result
Definition: glew.h:14007
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
Definition: glew.h:1849
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override