20 using namespace UT::Literal;
32 myFontFile =
"Helvetica Bold"_sh;
33 myText =
"Frame: $F"_sh;
36 myUseDescender =
false;
56 if (myType != src.myType)
return false;
57 if (myFontFile != src.myFontFile)
return false;
58 if (myText != src.myText)
return false;
59 if (myHAlign != src.myHAlign)
return false;
60 if (myVAlign != src.myVAlign)
return false;
61 if (myUseDescender != src.myUseDescender)
return false;
62 if (myTranslate != src.myTranslate)
return false;
63 if (myRotate != src.myRotate)
return false;
64 if (myScale != src.myScale)
return false;
65 if (myFontSize != src.myFontSize)
return false;
66 if (myTracking != src.myTracking)
return false;
67 if (myAutoKern != src.myAutoKern)
return false;
68 if (myOblique != src.myOblique)
return false;
69 if (myLOD != src.myLOD)
return false;
70 if (myHole != src.myHole)
return false;
71 if (myAddAttrib != src.myAddAttrib)
return false;
86 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
87 myFontFile =
"Helvetica Bold"_sh;
89 graph->
evalOpParm(myFontFile, nodeidx,
"file", time, 0);
90 myText =
"Frame: $F"_sh;
92 graph->
evalOpParm(myText, nodeidx,
"text", time, 0);
95 graph->
evalOpParm(myHAlign, nodeidx,
"halign", time, 0);
98 graph->
evalOpParm(myVAlign, nodeidx,
"valign", time, 0);
99 myUseDescender =
false;
101 graph->
evalOpParm(myUseDescender, nodeidx,
"use_descender", time, 0);
104 graph->
evalOpParm(myTranslate, nodeidx,
"t", time, 0);
107 graph->
evalOpParm(myRotate, nodeidx,
"r", time, 0);
110 graph->
evalOpParm(myScale, nodeidx,
"s", time, 0);
113 graph->
evalOpParm(myFontSize, nodeidx,
"fontsize", time, 0);
116 graph->
evalOpParm(myTracking, nodeidx,
"tracking", time, 0);
119 graph->
evalOpParm(myAutoKern, nodeidx,
"autokern", time, 0);
122 graph->
evalOpParm(myOblique, nodeidx,
"oblique", time, 0);
125 graph->
evalOpParm(myLOD, nodeidx,
"lod", time, 0);
128 graph->
evalOpParm(myHole, nodeidx,
"hole", time, 0);
131 graph->
evalOpParm(myAddAttrib, nodeidx,
"addattrib", time, 0);
147 template <
typename T>
154 if (idx.
size() != instance.
size()+1)
159 coerceValue(value, myType);
162 coerceValue(value, myFontFile);
165 coerceValue(value, myText);
168 coerceValue(value, myHAlign);
171 coerceValue(value, myVAlign);
174 coerceValue(value, myUseDescender);
177 coerceValue(value, myTranslate);
180 coerceValue(value, myRotate);
183 coerceValue(value, myScale);
186 coerceValue(value, myFontSize);
189 coerceValue(value, myTracking);
192 coerceValue(value, myAutoKern);
195 coerceValue(value, myOblique);
198 coerceValue(value, myLOD);
201 coerceValue(value, myHole);
204 coerceValue(value, myAddAttrib);
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 template <
typename T>
240 if (idx.
size() != instance.
size()+1)
245 coerceValue(myType, value);
248 coerceValue(myFontFile, value);
251 coerceValue(myText, value);
254 coerceValue(myHAlign, value);
257 coerceValue(myVAlign, value);
260 coerceValue(myUseDescender, value);
263 coerceValue(myTranslate, value);
266 coerceValue(myRotate, value);
269 coerceValue(myScale, value);
272 coerceValue(myFontSize, value);
275 coerceValue(myTracking, value);
278 coerceValue(myAutoKern, value);
281 coerceValue(myOblique, value);
284 coerceValue(myLOD, value);
287 coerceValue(myHole, value);
290 coerceValue(myAddAttrib, value);
297 { doSetParmValue(idx, instance, value); }
299 { doSetParmValue(idx, instance, value); }
301 { doSetParmValue(idx, instance, value); }
303 { doSetParmValue(idx, instance, value); }
305 { doSetParmValue(idx, instance, value); }
307 { doSetParmValue(idx, instance, value); }
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
333 if (fieldnum.
size() < 1)
348 return "use_descender";
376 if (fieldnum.
size() < 1)
377 return PARM_UNSUPPORTED;
414 return PARM_UNSUPPORTED;
450 loadData(is, rampdata);
468 int typelen = colon - data.
buffer();
482 {
int64 iv =
v; UTwrite(os, &iv); }
484 { UTwrite<fpreal64>(os, &
v); }
486 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
488 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
489 UTwrite<fpreal64>(os, &v.
z()); }
491 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
492 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
504 if (s) s->save(ostr);
506 saveData(os, result);
513 ostr << s->getDataTypeToken();
518 saveData(os, result);
522 void save(std::ostream &os)
const
526 saveData(os, myType);
527 saveData(os, myFontFile);
528 saveData(os, myText);
529 saveData(os, myHAlign);
530 saveData(os, myVAlign);
531 saveData(os, myUseDescender);
532 saveData(os, myTranslate);
533 saveData(os, myRotate);
534 saveData(os, myScale);
535 saveData(os, myFontSize);
536 saveData(os, myTracking);
537 saveData(os, myAutoKern);
538 saveData(os, myOblique);
540 saveData(os, myHole);
541 saveData(os, myAddAttrib);
554 loadData(is, myType);
555 loadData(is, myFontFile);
556 loadData(is, myText);
557 loadData(is, myHAlign);
558 loadData(is, myVAlign);
559 loadData(is, myUseDescender);
560 loadData(is, myTranslate);
561 loadData(is, myRotate);
562 loadData(is, myScale);
563 loadData(is, myFontSize);
564 loadData(is, myTracking);
565 loadData(is, myAutoKern);
566 loadData(is, myOblique);
568 loadData(is, myHole);
569 loadData(is, myAddAttrib);
579 if (!thissop)
return getType();
581 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
589 if (!thissop)
return getFontFile();
591 OP_Utils::evalOpParm(result, thissop,
"file", cookparms.
getCookTime(), 0);
599 if (!thissop)
return getText();
601 OP_Utils::evalOpParm(result, thissop,
"text", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getHAlign();
611 OP_Utils::evalOpParm(result, thissop,
"halign", cookparms.
getCookTime(), 0);
619 if (!thissop)
return getVAlign();
621 OP_Utils::evalOpParm(result, thissop,
"valign", cookparms.
getCookTime(), 0);
629 if (!thissop)
return getUseDescender();
631 OP_Utils::evalOpParm(result, thissop,
"use_descender", cookparms.
getCookTime(), 0);
639 if (!thissop)
return getTranslate();
641 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
649 if (!thissop)
return getRotate();
651 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
661 OP_Utils::evalOpParm(result, thissop,
"s", cookparms.
getCookTime(), 0);
669 if (!thissop)
return getFontSize();
671 OP_Utils::evalOpParm(result, thissop,
"fontsize", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getTracking();
681 OP_Utils::evalOpParm(result, thissop,
"tracking", cookparms.
getCookTime(), 0);
689 if (!thissop)
return getAutoKern();
691 OP_Utils::evalOpParm(result, thissop,
"autokern", cookparms.
getCookTime(), 0);
699 if (!thissop)
return getOblique();
701 OP_Utils::evalOpParm(result, thissop,
"oblique", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getLOD();
711 OP_Utils::evalOpParm(result, thissop,
"lod", cookparms.
getCookTime(), 0);
719 if (!thissop)
return getHole();
721 OP_Utils::evalOpParm(result, thissop,
"hole", cookparms.
getCookTime(), 0);
729 if (!thissop)
return getAddAttrib();
731 OP_Utils::evalOpParm(result, thissop,
"addattrib", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, fpreal64 v)
bool opAddAttrib(const SOP_NodeVerb::CookParms &cookparms) 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)
SOP_Node * getNode() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool operator==(const SOP_FontParms &src) const
void copyFrom(const SOP_NodeParms *src) override
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)
GT_API const UT_StringHolder time
UT_Vector2D getTracking() const
void setAddAttrib(bool val)
exint getNestNumParms(TempIndex idx) const override
GLuint const GLfloat * val
fpreal64 opLOD(const SOP_NodeVerb::CookParms &cookparms) const
bool getUseDescender() const
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
int64 opVAlign(const SOP_NodeVerb::CookParms &cookparms) const
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)
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, int64 v)
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)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
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 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.
GLint GLenum GLsizei GLint GLsizei const void * data
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setHAlign(int64 val)
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
~SOP_FontParms() override
UT_StringHolder opText(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opFontSize(const SOP_NodeVerb::CookParms &cookparms) const
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.
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
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 buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, int64 &v)
UT_Vector3D opTranslate(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_FontParms &src) const
Utility class for containing a color ramp.
static void saveData(std::ostream &os, UT_Vector2D v)
GLdouble GLdouble GLdouble r
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_Vector2D opScale(const SOP_NodeVerb::CookParms &cookparms) const
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.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setOblique(fpreal64 val)
fpreal getCookTime() const
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
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
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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
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
GLsizei const GLfloat * value
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
fpreal64 getFontSize() const
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)
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
void setAutoKern(bool val)