23 namespace SOP_MergePackedEnums
64 if (useinput != src.
useinput)
return false;
82 for (
int i = 0; i < list.
entries(); i++)
88 buf.
appendSprintf(
"%s", (list(i).useinput) ?
"true" :
"false");
104 mySetPrimName =
true;
105 myPrimName =
"name"_UTsh;
106 mySetPrimIndex =
false;
107 myPrimIndex =
"index"_UTsh;
108 myNameOverride =
false;
109 myNameOverrideAttrib =
"name"_UTsh;
111 myOnlyPackUnpacked =
false;
112 myIgnoreEmpty =
false;
114 mySingleMode =
false;
130 if (mySetPrimName != src.mySetPrimName)
return false;
131 if (myPrimName != src.myPrimName)
return false;
132 if (mySetPrimIndex != src.mySetPrimIndex)
return false;
133 if (myPrimIndex != src.myPrimIndex)
return false;
134 if (myNameOverride != src.myNameOverride)
return false;
135 if (myNameOverrideAttrib != src.myNameOverrideAttrib)
return false;
136 if (myPack != src.myPack)
return false;
137 if (myOnlyPackUnpacked != src.myOnlyPackUnpacked)
return false;
138 if (myIgnoreEmpty != src.myIgnoreEmpty)
return false;
139 if (myNamingMethod != src.myNamingMethod)
return false;
140 if (mySingleMode != src.mySingleMode)
return false;
141 if (mySingleIndex != src.mySingleIndex)
return false;
142 if (myNames != src.myNames)
return false;
143 if (myPivot != src.myPivot)
return false;
159 mySetPrimName =
true;
161 graph->
evalOpParm(mySetPrimName, nodeidx,
"setprimname", time, 0);
162 myPrimName =
"name"_UTsh;
163 if (
true && ( (
true&&!(((getSetPrimName()!=1)))) ) )
164 graph->
evalOpParm(myPrimName, nodeidx,
"primname", time, 0);
165 mySetPrimIndex =
false;
167 graph->
evalOpParm(mySetPrimIndex, nodeidx,
"setprimindex", time, 0);
168 myPrimIndex =
"index"_UTsh;
169 if (
true && ( (
true&&!(((getSetPrimIndex()!=1)))) ) )
170 graph->
evalOpParm(myPrimIndex, nodeidx,
"primindex", time, 0);
171 myNameOverride =
false;
173 graph->
evalOpParm(myNameOverride, nodeidx,
"nameoverride", time, 0);
174 myNameOverrideAttrib =
"name"_UTsh;
175 if (
true && ( (
true&&!(((getNameOverride()!=1)))) ) )
176 graph->
evalOpParm(myNameOverrideAttrib, nodeidx,
"nameoverrideattrib", time, 0);
179 graph->
evalOpParm(myPack, nodeidx,
"pack", time, 0);
180 myOnlyPackUnpacked =
false;
181 if (
true && ( (
true&&!(((getPack()!=1)))) ) )
182 graph->
evalOpParm(myOnlyPackUnpacked, nodeidx,
"onlypackunpacked", time, 0);
183 myIgnoreEmpty =
false;
185 graph->
evalOpParm(myIgnoreEmpty, nodeidx,
"ignoreempty", time, 0);
188 graph->
evalOpParm(myNamingMethod, nodeidx,
"namingmethod", time, 0);
189 mySingleMode =
false;
191 graph->
evalOpParm(mySingleMode, nodeidx,
"singlemode", time, 0);
193 if (
true && ( (
true&&!(((getSingleMode()!=1)))) ) )
194 graph->
evalOpParm(mySingleIndex, nodeidx,
"singleindex", time, 0);
198 graph->
evalOpParm(length, nodeidx,
"names", time, 0);
199 if (length < 0) length = 0;
200 myNames.setSize(length);
207 auto && _curentry = myNames(i);
209 _curentry.useinput =
true;
211 graph->
evalOpParmInst(_curentry.useinput, nodeidx,
"useinput#", parmidx, offsets, time, 0, 2-1);
212 _curentry.name =
""_UTsh;
214 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
215 _curentry.treatasfolder = 0;
217 graph->
evalOpParmInst(_curentry.treatasfolder, nodeidx,
"treatasfolder#", parmidx, offsets, time, 0, 2-1);
224 if (
true && ( (
true&&!(((getPack()!=1)))) ) )
225 graph->
evalOpParm(myPivot, nodeidx,
"pivot", time, 0);
241 template <
typename T>
248 if (idx.
size() != instance.
size()+1)
291 else if (instance[0] < myNames.entries())
293 auto && _data = myNames(instance[0]);
326 { doGetParmValue(idx, instance, value); }
328 { doGetParmValue(idx, instance, value); }
330 { doGetParmValue(idx, instance, value); }
332 { doGetParmValue(idx, instance, value); }
334 { doGetParmValue(idx, instance, value); }
336 { doGetParmValue(idx, instance, value); }
338 { doGetParmValue(idx, instance, value); }
340 { doGetParmValue(idx, instance, value); }
342 { doGetParmValue(idx, instance, value); }
344 { doGetParmValue(idx, instance, value); }
346 { doGetParmValue(idx, instance, value); }
348 template <
typename T>
355 if (idx.
size() != instance.
size()+1)
400 if (newsize < 0) newsize = 0;
401 myNames.setSize(newsize);
407 myNames.setSizeIfNeeded(instance[0]+1);
408 auto && _data = myNames(instance[0]);
432 { doSetParmValue(idx, instance, value); }
434 { doSetParmValue(idx, instance, value); }
436 { doSetParmValue(idx, instance, value); }
438 { doSetParmValue(idx, instance, value); }
440 { doSetParmValue(idx, instance, value); }
442 { doSetParmValue(idx, instance, value); }
444 { doSetParmValue(idx, instance, value); }
446 { doSetParmValue(idx, instance, value); }
448 { doSetParmValue(idx, instance, value); }
450 { doSetParmValue(idx, instance, value); }
452 { doSetParmValue(idx, instance, value); }
470 if (fieldnum.
size() < 1)
475 return "setprimname";
479 return "setprimindex";
483 return "nameoverride";
485 return "nameoverrideattrib";
489 return "onlypackunpacked";
491 return "ignoreempty";
493 return "namingmethod";
497 return "singleindex";
499 if (fieldnum.
size() == 1)
508 return "treatasfolder#";
521 if (fieldnum.
size() < 1)
522 return PARM_UNSUPPORTED;
550 if (fieldnum.
size() == 1)
551 return PARM_MULTIPARM;
586 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
588 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
590 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
603 loadData(is, rampdata);
621 int typelen = colon - data.
buffer();
635 {
int64 iv =
v; UTwrite(os, &iv); }
637 { UTwrite<fpreal64>(os, &
v); }
639 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
641 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
642 UTwrite<fpreal64>(os, &v.
z()); }
644 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
645 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
657 if (s) s->save(ostr);
659 saveData(os, result);
666 ostr << s->getDataTypeToken();
671 saveData(os, result);
675 void save(std::ostream &os)
const
679 saveData(os, mySetPrimName);
680 saveData(os, myPrimName);
681 saveData(os, mySetPrimIndex);
682 saveData(os, myPrimIndex);
683 saveData(os, myNameOverride);
684 saveData(os, myNameOverrideAttrib);
685 saveData(os, myPack);
686 saveData(os, myOnlyPackUnpacked);
687 saveData(os, myIgnoreEmpty);
688 saveData(os, myNamingMethod);
689 saveData(os, mySingleMode);
690 saveData(os, mySingleIndex);
693 UTwrite(os, &length);
696 auto && _curentry = myNames(i);
698 saveData(os, _curentry.useinput);
699 saveData(os, _curentry.name);
700 saveData(os, _curentry.treatasfolder);
704 saveData(os, myPivot);
717 loadData(is, mySetPrimName);
718 loadData(is, myPrimName);
719 loadData(is, mySetPrimIndex);
720 loadData(is, myPrimIndex);
721 loadData(is, myNameOverride);
722 loadData(is, myNameOverrideAttrib);
723 loadData(is, myPack);
724 loadData(is, myOnlyPackUnpacked);
725 loadData(is, myIgnoreEmpty);
726 loadData(is, myNamingMethod);
727 loadData(is, mySingleMode);
728 loadData(is, mySingleIndex);
732 myNames.setSize(length);
735 auto && _curentry = myNames(i);
737 loadData(is, _curentry.useinput);
738 loadData(is, _curentry.name);
739 loadData(is, _curentry.treatasfolder);
743 loadData(is, myPivot);
753 if (!thissop)
return getSetPrimName();
755 OP_Utils::evalOpParm(result, thissop,
"setprimname", cookparms.
getCookTime(), 0);
763 if (!thissop)
return getPrimName();
765 OP_Utils::evalOpParm(result, thissop,
"primname", cookparms.
getCookTime(), 0);
773 if (!thissop)
return getSetPrimIndex();
775 OP_Utils::evalOpParm(result, thissop,
"setprimindex", cookparms.
getCookTime(), 0);
783 if (!thissop)
return getPrimIndex();
785 OP_Utils::evalOpParm(result, thissop,
"primindex", cookparms.
getCookTime(), 0);
793 if (!thissop)
return getNameOverride();
795 OP_Utils::evalOpParm(result, thissop,
"nameoverride", cookparms.
getCookTime(), 0);
803 if (!thissop)
return getNameOverrideAttrib();
805 OP_Utils::evalOpParm(result, thissop,
"nameoverrideattrib", cookparms.
getCookTime(), 0);
813 if (!thissop)
return getPack();
815 OP_Utils::evalOpParm(result, thissop,
"pack", cookparms.
getCookTime(), 0);
823 if (!thissop)
return getOnlyPackUnpacked();
825 OP_Utils::evalOpParm(result, thissop,
"onlypackunpacked", cookparms.
getCookTime(), 0);
833 if (!thissop)
return getIgnoreEmpty();
835 OP_Utils::evalOpParm(result, thissop,
"ignoreempty", cookparms.
getCookTime(), 0);
843 if (!thissop)
return getNamingMethod();
845 OP_Utils::evalOpParm(result, thissop,
"namingmethod", cookparms.
getCookTime(), 0);
853 if (!thissop)
return getSingleMode();
855 OP_Utils::evalOpParm(result, thissop,
"singlemode", cookparms.
getCookTime(), 0);
863 if (!thissop)
return getSingleIndex();
865 OP_Utils::evalOpParm(result, thissop,
"singleindex", cookparms.
getCookTime(), 0);
873 if (!thissop)
return getNames().entries();
875 OP_Utils::evalOpParm(result, thissop,
"names", cookparms.
getCookTime(), 0);
879 {
return opinstNames_useinput(cookparms, &_idx); }
883 if (!thissop)
return (myNames(_idx[0]).useinput);
885 _parmidx[1-1] = _idx[1-1] + 1;
888 OP_Utils::evalOpParmInst(result, thissop,
"useinput#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
892 {
return opinstNames_name(cookparms, &_idx); }
896 if (!thissop)
return (myNames(_idx[0]).
name);
898 _parmidx[1-1] = _idx[1-1] + 1;
901 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
905 {
return opinstNames_treatasfolder(cookparms, &_idx); }
909 if (!thissop)
return (myNames(_idx[0]).treatasfolder);
911 _parmidx[1-1] = _idx[1-1] + 1;
914 OP_Utils::evalOpParmInst(result, thissop,
"treatasfolder#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
923 if (!thissop)
return getPivot();
925 OP_Utils::evalOpParm(result, thissop,
"pivot", cookparms.
getCookTime(), 0);
926 return Pivot(result);
937 bool myOnlyPackUnpacked;
939 int64 myNamingMethod;
const UT_StringHolder & getNameOverrideAttrib() const
void setSingleMode(bool val)
UT_StringHolder opPrimIndex(const SOP_NodeVerb::CookParms &cookparms) const
bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
bool getSetPrimName() const
GLenum GLuint GLenum GLsizei const GLchar * buf
static void saveData(std::ostream &os, UT_Matrix4D v)
bool getIgnoreEmpty() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
SOP_Node * getNode() const
int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
T clampMaxValue(fpreal maxvalue, const T &src) const
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool load(UT_IStream &is)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setSetPrimName(bool val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setNameOverrideAttrib(const UT_StringHolder &val)
GLuint GLsizei GLsizei * length
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
**But if you need a result
bool opSetPrimName(const SOP_NodeVerb::CookParms &cookparms) const
exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_MergePackedParms &src) const
T clampMinValue(fpreal minvalue, const T &src) const
static void saveData(std::ostream &os, UT_Matrix3D 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.
int64 opSingleIndex(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setPrimIndex(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
int64 getSingleIndex() const
GLuint GLsizei const GLuint const GLintptr * offsets
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, bool v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
NamingMethod opNamingMethod(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNameOverrideAttrib(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNames(const UT_Array< Names > &val)
bool operator==(const SOP_MergePackedParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
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 setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPrimName(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
GLuint const GLchar * name
bool operator!=(const Names &src) const
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const 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_Matrix3D &value) const override
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setPrimName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
bool operator==(const Names &src) const
exint entries() const
Alias of size(). size() is preferred.
static void saveData(std::ostream &os, UT_Vector4D v)
void setNamingMethod(NamingMethod val)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
static void loadData(UT_IStream &is, UT_Vector3I &v)
void coerceValue(T &result, const S &src) const
bool getNameOverride() const
bool opNameOverride(const SOP_NodeVerb::CookParms &cookparms) const
bool getSetPrimIndex() const
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool isParmColorRamp(exint idx) const override
DEP_MicroNode * depnode() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, fpreal64 &v)
UT_StringHolder createString(const UT_Array< Names > &list) const
Utility class for containing a color ramp.
bool getOnlyPackUnpacked() const
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, fpreal64 v)
void setSetPrimIndex(bool val)
const UT_StringHolder & getPrimName() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal getCookTime() const
void save(std::ostream &os) const
NamingMethod getNamingMethod() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool opSingleMode(const SOP_NodeVerb::CookParms &cookparms) const
void setNameOverride(bool val)
void setSingleIndex(int64 val)
const char * findChar(int c) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setOnlyPackUnpacked(bool val)
const UT_Array< Names > & getNames() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool getSingleMode() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
const UT_StringHolder & getPrimIndex() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_StringHolder s)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, UT_Matrix2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opSetPrimIndex(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
void setIgnoreEmpty(bool val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void copyFrom(const OP_NodeParms *src) override