32 myFontFile =
"Helvetica Bold"_UTsh;
33 myText =
"Frame: $F"_UTsh;
36 myUseDescender =
false;
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;
89 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
90 myFontFile =
"Helvetica Bold"_UTsh;
92 graph->
evalOpParm(myFontFile, nodeidx,
"file", time, 0);
93 myText =
"Frame: $F"_UTsh;
95 graph->
evalOpParm(myText, nodeidx,
"text", time, 0);
98 graph->
evalOpParm(myHAlign, nodeidx,
"halign", time, 0);
101 graph->
evalOpParm(myVAlign, nodeidx,
"valign", time, 0);
102 myUseDescender =
false;
104 graph->
evalOpParm(myUseDescender, nodeidx,
"use_descender", time, 0);
107 graph->
evalOpParm(myTranslate, nodeidx,
"t", time, 0);
110 graph->
evalOpParm(myRotate, nodeidx,
"r", time, 0);
113 graph->
evalOpParm(myScale, nodeidx,
"s", time, 0);
116 graph->
evalOpParm(myFontSize, nodeidx,
"fontsize", time, 0);
119 graph->
evalOpParm(myTracking, nodeidx,
"tracking", time, 0);
122 graph->
evalOpParm(myAutoKern, nodeidx,
"autokern", time, 0);
125 graph->
evalOpParm(myOblique, nodeidx,
"oblique", time, 0);
128 graph->
evalOpParm(myLOD, nodeidx,
"lod", time, 0);
131 graph->
evalOpParm(myHole, nodeidx,
"hole", time, 0);
134 graph->
evalOpParm(myAddAttrib, nodeidx,
"addattrib", time, 0);
150 template <
typename T>
157 if (idx.
size() != instance.
size()+1)
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 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 template <
typename T>
252 if (idx.
size() != instance.
size()+1)
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); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
345 if (fieldnum.
size() < 1)
360 return "use_descender";
388 if (fieldnum.
size() < 1)
389 return PARM_UNSUPPORTED;
462 loadData(is, rampdata);
480 int typelen = colon - data.
buffer();
494 {
int64 iv =
v; UTwrite(os, &iv); }
496 { UTwrite<fpreal64>(os, &
v); }
498 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
500 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
501 UTwrite<fpreal64>(os, &v.
z()); }
503 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
504 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
516 if (s) s->save(ostr);
518 saveData(os, result);
525 ostr << s->getDataTypeToken();
530 saveData(os, result);
534 void save(std::ostream &os)
const
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);
552 saveData(os, myHole);
553 saveData(os, myAddAttrib);
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);
580 loadData(is, myHole);
581 loadData(is, myAddAttrib);
591 if (!thissop)
return getType();
593 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
601 if (!thissop)
return getFontFile();
603 OP_Utils::evalOpParm(result, thissop,
"file", cookparms.
getCookTime(), 0);
611 if (!thissop)
return getText();
613 OP_Utils::evalOpParm(result, thissop,
"text", cookparms.
getCookTime(), 0);
621 if (!thissop)
return getHAlign();
623 OP_Utils::evalOpParm(result, thissop,
"halign", cookparms.
getCookTime(), 0);
631 if (!thissop)
return getVAlign();
633 OP_Utils::evalOpParm(result, thissop,
"valign", cookparms.
getCookTime(), 0);
641 if (!thissop)
return getUseDescender();
643 OP_Utils::evalOpParm(result, thissop,
"use_descender", cookparms.
getCookTime(), 0);
651 if (!thissop)
return getTranslate();
653 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
661 if (!thissop)
return getRotate();
663 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
673 OP_Utils::evalOpParm(result, thissop,
"s", cookparms.
getCookTime(), 0);
681 if (!thissop)
return getFontSize();
683 OP_Utils::evalOpParm(result, thissop,
"fontsize", cookparms.
getCookTime(), 0);
691 if (!thissop)
return getTracking();
693 OP_Utils::evalOpParm(result, thissop,
"tracking", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getAutoKern();
703 OP_Utils::evalOpParm(result, thissop,
"autokern", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getOblique();
713 OP_Utils::evalOpParm(result, thissop,
"oblique", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getLOD();
723 OP_Utils::evalOpParm(result, thissop,
"lod", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getHole();
733 OP_Utils::evalOpParm(result, thissop,
"hole", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getAddAttrib();
743 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
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
constexpr SYS_FORCE_INLINE T & y() noexcept
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
constexpr SYS_FORCE_INLINE T & z() noexcept
bool getUseDescender() const
SYS_FORCE_INLINE const char * buffer() 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)
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
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)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
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 copyFrom(const OP_NodeParms *src) override
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.
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setHAlign(int64 val)
const OP_GraphProxy * graph() const
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
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.
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
static void loadData(UT_IStream &is, int64 &v)
DEP_MicroNode * depnode() const
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)
constexpr SYS_FORCE_INLINE T & w() noexcept
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
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
constexpr SYS_FORCE_INLINE T & y() noexcept
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
fpreal64 getFontSize() const
constexpr SYS_FORCE_INLINE T & y() noexcept
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
constexpr SYS_FORCE_INLINE T & x() noexcept
void setAutoKern(bool val)