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;
150 graph->
evalOpParm(length, nodeidx,
"renames", time, graph->
isDirect()?
nullptr:depnode);
151 if (length < 0) length = 0;
152 myRenames.setSize(length);
159 auto && _curentry = myRenames(i);
161 _curentry.enable =
true;
163 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
164 _curentry.grouptype = 0;
165 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
166 graph->
evalOpParmInst(_curentry.grouptype, nodeidx,
"grouptype#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
167 _curentry.group =
""_UTsh;
168 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
169 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
170 _curentry.newname =
""_UTsh;
171 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
172 graph->
evalOpParmInst(_curentry.newname, nodeidx,
"newname#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
193 template <
typename T>
200 if (idx.
size() != instance.
size()+1)
206 coerceValue(value, myRenames.entries());
207 else if (instance[0] < myRenames.entries())
209 auto && _data = myRenames(instance[0]);
213 coerceValue(value, _data.enable);
216 coerceValue(value, _data.grouptype);
219 coerceValue(value, _data.group);
222 coerceValue(value, _data.newname);
242 { doGetParmValue(idx, instance, value); }
244 { doGetParmValue(idx, instance, value); }
246 { doGetParmValue(idx, instance, value); }
248 { doGetParmValue(idx, instance, value); }
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 { doGetParmValue(idx, instance, value); }
256 { doGetParmValue(idx, instance, value); }
258 { doGetParmValue(idx, instance, value); }
260 { doGetParmValue(idx, instance, value); }
262 { doGetParmValue(idx, instance, value); }
264 template <
typename T>
271 if (idx.
size() != instance.
size()+1)
279 coerceValue(newsize, value);
280 if (newsize < 0) newsize = 0;
281 myRenames.setSize(newsize);
287 myRenames.setSizeIfNeeded(instance[0]+1);
288 auto && _data = myRenames(instance[0]);
292 coerceValue(_data.enable, value);
295 coerceValue(_data.grouptype, value);
298 coerceValue(_data.group, value);
301 coerceValue(_data.newname, value);
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
316 { doSetParmValue(idx, instance, value); }
318 { doSetParmValue(idx, instance, value); }
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
350 if (fieldnum.
size() < 1)
355 if (fieldnum.
size() == 1)
377 if (fieldnum.
size() < 1)
378 return PARM_UNSUPPORTED;
382 if (fieldnum.
size() == 1)
383 return PARM_MULTIPARM;
396 return PARM_UNSUPPORTED;
399 return PARM_UNSUPPORTED;
435 loadData(is, rampdata);
453 int typelen = colon - data.
buffer();
467 {
int64 iv =
v; UTwrite(os, &iv); }
469 { UTwrite<fpreal64>(os, &
v); }
471 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
473 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
474 UTwrite<fpreal64>(os, &v.
z()); }
476 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
477 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
489 if (s) s->save(ostr);
491 saveData(os, result);
498 ostr << s->getDataTypeToken();
503 saveData(os, result);
507 void save(std::ostream &os)
const
513 UTwrite(os, &length);
516 auto && _curentry = myRenames(i);
518 saveData(os, _curentry.enable);
519 saveData(os, _curentry.grouptype);
520 saveData(os, _curentry.group);
521 saveData(os, _curentry.newname);
540 myRenames.setSize(length);
543 auto && _curentry = myRenames(i);
545 loadData(is, _curentry.enable);
546 loadData(is, _curentry.grouptype);
547 loadData(is, _curentry.group);
548 loadData(is, _curentry.newname);
561 if (!thissop)
return getRenames().entries();
563 OP_Utils::evalOpParm(result, thissop,
"renames", cookparms.
getCookTime(), 0);
567 {
return opinstRenames_enable(cookparms, &_idx); }
571 if (!thissop)
return (myRenames(_idx[0]).enable);
573 _parmidx[1-1] = _idx[1-1] + 1;
576 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
580 {
return opinstRenames_grouptype(cookparms, &_idx); }
584 if (!thissop)
return (myRenames(_idx[0]).grouptype);
586 _parmidx[1-1] = _idx[1-1] + 1;
589 OP_Utils::evalOpParmInst(result, thissop,
"grouptype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
593 {
return opinstRenames_group(cookparms, &_idx); }
597 if (!thissop)
return (myRenames(_idx[0]).group);
599 _parmidx[1-1] = _idx[1-1] + 1;
602 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
606 {
return opinstRenames_newname(cookparms, &_idx); }
610 if (!thissop)
return (myRenames(_idx[0]).newname);
612 _parmidx[1-1] = _idx[1-1] + 1;
615 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
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, bool &v)
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