23 namespace SOP_CaptureAttribUnpackEnums
36 using namespace UT::Literal;
57 myAttrib =
"boneCapture"_UTsh;
59 mySecondaryPrefix =
"secondary"_UTsh;
60 myUnpackProperties =
true;
62 myDeleteCaptureAttributes =
true;
75 if (myClass != src.myClass)
return false;
76 if (myAttrib != src.myAttrib)
return false;
77 if (myPrefix != src.myPrefix)
return false;
78 if (mySecondaryPrefix != src.mySecondaryPrefix)
return false;
79 if (myUnpackProperties != src.myUnpackProperties)
return false;
80 if (myUnpackData != src.myUnpackData)
return false;
81 if (myDeleteCaptureAttributes != src.myDeleteCaptureAttributes)
return false;
97 graph->
evalOpParm(myClass, nodeidx,
"class", time, 0);
98 myAttrib =
"boneCapture"_UTsh;
100 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
103 graph->
evalOpParm(myPrefix, nodeidx,
"prefix", time, 0);
104 mySecondaryPrefix =
"secondary"_UTsh;
106 graph->
evalOpParm(mySecondaryPrefix, nodeidx,
"secondaryprefix", time, 0);
107 myUnpackProperties =
true;
109 graph->
evalOpParm(myUnpackProperties, nodeidx,
"unpackproperties", time, 0);
112 graph->
evalOpParm(myUnpackData, nodeidx,
"unpackdata", time, 0);
113 myDeleteCaptureAttributes =
true;
115 graph->
evalOpParm(myDeleteCaptureAttributes, nodeidx,
"deletecapture", time, 0);
131 template <
typename T>
138 if (idx.
size() != instance.
size()+1)
143 coerceValue(value, myClass);
146 coerceValue(value, myAttrib);
149 coerceValue(value, myPrefix);
152 coerceValue(value, mySecondaryPrefix);
155 coerceValue(value, myUnpackProperties);
158 coerceValue(value, myUnpackData);
161 coerceValue(value, myDeleteCaptureAttributes);
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 { doGetParmValue(idx, instance, value); }
183 { doGetParmValue(idx, instance, value); }
185 { doGetParmValue(idx, instance, value); }
187 { doGetParmValue(idx, instance, value); }
189 { doGetParmValue(idx, instance, value); }
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 template <
typename T>
206 if (idx.
size() != instance.
size()+1)
211 coerceValue(myClass, clampMinValue(0, clampMaxValue(3, value ) ));
214 coerceValue(myAttrib, ( ( value ) ));
217 coerceValue(myPrefix, ( ( value ) ));
220 coerceValue(mySecondaryPrefix, ( ( value ) ));
223 coerceValue(myUnpackProperties, ( ( value ) ));
226 coerceValue(myUnpackData, ( ( value ) ));
229 coerceValue(myDeleteCaptureAttributes, ( ( value ) ));
236 { doSetParmValue(idx, instance, value); }
238 { doSetParmValue(idx, instance, value); }
240 { doSetParmValue(idx, instance, value); }
242 { doSetParmValue(idx, instance, value); }
244 { doSetParmValue(idx, instance, value); }
246 { doSetParmValue(idx, instance, value); }
248 { doSetParmValue(idx, instance, value); }
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, value); }
254 { doSetParmValue(idx, instance, value); }
256 { doSetParmValue(idx, instance, value); }
272 if (fieldnum.
size() < 1)
283 return "secondaryprefix";
285 return "unpackproperties";
289 return "deletecapture";
297 if (fieldnum.
size() < 1)
298 return PARM_UNSUPPORTED;
317 return PARM_UNSUPPORTED;
353 loadData(is, rampdata);
371 int typelen = colon - data.
buffer();
385 {
int64 iv =
v; UTwrite(os, &iv); }
387 { UTwrite<fpreal64>(os, &
v); }
389 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
391 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
392 UTwrite<fpreal64>(os, &v.
z()); }
394 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
395 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
407 if (s) s->save(ostr);
409 saveData(os, result);
416 ostr << s->getDataTypeToken();
421 saveData(os, result);
425 void save(std::ostream &os)
const
429 saveData(os, myClass);
430 saveData(os, myAttrib);
431 saveData(os, myPrefix);
432 saveData(os, mySecondaryPrefix);
433 saveData(os, myUnpackProperties);
434 saveData(os, myUnpackData);
435 saveData(os, myDeleteCaptureAttributes);
448 loadData(is, myClass);
449 loadData(is, myAttrib);
450 loadData(is, myPrefix);
451 loadData(is, mySecondaryPrefix);
452 loadData(is, myUnpackProperties);
453 loadData(is, myUnpackData);
454 loadData(is, myDeleteCaptureAttributes);
464 if (!thissop)
return getClass();
466 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
467 return Class(result);
474 if (!thissop)
return getAttrib();
476 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
484 if (!thissop)
return getPrefix();
486 OP_Utils::evalOpParm(result, thissop,
"prefix", cookparms.
getCookTime(), 0);
494 if (!thissop)
return getSecondaryPrefix();
496 OP_Utils::evalOpParm(result, thissop,
"secondaryprefix", cookparms.
getCookTime(), 0);
504 if (!thissop)
return getUnpackProperties();
506 OP_Utils::evalOpParm(result, thissop,
"unpackproperties", cookparms.
getCookTime(), 0);
514 if (!thissop)
return getUnpackData();
516 OP_Utils::evalOpParm(result, thissop,
"unpackdata", cookparms.
getCookTime(), 0);
524 if (!thissop)
return getDeleteCaptureAttributes();
526 OP_Utils::evalOpParm(result, thissop,
"deletecapture", cookparms.
getCookTime(), 0);
535 bool myUnpackProperties;
537 bool myDeleteCaptureAttributes;
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
SOP_Node * getNode() const
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opUnpackProperties(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & z() noexcept
bool getDeleteCaptureAttributes() const
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool operator!=(const SOP_CaptureAttribUnpackParms &src) const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
**But if you need a result
void setUnpackData(bool val)
bool getUnpackProperties() const
void setPrefix(const UT_StringHolder &val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setDeleteCaptureAttributes(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_StringHolder opPrefix(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
UT_StringHolder opSecondaryPrefix(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getPrefix() const
bool operator==(const SOP_CaptureAttribUnpackParms &src) const
const UT_StringHolder & getAttrib() 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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, UT_Vector3D v)
const char * getNestParmName(TempIndex fieldnum) const override
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Class enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool opUnpackData(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
SOP_CaptureAttribUnpackParms()
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
const UT_StringHolder & getSecondaryPrefix() const
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, fpreal64 &v)
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector3D &v)
DEP_MicroNode * depnode() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
bool isParmColorRamp(exint idx) const override
void setSecondaryPrefix(const UT_StringHolder &val)
exint getNestNumParms(TempIndex idx) const override
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
const char * findChar(int c) const
bool getUnpackData() const
void setAttrib(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opDeleteCaptureAttributes(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setUnpackProperties(bool val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept