23 namespace SOP_CaptureAttribPackEnums
36 using namespace UT::Literal;
57 myAttrib =
"boneCapture"_UTsh;
59 mySecondaryPrefix =
"secondary"_UTsh;
60 myPackProperties =
true;
62 myDeleteArrayAttributes =
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 (myPackProperties != src.myPackProperties)
return false;
80 if (myPackData != src.myPackData)
return false;
81 if (myDeleteArrayAttributes != src.myDeleteArrayAttributes)
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 myPackProperties =
true;
109 graph->
evalOpParm(myPackProperties, nodeidx,
"packproperties", time, 0);
112 graph->
evalOpParm(myPackData, nodeidx,
"packdata", time, 0);
113 myDeleteArrayAttributes =
true;
115 graph->
evalOpParm(myDeleteArrayAttributes, 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, myPackProperties);
158 coerceValue(value, myPackData);
161 coerceValue(value, myDeleteArrayAttributes);
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(myPackProperties, ( ( value ) ));
226 coerceValue(myPackData, ( ( value ) ));
229 coerceValue(myDeleteArrayAttributes, ( ( 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 "packproperties";
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, myPackProperties);
434 saveData(os, myPackData);
435 saveData(os, myDeleteArrayAttributes);
448 loadData(is, myClass);
449 loadData(is, myAttrib);
450 loadData(is, myPrefix);
451 loadData(is, mySecondaryPrefix);
452 loadData(is, myPackProperties);
453 loadData(is, myPackData);
454 loadData(is, myDeleteArrayAttributes);
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 getPackProperties();
506 OP_Utils::evalOpParm(result, thissop,
"packproperties", cookparms.
getCookTime(), 0);
514 if (!thissop)
return getPackData();
516 OP_Utils::evalOpParm(result, thissop,
"packdata", cookparms.
getCookTime(), 0);
524 if (!thissop)
return getDeleteArrayAttributes();
526 OP_Utils::evalOpParm(result, thissop,
"deletecapture", cookparms.
getCookTime(), 0);
535 bool myPackProperties;
537 bool myDeleteArrayAttributes;
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SOP_CaptureAttribPackParms()
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_StringHolder opPrefix(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, bool &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
An output stream object that owns its own string buffer storage.
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setPrefix(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
bool operator==(const SOP_CaptureAttribPackParms &src) const
bool operator!=(const SOP_CaptureAttribPackParms &src) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool opPackData(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setSecondaryPrefix(const UT_StringHolder &val)
static void loadData(UT_IStream &is, int64 &v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder opSecondaryPrefix(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool opDeleteArrayAttributes(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
bool getPackProperties() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
const UT_StringHolder & getPrefix() const
ParmType getNestParmType(TempIndex fieldnum) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, fpreal64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool isParmColorRamp(exint idx) const override
void setPackProperties(bool val)
const UT_StringHolder & getSecondaryPrefix() const
SYS_FORCE_INLINE UT_StringHolder getToken(Class enum_value)
void setPackData(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
DEP_MicroNode * depnode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
LeafData & operator=(const LeafData &)=delete
void setAttrib(const UT_StringHolder &val)
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool getDeleteArrayAttributes() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opPackProperties(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setDeleteArrayAttributes(bool val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept