20 using namespace UT::Literal;
23 namespace SOP_AddEnums
57 if (usept != src.
usept)
return false;
58 if (pt != src.
pt)
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 myAddparticlesystem =
false;
155 myParticlegroup =
""_sh;
156 myAppendunusedtoparticlesystem =
false;
166 if (myKeep != src.myKeep)
return false;
167 if (myPoints != src.myPoints)
return false;
168 if (myRemove != src.myRemove)
return false;
169 if (myPrims != src.myPrims)
return false;
170 if (mySwitcher != src.mySwitcher)
return false;
171 if (myGroup != src.myGroup)
return false;
172 if (myAdd != src.myAdd)
return false;
173 if (myInc != src.myInc)
return false;
174 if (myAttrname != src.myAttrname)
return false;
175 if (myClosedall != src.myClosedall)
return false;
176 if (myAddparticlesystem != src.myAddparticlesystem)
return false;
177 if (myParticlegroup != src.myParticlegroup)
return false;
178 if (myAppendunusedtoparticlesystem != src.myAppendunusedtoparticlesystem)
return false;
193 if (
true && ( (!((((graph->
getInput(nodeidx,0)>=0)==0)))) ) )
194 graph->
evalOpParm(myKeep, nodeidx,
"keep", time, 0);
198 graph->
evalOpParm(length, nodeidx,
"points", time, 0);
199 myPoints.entries(length);
203 auto && _curentry = myPoints(i);
205 myPoints(i).usept =
false;
207 graph->
evalOpParmInst(myPoints(i).usept, nodeidx,
"usept#", &parmidx, time, 0);
209 if (
true && ( (!(((_curentry.usept==0)))) ) )
210 graph->
evalOpParmInst(myPoints(i).pt, nodeidx,
"pt#", &parmidx, time, 0);
211 myPoints(i).weight = 1;
212 if (
true && ( (!(((_curentry.usept==0)))) ) )
221 graph->
evalOpParm(myRemove, nodeidx,
"remove", time, 0);
225 graph->
evalOpParm(length, nodeidx,
"prims", time, 0);
226 myPrims.entries(length);
230 auto && _curentry = myPrims(i);
232 myPrims(i).prim =
""_sh;
234 graph->
evalOpParmInst(myPrims(i).prim, nodeidx,
"prim#", &parmidx, time, 0);
235 myPrims(i).closed =
false;
237 graph->
evalOpParmInst(myPrims(i).closed, nodeidx,
"closed#", &parmidx, time, 0);
245 graph->
evalOpParm(mySwitcher, nodeidx,
"switcher", time, 0);
248 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
251 graph->
evalOpParm(myAdd, nodeidx,
"add", time, 0);
253 if (
true && ( (!(((
int64(getAdd())==0))||((
int64(getAdd())==3))||((
int64(getAdd())==4)))) ) )
254 graph->
evalOpParm(myInc, nodeidx,
"inc", time, 0);
256 if (
true && ( (!(((
int64(getAdd())!=4)))) ) )
257 graph->
evalOpParm(myAttrname, nodeidx,
"attrname", time, 0);
260 graph->
evalOpParm(myClosedall, nodeidx,
"closedall", time, 0);
261 myAddparticlesystem =
false;
263 graph->
evalOpParm(myAddparticlesystem, nodeidx,
"addparticlesystem", time, 0);
264 myParticlegroup =
""_sh;
265 if (
true && ( (!(((getAddparticlesystem()==0)))) ) )
266 graph->
evalOpParm(myParticlegroup, nodeidx,
"particlegroup", time, 0);
267 myAppendunusedtoparticlesystem =
false;
269 graph->
evalOpParm(myAppendunusedtoparticlesystem, nodeidx,
"appendunusedtoparticlesystem", time, 0);
285 template <
typename T>
292 if (idx.
size() != instance.
size()+1)
297 coerceValue(value, myKeep);
301 coerceValue(value, myPoints.entries());
302 else if (instance[0] < myPoints.entries())
304 auto && _data = myPoints(instance[0]);
308 coerceValue(value, _data.usept);
311 coerceValue(value, _data.pt);
314 coerceValue(value, _data.weight);
321 coerceValue(value, myRemove);
325 coerceValue(value, myPrims.entries());
326 else if (instance[0] < myPrims.entries())
328 auto && _data = myPrims(instance[0]);
332 coerceValue(value, _data.prim);
335 coerceValue(value, _data.closed);
342 coerceValue(value, mySwitcher);
345 coerceValue(value, myGroup);
348 coerceValue(value, myAdd);
351 coerceValue(value, myInc);
354 coerceValue(value, myAttrname);
357 coerceValue(value, myClosedall);
360 coerceValue(value, myAddparticlesystem);
363 coerceValue(value, myParticlegroup);
366 coerceValue(value, myAppendunusedtoparticlesystem);
373 { doGetParmValue(idx, instance, value); }
375 { doGetParmValue(idx, instance, value); }
377 { doGetParmValue(idx, instance, value); }
379 { doGetParmValue(idx, instance, value); }
381 { doGetParmValue(idx, instance, value); }
383 { doGetParmValue(idx, instance, value); }
385 { doGetParmValue(idx, instance, value); }
387 { doGetParmValue(idx, instance, value); }
389 { doGetParmValue(idx, instance, value); }
391 { doGetParmValue(idx, instance, value); }
393 { doGetParmValue(idx, instance, value); }
395 template <
typename T>
402 if (idx.
size() != instance.
size()+1)
407 coerceValue(myKeep, value);
413 coerceValue(newsize, value);
414 myPoints.setSize(newsize);
418 myPoints.setSizeIfNeeded(instance[0]+1);
419 auto && _data = myPoints(instance[0]);
423 coerceValue(_data.usept, value);
426 coerceValue(_data.pt, value);
429 coerceValue(_data.weight, value);
436 coerceValue(myRemove, value);
442 coerceValue(newsize, value);
443 myPrims.setSize(newsize);
447 myPrims.setSizeIfNeeded(instance[0]+1);
448 auto && _data = myPrims(instance[0]);
452 coerceValue(_data.prim, value);
455 coerceValue(_data.closed, value);
462 coerceValue(mySwitcher, value);
465 coerceValue(myGroup, value);
468 coerceValue(myAdd, value);
471 coerceValue(myInc, value);
474 coerceValue(myAttrname, value);
477 coerceValue(myClosedall, value);
480 coerceValue(myAddparticlesystem, value);
483 coerceValue(myParticlegroup, value);
486 coerceValue(myAppendunusedtoparticlesystem, value);
493 { doSetParmValue(idx, instance, value); }
495 { doSetParmValue(idx, instance, value); }
497 { doSetParmValue(idx, instance, value); }
499 { doSetParmValue(idx, instance, value); }
501 { doSetParmValue(idx, instance, value); }
503 { doSetParmValue(idx, instance, value); }
505 { doSetParmValue(idx, instance, value); }
507 { doSetParmValue(idx, instance, value); }
509 { doSetParmValue(idx, instance, value); }
511 { doSetParmValue(idx, instance, value); }
513 { doSetParmValue(idx, instance, value); }
533 if (fieldnum.
size() < 1)
540 if (fieldnum.
size() == 1)
556 if (fieldnum.
size() == 1)
580 return "addparticlesystem";
582 return "particlegroup";
584 return "appendunusedtoparticlesystem";
592 if (fieldnum.
size() < 1)
593 return PARM_UNSUPPORTED;
599 if (fieldnum.
size() == 1)
600 return PARM_MULTIPARM;
611 return PARM_UNSUPPORTED;
615 if (fieldnum.
size() == 1)
616 return PARM_MULTIPARM;
625 return PARM_UNSUPPORTED;
646 return PARM_UNSUPPORTED;
682 loadData(is, rampdata);
700 int typelen = colon - data.
buffer();
714 {
int64 iv =
v; UTwrite(os, &iv); }
716 { UTwrite<fpreal64>(os, &
v); }
718 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
720 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
721 UTwrite<fpreal64>(os, &v.
z()); }
723 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
724 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
736 if (s) s->save(ostr);
738 saveData(os, result);
745 ostr << s->getDataTypeToken();
750 saveData(os, result);
754 void save(std::ostream &os)
const
758 saveData(os, myKeep);
761 UTwrite(os, &length);
764 saveData(os, myPoints(i).usept);
765 saveData(os, myPoints(i).pt);
766 saveData(os, myPoints(i).
weight);
770 saveData(os, myRemove);
773 UTwrite(os, &length);
776 saveData(os, myPrims(i).prim);
777 saveData(os, myPrims(i).closed);
781 saveData(os, mySwitcher);
782 saveData(os, myGroup);
785 saveData(os, myAttrname);
786 saveData(os, myClosedall);
787 saveData(os, myAddparticlesystem);
788 saveData(os, myParticlegroup);
789 saveData(os, myAppendunusedtoparticlesystem);
802 loadData(is, myKeep);
806 myPoints.entries(length);
809 loadData(is, myPoints(i).usept);
810 loadData(is, myPoints(i).pt);
811 loadData(is, myPoints(i).
weight);
815 loadData(is, myRemove);
819 myPrims.entries(length);
822 loadData(is, myPrims(i).prim);
823 loadData(is, myPrims(i).closed);
827 loadData(is, mySwitcher);
828 loadData(is, myGroup);
831 loadData(is, myAttrname);
832 loadData(is, myClosedall);
833 loadData(is, myAddparticlesystem);
834 loadData(is, myParticlegroup);
835 loadData(is, myAppendunusedtoparticlesystem);
845 if (!thissop)
return getKeep();
847 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
855 if (!thissop)
return getPoints().entries();
857 OP_Utils::evalOpParm(result, thissop,
"points", cookparms.
getCookTime(), 0);
863 if (!thissop)
return (myPoints(_idx).usept);
864 int _parmidx = _idx + 0;
866 OP_Utils::evalOpParmInst(result, thissop,
"usept#", &_parmidx, cookparms.
getCookTime(), 0);
872 if (!thissop)
return (myPoints(_idx).pt);
873 int _parmidx = _idx + 0;
875 OP_Utils::evalOpParmInst(result, thissop,
"pt#", &_parmidx, cookparms.
getCookTime(), 0);
881 if (!thissop)
return (myPoints(_idx).
weight);
882 int _parmidx = _idx + 0;
884 OP_Utils::evalOpParmInst(result, thissop,
"weight#", &_parmidx, cookparms.
getCookTime(), 0);
893 if (!thissop)
return getRemove();
895 OP_Utils::evalOpParm(result, thissop,
"remove", cookparms.
getCookTime(), 0);
903 if (!thissop)
return getPrims().entries();
905 OP_Utils::evalOpParm(result, thissop,
"prims", cookparms.
getCookTime(), 0);
911 if (!thissop)
return (myPrims(_idx).prim);
912 int _parmidx = _idx + 0;
914 OP_Utils::evalOpParmInst(result, thissop,
"prim#", &_parmidx, cookparms.
getCookTime(), 0);
920 if (!thissop)
return (myPrims(_idx).closed);
921 int _parmidx = _idx + 0;
923 OP_Utils::evalOpParmInst(result, thissop,
"closed#", &_parmidx, cookparms.
getCookTime(), 0);
932 if (!thissop)
return getSwitcher();
934 OP_Utils::evalOpParm(result, thissop,
"switcher", cookparms.
getCookTime(), 0);
942 if (!thissop)
return getGroup();
944 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
952 if (!thissop)
return getAdd();
954 OP_Utils::evalOpParm(result, thissop,
"add", cookparms.
getCookTime(), 0);
962 if (!thissop)
return getInc();
964 OP_Utils::evalOpParm(result, thissop,
"inc", cookparms.
getCookTime(), 0);
972 if (!thissop)
return getAttrname();
974 OP_Utils::evalOpParm(result, thissop,
"attrname", cookparms.
getCookTime(), 0);
982 if (!thissop)
return getClosedall();
984 OP_Utils::evalOpParm(result, thissop,
"closedall", cookparms.
getCookTime(), 0);
992 if (!thissop)
return getAddparticlesystem();
994 OP_Utils::evalOpParm(result, thissop,
"addparticlesystem", cookparms.
getCookTime(), 0);
1002 if (!thissop)
return getParticlegroup();
1004 OP_Utils::evalOpParm(result, thissop,
"particlegroup", cookparms.
getCookTime(), 0);
1012 if (!thissop)
return getAppendunusedtoparticlesystem();
1014 OP_Utils::evalOpParm(result, thissop,
"appendunusedtoparticlesystem", cookparms.
getCookTime(), 0);
1029 bool myAddparticlesystem;
1031 bool myAppendunusedtoparticlesystem;
const UT_StringHolder & getGroup() const
bool operator==(const SOP_AddParms &src) const
bool opClosedall(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const Prims &src) const
const UT_StringHolder & getParticlegroup() const
fpreal64 opPoints_weight(const SOP_NodeVerb::CookParms &cookparms, exint _idx) 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
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, int *inst, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
bool opPoints_usept(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
GLuint const GLfloat * val
GLuint GLuint GLfloat weight
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setSwitcher(int64 val)
void setClosedall(bool val)
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)
const SOP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setPrims(const UT_Array< Prims > &val)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Vector4D v)
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
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
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)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
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)
SYS_FORCE_INLINE const char * buffer() const
bool operator==(const Points &src) const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool getAppendunusedtoparticlesystem() const
GLint GLenum GLsizei GLint GLsizei const void * data
exint read(bool *array, exint sz=1)
bool opAddparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
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
GLuint GLsizei GLsizei * length
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
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
DEP_MicroNode * depnode() const
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
bool opPrims_closed(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
int64 opInc(const SOP_NodeVerb::CookParms &cookparms) const
void setAppendunusedtoparticlesystem(bool val)
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
SYS_FORCE_INLINE void append(char character)
GLdouble GLdouble GLdouble r
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< Prims > & getPrims() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal getCookTime() const
void setPoints(const UT_Array< Points > &val)
void setAttrname(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void copyFrom(const SOP_NodeParms *src) 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
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GLenum GLuint GLsizei const GLchar * buf
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opParticlegroup(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
UT_StringHolder opPrims_prim(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void save(std::ostream &os) const
bool opAppendunusedtoparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() 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
SYS_FORCE_INLINE bool isstring() const
UT_Vector3D opPoints_pt(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder createString(const UT_Array< Points > &list) const