23 namespace SOP_NameEnums
35 using namespace UT::Literal;
66 if (group != src.
group)
return false;
83 for (
int i = 0; i < list.
entries(); i++)
119 if (enable != src.
enable)
return false;
120 if (global != src.
global)
return false;
121 if (from != src.
from)
return false;
122 if (to != src.
to)
return false;
138 for (
int i = 0; i < list.
entries(); i++)
144 buf.
appendSprintf(
"%s", (list(i).enable) ?
"true" :
"false");
146 buf.
appendSprintf(
"%s", (list(i).global) ?
"true" :
"false");
162 myAttribname =
"name"_UTsh;
164 myDonamefromgroup =
false;
165 myNamefromgroupmask =
"piece*"_UTsh;
166 myNumnames.setSize(1);
167 myNumrenames.setSize(0);
180 if (myAttribname != src.myAttribname)
return false;
181 if (myClass != src.myClass)
return false;
182 if (myDonamefromgroup != src.myDonamefromgroup)
return false;
183 if (myNamefromgroupmask != src.myNamefromgroupmask)
return false;
184 if (myNumnames != src.myNumnames)
return false;
185 if (myNumrenames != src.myNumrenames)
return false;
199 myAttribname =
"name"_UTsh;
201 graph->
evalOpParm(myAttribname, nodeidx,
"attribname", time, 0);
204 graph->
evalOpParm(myClass, nodeidx,
"class", time, 0);
205 myDonamefromgroup =
false;
207 graph->
evalOpParm(myDonamefromgroup, nodeidx,
"donamefromgroup", time, 0);
208 myNamefromgroupmask =
"piece*"_UTsh;
209 if (
true && ( (
true&&!(((getDonamefromgroup()==0)))) ) )
210 graph->
evalOpParm(myNamefromgroupmask, nodeidx,
"namefromgroupmask", time, 0);
214 graph->
evalOpParm(length, nodeidx,
"numnames", time, 0);
215 if (length < 0) length = 0;
216 myNumnames.setSize(length);
223 auto && _curentry = myNumnames(i);
225 _curentry.group =
""_UTsh;
227 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, 0, 2-1);
228 _curentry.name =
""_UTsh;
230 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
239 graph->
evalOpParm(length, nodeidx,
"numrenames", time, 0);
240 if (length < 0) length = 0;
241 myNumrenames.setSize(length);
248 auto && _curentry = myNumrenames(i);
250 _curentry.enable =
true;
252 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
253 _curentry.global =
false;
254 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
255 graph->
evalOpParmInst(_curentry.global, nodeidx,
"global#", parmidx, offsets, time, 0, 2-1);
256 _curentry.from =
""_UTsh;
257 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
258 graph->
evalOpParmInst(_curentry.from, nodeidx,
"from#", parmidx, offsets, time, 0, 2-1);
259 _curentry.to =
""_UTsh;
260 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
261 graph->
evalOpParmInst(_curentry.to, nodeidx,
"to#", parmidx, offsets, time, 0, 2-1);
266 myNumrenames.clear();
282 template <
typename T>
289 if (idx.
size() != instance.
size()+1)
294 coerceValue(value, myAttribname);
297 coerceValue(value, myClass);
300 coerceValue(value, myDonamefromgroup);
303 coerceValue(value, myNamefromgroupmask);
307 coerceValue(value, myNumnames.entries());
308 else if (instance[0] < myNumnames.entries())
310 auto && _data = myNumnames(instance[0]);
314 coerceValue(value, _data.group);
317 coerceValue(value, _data.name);
325 coerceValue(value, myNumrenames.entries());
326 else if (instance[0] < myNumrenames.entries())
328 auto && _data = myNumrenames(instance[0]);
332 coerceValue(value, _data.enable);
335 coerceValue(value, _data.global);
338 coerceValue(value, _data.from);
341 coerceValue(value, _data.to);
361 { doGetParmValue(idx, instance, value); }
363 { doGetParmValue(idx, instance, value); }
365 { doGetParmValue(idx, instance, value); }
367 { doGetParmValue(idx, instance, value); }
369 { doGetParmValue(idx, instance, value); }
371 { doGetParmValue(idx, instance, value); }
373 { doGetParmValue(idx, instance, value); }
375 { doGetParmValue(idx, instance, value); }
377 { doGetParmValue(idx, instance, value); }
379 { doGetParmValue(idx, instance, value); }
381 { doGetParmValue(idx, instance, value); }
383 template <
typename T>
390 if (idx.
size() != instance.
size()+1)
395 coerceValue(myAttribname, ( ( value ) ));
398 coerceValue(myClass, clampMinValue(0, clampMaxValue(2, value ) ));
401 coerceValue(myDonamefromgroup, ( ( value ) ));
404 coerceValue(myNamefromgroupmask, ( ( value ) ));
410 coerceValue(newsize, value);
411 if (newsize < 0) newsize = 0;
412 myNumnames.setSize(newsize);
418 myNumnames.setSizeIfNeeded(instance[0]+1);
419 auto && _data = myNumnames(instance[0]);
423 coerceValue(_data.group, value);
426 coerceValue(_data.name, value);
436 coerceValue(newsize, value);
437 if (newsize < 0) newsize = 0;
438 myNumrenames.setSize(newsize);
444 myNumrenames.setSizeIfNeeded(instance[0]+1);
445 auto && _data = myNumrenames(instance[0]);
449 coerceValue(_data.enable, value);
452 coerceValue(_data.global, value);
455 coerceValue(_data.from, value);
458 coerceValue(_data.to, value);
469 { doSetParmValue(idx, instance, value); }
471 { doSetParmValue(idx, instance, value); }
473 { doSetParmValue(idx, instance, value); }
475 { doSetParmValue(idx, instance, value); }
477 { doSetParmValue(idx, instance, value); }
479 { doSetParmValue(idx, instance, value); }
481 { doSetParmValue(idx, instance, value); }
483 { doSetParmValue(idx, instance, value); }
485 { doSetParmValue(idx, instance, value); }
487 { doSetParmValue(idx, instance, value); }
489 { doSetParmValue(idx, instance, value); }
509 if (fieldnum.
size() < 1)
518 return "donamefromgroup";
520 return "namefromgroupmask";
522 if (fieldnum.
size() == 1)
534 if (fieldnum.
size() == 1)
556 if (fieldnum.
size() < 1)
557 return PARM_UNSUPPORTED;
569 if (fieldnum.
size() == 1)
570 return PARM_MULTIPARM;
579 return PARM_UNSUPPORTED;
581 if (fieldnum.
size() == 1)
582 return PARM_MULTIPARM;
595 return PARM_UNSUPPORTED;
598 return PARM_UNSUPPORTED;
634 loadData(is, rampdata);
652 int typelen = colon - data.
buffer();
666 {
int64 iv =
v; UTwrite(os, &iv); }
668 { UTwrite<fpreal64>(os, &
v); }
670 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
672 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
673 UTwrite<fpreal64>(os, &v.
z()); }
675 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
676 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
688 if (s) s->save(ostr);
690 saveData(os, result);
697 ostr << s->getDataTypeToken();
702 saveData(os, result);
706 void save(std::ostream &os)
const
710 saveData(os, myAttribname);
711 saveData(os, myClass);
712 saveData(os, myDonamefromgroup);
713 saveData(os, myNamefromgroupmask);
716 UTwrite(os, &length);
719 auto && _curentry = myNumnames(i);
721 saveData(os, _curentry.group);
722 saveData(os, _curentry.name);
728 UTwrite(os, &length);
731 auto && _curentry = myNumrenames(i);
733 saveData(os, _curentry.enable);
734 saveData(os, _curentry.global);
735 saveData(os, _curentry.from);
736 saveData(os, _curentry.to);
752 loadData(is, myAttribname);
753 loadData(is, myClass);
754 loadData(is, myDonamefromgroup);
755 loadData(is, myNamefromgroupmask);
759 myNumnames.setSize(length);
762 auto && _curentry = myNumnames(i);
764 loadData(is, _curentry.group);
765 loadData(is, _curentry.name);
772 myNumrenames.setSize(length);
775 auto && _curentry = myNumrenames(i);
777 loadData(is, _curentry.enable);
778 loadData(is, _curentry.global);
779 loadData(is, _curentry.from);
780 loadData(is, _curentry.to);
793 if (!thissop)
return getAttribname();
795 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
803 if (!thissop)
return getClass();
805 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
806 return Class(result);
813 if (!thissop)
return getDonamefromgroup();
815 OP_Utils::evalOpParm(result, thissop,
"donamefromgroup", cookparms.
getCookTime(), 0);
823 if (!thissop)
return getNamefromgroupmask();
825 OP_Utils::evalOpParm(result, thissop,
"namefromgroupmask", cookparms.
getCookTime(), 0);
833 if (!thissop)
return getNumnames().entries();
835 OP_Utils::evalOpParm(result, thissop,
"numnames", cookparms.
getCookTime(), 0);
839 {
return opinstNumnames_group(cookparms, &_idx); }
843 if (!thissop)
return (myNumnames(_idx[0]).group);
845 _parmidx[1-1] = _idx[1-1] + 1;
848 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
852 {
return opinstNumnames_name(cookparms, &_idx); }
856 if (!thissop)
return (myNumnames(_idx[0]).
name);
858 _parmidx[1-1] = _idx[1-1] + 1;
861 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
870 if (!thissop)
return getNumrenames().entries();
872 OP_Utils::evalOpParm(result, thissop,
"numrenames", cookparms.
getCookTime(), 0);
876 {
return opinstNumrenames_enable(cookparms, &_idx); }
880 if (!thissop)
return (myNumrenames(_idx[0]).enable);
882 _parmidx[1-1] = _idx[1-1] + 1;
885 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
889 {
return opinstNumrenames_global(cookparms, &_idx); }
893 if (!thissop)
return (myNumrenames(_idx[0]).global);
895 _parmidx[1-1] = _idx[1-1] + 1;
898 OP_Utils::evalOpParmInst(result, thissop,
"global#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
902 {
return opinstNumrenames_from(cookparms, &_idx); }
906 if (!thissop)
return (myNumrenames(_idx[0]).from);
908 _parmidx[1-1] = _idx[1-1] + 1;
911 OP_Utils::evalOpParmInst(result, thissop,
"from#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
915 {
return opinstNumrenames_to(cookparms, &_idx); }
919 if (!thissop)
return (myNumrenames(_idx[0]).to);
921 _parmidx[1-1] = _idx[1-1] + 1;
924 OP_Utils::evalOpParmInst(result, thissop,
"to#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
932 bool myDonamefromgroup;
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const Numrenames &src) const
GLenum GLuint GLenum GLsizei const GLchar * buf
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
SOP_Node * getNode() const
bool operator==(const SOP_NameParms &src) const
static void saveData(std::ostream &os, UT_Vector3D v)
exint bread(int32 *buffer, exint asize=1)
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder opNumrenames_from(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GT_API const UT_StringHolder time
UT_StringHolder opAttribname(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setDonamefromgroup(bool val)
void copyFrom(const OP_NodeParms *src) override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_StringHolder createString(const UT_Array< Numnames > &list) const
**But if you need a result
static void saveData(std::ostream &os, int64 v)
exint opNumnames(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder createString(const UT_Array< Numrenames > &list) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool opDonamefromgroup(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
const UT_StringHolder & getAttribname() const
static void saveData(std::ostream &os, UT_Matrix2D v)
GLuint GLsizei const GLuint const GLintptr * offsets
UT_StringHolder opinstNumnames_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool getDonamefromgroup() const
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder opNamefromgroupmask(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opinstNumrenames_from(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNamefromgroupmask(const UT_StringHolder &val)
bool operator!=(const Numnames &src) const
UT_StringHolder opinstNumrenames_to(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint getNestNumParms(TempIndex idx) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
const char * getNestParmName(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNumnames(const UT_Array< Numnames > &val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_StringHolder opNumnames_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
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
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
GLuint const GLchar * name
bool opinstNumrenames_global(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const UT_Array< Numnames > & getNumnames() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Matrix4D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Class enum_value)
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
exint entries() const
Alias of size(). size() is preferred.
UT_StringHolder opNumrenames_to(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint opNumrenames(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumnames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNumrenames(const UT_Array< Numrenames > &val)
void save(std::ostream &os) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool opinstNumrenames_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
bool opNumrenames_global(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getNamefromgroupmask() const
static void saveData(std::ostream &os, fpreal64 v)
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, bool &v)
bool opNumrenames_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool operator!=(const Numrenames &src) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setAttribname(const UT_StringHolder &val)
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool operator==(const Numnames &src) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool isParmColorRamp(exint idx) const override
UT_StringHolder opinstNumnames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const char * findChar(int c) const
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
const UT_Array< Numrenames > & getNumrenames() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator!=(const SOP_NameParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept