23 namespace SOP_PackFolderEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
70 using namespace UT::Literal;
106 if (useinput != src.
useinput)
return false;
109 if (visible != src.
visible)
return false;
126 for (
int i = 0; i < list.
entries(); i++)
132 buf.
appendSprintf(
"%s", (list(i).useinput) ?
"true" :
"false");
155 myOnlyPackUnpacked =
false;
156 myIgnoreEmpty =
false;
170 if (myFolder != src.myFolder)
return false;
171 if (myMethod != src.myMethod)
return false;
172 if (myPack != src.myPack)
return false;
173 if (myOnlyPackUnpacked != src.myOnlyPackUnpacked)
return false;
174 if (myIgnoreEmpty != src.myIgnoreEmpty)
return false;
175 if (myNames != src.myNames)
return false;
193 graph->
evalOpParm(myFolder, nodeidx,
"folder", time, 0);
196 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
199 graph->
evalOpParm(myPack, nodeidx,
"pack", time, 0);
200 myOnlyPackUnpacked =
false;
201 if (
true && ( (
true&&!(((getPack()!=1)))) ) )
202 graph->
evalOpParm(myOnlyPackUnpacked, nodeidx,
"onlypackunpacked", time, 0);
203 myIgnoreEmpty =
false;
205 graph->
evalOpParm(myIgnoreEmpty, nodeidx,
"ignoreempty", time, 0);
209 graph->
evalOpParm(length, nodeidx,
"names", time, 0);
210 if (length < 0) length = 0;
211 myNames.setSize(length);
218 auto && _curentry = myNames(i);
220 _curentry.useinput =
true;
222 graph->
evalOpParmInst(_curentry.useinput, nodeidx,
"useinput#", parmidx, offsets, time, 0, 2-1);
223 _curentry.name =
""_UTsh;
225 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
226 _curentry.type =
""_UTsh;
228 graph->
evalOpParmInst(_curentry.type, nodeidx,
"type#", parmidx, offsets, time, 0, 2-1);
229 _curentry.visible = 0;
231 graph->
evalOpParmInst(_curentry.visible, nodeidx,
"visible#", parmidx, offsets, time, 0, 2-1);
232 _curentry.treatasfolder = 0;
233 if (
true && ( (
true&&!(((_curentry.type==
"shp"))||((_curentry.type==
"skel"))||((_curentry.type==
"rig"))||((_curentry.type==
"ctrl"))||((_curentry.type==
"char"))||((_curentry.type==
"graph")))) ) )
234 graph->
evalOpParmInst(_curentry.treatasfolder, nodeidx,
"treatasfolder#", parmidx, offsets, time, 0, 2-1);
255 template <
typename T>
262 if (idx.
size() != instance.
size()+1)
267 coerceValue(value, myFolder);
270 coerceValue(value, myMethod);
273 coerceValue(value, myPack);
276 coerceValue(value, myOnlyPackUnpacked);
279 coerceValue(value, myIgnoreEmpty);
283 coerceValue(value, myNames.entries());
284 else if (instance[0] < myNames.entries())
286 auto && _data = myNames(instance[0]);
290 coerceValue(value, _data.useinput);
293 coerceValue(value, _data.name);
296 coerceValue(value, _data.type);
299 coerceValue(value, _data.visible);
302 coerceValue(value, _data.treatasfolder);
322 { doGetParmValue(idx, instance, value); }
324 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
351 if (idx.
size() != instance.
size()+1)
356 coerceValue(myFolder, ( ( value ) ));
359 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
362 coerceValue(myPack, ( ( value ) ));
365 coerceValue(myOnlyPackUnpacked, ( ( value ) ));
368 coerceValue(myIgnoreEmpty, ( ( value ) ));
374 coerceValue(newsize, value);
375 if (newsize < 0) newsize = 0;
376 myNames.setSize(newsize);
382 myNames.setSizeIfNeeded(instance[0]+1);
383 auto && _data = myNames(instance[0]);
387 coerceValue(_data.useinput, value);
390 coerceValue(_data.name, value);
393 coerceValue(_data.type, value);
396 coerceValue(_data.visible, value);
399 coerceValue(_data.treatasfolder, value);
410 { doSetParmValue(idx, instance, value); }
412 { doSetParmValue(idx, instance, value); }
414 { doSetParmValue(idx, instance, value); }
416 { doSetParmValue(idx, instance, value); }
418 { doSetParmValue(idx, instance, value); }
420 { doSetParmValue(idx, instance, value); }
422 { doSetParmValue(idx, instance, value); }
424 { doSetParmValue(idx, instance, value); }
426 { doSetParmValue(idx, instance, value); }
428 { doSetParmValue(idx, instance, value); }
430 { doSetParmValue(idx, instance, value); }
448 if (fieldnum.
size() < 1)
459 return "onlypackunpacked";
461 return "ignoreempty";
463 if (fieldnum.
size() == 1)
476 return "treatasfolder#";
487 if (fieldnum.
size() < 1)
488 return PARM_UNSUPPORTED;
502 if (fieldnum.
size() == 1)
503 return PARM_MULTIPARM;
518 return PARM_UNSUPPORTED;
521 return PARM_UNSUPPORTED;
557 loadData(is, rampdata);
575 int typelen = colon - data.
buffer();
589 {
int64 iv =
v; UTwrite(os, &iv); }
591 { UTwrite<fpreal64>(os, &
v); }
593 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
595 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
596 UTwrite<fpreal64>(os, &v.
z()); }
598 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
599 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
611 if (s) s->save(ostr);
613 saveData(os, result);
620 ostr << s->getDataTypeToken();
625 saveData(os, result);
629 void save(std::ostream &os)
const
633 saveData(os, myFolder);
634 saveData(os, myMethod);
635 saveData(os, myPack);
636 saveData(os, myOnlyPackUnpacked);
637 saveData(os, myIgnoreEmpty);
640 UTwrite(os, &length);
643 auto && _curentry = myNames(i);
645 saveData(os, _curentry.useinput);
646 saveData(os, _curentry.name);
647 saveData(os, _curentry.type);
648 saveData(os, _curentry.visible);
649 saveData(os, _curentry.treatasfolder);
665 loadData(is, myFolder);
666 loadData(is, myMethod);
667 loadData(is, myPack);
668 loadData(is, myOnlyPackUnpacked);
669 loadData(is, myIgnoreEmpty);
673 myNames.setSize(length);
676 auto && _curentry = myNames(i);
678 loadData(is, _curentry.useinput);
679 loadData(is, _curentry.name);
680 loadData(is, _curentry.type);
681 loadData(is, _curentry.visible);
682 loadData(is, _curentry.treatasfolder);
695 if (!thissop)
return getFolder();
697 OP_Utils::evalOpParm(result, thissop,
"folder", cookparms.
getCookTime(), 0);
705 if (!thissop)
return getMethod();
707 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
715 if (!thissop)
return getPack();
717 OP_Utils::evalOpParm(result, thissop,
"pack", cookparms.
getCookTime(), 0);
725 if (!thissop)
return getOnlyPackUnpacked();
727 OP_Utils::evalOpParm(result, thissop,
"onlypackunpacked", cookparms.
getCookTime(), 0);
735 if (!thissop)
return getIgnoreEmpty();
737 OP_Utils::evalOpParm(result, thissop,
"ignoreempty", cookparms.
getCookTime(), 0);
745 if (!thissop)
return getNames().entries();
747 OP_Utils::evalOpParm(result, thissop,
"names", cookparms.
getCookTime(), 0);
751 {
return opinstNames_useinput(cookparms, &_idx); }
755 if (!thissop)
return (myNames(_idx[0]).useinput);
757 _parmidx[1-1] = _idx[1-1] + 1;
760 OP_Utils::evalOpParmInst(result, thissop,
"useinput#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
764 {
return opinstNames_name(cookparms, &_idx); }
768 if (!thissop)
return (myNames(_idx[0]).
name);
770 _parmidx[1-1] = _idx[1-1] + 1;
773 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
777 {
return opinstNames_type(cookparms, &_idx); }
781 if (!thissop)
return (myNames(_idx[0]).
type);
783 _parmidx[1-1] = _idx[1-1] + 1;
786 OP_Utils::evalOpParmInst(result, thissop,
"type#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
790 {
return opinstNames_visible(cookparms, &_idx); }
794 if (!thissop)
return (myNames(_idx[0]).visible);
796 _parmidx[1-1] = _idx[1-1] + 1;
799 OP_Utils::evalOpParmInst(result, thissop,
"visible#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
803 {
return opinstNames_treatasfolder(cookparms, &_idx); }
807 if (!thissop)
return (myNames(_idx[0]).treatasfolder);
809 _parmidx[1-1] = _idx[1-1] + 1;
812 OP_Utils::evalOpParmInst(result, thissop,
"treatasfolder#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
821 bool myOnlyPackUnpacked;
int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint getNestNumParms(TempIndex idx) const override
void setOnlyPackUnpacked(bool val)
GLenum GLuint GLenum GLsizei const GLchar * buf
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool load(UT_IStream &is)
bool operator!=(const SOP_PackFolderParms &src) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_Matrix4D v)
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setIgnoreEmpty(bool val)
bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool getOnlyPackUnpacked() const
void setFolder(const UT_StringHolder &val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
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 loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
int64 opNames_visible(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opFolder(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getFolder() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, int64 v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_StringHolder opNames_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
bool operator==(const SOP_PackFolderParms &src) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setMethod(Method val)
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 saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder createString(const UT_Array< Names > &list) const
bool operator!=(const Names &src) const
static void saveData(std::ostream &os, UT_Vector3D v)
GLuint const GLchar * name
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
int64 opinstNames_visible(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
void setNames(const UT_Array< Names > &val)
exint entries() const
Alias of size(). size() is preferred.
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal getCookTime() const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const char * findChar(int c) const
UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
bool operator==(const Names &src) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool getIgnoreEmpty() const
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
const UT_Array< Names > & getNames() const
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept