23 namespace SOP_GroupRenameEnums
59 if (enable != src.
enable)
return false;
60 if (grouptype != src.
grouptype)
return false;
61 if (group != src.
group)
return false;
62 if (newname != src.
newname)
return false;
78 for (
int i = 0; i < list.
entries(); i++)
102 myRenames.setSize(1);
115 if (myRenames != src.myRenames)
return false;
132 graph->
evalOpParm(length, nodeidx,
"renames", time, 0);
133 if (length < 0) length = 0;
134 myRenames.setSize(length);
141 auto && _curentry = myRenames(i);
143 _curentry.enable =
true;
145 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
146 _curentry.grouptype = 0;
147 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
148 graph->
evalOpParmInst(_curentry.grouptype, nodeidx,
"grouptype#", parmidx, offsets, time, 0, 2-1);
149 _curentry.group =
""_UTsh;
150 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
151 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, 0, 2-1);
152 _curentry.newname =
""_UTsh;
153 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
154 graph->
evalOpParmInst(_curentry.newname, nodeidx,
"newname#", parmidx, offsets, time, 0, 2-1);
175 template <
typename T>
182 if (idx.
size() != instance.
size()+1)
189 else if (instance[0] < myRenames.entries())
191 auto && _data = myRenames(instance[0]);
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 { doGetParmValue(idx, instance, value); }
230 { doGetParmValue(idx, instance, value); }
232 { doGetParmValue(idx, instance, value); }
234 { doGetParmValue(idx, instance, value); }
236 { doGetParmValue(idx, instance, value); }
238 { doGetParmValue(idx, instance, value); }
240 { doGetParmValue(idx, instance, value); }
242 { doGetParmValue(idx, instance, value); }
244 { doGetParmValue(idx, instance, value); }
246 template <
typename T>
253 if (idx.
size() != instance.
size()+1)
262 if (newsize < 0) newsize = 0;
263 myRenames.setSize(newsize);
269 myRenames.setSizeIfNeeded(instance[0]+1);
270 auto && _data = myRenames(instance[0]);
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
332 if (fieldnum.
size() < 1)
337 if (fieldnum.
size() == 1)
359 if (fieldnum.
size() < 1)
360 return PARM_UNSUPPORTED;
364 if (fieldnum.
size() == 1)
365 return PARM_MULTIPARM;
400 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
402 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
404 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
417 loadData(is, rampdata);
435 int typelen = colon - data.
buffer();
449 {
int64 iv =
v; UTwrite(os, &iv); }
451 { UTwrite<fpreal64>(os, &
v); }
453 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
455 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
456 UTwrite<fpreal64>(os, &v.
z()); }
458 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
459 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
471 if (s) s->save(ostr);
473 saveData(os, result);
480 ostr << s->getDataTypeToken();
485 saveData(os, result);
489 void save(std::ostream &os)
const
495 UTwrite(os, &length);
498 auto && _curentry = myRenames(i);
500 saveData(os, _curentry.enable);
501 saveData(os, _curentry.grouptype);
502 saveData(os, _curentry.group);
503 saveData(os, _curentry.newname);
522 myRenames.setSize(length);
525 auto && _curentry = myRenames(i);
527 loadData(is, _curentry.enable);
528 loadData(is, _curentry.grouptype);
529 loadData(is, _curentry.group);
530 loadData(is, _curentry.newname);
543 if (!thissop)
return getRenames().entries();
545 OP_Utils::evalOpParm(result, thissop,
"renames", cookparms.
getCookTime(), 0);
549 {
return opinstRenames_enable(cookparms, &_idx); }
553 if (!thissop)
return (myRenames(_idx[0]).enable);
555 _parmidx[1-1] = _idx[1-1] + 1;
558 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
562 {
return opinstRenames_grouptype(cookparms, &_idx); }
566 if (!thissop)
return (myRenames(_idx[0]).grouptype);
568 _parmidx[1-1] = _idx[1-1] + 1;
571 OP_Utils::evalOpParmInst(result, thissop,
"grouptype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
575 {
return opinstRenames_group(cookparms, &_idx); }
579 if (!thissop)
return (myRenames(_idx[0]).group);
581 _parmidx[1-1] = _idx[1-1] + 1;
584 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
588 {
return opinstRenames_newname(cookparms, &_idx); }
592 if (!thissop)
return (myRenames(_idx[0]).newname);
594 _parmidx[1-1] = _idx[1-1] + 1;
597 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 coerceValue(T &result, const S &src) const
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
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)
OP_NodeParms & operator=(const OP_NodeParms &)=default
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