HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_FontParms.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_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myType = 2;
32  myFontFile = "Helvetica Bold"_UTsh;
33  myText = "Frame: $F"_UTsh;
34  myHAlign = 1;
35  myVAlign = 2;
36  myUseDescender = false;
37  myTranslate = 0;
38  myRotate = 0;
39  myScale = 1;
40  myFontSize = 1;
41  myTracking = 0;
42  myAutoKern = true;
43  myOblique = 0;
44  myLOD = 1;
45  myHole = true;
46  myAddAttrib = false;
47 
48  }
49 
50  explicit SOP_FontParms(const SOP_FontParms &) = default;
51  SOP_FontParms &operator=(const SOP_FontParms &) = default;
52  SOP_FontParms(SOP_FontParms &&) noexcept = default;
53  SOP_FontParms &operator=(SOP_FontParms &&) noexcept = default;
54 
55  ~SOP_FontParms() override {}
56 
57  bool operator==(const SOP_FontParms &src) const
58  {
59  if (myType != src.myType) return false;
60  if (myFontFile != src.myFontFile) return false;
61  if (myText != src.myText) return false;
62  if (myHAlign != src.myHAlign) return false;
63  if (myVAlign != src.myVAlign) return false;
64  if (myUseDescender != src.myUseDescender) return false;
65  if (myTranslate != src.myTranslate) return false;
66  if (myRotate != src.myRotate) return false;
67  if (myScale != src.myScale) return false;
68  if (myFontSize != src.myFontSize) return false;
69  if (myTracking != src.myTracking) return false;
70  if (myAutoKern != src.myAutoKern) return false;
71  if (myOblique != src.myOblique) return false;
72  if (myLOD != src.myLOD) return false;
73  if (myHole != src.myHole) return false;
74  if (myAddAttrib != src.myAddAttrib) return false;
75 
76  return true;
77  }
78  bool operator!=(const SOP_FontParms &src) const
79  {
80  return !operator==(src);
81  }
82 
83 
84 
85  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
86  {
87  myType = 2;
88  if (true)
89  graph->evalOpParm(myType, nodeidx, "type", time, 0);
90  myFontFile = "Helvetica Bold"_UTsh;
91  if (true)
92  graph->evalOpParm(myFontFile, nodeidx, "file", time, 0);
93  myText = "Frame: $F"_UTsh;
94  if (true)
95  graph->evalOpParm(myText, nodeidx, "text", time, 0);
96  myHAlign = 1;
97  if (true)
98  graph->evalOpParm(myHAlign, nodeidx, "halign", time, 0);
99  myVAlign = 2;
100  if (true)
101  graph->evalOpParm(myVAlign, nodeidx, "valign", time, 0);
102  myUseDescender = false;
103  if (true)
104  graph->evalOpParm(myUseDescender, nodeidx, "use_descender", time, 0);
105  myTranslate = 0;
106  if (true)
107  graph->evalOpParm(myTranslate, nodeidx, "t", time, 0);
108  myRotate = 0;
109  if (true)
110  graph->evalOpParm(myRotate, nodeidx, "r", time, 0);
111  myScale = 1;
112  if (true)
113  graph->evalOpParm(myScale, nodeidx, "s", time, 0);
114  myFontSize = 1;
115  if (true)
116  graph->evalOpParm(myFontSize, nodeidx, "fontsize", time, 0);
117  myTracking = 0;
118  if (true)
119  graph->evalOpParm(myTracking, nodeidx, "tracking", time, 0);
120  myAutoKern = true;
121  if (true)
122  graph->evalOpParm(myAutoKern, nodeidx, "autokern", time, 0);
123  myOblique = 0;
124  if (true)
125  graph->evalOpParm(myOblique, nodeidx, "oblique", time, 0);
126  myLOD = 1;
127  if (true)
128  graph->evalOpParm(myLOD, nodeidx, "lod", time, 0);
129  myHole = true;
130  if (true)
131  graph->evalOpParm(myHole, nodeidx, "hole", time, 0);
132  myAddAttrib = false;
133  if (true)
134  graph->evalOpParm(myAddAttrib, nodeidx, "addattrib", time, 0);
135 
136  }
137 
138 
139  void loadFromOpSubclass(const LoadParms &loadparms) override
140  {
141  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
142  }
143 
144 
145  void copyFrom(const OP_NodeParms *src) override
146  {
147  *this = *((const SOP_FontParms *)src);
148  }
149 
150  template <typename T>
151  void
152  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
153  {
154  if (idx.size() < 1)
155  return;
156  UT_ASSERT(idx.size() == instance.size()+1);
157  if (idx.size() != instance.size()+1)
158  return;
159  switch (idx[0])
160  {
161  case 0:
162  coerceValue(value, myType);
163  break;
164  case 1:
165  coerceValue(value, myFontFile);
166  break;
167  case 2:
168  coerceValue(value, myText);
169  break;
170  case 3:
171  coerceValue(value, myHAlign);
172  break;
173  case 4:
174  coerceValue(value, myVAlign);
175  break;
176  case 5:
177  coerceValue(value, myUseDescender);
178  break;
179  case 6:
180  coerceValue(value, myTranslate);
181  break;
182  case 7:
183  coerceValue(value, myRotate);
184  break;
185  case 8:
186  coerceValue(value, myScale);
187  break;
188  case 9:
189  coerceValue(value, myFontSize);
190  break;
191  case 10:
192  coerceValue(value, myTracking);
193  break;
194  case 11:
195  coerceValue(value, myAutoKern);
196  break;
197  case 12:
198  coerceValue(value, myOblique);
199  break;
200  case 13:
201  coerceValue(value, myLOD);
202  break;
203  case 14:
204  coerceValue(value, myHole);
205  break;
206  case 15:
207  coerceValue(value, myAddAttrib);
208  break;
209 
210  }
211  }
212 
213  bool isParmColorRamp(exint idx) const override
214  {
215  switch (idx)
216  {
217 
218  }
219  return false;
220  }
221 
222  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
223  { doGetParmValue(idx, instance, value); }
224  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
225  { doGetParmValue(idx, instance, value); }
226  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
227  { doGetParmValue(idx, instance, value); }
228  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
229  { doGetParmValue(idx, instance, value); }
230  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
231  { doGetParmValue(idx, instance, value); }
232  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
233  { doGetParmValue(idx, instance, value); }
234  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
235  { doGetParmValue(idx, instance, value); }
236  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
237  { doGetParmValue(idx, instance, value); }
238  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
239  { doGetParmValue(idx, instance, value); }
240  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
241  { doGetParmValue(idx, instance, value); }
242  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
243  { doGetParmValue(idx, instance, value); }
244 
245  template <typename T>
246  void
247  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
248  {
249  if (idx.size() < 1)
250  return;
251  UT_ASSERT(idx.size() == instance.size()+1);
252  if (idx.size() != instance.size()+1)
253  return;
254  switch (idx[0])
255  {
256  case 0:
257  coerceValue(myType, ( ( value ) ));
258  break;
259  case 1:
260  coerceValue(myFontFile, ( ( value ) ));
261  break;
262  case 2:
263  coerceValue(myText, ( ( value ) ));
264  break;
265  case 3:
266  coerceValue(myHAlign, ( ( value ) ));
267  break;
268  case 4:
269  coerceValue(myVAlign, ( ( value ) ));
270  break;
271  case 5:
272  coerceValue(myUseDescender, ( ( value ) ));
273  break;
274  case 6:
275  coerceValue(myTranslate, ( ( value ) ));
276  break;
277  case 7:
278  coerceValue(myRotate, ( ( value ) ));
279  break;
280  case 8:
281  coerceValue(myScale, ( ( value ) ));
282  break;
283  case 9:
284  coerceValue(myFontSize, ( ( value ) ));
285  break;
286  case 10:
287  coerceValue(myTracking, ( ( value ) ));
288  break;
289  case 11:
290  coerceValue(myAutoKern, ( ( value ) ));
291  break;
292  case 12:
293  coerceValue(myOblique, ( ( value ) ));
294  break;
295  case 13:
296  coerceValue(myLOD, ( ( value ) ));
297  break;
298  case 14:
299  coerceValue(myHole, ( ( value ) ));
300  break;
301  case 15:
302  coerceValue(myAddAttrib, ( ( value ) ));
303  break;
304 
305  }
306  }
307 
308  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
309  { doSetParmValue(idx, instance, value); }
310  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
311  { doSetParmValue(idx, instance, value); }
312  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
313  { doSetParmValue(idx, instance, value); }
314  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
315  { doSetParmValue(idx, instance, value); }
316  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
317  { doSetParmValue(idx, instance, value); }
318  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
319  { doSetParmValue(idx, instance, value); }
320  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
321  { doSetParmValue(idx, instance, value); }
322  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
323  { doSetParmValue(idx, instance, value); }
324  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
325  { doSetParmValue(idx, instance, value); }
326  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
329  { doSetParmValue(idx, instance, value); }
330 
331  exint getNestNumParms(TempIndex idx) const override
332  {
333  if (idx.size() == 0)
334  return 16;
335  switch (idx[0])
336  {
337 
338  }
339  // Invalid
340  return 0;
341  }
342 
343  const char *getNestParmName(TempIndex fieldnum) const override
344  {
345  if (fieldnum.size() < 1)
346  return 0;
347  switch (fieldnum[0])
348  {
349  case 0:
350  return "type";
351  case 1:
352  return "file";
353  case 2:
354  return "text";
355  case 3:
356  return "halign";
357  case 4:
358  return "valign";
359  case 5:
360  return "use_descender";
361  case 6:
362  return "t";
363  case 7:
364  return "r";
365  case 8:
366  return "s";
367  case 9:
368  return "fontsize";
369  case 10:
370  return "tracking";
371  case 11:
372  return "autokern";
373  case 12:
374  return "oblique";
375  case 13:
376  return "lod";
377  case 14:
378  return "hole";
379  case 15:
380  return "addattrib";
381 
382  }
383  return 0;
384  }
385 
386  ParmType getNestParmType(TempIndex fieldnum) const override
387  {
388  if (fieldnum.size() < 1)
389  return PARM_UNSUPPORTED;
390  switch (fieldnum[0])
391  {
392  case 0:
393  return PARM_INTEGER;
394  case 1:
395  return PARM_STRING;
396  case 2:
397  return PARM_STRING;
398  case 3:
399  return PARM_INTEGER;
400  case 4:
401  return PARM_INTEGER;
402  case 5:
403  return PARM_INTEGER;
404  case 6:
405  return PARM_VECTOR3;
406  case 7:
407  return PARM_VECTOR3;
408  case 8:
409  return PARM_VECTOR2;
410  case 9:
411  return PARM_FLOAT;
412  case 10:
413  return PARM_VECTOR2;
414  case 11:
415  return PARM_INTEGER;
416  case 12:
417  return PARM_FLOAT;
418  case 13:
419  return PARM_FLOAT;
420  case 14:
421  return PARM_INTEGER;
422  case 15:
423  return PARM_INTEGER;
424 
425  }
426  return PARM_UNSUPPORTED;
427  }
428 
429  // Boiler plate to load individual types.
430  static void loadData(UT_IStream &is, int64 &v)
431  { is.bread(&v, 1); }
432  static void loadData(UT_IStream &is, bool &v)
433  { int64 iv; is.bread(&iv, 1); v = iv; }
434  static void loadData(UT_IStream &is, fpreal64 &v)
435  { is.bread<fpreal64>(&v, 1); }
436  static void loadData(UT_IStream &is, UT_Vector2D &v)
437  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
438  static void loadData(UT_IStream &is, UT_Vector3D &v)
439  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
440  is.bread<fpreal64>(&v.z(), 1); }
441  static void loadData(UT_IStream &is, UT_Vector4D &v)
442  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
443  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
444  static void loadData(UT_IStream &is, UT_Matrix2D &v)
445  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
446  static void loadData(UT_IStream &is, UT_Matrix3D &v)
447  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
448  static void loadData(UT_IStream &is, UT_Matrix4D &v)
449  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
450  static void loadData(UT_IStream &is, UT_Vector2I &v)
451  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
452  static void loadData(UT_IStream &is, UT_Vector3I &v)
453  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
454  is.bread<int64>(&v.z(), 1); }
455  static void loadData(UT_IStream &is, UT_Vector4I &v)
456  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
457  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
459  { is.bread(v); }
461  { UT_StringHolder rampdata;
462  loadData(is, rampdata);
463  if (rampdata.isstring())
464  {
465  v.reset(new UT_Ramp());
466  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
467  v->load(istr);
468  }
469  else v.reset();
470  }
473  loadData(is, data);
474  if (data.isstring())
475  {
476  // Find the data type.
477  const char *colon = UT_StringWrap(data).findChar(':');
478  if (colon)
479  {
480  int typelen = colon - data.buffer();
482  type.strncpy(data.buffer(), typelen);
483  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
484 
485  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
486  }
487  }
488  else v.reset();
489  }
490 
491  static void saveData(std::ostream &os, int64 v)
492  { UTwrite(os, &v); }
493  static void saveData(std::ostream &os, bool v)
494  { int64 iv = v; UTwrite(os, &iv); }
495  static void saveData(std::ostream &os, fpreal64 v)
496  { UTwrite<fpreal64>(os, &v); }
497  static void saveData(std::ostream &os, UT_Vector2D v)
498  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
499  static void saveData(std::ostream &os, UT_Vector3D v)
500  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
501  UTwrite<fpreal64>(os, &v.z()); }
502  static void saveData(std::ostream &os, UT_Vector4D v)
503  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
504  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
505  static void saveData(std::ostream &os, UT_Matrix2D v)
507  static void saveData(std::ostream &os, UT_Matrix3D v)
509  static void saveData(std::ostream &os, UT_Matrix4D v)
511  static void saveData(std::ostream &os, UT_StringHolder s)
512  { UT_StringWrap(s).saveBinary(os); }
513  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
515  UT_OStringStream ostr;
516  if (s) s->save(ostr);
517  result = ostr.str();
518  saveData(os, result);
519  }
520  static void saveData(std::ostream &os, PRM_DataItemHandle s)
522  UT_OStringStream ostr;
523  if (s)
524  {
525  ostr << s->getDataTypeToken();
526  ostr << ":";
527  s->saveBinary(ostr);
528  }
529  result = ostr.str();
530  saveData(os, result);
531  }
532 
533 
534  void save(std::ostream &os) const
535  {
536  int32 v = version();
537  UTwrite(os, &v);
538  saveData(os, myType);
539  saveData(os, myFontFile);
540  saveData(os, myText);
541  saveData(os, myHAlign);
542  saveData(os, myVAlign);
543  saveData(os, myUseDescender);
544  saveData(os, myTranslate);
545  saveData(os, myRotate);
546  saveData(os, myScale);
547  saveData(os, myFontSize);
548  saveData(os, myTracking);
549  saveData(os, myAutoKern);
550  saveData(os, myOblique);
551  saveData(os, myLOD);
552  saveData(os, myHole);
553  saveData(os, myAddAttrib);
554 
555  }
556 
557  bool load(UT_IStream &is)
558  {
559  int32 v;
560  is.bread(&v, 1);
561  if (version() != v)
562  {
563  // Fail incompatible versions
564  return false;
565  }
566  loadData(is, myType);
567  loadData(is, myFontFile);
568  loadData(is, myText);
569  loadData(is, myHAlign);
570  loadData(is, myVAlign);
571  loadData(is, myUseDescender);
572  loadData(is, myTranslate);
573  loadData(is, myRotate);
574  loadData(is, myScale);
575  loadData(is, myFontSize);
576  loadData(is, myTracking);
577  loadData(is, myAutoKern);
578  loadData(is, myOblique);
579  loadData(is, myLOD);
580  loadData(is, myHole);
581  loadData(is, myAddAttrib);
582 
583  return true;
584  }
585 
586  int64 getType() const { return myType; }
587  void setType(int64 val) { myType = val; }
588  int64 opType(const SOP_NodeVerb::CookParms &cookparms) const
589  {
590  SOP_Node *thissop = cookparms.getNode();
591  if (!thissop) return getType();
592  int64 result;
593  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
594  return result;
595  }
596  const UT_StringHolder & getFontFile() const { return myFontFile; }
597  void setFontFile(const UT_StringHolder & val) { myFontFile = val; }
599  {
600  SOP_Node *thissop = cookparms.getNode();
601  if (!thissop) return getFontFile();
603  OP_Utils::evalOpParm(result, thissop, "file", cookparms.getCookTime(), 0);
604  return result;
605  }
606  const UT_StringHolder & getText() const { return myText; }
607  void setText(const UT_StringHolder & val) { myText = val; }
609  {
610  SOP_Node *thissop = cookparms.getNode();
611  if (!thissop) return getText();
613  OP_Utils::evalOpParm(result, thissop, "text", cookparms.getCookTime(), 0);
614  return result;
615  }
616  int64 getHAlign() const { return myHAlign; }
617  void setHAlign(int64 val) { myHAlign = val; }
618  int64 opHAlign(const SOP_NodeVerb::CookParms &cookparms) const
619  {
620  SOP_Node *thissop = cookparms.getNode();
621  if (!thissop) return getHAlign();
622  int64 result;
623  OP_Utils::evalOpParm(result, thissop, "halign", cookparms.getCookTime(), 0);
624  return result;
625  }
626  int64 getVAlign() const { return myVAlign; }
627  void setVAlign(int64 val) { myVAlign = val; }
628  int64 opVAlign(const SOP_NodeVerb::CookParms &cookparms) const
629  {
630  SOP_Node *thissop = cookparms.getNode();
631  if (!thissop) return getVAlign();
632  int64 result;
633  OP_Utils::evalOpParm(result, thissop, "valign", cookparms.getCookTime(), 0);
634  return result;
635  }
636  bool getUseDescender() const { return myUseDescender; }
637  void setUseDescender(bool val) { myUseDescender = val; }
638  bool opUseDescender(const SOP_NodeVerb::CookParms &cookparms) const
639  {
640  SOP_Node *thissop = cookparms.getNode();
641  if (!thissop) return getUseDescender();
642  bool result;
643  OP_Utils::evalOpParm(result, thissop, "use_descender", cookparms.getCookTime(), 0);
644  return result;
645  }
646  UT_Vector3D getTranslate() const { return myTranslate; }
647  void setTranslate(UT_Vector3D val) { myTranslate = val; }
649  {
650  SOP_Node *thissop = cookparms.getNode();
651  if (!thissop) return getTranslate();
653  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
654  return result;
655  }
656  UT_Vector3D getRotate() const { return myRotate; }
657  void setRotate(UT_Vector3D val) { myRotate = val; }
659  {
660  SOP_Node *thissop = cookparms.getNode();
661  if (!thissop) return getRotate();
663  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
664  return result;
665  }
666  UT_Vector2D getScale() const { return myScale; }
667  void setScale(UT_Vector2D val) { myScale = val; }
669  {
670  SOP_Node *thissop = cookparms.getNode();
671  if (!thissop) return getScale();
673  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
674  return result;
675  }
676  fpreal64 getFontSize() const { return myFontSize; }
677  void setFontSize(fpreal64 val) { myFontSize = val; }
679  {
680  SOP_Node *thissop = cookparms.getNode();
681  if (!thissop) return getFontSize();
683  OP_Utils::evalOpParm(result, thissop, "fontsize", cookparms.getCookTime(), 0);
684  return result;
685  }
686  UT_Vector2D getTracking() const { return myTracking; }
687  void setTracking(UT_Vector2D val) { myTracking = val; }
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getTracking();
693  OP_Utils::evalOpParm(result, thissop, "tracking", cookparms.getCookTime(), 0);
694  return result;
695  }
696  bool getAutoKern() const { return myAutoKern; }
697  void setAutoKern(bool val) { myAutoKern = val; }
698  bool opAutoKern(const SOP_NodeVerb::CookParms &cookparms) const
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getAutoKern();
702  bool result;
703  OP_Utils::evalOpParm(result, thissop, "autokern", cookparms.getCookTime(), 0);
704  return result;
705  }
706  fpreal64 getOblique() const { return myOblique; }
707  void setOblique(fpreal64 val) { myOblique = val; }
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getOblique();
713  OP_Utils::evalOpParm(result, thissop, "oblique", cookparms.getCookTime(), 0);
714  return result;
715  }
716  fpreal64 getLOD() const { return myLOD; }
717  void setLOD(fpreal64 val) { myLOD = val; }
718  fpreal64 opLOD(const SOP_NodeVerb::CookParms &cookparms) const
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getLOD();
723  OP_Utils::evalOpParm(result, thissop, "lod", cookparms.getCookTime(), 0);
724  return result;
725  }
726  bool getHole() const { return myHole; }
727  void setHole(bool val) { myHole = val; }
728  bool opHole(const SOP_NodeVerb::CookParms &cookparms) const
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getHole();
732  bool result;
733  OP_Utils::evalOpParm(result, thissop, "hole", cookparms.getCookTime(), 0);
734  return result;
735  }
736  bool getAddAttrib() const { return myAddAttrib; }
737  void setAddAttrib(bool val) { myAddAttrib = val; }
738  bool opAddAttrib(const SOP_NodeVerb::CookParms &cookparms) const
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getAddAttrib();
742  bool result;
743  OP_Utils::evalOpParm(result, thissop, "addattrib", cookparms.getCookTime(), 0);
744  return result;
745  }
746 
747 private:
748  int64 myType;
749  UT_StringHolder myFontFile;
750  UT_StringHolder myText;
751  int64 myHAlign;
752  int64 myVAlign;
753  bool myUseDescender;
754  UT_Vector3D myTranslate;
755  UT_Vector3D myRotate;
756  UT_Vector2D myScale;
757  fpreal64 myFontSize;
758  UT_Vector2D myTracking;
759  bool myAutoKern;
760  fpreal64 myOblique;
761  fpreal64 myLOD;
762  bool myHole;
763  bool myAddAttrib;
764 
765 };
static void saveData(std::ostream &os, fpreal64 v)
bool opAddAttrib(const SOP_NodeVerb::CookParms &cookparms) const
bool getAutoKern() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_Vector3D getTranslate() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool opUseDescender(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setUseDescender(bool val)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool operator==(const SOP_FontParms &src) const
int64 getHAlign() const
bool opAutoKern(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_Vector2D getScale() const
static void loadData(UT_IStream &is, fpreal64 &v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_Vector2D getTracking() const
void setAddAttrib(bool val)
exint getNestNumParms(TempIndex idx) const override
fpreal64 opLOD(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
bool getUseDescender() const
void setType(int64 val)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
int64 opVAlign(const SOP_NodeVerb::CookParms &cookparms) const
void setHole(bool val)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setTranslate(UT_Vector3D val)
static void loadData(UT_IStream &is, bool &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Vector3I &v)
**But if you need a result
Definition: thread.h:613
bool load(UT_IStream &is)
fpreal64 getLOD() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, int64 v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setFontFile(const UT_StringHolder &val)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setLOD(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const UT_StringHolder & getText() const
UT_Vector3D opRotate(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void copyFrom(const OP_NodeParms *src) override
static int version()
exint length() const
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_Vector2D opTracking(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setHAlign(int64 val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool getAddAttrib() const
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setFontSize(fpreal64 val)
void save(std::ostream &os) const
int64 opHAlign(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
UT_StringHolder opText(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opFontSize(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_StringHolder opFontFile(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
int64 getType() const
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, bool v)
const UT_StringHolder & getFontFile() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_Vector3D getRotate() const
int64 opType(const SOP_NodeVerb::CookParms &cookparms) const
void setTracking(UT_Vector2D val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
bool getHole() const
static void loadData(UT_IStream &is, int64 &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
UT_Vector3D opTranslate(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_FontParms &src) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
int64 getVAlign() const
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_Vector2D opScale(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
Definition: Mat.h:633
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
#define SOP_API
Definition: SOP_API.h:10
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setOblique(fpreal64 val)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_Vector3D v)
fpreal64 getOblique() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setVAlign(int64 val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setText(const UT_StringHolder &val)
bool opHole(const SOP_NodeVerb::CookParms &cookparms) const
GLboolean r
Definition: glcorearb.h:1222
fpreal64 opOblique(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
type
Definition: core.h:1059
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setScale(UT_Vector2D val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
fpreal64 getFontSize() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
const char * getNestParmName(TempIndex fieldnum) const override
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setRotate(UT_Vector3D val)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void setAutoKern(bool val)