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;
100 graph->
evalOpParm(myClass, nodeidx,
"class", time, graph->
isDirect()?
nullptr:depnode);
101 myAttrib =
"boneCapture"_UTsh;
103 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, graph->
isDirect()?
nullptr:depnode);
106 graph->
evalOpParm(myPrefix, nodeidx,
"prefix", time, graph->
isDirect()?
nullptr:depnode);
107 mySecondaryPrefix =
"secondary"_UTsh;
109 graph->
evalOpParm(mySecondaryPrefix, nodeidx,
"secondaryprefix", time, graph->
isDirect()?
nullptr:depnode);
110 myPackProperties =
true;
112 graph->
evalOpParm(myPackProperties, nodeidx,
"packproperties", time, graph->
isDirect()?
nullptr:depnode);
115 graph->
evalOpParm(myPackData, nodeidx,
"packdata", time, graph->
isDirect()?
nullptr:depnode);
116 myDeleteArrayAttributes =
true;
118 graph->
evalOpParm(myDeleteArrayAttributes, nodeidx,
"deletecapture", time, graph->
isDirect()?
nullptr:depnode);
134 template <
typename T>
141 if (idx.
size() != instance.
size()+1)
146 coerceValue(value, myClass);
149 coerceValue(value, myAttrib);
152 coerceValue(value, myPrefix);
155 coerceValue(value, mySecondaryPrefix);
158 coerceValue(value, myPackProperties);
161 coerceValue(value, myPackData);
164 coerceValue(value, myDeleteArrayAttributes);
180 { doGetParmValue(idx, instance, value); }
182 { doGetParmValue(idx, instance, value); }
184 { doGetParmValue(idx, instance, value); }
186 { doGetParmValue(idx, instance, value); }
188 { doGetParmValue(idx, instance, value); }
190 { doGetParmValue(idx, instance, value); }
192 { doGetParmValue(idx, instance, value); }
194 { doGetParmValue(idx, instance, value); }
196 { doGetParmValue(idx, instance, value); }
198 { doGetParmValue(idx, instance, value); }
200 { doGetParmValue(idx, instance, value); }
202 template <
typename T>
209 if (idx.
size() != instance.
size()+1)
214 coerceValue(myClass, clampMinValue(0, clampMaxValue(3, value ) ));
217 coerceValue(myAttrib, ( ( value ) ));
220 coerceValue(myPrefix, ( ( value ) ));
223 coerceValue(mySecondaryPrefix, ( ( value ) ));
226 coerceValue(myPackProperties, ( ( value ) ));
229 coerceValue(myPackData, ( ( value ) ));
232 coerceValue(myDeleteArrayAttributes, ( ( value ) ));
239 { doSetParmValue(idx, instance, value); }
241 { doSetParmValue(idx, instance, value); }
243 { doSetParmValue(idx, instance, value); }
245 { doSetParmValue(idx, instance, value); }
247 { doSetParmValue(idx, instance, value); }
249 { doSetParmValue(idx, instance, value); }
251 { doSetParmValue(idx, instance, value); }
253 { doSetParmValue(idx, instance, value); }
255 { doSetParmValue(idx, instance, value); }
257 { doSetParmValue(idx, instance, value); }
259 { doSetParmValue(idx, instance, value); }
275 if (fieldnum.
size() < 1)
286 return "secondaryprefix";
288 return "packproperties";
292 return "deletecapture";
300 if (fieldnum.
size() < 1)
301 return PARM_UNSUPPORTED;
320 return PARM_UNSUPPORTED;
356 loadData(is, rampdata);
374 int typelen = colon - data.
buffer();
388 {
int64 iv =
v; UTwrite(os, &iv); }
390 { UTwrite<fpreal64>(os, &
v); }
392 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
394 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
395 UTwrite<fpreal64>(os, &v.
z()); }
397 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
398 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
410 if (s) s->save(ostr);
412 saveData(os, result);
419 ostr << s->getDataTypeToken();
424 saveData(os, result);
428 void save(std::ostream &os)
const
432 saveData(os, myClass);
433 saveData(os, myAttrib);
434 saveData(os, myPrefix);
435 saveData(os, mySecondaryPrefix);
436 saveData(os, myPackProperties);
437 saveData(os, myPackData);
438 saveData(os, myDeleteArrayAttributes);
451 loadData(is, myClass);
452 loadData(is, myAttrib);
453 loadData(is, myPrefix);
454 loadData(is, mySecondaryPrefix);
455 loadData(is, myPackProperties);
456 loadData(is, myPackData);
457 loadData(is, myDeleteArrayAttributes);
467 if (!thissop)
return getClass();
469 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
470 return Class(result);
477 if (!thissop)
return getAttrib();
479 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
487 if (!thissop)
return getPrefix();
489 OP_Utils::evalOpParm(result, thissop,
"prefix", cookparms.
getCookTime(), 0);
497 if (!thissop)
return getSecondaryPrefix();
499 OP_Utils::evalOpParm(result, thissop,
"secondaryprefix", cookparms.
getCookTime(), 0);
507 if (!thissop)
return getPackProperties();
509 OP_Utils::evalOpParm(result, thissop,
"packproperties", cookparms.
getCookTime(), 0);
517 if (!thissop)
return getPackData();
519 OP_Utils::evalOpParm(result, thissop,
"packdata", cookparms.
getCookTime(), 0);
527 if (!thissop)
return getDeleteArrayAttributes();
529 OP_Utils::evalOpParm(result, thissop,
"deletecapture", cookparms.
getCookTime(), 0);
538 bool myPackProperties;
540 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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