23 namespace SOP_CaptureAttribPackEnums
43 myAttrib =
"boneCapture"_UTsh;
45 mySecondaryPrefix =
"secondary"_UTsh;
46 myPackProperties =
true;
48 myDeleteArrayAttributes =
true;
61 if (myClass != src.myClass)
return false;
62 if (myAttrib != src.myAttrib)
return false;
63 if (myPrefix != src.myPrefix)
return false;
64 if (mySecondaryPrefix != src.mySecondaryPrefix)
return false;
65 if (myPackProperties != src.myPackProperties)
return false;
66 if (myPackData != src.myPackData)
return false;
67 if (myDeleteArrayAttributes != src.myDeleteArrayAttributes)
return false;
83 graph->
evalOpParm(myClass, nodeidx,
"class", time, 0);
84 myAttrib =
"boneCapture"_UTsh;
86 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
89 graph->
evalOpParm(myPrefix, nodeidx,
"prefix", time, 0);
90 mySecondaryPrefix =
"secondary"_UTsh;
92 graph->
evalOpParm(mySecondaryPrefix, nodeidx,
"secondaryprefix", time, 0);
93 myPackProperties =
true;
95 graph->
evalOpParm(myPackProperties, nodeidx,
"packproperties", time, 0);
98 graph->
evalOpParm(myPackData, nodeidx,
"packdata", time, 0);
99 myDeleteArrayAttributes =
true;
101 graph->
evalOpParm(myDeleteArrayAttributes, nodeidx,
"deletecapture", time, 0);
117 template <
typename T>
124 if (idx.
size() != instance.
size()+1)
163 { doGetParmValue(idx, instance, value); }
165 { doGetParmValue(idx, instance, value); }
167 { doGetParmValue(idx, instance, value); }
169 { doGetParmValue(idx, instance, value); }
171 { doGetParmValue(idx, instance, value); }
173 { doGetParmValue(idx, instance, value); }
175 { doGetParmValue(idx, instance, value); }
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 { doGetParmValue(idx, instance, value); }
183 { doGetParmValue(idx, instance, value); }
185 template <
typename T>
192 if (idx.
size() != instance.
size()+1)
215 coerceValue(myDeleteArrayAttributes, ( ( value ) ));
222 { doSetParmValue(idx, instance, value); }
224 { doSetParmValue(idx, instance, value); }
226 { doSetParmValue(idx, instance, value); }
228 { doSetParmValue(idx, instance, value); }
230 { doSetParmValue(idx, instance, value); }
232 { doSetParmValue(idx, instance, value); }
234 { doSetParmValue(idx, instance, value); }
236 { doSetParmValue(idx, instance, value); }
238 { doSetParmValue(idx, instance, value); }
240 { doSetParmValue(idx, instance, value); }
242 { doSetParmValue(idx, instance, value); }
258 if (fieldnum.
size() < 1)
269 return "secondaryprefix";
271 return "packproperties";
275 return "deletecapture";
283 if (fieldnum.
size() < 1)
284 return PARM_UNSUPPORTED;
322 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
324 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
326 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
339 loadData(is, rampdata);
357 int typelen = colon - data.
buffer();
371 {
int64 iv =
v; UTwrite(os, &iv); }
373 { UTwrite<fpreal64>(os, &
v); }
375 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
377 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
378 UTwrite<fpreal64>(os, &v.
z()); }
380 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
381 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
393 if (s) s->save(ostr);
395 saveData(os, result);
402 ostr << s->getDataTypeToken();
407 saveData(os, result);
411 void save(std::ostream &os)
const
415 saveData(os, myClass);
416 saveData(os, myAttrib);
417 saveData(os, myPrefix);
418 saveData(os, mySecondaryPrefix);
419 saveData(os, myPackProperties);
420 saveData(os, myPackData);
421 saveData(os, myDeleteArrayAttributes);
434 loadData(is, myClass);
435 loadData(is, myAttrib);
436 loadData(is, myPrefix);
437 loadData(is, mySecondaryPrefix);
438 loadData(is, myPackProperties);
439 loadData(is, myPackData);
440 loadData(is, myDeleteArrayAttributes);
450 if (!thissop)
return getClass();
452 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
453 return Class(result);
460 if (!thissop)
return getAttrib();
462 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
470 if (!thissop)
return getPrefix();
472 OP_Utils::evalOpParm(result, thissop,
"prefix", cookparms.
getCookTime(), 0);
480 if (!thissop)
return getSecondaryPrefix();
482 OP_Utils::evalOpParm(result, thissop,
"secondaryprefix", cookparms.
getCookTime(), 0);
490 if (!thissop)
return getPackProperties();
492 OP_Utils::evalOpParm(result, thissop,
"packproperties", cookparms.
getCookTime(), 0);
500 if (!thissop)
return getPackData();
502 OP_Utils::evalOpParm(result, thissop,
"packdata", cookparms.
getCookTime(), 0);
510 if (!thissop)
return getDeleteArrayAttributes();
512 OP_Utils::evalOpParm(result, thissop,
"deletecapture", cookparms.
getCookTime(), 0);
521 bool myPackProperties;
523 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
T clampMaxValue(fpreal maxvalue, const T &src) const
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
T clampMinValue(fpreal minvalue, const T &src) const
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
void coerceValue(T &result, const S &src) const
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
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)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept