23 namespace SOP_GroupsFromNameEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
71 using namespace UT::Literal;
90 myAttribName =
"name"_UTsh;
92 myGroupPrefix =
""_UTsh;
107 if (myAttribName != src.myAttribName)
return false;
108 if (myClass != src.myClass)
return false;
109 if (myGroupPrefix != src.myGroupPrefix)
return false;
110 if (myConflictOp != src.myConflictOp)
return false;
111 if (myInvalidNames != src.myInvalidNames)
return false;
127 myAttribName =
"name"_UTsh;
129 graph->
evalOpParm(myAttribName, nodeidx,
"attribname", time, 0);
132 graph->
evalOpParm(myClass, nodeidx,
"class", time, 0);
133 myGroupPrefix =
""_UTsh;
135 graph->
evalOpParm(myGroupPrefix, nodeidx,
"groupprefix", time, 0);
138 graph->
evalOpParm(myConflictOp, nodeidx,
"conflict", time, 0);
141 graph->
evalOpParm(myInvalidNames, nodeidx,
"invalidnames", time, 0);
157 template <
typename T>
164 if (idx.
size() != instance.
size()+1)
169 coerceValue(value, myAttribName);
172 coerceValue(value, myClass);
175 coerceValue(value, myGroupPrefix);
178 coerceValue(value, myConflictOp);
181 coerceValue(value, myInvalidNames);
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 template <
typename T>
226 if (idx.
size() != instance.
size()+1)
231 coerceValue(myAttribName, ( ( value ) ));
234 coerceValue(myClass, clampMinValue(0, clampMaxValue(2, value ) ));
237 coerceValue(myGroupPrefix, ( ( value ) ));
240 coerceValue(myConflictOp, clampMinValue(0, clampMaxValue(1, value ) ));
243 coerceValue(myInvalidNames, clampMinValue(0, clampMaxValue(2, value ) ));
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, value); }
254 { doSetParmValue(idx, instance, value); }
256 { doSetParmValue(idx, instance, value); }
258 { doSetParmValue(idx, instance, value); }
260 { doSetParmValue(idx, instance, value); }
262 { doSetParmValue(idx, instance, value); }
264 { doSetParmValue(idx, instance, value); }
266 { doSetParmValue(idx, instance, value); }
268 { doSetParmValue(idx, instance, value); }
270 { doSetParmValue(idx, instance, value); }
286 if (fieldnum.
size() < 1)
295 return "groupprefix";
299 return "invalidnames";
307 if (fieldnum.
size() < 1)
308 return PARM_UNSUPPORTED;
323 return PARM_UNSUPPORTED;
359 loadData(is, rampdata);
377 int typelen = colon - data.
buffer();
391 {
int64 iv =
v; UTwrite(os, &iv); }
393 { UTwrite<fpreal64>(os, &
v); }
395 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
397 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
398 UTwrite<fpreal64>(os, &v.
z()); }
400 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
401 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
413 if (s) s->save(ostr);
415 saveData(os, result);
422 ostr << s->getDataTypeToken();
427 saveData(os, result);
431 void save(std::ostream &os)
const
435 saveData(os, myAttribName);
436 saveData(os, myClass);
437 saveData(os, myGroupPrefix);
438 saveData(os, myConflictOp);
439 saveData(os, myInvalidNames);
452 loadData(is, myAttribName);
453 loadData(is, myClass);
454 loadData(is, myGroupPrefix);
455 loadData(is, myConflictOp);
456 loadData(is, myInvalidNames);
466 if (!thissop)
return getAttribName();
468 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
476 if (!thissop)
return getClass();
478 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
479 return Class(result);
486 if (!thissop)
return getGroupPrefix();
488 OP_Utils::evalOpParm(result, thissop,
"groupprefix", cookparms.
getCookTime(), 0);
496 if (!thissop)
return getConflictOp();
498 OP_Utils::evalOpParm(result, thissop,
"conflict", cookparms.
getCookTime(), 0);
506 if (!thissop)
return getInvalidNames();
508 OP_Utils::evalOpParm(result, thissop,
"invalidnames", cookparms.
getCookTime(), 0);
517 int64 myInvalidNames;
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getGroupPrefix() const
bool operator!=(const SOP_GroupsFromNameParms &src) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
SOP_Node * getNode() const
static void saveData(std::ostream &os, int64 v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE UT_StringHolder getToken(Class enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
InvalidNames opInvalidNames(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, bool &v)
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
An output stream object that owns its own string buffer storage.
**But if you need a result
static void saveData(std::ostream &os, UT_Matrix3D v)
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 setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
void setGroupPrefix(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const UT_StringHolder & getAttribName() const
InvalidNames getInvalidNames() const
void setInvalidNames(InvalidNames val)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & z() noexcept
SOP_GroupsFromNameParms()
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Vector2I &v)
ConflictOp getConflictOp() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void save(std::ostream &os) const
void setAttribName(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
DEP_MicroNode * depnode() const
UT_StringHolder opAttribName(const SOP_NodeVerb::CookParms &cookparms) const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setConflictOp(ConflictOp val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
const char * findChar(int c) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator==(const SOP_GroupsFromNameParms &src) const
static void saveData(std::ostream &os, UT_StringHolder s)
ConflictOp opConflictOp(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
UT_StringHolder opGroupPrefix(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool isParmColorRamp(exint idx) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept