23 namespace SOP_GroupRenameEnums
37 using namespace UT::Literal;
74 if (enable != src.
enable)
return false;
75 if (grouptype != src.
grouptype)
return false;
76 if (group != src.
group)
return false;
77 if (newname != src.
newname)
return false;
93 for (
int i = 0; i < list.
entries(); i++)
117 myRenames.setSize(1);
130 if (myRenames != src.myRenames)
return false;
147 graph->
evalOpParm(length, nodeidx,
"renames", time, 0);
148 if (length < 0) length = 0;
149 myRenames.setSize(length);
156 auto && _curentry = myRenames(i);
158 _curentry.enable =
true;
160 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
161 _curentry.grouptype = 0;
162 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
163 graph->
evalOpParmInst(_curentry.grouptype, nodeidx,
"grouptype#", parmidx, offsets, time, 0, 2-1);
164 _curentry.group =
""_UTsh;
165 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
166 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, 0, 2-1);
167 _curentry.newname =
""_UTsh;
168 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
169 graph->
evalOpParmInst(_curentry.newname, nodeidx,
"newname#", parmidx, offsets, time, 0, 2-1);
190 template <
typename T>
197 if (idx.
size() != instance.
size()+1)
203 coerceValue(value, myRenames.entries());
204 else if (instance[0] < myRenames.entries())
206 auto && _data = myRenames(instance[0]);
210 coerceValue(value, _data.enable);
213 coerceValue(value, _data.grouptype);
216 coerceValue(value, _data.group);
219 coerceValue(value, _data.newname);
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 { doGetParmValue(idx, instance, value); }
259 { doGetParmValue(idx, instance, value); }
261 template <
typename T>
268 if (idx.
size() != instance.
size()+1)
276 coerceValue(newsize, value);
277 if (newsize < 0) newsize = 0;
278 myRenames.setSize(newsize);
284 myRenames.setSizeIfNeeded(instance[0]+1);
285 auto && _data = myRenames(instance[0]);
289 coerceValue(_data.enable, value);
292 coerceValue(_data.grouptype, value);
295 coerceValue(_data.group, value);
298 coerceValue(_data.newname, value);
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
347 if (fieldnum.
size() < 1)
352 if (fieldnum.
size() == 1)
374 if (fieldnum.
size() < 1)
375 return PARM_UNSUPPORTED;
379 if (fieldnum.
size() == 1)
380 return PARM_MULTIPARM;
393 return PARM_UNSUPPORTED;
396 return PARM_UNSUPPORTED;
432 loadData(is, rampdata);
450 int typelen = colon - data.
buffer();
464 {
int64 iv =
v; UTwrite(os, &iv); }
466 { UTwrite<fpreal64>(os, &
v); }
468 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
470 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
471 UTwrite<fpreal64>(os, &v.
z()); }
473 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
474 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
486 if (s) s->save(ostr);
488 saveData(os, result);
495 ostr << s->getDataTypeToken();
500 saveData(os, result);
504 void save(std::ostream &os)
const
510 UTwrite(os, &length);
513 auto && _curentry = myRenames(i);
515 saveData(os, _curentry.enable);
516 saveData(os, _curentry.grouptype);
517 saveData(os, _curentry.group);
518 saveData(os, _curentry.newname);
537 myRenames.setSize(length);
540 auto && _curentry = myRenames(i);
542 loadData(is, _curentry.enable);
543 loadData(is, _curentry.grouptype);
544 loadData(is, _curentry.group);
545 loadData(is, _curentry.newname);
558 if (!thissop)
return getRenames().entries();
560 OP_Utils::evalOpParm(result, thissop,
"renames", cookparms.
getCookTime(), 0);
564 {
return opinstRenames_enable(cookparms, &_idx); }
568 if (!thissop)
return (myRenames(_idx[0]).enable);
570 _parmidx[1-1] = _idx[1-1] + 1;
573 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
577 {
return opinstRenames_grouptype(cookparms, &_idx); }
581 if (!thissop)
return (myRenames(_idx[0]).grouptype);
583 _parmidx[1-1] = _idx[1-1] + 1;
586 OP_Utils::evalOpParmInst(result, thissop,
"grouptype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
590 {
return opinstRenames_group(cookparms, &_idx); }
594 if (!thissop)
return (myRenames(_idx[0]).group);
596 _parmidx[1-1] = _idx[1-1] + 1;
599 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
603 {
return opinstRenames_newname(cookparms, &_idx); }
607 if (!thissop)
return (myRenames(_idx[0]).newname);
609 _parmidx[1-1] = _idx[1-1] + 1;
612 OP_Utils::evalOpParmInst(result, thissop,
"newname#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GLenum GLuint GLenum GLsizei const GLchar * buf
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
SOP_Node * getNode() const
UT_StringHolder opRenames_newname(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
const UT_Array< Renames > & getRenames() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, fpreal64 v)
GLuint GLsizei GLsizei * length
void setRenames(const UT_Array< Renames > &val)
An output stream object that owns its own string buffer storage.
void copyFrom(const OP_NodeParms *src) override
**But if you need a result
static void loadData(UT_IStream &is, UT_Matrix2D &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.
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, int64 &v)
UT_StringHolder createString(const UT_Array< Renames > &list) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool operator!=(const SOP_GroupRenameParms &src) const
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool operator==(const SOP_GroupRenameParms &src) const
exint read(bool *array, exint sz=1)
UT_StringHolder opinstRenames_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const OP_GraphProxy * graph() const
bool opRenames_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool opinstRenames_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, bool v)
exint opRenames(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_StringHolder opRenames_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, UT_Vector3D v)
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void save(std::ostream &os) const
bool operator!=(const Renames &src) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_StringHolder opinstRenames_newname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
DEP_MicroNode * depnode() const
void loadFromOpSubclass(const LoadParms &loadparms) override
int64 opinstRenames_grouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal getCookTime() const
bool isParmColorRamp(exint idx) const override
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, bool &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
int64 opRenames_grouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
bool operator==(const Renames &src) const
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_StringHolder s)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override