23 namespace SOP_ShapeDiffEnums
36 using namespace UT::Literal;
57 using namespace UT::Literal;
78 myOrientAttrib =
""_UTsh;
79 mySkelRootPath =
""_UTsh;
80 myBoneTransformPath =
""_UTsh;
82 myBlendAttrib =
""_UTsh;
85 myVAttribs =
"P"_UTsh;
88 myMaskAttrib =
""_UTsh;
102 if (myDiffType != src.myDiffType)
return false;
103 if (myOrientAttrib != src.myOrientAttrib)
return false;
104 if (mySkelRootPath != src.mySkelRootPath)
return false;
105 if (myBoneTransformPath != src.myBoneTransformPath)
return false;
106 if (mySkinType != src.mySkinType)
return false;
107 if (myBlendAttrib != src.myBlendAttrib)
return false;
108 if (myDoNormal != src.myDoNormal)
return false;
109 if (myDoVAttribs != src.myDoVAttribs)
return false;
110 if (myVAttribs != src.myVAttribs)
return false;
111 if (myDoQAttribs != src.myDoQAttribs)
return false;
112 if (myQAttribs != src.myQAttribs)
return false;
113 if (myMaskAttrib != src.myMaskAttrib)
return false;
114 if (myScaleMask != src.myScaleMask)
return false;
131 graph->
evalOpParm(myDiffType, nodeidx,
"difftype", time, 0);
132 myOrientAttrib =
""_UTsh;
133 if (
true && ( (
true&&!(((
int64(getDiffType())!=2)))) ) )
134 graph->
evalOpParm(myOrientAttrib, nodeidx,
"orientattrib", time, 0);
135 mySkelRootPath =
""_UTsh;
136 if (
true && ( (
true&&!(((
int64(getDiffType())==1))||((
int64(getDiffType())==2)))) ) )
137 graph->
evalOpParm(mySkelRootPath, nodeidx,
"skelrootpath", time, 0);
138 myBoneTransformPath =
""_UTsh;
139 if (
true && ( (
true&&!(((
int64(getDiffType())==1))||((
int64(getDiffType())==2)))) ) )
140 graph->
evalOpParm(myBoneTransformPath, nodeidx,
"bonetransformpath", time, 0);
142 if (
true && ( (
true&&!(((
int64(getDiffType())==1))||((
int64(getDiffType())==2)))) ) )
143 graph->
evalOpParm(mySkinType, nodeidx,
"skintype", time, 0);
144 myBlendAttrib =
""_UTsh;
145 if (
true && ( (
true&&!(((
int64(getSkinType())!=2))||((
int64(getDiffType())==1))||((
int64(getDiffType())==2)))) ) )
146 graph->
evalOpParm(myBlendAttrib, nodeidx,
"blendattrib", time, 0);
149 graph->
evalOpParm(myDoNormal, nodeidx,
"donormal", time, 0);
152 graph->
evalOpParm(myDoVAttribs, nodeidx,
"dovattribs", time, 0);
153 myVAttribs =
"P"_UTsh;
154 if (
true && ( (
true&&!(((getDoVAttribs()==0)))) ) )
155 graph->
evalOpParm(myVAttribs, nodeidx,
"vattribs", time, 0);
156 myDoQAttribs =
false;
158 graph->
evalOpParm(myDoQAttribs, nodeidx,
"doqattribs", time, 0);
159 myQAttribs =
""_UTsh;
160 if (
true && ( (
true&&!(((getDoQAttribs()==0)))) ) )
161 graph->
evalOpParm(myQAttribs, nodeidx,
"qattribs", time, 0);
162 myMaskAttrib =
""_UTsh;
164 graph->
evalOpParm(myMaskAttrib, nodeidx,
"maskattrib", time, 0);
166 if (
true && ( (
true&&!(((getMaskAttrib()==
"''")))) ) )
167 graph->
evalOpParm(myScaleMask, nodeidx,
"scalemask", time, 0);
183 template <
typename T>
190 if (idx.
size() != instance.
size()+1)
195 coerceValue(value, myDiffType);
198 coerceValue(value, myOrientAttrib);
201 coerceValue(value, mySkelRootPath);
204 coerceValue(value, myBoneTransformPath);
207 coerceValue(value, mySkinType);
210 coerceValue(value, myBlendAttrib);
213 coerceValue(value, myDoNormal);
216 coerceValue(value, myDoVAttribs);
219 coerceValue(value, myVAttribs);
222 coerceValue(value, myDoQAttribs);
225 coerceValue(value, myQAttribs);
228 coerceValue(value, myMaskAttrib);
231 coerceValue(value, myScaleMask);
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 { doGetParmValue(idx, instance, value); }
259 { doGetParmValue(idx, instance, value); }
261 { doGetParmValue(idx, instance, value); }
263 { doGetParmValue(idx, instance, value); }
265 { doGetParmValue(idx, instance, value); }
267 { doGetParmValue(idx, instance, value); }
269 template <
typename T>
276 if (idx.
size() != instance.
size()+1)
281 coerceValue(myDiffType, clampMinValue(0, clampMaxValue(3, value ) ));
284 coerceValue(myOrientAttrib, ( ( value ) ));
287 coerceValue(mySkelRootPath, ( ( value ) ));
290 coerceValue(myBoneTransformPath, ( ( value ) ));
293 coerceValue(mySkinType, clampMinValue(0, clampMaxValue(3, value ) ));
296 coerceValue(myBlendAttrib, ( ( value ) ));
299 coerceValue(myDoNormal, ( ( value ) ));
302 coerceValue(myDoVAttribs, ( ( value ) ));
305 coerceValue(myVAttribs, ( ( value ) ));
308 coerceValue(myDoQAttribs, ( ( value ) ));
311 coerceValue(myQAttribs, ( ( value ) ));
314 coerceValue(myMaskAttrib, ( ( value ) ));
317 coerceValue(myScaleMask, ( ( value ) ));
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
334 { doSetParmValue(idx, instance, value); }
336 { doSetParmValue(idx, instance, value); }
338 { doSetParmValue(idx, instance, value); }
340 { doSetParmValue(idx, instance, value); }
342 { doSetParmValue(idx, instance, value); }
344 { doSetParmValue(idx, instance, value); }
360 if (fieldnum.
size() < 1)
367 return "orientattrib";
369 return "skelrootpath";
371 return "bonetransformpath";
375 return "blendattrib";
397 if (fieldnum.
size() < 1)
398 return PARM_UNSUPPORTED;
429 return PARM_UNSUPPORTED;
465 loadData(is, rampdata);
483 int typelen = colon - data.
buffer();
497 {
int64 iv =
v; UTwrite(os, &iv); }
499 { UTwrite<fpreal64>(os, &
v); }
501 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
503 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
504 UTwrite<fpreal64>(os, &v.
z()); }
506 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
507 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
519 if (s) s->save(ostr);
521 saveData(os, result);
528 ostr << s->getDataTypeToken();
533 saveData(os, result);
537 void save(std::ostream &os)
const
541 saveData(os, myDiffType);
542 saveData(os, myOrientAttrib);
543 saveData(os, mySkelRootPath);
544 saveData(os, myBoneTransformPath);
545 saveData(os, mySkinType);
546 saveData(os, myBlendAttrib);
547 saveData(os, myDoNormal);
548 saveData(os, myDoVAttribs);
549 saveData(os, myVAttribs);
550 saveData(os, myDoQAttribs);
551 saveData(os, myQAttribs);
552 saveData(os, myMaskAttrib);
553 saveData(os, myScaleMask);
566 loadData(is, myDiffType);
567 loadData(is, myOrientAttrib);
568 loadData(is, mySkelRootPath);
569 loadData(is, myBoneTransformPath);
570 loadData(is, mySkinType);
571 loadData(is, myBlendAttrib);
572 loadData(is, myDoNormal);
573 loadData(is, myDoVAttribs);
574 loadData(is, myVAttribs);
575 loadData(is, myDoQAttribs);
576 loadData(is, myQAttribs);
577 loadData(is, myMaskAttrib);
578 loadData(is, myScaleMask);
588 if (!thissop)
return getDiffType();
590 OP_Utils::evalOpParm(result, thissop,
"difftype", cookparms.
getCookTime(), 0);
598 if (!thissop)
return getOrientAttrib();
600 OP_Utils::evalOpParm(result, thissop,
"orientattrib", cookparms.
getCookTime(), 0);
608 if (!thissop)
return getSkelRootPath();
610 OP_Utils::evalOpParm(result, thissop,
"skelrootpath", cookparms.
getCookTime(), 0);
618 if (!thissop)
return getBoneTransformPath();
620 OP_Utils::evalOpParm(result, thissop,
"bonetransformpath", cookparms.
getCookTime(), 0);
628 if (!thissop)
return getSkinType();
630 OP_Utils::evalOpParm(result, thissop,
"skintype", cookparms.
getCookTime(), 0);
638 if (!thissop)
return getBlendAttrib();
640 OP_Utils::evalOpParm(result, thissop,
"blendattrib", cookparms.
getCookTime(), 0);
648 if (!thissop)
return getDoNormal();
650 OP_Utils::evalOpParm(result, thissop,
"donormal", cookparms.
getCookTime(), 0);
658 if (!thissop)
return getDoVAttribs();
660 OP_Utils::evalOpParm(result, thissop,
"dovattribs", cookparms.
getCookTime(), 0);
668 if (!thissop)
return getVAttribs();
670 OP_Utils::evalOpParm(result, thissop,
"vattribs", cookparms.
getCookTime(), 0);
678 if (!thissop)
return getDoQAttribs();
680 OP_Utils::evalOpParm(result, thissop,
"doqattribs", cookparms.
getCookTime(), 0);
688 if (!thissop)
return getQAttribs();
690 OP_Utils::evalOpParm(result, thissop,
"qattribs", cookparms.
getCookTime(), 0);
698 if (!thissop)
return getMaskAttrib();
700 OP_Utils::evalOpParm(result, thissop,
"maskattrib", cookparms.
getCookTime(), 0);
708 if (!thissop)
return getScaleMask();
710 OP_Utils::evalOpParm(result, thissop,
"scalemask", cookparms.
getCookTime(), 0);
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(DiffType enum_value)
void setScaleMask(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, fpreal64 v)
ParmType getNestParmType(TempIndex fieldnum) const override
void setBoneTransformPath(const UT_StringHolder &val)
SOP_Node * getNode() const
bool getDoVAttribs() const
static void loadData(UT_IStream &is, bool &v)
void setQAttribs(const UT_StringHolder &val)
const UT_StringHolder & getBlendAttrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setOrientAttrib(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Vector2D v)
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const UT_StringHolder & getVAttribs() const
const UT_StringHolder & getBoneTransformPath() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
exint bread(int32 *buffer, exint asize=1)
static void saveData(std::ostream &os, UT_Vector4D v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opVAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void setSkelRootPath(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal64 opScaleMask(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opSkelRootPath(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setBlendAttrib(const UT_StringHolder &val)
SkinType getSkinType() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opDoQAttribs(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator!=(const SOP_ShapeDiffParms &src) const
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setDiffType(DiffType val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
exint getNestNumParms(TempIndex idx) const override
An output stream object that owns its own string buffer storage.
void setMaskAttrib(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
**But if you need a result
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder opBoneTransformPath(const SOP_NodeVerb::CookParms &cookparms) const
DiffType opDiffType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool operator==(const SOP_ShapeDiffParms &src) const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, int64 v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_StringHolder opQAttribs(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getSkelRootPath() const
const UT_StringHolder & getMaskAttrib() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_StringHolder opOrientAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setDoQAttribs(bool val)
const OP_GraphProxy * graph() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setDoNormal(bool val)
const UT_StringHolder & getOrientAttrib() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setVAttribs(const UT_StringHolder &val)
UT_StringHolder opMaskAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 getScaleMask() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool getDoQAttribs() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_StringHolder & getQAttribs() const
bool opDoVAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_StringHolder opBlendAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setSkinType(SkinType val)
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
DEP_MicroNode * depnode() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
DiffType getDiffType() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opDoNormal(const SOP_NodeVerb::CookParms &cookparms) const
SkinType opSkinType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setDoVAttribs(bool val)
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept