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