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;
196 graph->
evalOpParm(myFolder, nodeidx,
"folder", time, graph->
isDirect()?
nullptr:depnode);
199 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
203 myOnlyPackUnpacked =
false;
204 if (
true && ( (
true&&!(((getPack()!=1)))) ) )
205 graph->
evalOpParm(myOnlyPackUnpacked, nodeidx,
"onlypackunpacked", time, graph->
isDirect()?
nullptr:depnode);
206 myIgnoreEmpty =
false;
208 graph->
evalOpParm(myIgnoreEmpty, nodeidx,
"ignoreempty", time, graph->
isDirect()?
nullptr:depnode);
213 if (length < 0) length = 0;
214 myNames.setSize(length);
221 auto && _curentry = myNames(i);
223 _curentry.useinput =
true;
225 graph->
evalOpParmInst(_curentry.useinput, nodeidx,
"useinput#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
226 _curentry.name =
""_UTsh;
228 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
229 _curentry.type =
""_UTsh;
231 graph->
evalOpParmInst(_curentry.type, nodeidx,
"type#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
232 _curentry.visible = 0;
234 graph->
evalOpParmInst(_curentry.visible, nodeidx,
"visible#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
235 _curentry.treatasfolder = 0;
236 if (
true && ( (
true&&!(((_curentry.type==
"shp"))||((_curentry.type==
"skel"))||((_curentry.type==
"rig"))||((_curentry.type==
"ctrl"))||((_curentry.type==
"char"))||((_curentry.type==
"graph")))) ) )
237 graph->
evalOpParmInst(_curentry.treatasfolder, nodeidx,
"treatasfolder#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
258 template <
typename T>
265 if (idx.
size() != instance.
size()+1)
270 coerceValue(value, myFolder);
273 coerceValue(value, myMethod);
276 coerceValue(value, myPack);
279 coerceValue(value, myOnlyPackUnpacked);
282 coerceValue(value, myIgnoreEmpty);
286 coerceValue(value, myNames.entries());
287 else if (instance[0] < myNames.entries())
289 auto && _data = myNames(instance[0]);
293 coerceValue(value, _data.useinput);
296 coerceValue(value, _data.name);
299 coerceValue(value, _data.type);
302 coerceValue(value, _data.visible);
305 coerceValue(value, _data.treatasfolder);
325 { doGetParmValue(idx, instance, value); }
327 { doGetParmValue(idx, instance, value); }
329 { doGetParmValue(idx, instance, value); }
331 { doGetParmValue(idx, instance, value); }
333 { doGetParmValue(idx, instance, value); }
335 { doGetParmValue(idx, instance, value); }
337 { doGetParmValue(idx, instance, value); }
339 { doGetParmValue(idx, instance, value); }
341 { doGetParmValue(idx, instance, value); }
343 { doGetParmValue(idx, instance, value); }
345 { doGetParmValue(idx, instance, value); }
347 template <
typename T>
354 if (idx.
size() != instance.
size()+1)
359 coerceValue(myFolder, ( ( value ) ));
362 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
365 coerceValue(myPack, ( ( value ) ));
368 coerceValue(myOnlyPackUnpacked, ( ( value ) ));
371 coerceValue(myIgnoreEmpty, ( ( value ) ));
377 coerceValue(newsize, value);
378 if (newsize < 0) newsize = 0;
379 myNames.setSize(newsize);
385 myNames.setSizeIfNeeded(instance[0]+1);
386 auto && _data = myNames(instance[0]);
390 coerceValue(_data.useinput, value);
393 coerceValue(_data.name, value);
396 coerceValue(_data.type, value);
399 coerceValue(_data.visible, value);
402 coerceValue(_data.treatasfolder, value);
413 { doSetParmValue(idx, instance, value); }
415 { doSetParmValue(idx, instance, value); }
417 { doSetParmValue(idx, instance, value); }
419 { doSetParmValue(idx, instance, value); }
421 { doSetParmValue(idx, instance, value); }
423 { doSetParmValue(idx, instance, value); }
425 { doSetParmValue(idx, instance, value); }
427 { doSetParmValue(idx, instance, value); }
429 { doSetParmValue(idx, instance, value); }
431 { doSetParmValue(idx, instance, value); }
433 { doSetParmValue(idx, instance, value); }
451 if (fieldnum.
size() < 1)
462 return "onlypackunpacked";
464 return "ignoreempty";
466 if (fieldnum.
size() == 1)
479 return "treatasfolder#";
490 if (fieldnum.
size() < 1)
491 return PARM_UNSUPPORTED;
505 if (fieldnum.
size() == 1)
506 return PARM_MULTIPARM;
521 return PARM_UNSUPPORTED;
524 return PARM_UNSUPPORTED;
560 loadData(is, rampdata);
578 int typelen = colon - data.
buffer();
592 {
int64 iv =
v; UTwrite(os, &iv); }
594 { UTwrite<fpreal64>(os, &
v); }
596 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
598 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
599 UTwrite<fpreal64>(os, &v.
z()); }
601 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
602 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
614 if (s) s->save(ostr);
616 saveData(os, result);
623 ostr << s->getDataTypeToken();
628 saveData(os, result);
632 void save(std::ostream &os)
const
636 saveData(os, myFolder);
637 saveData(os, myMethod);
638 saveData(os, myPack);
639 saveData(os, myOnlyPackUnpacked);
640 saveData(os, myIgnoreEmpty);
643 UTwrite(os, &length);
646 auto && _curentry = myNames(i);
648 saveData(os, _curentry.useinput);
649 saveData(os, _curentry.name);
650 saveData(os, _curentry.type);
651 saveData(os, _curentry.visible);
652 saveData(os, _curentry.treatasfolder);
668 loadData(is, myFolder);
669 loadData(is, myMethod);
670 loadData(is, myPack);
671 loadData(is, myOnlyPackUnpacked);
672 loadData(is, myIgnoreEmpty);
676 myNames.setSize(length);
679 auto && _curentry = myNames(i);
681 loadData(is, _curentry.useinput);
682 loadData(is, _curentry.name);
683 loadData(is, _curentry.type);
684 loadData(is, _curentry.visible);
685 loadData(is, _curentry.treatasfolder);
698 if (!thissop)
return getFolder();
700 OP_Utils::evalOpParm(result, thissop,
"folder", cookparms.
getCookTime(), 0);
708 if (!thissop)
return getMethod();
710 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
718 if (!thissop)
return getPack();
720 OP_Utils::evalOpParm(result, thissop,
"pack", cookparms.
getCookTime(), 0);
728 if (!thissop)
return getOnlyPackUnpacked();
730 OP_Utils::evalOpParm(result, thissop,
"onlypackunpacked", cookparms.
getCookTime(), 0);
738 if (!thissop)
return getIgnoreEmpty();
740 OP_Utils::evalOpParm(result, thissop,
"ignoreempty", cookparms.
getCookTime(), 0);
748 if (!thissop)
return getNames().entries();
750 OP_Utils::evalOpParm(result, thissop,
"names", cookparms.
getCookTime(), 0);
754 {
return opinstNames_useinput(cookparms, &_idx); }
758 if (!thissop)
return (myNames(_idx[0]).useinput);
760 _parmidx[1-1] = _idx[1-1] + 1;
763 OP_Utils::evalOpParmInst(result, thissop,
"useinput#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
767 {
return opinstNames_name(cookparms, &_idx); }
771 if (!thissop)
return (myNames(_idx[0]).
name);
773 _parmidx[1-1] = _idx[1-1] + 1;
776 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
780 {
return opinstNames_type(cookparms, &_idx); }
784 if (!thissop)
return (myNames(_idx[0]).
type);
786 _parmidx[1-1] = _idx[1-1] + 1;
789 OP_Utils::evalOpParmInst(result, thissop,
"type#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
793 {
return opinstNames_visible(cookparms, &_idx); }
797 if (!thissop)
return (myNames(_idx[0]).visible);
799 _parmidx[1-1] = _idx[1-1] + 1;
802 OP_Utils::evalOpParmInst(result, thissop,
"visible#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
806 {
return opinstNames_treatasfolder(cookparms, &_idx); }
810 if (!thissop)
return (myNames(_idx[0]).treatasfolder);
812 _parmidx[1-1] = _idx[1-1] + 1;
815 OP_Utils::evalOpParmInst(result, thissop,
"treatasfolder#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
824 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)
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
GLint GLint GLsizei GLint GLenum GLenum type
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)
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
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