23 namespace SOP_GroupRenameEnums
37 using namespace UT::Literal;
59 using namespace UT::Literal;
97 if (enable != src.
enable)
return false;
98 if (grouptype != src.
grouptype)
return false;
99 if (group != src.
group)
return false;
100 if (newname != src.
newname)
return false;
101 if (conflict != src.
conflict)
return false;
117 for (
int i = 0; i < list.
entries(); i++)
123 buf.
appendSprintf(
"%s", (list(i).enable) ?
"true" :
"false");
143 myRenames.setSize(1);
156 if (myRenames != src.myRenames)
return false;
177 graph->
evalOpParm(length, nodeidx,
"renames", time, graph->
isDirect()?
nullptr:depnode);
178 if (length < 0) length = 0;
179 myRenames.setSize(length);
186 auto && _curentry = myRenames(i);
188 _curentry.enable =
true;
190 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
191 _curentry.grouptype = 0;
192 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
193 graph->
evalOpParmInst(_curentry.grouptype, nodeidx,
"grouptype#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
194 _curentry.group =
""_UTsh;
195 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
196 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
197 _curentry.newname =
""_UTsh;
198 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
199 graph->
evalOpParmInst(_curentry.newname, nodeidx,
"newname#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
200 _curentry.conflict = 0;
201 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
202 graph->
evalOpParmInst(_curentry.conflict, nodeidx,
"conflict#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
223 template <
typename T>
230 if (idx.
size() != instance.
size()+1)
236 coerceValue(value, myRenames.entries());
237 else if (instance[0] < myRenames.entries())
239 auto && _data = myRenames(instance[0]);
243 coerceValue(value, _data.enable);
246 coerceValue(value, _data.grouptype);
249 coerceValue(value, _data.group);
252 coerceValue(value, _data.newname);
255 coerceValue(value, _data.conflict);
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 template <
typename T>
304 if (idx.
size() != instance.
size()+1)
312 coerceValue(newsize, value);
313 if (newsize < 0) newsize = 0;
314 myRenames.setSize(newsize);
320 myRenames.setSizeIfNeeded(instance[0]+1);
321 auto && _data = myRenames(instance[0]);
325 coerceValue(_data.enable, value);
328 coerceValue(_data.grouptype, value);
331 coerceValue(_data.group, value);
334 coerceValue(_data.newname, value);
337 coerceValue(_data.conflict, value);
348 { doSetParmValue(idx, instance, value); }
350 { doSetParmValue(idx, instance, value); }
352 { doSetParmValue(idx, instance, value); }
354 { doSetParmValue(idx, instance, value); }
356 { doSetParmValue(idx, instance, value); }
358 { doSetParmValue(idx, instance, value); }
360 { doSetParmValue(idx, instance, value); }
362 { doSetParmValue(idx, instance, value); }
364 { doSetParmValue(idx, instance, value); }
366 { doSetParmValue(idx, instance, value); }
368 { doSetParmValue(idx, instance, value); }
386 if (fieldnum.
size() < 1)
391 if (fieldnum.
size() == 1)
415 if (fieldnum.
size() < 1)
416 return PARM_UNSUPPORTED;
420 if (fieldnum.
size() == 1)
421 return PARM_MULTIPARM;
436 return PARM_UNSUPPORTED;
439 return PARM_UNSUPPORTED;
475 loadData(is, rampdata);
493 int typelen = colon - data.
buffer();
507 {
int64 iv =
v; UTwrite(os, &iv); }
509 { UTwrite<fpreal64>(os, &
v); }
511 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
513 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
514 UTwrite<fpreal64>(os, &v.
z()); }
516 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
517 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
529 if (s) s->save(ostr);
531 saveData(os, result);
538 ostr << s->getDataTypeToken();
543 saveData(os, result);
547 void save(std::ostream &os)
const
553 UTwrite(os, &length);
556 auto && _curentry = myRenames(i);
558 saveData(os, _curentry.enable);
559 saveData(os, _curentry.grouptype);
560 saveData(os, _curentry.group);
561 saveData(os, _curentry.newname);
562 saveData(os, _curentry.conflict);
581 myRenames.setSize(length);
584 auto && _curentry = myRenames(i);
586 loadData(is, _curentry.enable);
587 loadData(is, _curentry.grouptype);
588 loadData(is, _curentry.group);
589 loadData(is, _curentry.newname);
590 loadData(is, _curentry.conflict);
603 if (!thissop)
return getRenames().entries();
605 OP_Utils::evalOpParm(result, thissop,
"renames", cookparms.
getCookTime(), 0);
609 {
return opinstRenames_enable(cookparms, &_idx); }
613 if (!thissop)
return (myRenames(_idx[0]).enable);
615 _parmidx[1-1] = _idx[1-1] + 1;
618 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
622 {
return opinstRenames_grouptype(cookparms, &_idx); }
626 if (!thissop)
return (myRenames(_idx[0]).grouptype);
628 _parmidx[1-1] = _idx[1-1] + 1;
631 OP_Utils::evalOpParmInst(result, thissop,
"grouptype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
635 {
return opinstRenames_group(cookparms, &_idx); }
639 if (!thissop)
return (myRenames(_idx[0]).group);
641 _parmidx[1-1] = _idx[1-1] + 1;
644 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
648 {
return opinstRenames_newname(cookparms, &_idx); }
652 if (!thissop)
return (myRenames(_idx[0]).newname);
654 _parmidx[1-1] = _idx[1-1] + 1;
657 OP_Utils::evalOpParmInst(result, thissop,
"newname#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
661 {
return opinstRenames_conflict(cookparms, &_idx); }
665 if (!thissop)
return (myRenames(_idx[0]).conflict);
667 _parmidx[1-1] = _idx[1-1] + 1;
670 OP_Utils::evalOpParmInst(result, thissop,
"conflict#", _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)
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)
int64 opinstRenames_conflict(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
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
exint bread(uint8 *buffer, exint asize=1)
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)
int64 opRenames_conflict(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
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