23 namespace SOP_AddEnums
57 if (usept != src.
usept)
return false;
58 if (pt != src.
pt)
return false;
59 if (weight != src.
weight)
return false;
75 for (
int i = 0; i < list.
entries(); i++)
83 buf.
appendSprintf(
"(%f, %f, %f)", list(i).pt.x(), list(i).pt.y(), list(i).pt.z());
109 if (prim != src.
prim)
return false;
110 if (closed != src.
closed)
return false;
126 for (
int i = 0; i < list.
entries(); i++)
134 buf.
appendSprintf(
"%s", (list(i).closed) ?
"true" :
"false");
154 myAttrname =
""_UTsh;
156 myAddparticlesystem =
false;
157 myParticlegroup =
""_UTsh;
158 myAppendunusedtoparticlesystem =
false;
171 if (myKeep != src.myKeep)
return false;
172 if (myPoints != src.myPoints)
return false;
173 if (myRemove != src.myRemove)
return false;
174 if (myPrims != src.myPrims)
return false;
175 if (mySwitcher != src.mySwitcher)
return false;
176 if (myGroup != src.myGroup)
return false;
177 if (myAdd != src.myAdd)
return false;
178 if (myInc != src.myInc)
return false;
179 if (myAttrname != src.myAttrname)
return false;
180 if (myClosedall != src.myClosedall)
return false;
181 if (myAddparticlesystem != src.myAddparticlesystem)
return false;
182 if (myParticlegroup != src.myParticlegroup)
return false;
183 if (myAppendunusedtoparticlesystem != src.myAppendunusedtoparticlesystem)
return false;
198 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)==0)))) ) )
199 graph->
evalOpParm(myKeep, nodeidx,
"keep", time, 0);
203 graph->
evalOpParm(length, nodeidx,
"points", time, 0);
204 if (length < 0) length = 0;
205 myPoints.setSize(length);
212 auto && _curentry = myPoints(i);
214 _curentry.usept =
true;
216 graph->
evalOpParmInst(_curentry.usept, nodeidx,
"usept#", parmidx, offsets, time, 0, 2-1);
218 if (
true && ( (
true&&!(((_curentry.usept==0)))) ) )
219 graph->
evalOpParmInst(_curentry.pt, nodeidx,
"pt#", parmidx, offsets, time, 0, 2-1);
220 _curentry.weight = 1;
221 if (
true && ( (
true&&!(((_curentry.usept==0)))) ) )
222 graph->
evalOpParmInst(_curentry.weight, nodeidx,
"weight#", parmidx, offsets, time, 0, 2-1);
230 graph->
evalOpParm(myRemove, nodeidx,
"remove", time, 0);
234 graph->
evalOpParm(length, nodeidx,
"prims", time, 0);
235 if (length < 0) length = 0;
236 myPrims.setSize(length);
243 auto && _curentry = myPrims(i);
245 _curentry.prim =
""_UTsh;
247 graph->
evalOpParmInst(_curentry.prim, nodeidx,
"prim#", parmidx, offsets, time, 0, 2-1);
248 _curentry.closed =
false;
250 graph->
evalOpParmInst(_curentry.closed, nodeidx,
"closed#", parmidx, offsets, time, 0, 2-1);
258 graph->
evalOpParm(mySwitcher, nodeidx,
"switcher", time, 0);
261 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
264 graph->
evalOpParm(myAdd, nodeidx,
"add", time, 0);
266 if (
true && ( (
true&&!(((
int64(getAdd())==0))||((
int64(getAdd())==3))||((
int64(getAdd())==4)))) ) )
267 graph->
evalOpParm(myInc, nodeidx,
"inc", time, 0);
268 myAttrname =
""_UTsh;
269 if (
true && ( (
true&&!(((
int64(getAdd())!=4)))) ) )
270 graph->
evalOpParm(myAttrname, nodeidx,
"attrname", time, 0);
273 graph->
evalOpParm(myClosedall, nodeidx,
"closedall", time, 0);
274 myAddparticlesystem =
false;
276 graph->
evalOpParm(myAddparticlesystem, nodeidx,
"addparticlesystem", time, 0);
277 myParticlegroup =
""_UTsh;
278 if (
true && ( (
true&&!(((getAddparticlesystem()==0)))) ) )
279 graph->
evalOpParm(myParticlegroup, nodeidx,
"particlegroup", time, 0);
280 myAppendunusedtoparticlesystem =
false;
282 graph->
evalOpParm(myAppendunusedtoparticlesystem, nodeidx,
"appendunusedtoparticlesystem", time, 0);
298 template <
typename T>
305 if (idx.
size() != instance.
size()+1)
315 else if (instance[0] < myPoints.entries())
317 auto && _data = myPoints(instance[0]);
339 else if (instance[0] < myPrims.entries())
341 auto && _data = myPrims(instance[0]);
379 coerceValue(value, myAppendunusedtoparticlesystem);
386 { doGetParmValue(idx, instance, value); }
388 { doGetParmValue(idx, instance, value); }
390 { doGetParmValue(idx, instance, value); }
392 { doGetParmValue(idx, instance, value); }
394 { doGetParmValue(idx, instance, value); }
396 { doGetParmValue(idx, instance, value); }
398 { doGetParmValue(idx, instance, value); }
400 { doGetParmValue(idx, instance, value); }
402 { doGetParmValue(idx, instance, value); }
404 { doGetParmValue(idx, instance, value); }
406 { doGetParmValue(idx, instance, value); }
408 template <
typename T>
415 if (idx.
size() != instance.
size()+1)
427 if (newsize < 0) newsize = 0;
428 myPoints.setSize(newsize);
434 myPoints.setSizeIfNeeded(instance[0]+1);
435 auto && _data = myPoints(instance[0]);
459 if (newsize < 0) newsize = 0;
460 myPrims.setSize(newsize);
466 myPrims.setSizeIfNeeded(instance[0]+1);
467 auto && _data = myPrims(instance[0]);
505 coerceValue(myAppendunusedtoparticlesystem, ( ( value ) ));
512 { doSetParmValue(idx, instance, value); }
514 { doSetParmValue(idx, instance, value); }
516 { doSetParmValue(idx, instance, value); }
518 { doSetParmValue(idx, instance, value); }
520 { doSetParmValue(idx, instance, value); }
522 { doSetParmValue(idx, instance, value); }
524 { doSetParmValue(idx, instance, value); }
526 { doSetParmValue(idx, instance, value); }
528 { doSetParmValue(idx, instance, value); }
530 { doSetParmValue(idx, instance, value); }
532 { doSetParmValue(idx, instance, value); }
552 if (fieldnum.
size() < 1)
559 if (fieldnum.
size() == 1)
575 if (fieldnum.
size() == 1)
599 return "addparticlesystem";
601 return "particlegroup";
603 return "appendunusedtoparticlesystem";
611 if (fieldnum.
size() < 1)
612 return PARM_UNSUPPORTED;
618 if (fieldnum.
size() == 1)
619 return PARM_MULTIPARM;
634 if (fieldnum.
size() == 1)
635 return PARM_MULTIPARM;
684 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
686 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
688 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
701 loadData(is, rampdata);
719 int typelen = colon - data.
buffer();
733 {
int64 iv =
v; UTwrite(os, &iv); }
735 { UTwrite<fpreal64>(os, &
v); }
737 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
739 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
740 UTwrite<fpreal64>(os, &v.
z()); }
742 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
743 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
755 if (s) s->save(ostr);
757 saveData(os, result);
764 ostr << s->getDataTypeToken();
769 saveData(os, result);
773 void save(std::ostream &os)
const
777 saveData(os, myKeep);
780 UTwrite(os, &length);
783 auto && _curentry = myPoints(i);
785 saveData(os, _curentry.usept);
786 saveData(os, _curentry.pt);
787 saveData(os, _curentry.weight);
791 saveData(os, myRemove);
794 UTwrite(os, &length);
797 auto && _curentry = myPrims(i);
799 saveData(os, _curentry.prim);
800 saveData(os, _curentry.closed);
804 saveData(os, mySwitcher);
805 saveData(os, myGroup);
808 saveData(os, myAttrname);
809 saveData(os, myClosedall);
810 saveData(os, myAddparticlesystem);
811 saveData(os, myParticlegroup);
812 saveData(os, myAppendunusedtoparticlesystem);
825 loadData(is, myKeep);
829 myPoints.setSize(length);
832 auto && _curentry = myPoints(i);
834 loadData(is, _curentry.usept);
835 loadData(is, _curentry.pt);
836 loadData(is, _curentry.weight);
840 loadData(is, myRemove);
844 myPrims.setSize(length);
847 auto && _curentry = myPrims(i);
849 loadData(is, _curentry.prim);
850 loadData(is, _curentry.closed);
854 loadData(is, mySwitcher);
855 loadData(is, myGroup);
858 loadData(is, myAttrname);
859 loadData(is, myClosedall);
860 loadData(is, myAddparticlesystem);
861 loadData(is, myParticlegroup);
862 loadData(is, myAppendunusedtoparticlesystem);
872 if (!thissop)
return getKeep();
874 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
882 if (!thissop)
return getPoints().entries();
884 OP_Utils::evalOpParm(result, thissop,
"points", cookparms.
getCookTime(), 0);
888 {
return opinstPoints_usept(cookparms, &_idx); }
892 if (!thissop)
return (myPoints(_idx[0]).usept);
894 _parmidx[1-1] = _idx[1-1] + 0;
897 OP_Utils::evalOpParmInst(result, thissop,
"usept#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
901 {
return opinstPoints_pt(cookparms, &_idx); }
905 if (!thissop)
return (myPoints(_idx[0]).pt);
907 _parmidx[1-1] = _idx[1-1] + 0;
910 OP_Utils::evalOpParmInst(result, thissop,
"pt#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
914 {
return opinstPoints_weight(cookparms, &_idx); }
918 if (!thissop)
return (myPoints(_idx[0]).weight);
920 _parmidx[1-1] = _idx[1-1] + 0;
923 OP_Utils::evalOpParmInst(result, thissop,
"weight#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
932 if (!thissop)
return getRemove();
934 OP_Utils::evalOpParm(result, thissop,
"remove", cookparms.
getCookTime(), 0);
942 if (!thissop)
return getPrims().entries();
944 OP_Utils::evalOpParm(result, thissop,
"prims", cookparms.
getCookTime(), 0);
948 {
return opinstPrims_prim(cookparms, &_idx); }
952 if (!thissop)
return (myPrims(_idx[0]).prim);
954 _parmidx[1-1] = _idx[1-1] + 0;
957 OP_Utils::evalOpParmInst(result, thissop,
"prim#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
961 {
return opinstPrims_closed(cookparms, &_idx); }
965 if (!thissop)
return (myPrims(_idx[0]).closed);
967 _parmidx[1-1] = _idx[1-1] + 0;
970 OP_Utils::evalOpParmInst(result, thissop,
"closed#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
979 if (!thissop)
return getSwitcher();
981 OP_Utils::evalOpParm(result, thissop,
"switcher", cookparms.
getCookTime(), 0);
989 if (!thissop)
return getGroup();
991 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
999 if (!thissop)
return getAdd();
1001 OP_Utils::evalOpParm(result, thissop,
"add", cookparms.
getCookTime(), 0);
1009 if (!thissop)
return getInc();
1011 OP_Utils::evalOpParm(result, thissop,
"inc", cookparms.
getCookTime(), 0);
1019 if (!thissop)
return getAttrname();
1021 OP_Utils::evalOpParm(result, thissop,
"attrname", cookparms.
getCookTime(), 0);
1029 if (!thissop)
return getClosedall();
1031 OP_Utils::evalOpParm(result, thissop,
"closedall", cookparms.
getCookTime(), 0);
1039 if (!thissop)
return getAddparticlesystem();
1041 OP_Utils::evalOpParm(result, thissop,
"addparticlesystem", cookparms.
getCookTime(), 0);
1049 if (!thissop)
return getParticlegroup();
1051 OP_Utils::evalOpParm(result, thissop,
"particlegroup", cookparms.
getCookTime(), 0);
1059 if (!thissop)
return getAppendunusedtoparticlesystem();
1061 OP_Utils::evalOpParm(result, thissop,
"appendunusedtoparticlesystem", cookparms.
getCookTime(), 0);
1076 bool myAddparticlesystem;
1078 bool myAppendunusedtoparticlesystem;
const UT_StringHolder & getGroup() const
bool operator==(const SOP_AddParms &src) const
GLenum GLuint GLenum GLsizei const GLchar * buf
fpreal64 opPoints_weight(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opClosedall(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const Prims &src) const
const UT_StringHolder & getParticlegroup() const
static void saveData(std::ostream &os, UT_Matrix3D v)
SOP_Node * getNode() const
const UT_StringHolder & getAttrname() const
static void saveData(std::ostream &os, UT_Matrix2D v)
const char * getNestParmName(TempIndex fieldnum) const override
bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool operator!=(const SOP_AddParms &src) const
T clampMaxValue(fpreal maxvalue, const T &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
exint bread(int32 *buffer, exint asize=1)
bool opPrims_closed(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
bool opPoints_usept(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setSwitcher(int64 val)
const OP_Context & context() const
void setClosedall(bool val)
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setPrims(const UT_Array< Prims > &val)
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Vector4D v)
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void setParticlegroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
T clampMinValue(fpreal minvalue, const T &src) const
UT_StringHolder createString(const UT_Array< Prims > &list) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
GLuint GLsizei const GLuint const GLintptr * offsets
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opinstPrims_closed(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE const char * buffer() const
bool operator==(const Points &src) const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
bool getAppendunusedtoparticlesystem() const
UT_Vector3D opinstPoints_pt(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void copyFrom(const OP_NodeParms *src) override
exint read(bool *array, exint sz=1)
bool opAddparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
exint opPoints(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
UT_Vector3D opPoints_pt(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
exint opPrims(const SOP_NodeVerb::CookParms &cookparms) const
bool getAddparticlesystem() const
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool opRemove(const SOP_NodeVerb::CookParms &cookparms) const
int64 opSwitcher(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool opinstPoints_usept(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Vector3D v)
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, fpreal64 &v)
exint entries() const
Alias of size(). size() is preferred.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool operator!=(const Points &src) const
static void saveData(std::ostream &os, bool v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
bool load(UT_IStream &is)
UT_StringHolder opAttrname(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const Prims &src) const
int64 getSwitcher() const
void coerceValue(T &result, const S &src) const
int64 opInc(const SOP_NodeVerb::CookParms &cookparms) const
void setAppendunusedtoparticlesystem(bool val)
DEP_MicroNode * depnode() const
UT_StringHolder opinstPrims_prim(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setGroup(const UT_StringHolder &val)
Add opAdd(const SOP_NodeVerb::CookParms &cookparms) const
bool getClosedall() const
Utility class for containing a color ramp.
static void saveData(std::ostream &os, int64 v)
const UT_Array< Points > & getPoints() const
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
fpreal64 opinstPoints_weight(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< Prims > & getPrims() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal getCookTime() const
void setPoints(const UT_Array< Points > &val)
UT_StringHolder opPrims_prim(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setAttrname(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
const char * findChar(int c) const
void setAddparticlesystem(bool val)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
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_Matrix2D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opParticlegroup(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void save(std::ostream &os) const
bool opAppendunusedtoparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Vector4D &v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder createString(const UT_Array< Points > &list) const