20 using namespace UT::Literal;
23 namespace SOP_GroupRenameEnums
60 if (grouptype != src.
grouptype)
return false;
62 if (newname != src.
newname)
return false;
78 for (
int i = 0; i < list.
entries(); i++)
111 if (myRenames != src.myRenames)
return false;
128 graph->
evalOpParm(length, nodeidx,
"renames", time, 0);
129 myRenames.entries(length);
133 auto && _curentry = myRenames(i);
135 myRenames(i).enable =
true;
138 myRenames(i).grouptype = 0;
139 if (
true && ( (!(((_curentry.enable==0)))) ) )
140 graph->
evalOpParmInst(myRenames(i).grouptype, nodeidx,
"grouptype#", &parmidx, time, 0);
141 myRenames(i).group =
""_sh;
142 if (
true && ( (!(((_curentry.enable==0)))) ) )
144 myRenames(i).newname =
""_sh;
145 if (
true && ( (!(((_curentry.enable==0)))) ) )
146 graph->
evalOpParmInst(myRenames(i).newname, nodeidx,
"newname#", &parmidx, time, 0);
167 template <
typename T>
174 if (idx.
size() != instance.
size()+1)
180 coerceValue(value, myRenames.entries());
181 else if (instance[0] < myRenames.entries())
183 auto && _data = myRenames(instance[0]);
187 coerceValue(value, _data.enable);
190 coerceValue(value, _data.grouptype);
193 coerceValue(value, _data.group);
196 coerceValue(value, _data.newname);
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 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 template <
typename T>
236 if (idx.
size() != instance.
size()+1)
244 coerceValue(newsize, value);
245 myRenames.setSize(newsize);
249 myRenames.setSizeIfNeeded(instance[0]+1);
250 auto && _data = myRenames(instance[0]);
254 coerceValue(_data.enable, value);
257 coerceValue(_data.grouptype, value);
260 coerceValue(_data.group, value);
263 coerceValue(_data.newname, value);
274 { doSetParmValue(idx, instance, value); }
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
312 if (fieldnum.
size() < 1)
317 if (fieldnum.
size() == 1)
339 if (fieldnum.
size() < 1)
340 return PARM_UNSUPPORTED;
344 if (fieldnum.
size() == 1)
345 return PARM_MULTIPARM;
358 return PARM_UNSUPPORTED;
361 return PARM_UNSUPPORTED;
397 loadData(is, rampdata);
415 int typelen = colon - data.
buffer();
429 {
int64 iv =
v; UTwrite(os, &iv); }
431 { UTwrite<fpreal64>(os, &
v); }
433 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
435 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
436 UTwrite<fpreal64>(os, &v.
z()); }
438 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
439 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
451 if (s) s->save(ostr);
453 saveData(os, result);
460 ostr << s->getDataTypeToken();
465 saveData(os, result);
469 void save(std::ostream &os)
const
475 UTwrite(os, &length);
478 saveData(os, myRenames(i).
enable);
479 saveData(os, myRenames(i).grouptype);
480 saveData(os, myRenames(i).
group);
481 saveData(os, myRenames(i).newname);
500 myRenames.entries(length);
503 loadData(is, myRenames(i).
enable);
504 loadData(is, myRenames(i).grouptype);
505 loadData(is, myRenames(i).
group);
506 loadData(is, myRenames(i).newname);
519 if (!thissop)
return getRenames().entries();
521 OP_Utils::evalOpParm(result, thissop,
"renames", cookparms.
getCookTime(), 0);
527 if (!thissop)
return (myRenames(_idx).
enable);
528 int _parmidx = _idx + 1;
530 OP_Utils::evalOpParmInst(result, thissop,
"enable#", &_parmidx, cookparms.
getCookTime(), 0);
536 if (!thissop)
return (myRenames(_idx).grouptype);
537 int _parmidx = _idx + 1;
539 OP_Utils::evalOpParmInst(result, thissop,
"grouptype#", &_parmidx, cookparms.
getCookTime(), 0);
545 if (!thissop)
return (myRenames(_idx).
group);
546 int _parmidx = _idx + 1;
548 OP_Utils::evalOpParmInst(result, thissop,
"group#", &_parmidx, cookparms.
getCookTime(), 0);
554 if (!thissop)
return (myRenames(_idx).newname);
555 int _parmidx = _idx + 1;
557 OP_Utils::evalOpParmInst(result, thissop,
"newname#", &_parmidx, cookparms.
getCookTime(), 0);
UT_StringHolder opRenames_newname(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
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
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)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, int *inst, fpreal time, DEP_MicroNode *depnode) const =0
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
GLuint const GLfloat * val
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
static void saveData(std::ostream &os, fpreal64 v)
void copyFrom(const SOP_NodeParms *src) override
void setRenames(const UT_Array< Renames > &val)
An output stream object that owns its own string buffer storage.
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)
static void loadData(UT_IStream &is, UT_Vector3I &v)
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
UT_StringHolder opRenames_group(const SOP_NodeVerb::CookParms &cookparms, exint _idx) 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.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
GLint GLenum GLsizei GLint GLsizei const void * data
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)
static void loadData(UT_IStream &is, UT_Vector3D &v)
GLuint GLsizei GLsizei * length
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool opRenames_enable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
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
DEP_MicroNode * depnode() const
exint entries() const
Alias of size(). size() is preferred.
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
~SOP_GroupRenameParms() override
void loadFromOpSubclass(const LoadParms &loadparms) override
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 opRenames_grouptype(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
SYS_FORCE_INLINE void append(char character)
GLdouble GLdouble GLdouble r
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
fpreal getCookTime() const
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
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
GLenum GLuint GLsizei const GLchar * buf
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, bool &v)
GLsizei const GLfloat * value
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override