23 namespace SOP_GroupDeleteEnums
37 using namespace UT::Literal;
60 using namespace UT::Literal;
95 if (enable != src.
enable)
return false;
96 if (grouptype != src.
grouptype)
return false;
97 if (group != src.
group)
return false;
113 for (
int i = 0; i < list.
entries(); i++)
119 buf.
appendSprintf(
"%s", (list(i).enable) ?
"true" :
"false");
135 myDeletions.setSize(1);
137 mySelectiongroup =
""_UTsh;
138 mySelectiongrouptype = 0;
151 if (myDeletions != src.myDeletions)
return false;
152 if (myRemovegrp != src.myRemovegrp)
return false;
153 if (mySelectiongroup != src.mySelectiongroup)
return false;
154 if (mySelectiongrouptype != src.mySelectiongrouptype)
return false;
172 graph->
evalOpParm(length, nodeidx,
"deletions", time, 0);
173 if (length < 0) length = 0;
174 myDeletions.setSize(length);
181 auto && _curentry = myDeletions(i);
183 _curentry.enable =
true;
185 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
186 _curentry.grouptype = 0;
187 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
188 graph->
evalOpParmInst(_curentry.grouptype, nodeidx,
"grouptype#", parmidx, offsets, time, 0, 2-1);
189 _curentry.group =
""_UTsh;
190 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
191 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, 0, 2-1);
199 graph->
evalOpParm(myRemovegrp, nodeidx,
"removegrp", time, 0);
200 mySelectiongroup =
""_UTsh;
202 graph->
evalOpParm(mySelectiongroup, nodeidx,
"selectiongroup", time, 0);
203 mySelectiongrouptype = 0;
205 graph->
evalOpParm(mySelectiongrouptype, nodeidx,
"selectiongrouptype", time, 0);
221 template <
typename T>
228 if (idx.
size() != instance.
size()+1)
234 coerceValue(value, myDeletions.entries());
235 else if (instance[0] < myDeletions.entries())
237 auto && _data = myDeletions(instance[0]);
241 coerceValue(value, _data.enable);
244 coerceValue(value, _data.grouptype);
247 coerceValue(value, _data.group);
254 coerceValue(value, myRemovegrp);
257 coerceValue(value, mySelectiongroup);
260 coerceValue(value, mySelectiongrouptype);
276 { doGetParmValue(idx, instance, value); }
278 { doGetParmValue(idx, instance, value); }
280 { doGetParmValue(idx, instance, value); }
282 { doGetParmValue(idx, instance, value); }
284 { doGetParmValue(idx, instance, value); }
286 { doGetParmValue(idx, instance, value); }
288 { doGetParmValue(idx, instance, value); }
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 { doGetParmValue(idx, instance, value); }
298 template <
typename T>
305 if (idx.
size() != instance.
size()+1)
313 coerceValue(newsize, value);
314 if (newsize < 0) newsize = 0;
315 myDeletions.setSize(newsize);
321 myDeletions.setSizeIfNeeded(instance[0]+1);
322 auto && _data = myDeletions(instance[0]);
326 coerceValue(_data.enable, value);
329 coerceValue(_data.grouptype, value);
332 coerceValue(_data.group, value);
339 coerceValue(myRemovegrp, ( ( value ) ));
342 coerceValue(mySelectiongroup, ( ( value ) ));
345 coerceValue(mySelectiongrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
352 { doSetParmValue(idx, instance, value); }
354 { doSetParmValue(idx, instance, value); }
356 { doSetParmValue(idx, instance, value); }
358 { doSetParmValue(idx, instance, value); }
360 { doSetParmValue(idx, instance, value); }
362 { doSetParmValue(idx, instance, value); }
364 { doSetParmValue(idx, instance, value); }
366 { doSetParmValue(idx, instance, value); }
368 { doSetParmValue(idx, instance, value); }
370 { doSetParmValue(idx, instance, value); }
372 { doSetParmValue(idx, instance, value); }
390 if (fieldnum.
size() < 1)
395 if (fieldnum.
size() == 1)
411 return "selectiongroup";
413 return "selectiongrouptype";
421 if (fieldnum.
size() < 1)
422 return PARM_UNSUPPORTED;
426 if (fieldnum.
size() == 1)
427 return PARM_MULTIPARM;
438 return PARM_UNSUPPORTED;
447 return PARM_UNSUPPORTED;
483 loadData(is, rampdata);
501 int typelen = colon - data.
buffer();
515 {
int64 iv =
v; UTwrite(os, &iv); }
517 { UTwrite<fpreal64>(os, &
v); }
519 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
521 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
522 UTwrite<fpreal64>(os, &v.
z()); }
524 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
525 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
537 if (s) s->save(ostr);
539 saveData(os, result);
546 ostr << s->getDataTypeToken();
551 saveData(os, result);
555 void save(std::ostream &os)
const
561 UTwrite(os, &length);
564 auto && _curentry = myDeletions(i);
566 saveData(os, _curentry.enable);
567 saveData(os, _curentry.grouptype);
568 saveData(os, _curentry.group);
572 saveData(os, myRemovegrp);
573 saveData(os, mySelectiongroup);
574 saveData(os, mySelectiongrouptype);
590 myDeletions.setSize(length);
593 auto && _curentry = myDeletions(i);
595 loadData(is, _curentry.enable);
596 loadData(is, _curentry.grouptype);
597 loadData(is, _curentry.group);
601 loadData(is, myRemovegrp);
602 loadData(is, mySelectiongroup);
603 loadData(is, mySelectiongrouptype);
613 if (!thissop)
return getDeletions().entries();
615 OP_Utils::evalOpParm(result, thissop,
"deletions", cookparms.
getCookTime(), 0);
619 {
return opinstDeletions_enable(cookparms, &_idx); }
623 if (!thissop)
return (myDeletions(_idx[0]).enable);
625 _parmidx[1-1] = _idx[1-1] + 1;
628 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
632 {
return opinstDeletions_grouptype(cookparms, &_idx); }
636 if (!thissop)
return (myDeletions(_idx[0]).grouptype);
638 _parmidx[1-1] = _idx[1-1] + 1;
641 OP_Utils::evalOpParmInst(result, thissop,
"grouptype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
645 {
return opinstDeletions_group(cookparms, &_idx); }
649 if (!thissop)
return (myDeletions(_idx[0]).group);
651 _parmidx[1-1] = _idx[1-1] + 1;
654 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
663 if (!thissop)
return getRemovegrp();
665 OP_Utils::evalOpParm(result, thissop,
"removegrp", cookparms.
getCookTime(), 0);
673 if (!thissop)
return getSelectiongroup();
675 OP_Utils::evalOpParm(result, thissop,
"selectiongroup", cookparms.
getCookTime(), 0);
683 if (!thissop)
return getSelectiongrouptype();
685 OP_Utils::evalOpParm(result, thissop,
"selectiongrouptype", cookparms.
getCookTime(), 0);
693 int64 mySelectiongrouptype;
GLenum GLuint GLenum GLsizei const GLchar * buf
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
SOP_Node * getNode() const
const UT_Array< Deletions > & getDeletions() const
bool operator==(const Deletions &src) const
void save(std::ostream &os) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void copyFrom(const OP_NodeParms *src) override
Selectiongrouptype getSelectiongrouptype() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool opRemovegrp(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setRemovegrp(bool val)
UT_StringHolder opinstDeletions_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLuint GLsizei GLsizei * length
void setSelectiongroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
**But if you need a result
UT_StringHolder opSelectiongroup(const SOP_NodeVerb::CookParms &cookparms) 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.
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
const UT_StringHolder & getSelectiongroup() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_StringHolder opDeletions_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, int64 &v)
int64 opinstDeletions_grouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
bool getRemovegrp() const
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Vector3D v)
bool opDeletions_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setDeletions(const UT_Array< Deletions > &val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
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_Vector3D &value) override
void setSelectiongrouptype(Selectiongrouptype val)
exint getNestNumParms(TempIndex idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool load(UT_IStream &is)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool operator==(const SOP_GroupDeleteParms &src) 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
exint entries() const
Alias of size(). size() is preferred.
Selectiongrouptype opSelectiongrouptype(const SOP_NodeVerb::CookParms &cookparms) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
const char * getNestParmName(TempIndex fieldnum) const override
int64 opDeletions_grouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, bool &v)
DEP_MicroNode * depnode() const
UT_StringHolder createString(const UT_Array< Deletions > &list) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
LeafData & operator=(const LeafData &)=delete
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
Utility class for containing a color ramp.
static void saveData(std::ostream &os, fpreal64 v)
bool operator!=(const SOP_GroupDeleteParms &src) const
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
static void loadData(UT_IStream &is, UT_Matrix4D &v)
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opinstDeletions_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
bool operator!=(const Deletions &src) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool isParmColorRamp(exint idx) const override
exint opDeletions(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept