23 namespace SOP_CopyToPoints_2_0Enums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
73 using namespace UT::Literal;
94 using namespace UT::Literal;
115 using namespace UT::Literal;
116 switch (enum_value) {
146 applyattribs =
""_UTsh;
152 if (useapply != src.
useapply)
return false;
153 if (applyto != src.
applyto)
return false;
171 for (
int i = 0; i < list.
entries(); i++)
177 buf.
appendSprintf(
"%s", (list(i).useapply) ?
"true" :
"false");
195 mySourceGroup =
""_UTsh;
196 mySourceGroupType = 0;
197 myTargetGroup =
""_UTsh;
198 myUseIDAttrib =
false;
199 myIDAttrib =
"name"_UTsh;
204 myUseImplicitN =
true;
205 myTargetAttribs.setSize(0);
218 if (mySourceGroup != src.mySourceGroup)
return false;
219 if (mySourceGroupType != src.mySourceGroupType)
return false;
220 if (myTargetGroup != src.myTargetGroup)
return false;
221 if (myUseIDAttrib != src.myUseIDAttrib)
return false;
222 if (myIDAttrib != src.myIDAttrib)
return false;
223 if (myPack != src.myPack)
return false;
224 if (myPivot != src.myPivot)
return false;
225 if (myViewportLOD != src.myViewportLOD)
return false;
226 if (myTransform != src.myTransform)
return false;
227 if (myUseImplicitN != src.myUseImplicitN)
return false;
228 if (myTargetAttribs != src.myTargetAttribs)
return false;
246 mySourceGroup =
""_UTsh;
248 graph->
evalOpParm(mySourceGroup, nodeidx,
"sourcegroup", time, 0);
249 mySourceGroupType = 0;
251 graph->
evalOpParm(mySourceGroupType, nodeidx,
"sourcegrouptype", time, 0);
252 myTargetGroup =
""_UTsh;
254 graph->
evalOpParm(myTargetGroup, nodeidx,
"targetgroup", time, 0);
255 myUseIDAttrib =
false;
257 graph->
evalOpParm(myUseIDAttrib, nodeidx,
"useidattrib", time, 0);
258 myIDAttrib =
"name"_UTsh;
259 if (
true && ( (
true&&!(((getUseIDAttrib()==0)))) ) )
260 graph->
evalOpParm(myIDAttrib, nodeidx,
"idattrib", time, 0);
263 graph->
evalOpParm(myPack, nodeidx,
"pack", time, 0);
265 if (
true && ( (
true&&!(((getPack()==0)))) ) )
266 graph->
evalOpParm(myPivot, nodeidx,
"pivot", time, 0);
268 if (
true && ( (
true&&!(((getPack()==0)))) ) )
269 graph->
evalOpParm(myViewportLOD, nodeidx,
"viewportlod", time, 0);
272 graph->
evalOpParm(myTransform, nodeidx,
"transform", time, 0);
273 myUseImplicitN =
true;
274 if (
true && ( (
true&&!(((getTransform()==0)))) ) )
275 graph->
evalOpParm(myUseImplicitN, nodeidx,
"useimplicitn", time, 0);
279 graph->
evalOpParm(length, nodeidx,
"targetattribs", time, 0);
280 if (length < 0) length = 0;
281 myTargetAttribs.setSize(length);
288 auto && _curentry = myTargetAttribs(i);
290 _curentry.useapply =
true;
292 graph->
evalOpParmInst(_curentry.useapply, nodeidx,
"useapply#", parmidx, offsets, time, 0, 2-1);
293 _curentry.applyto = 0;
295 graph->
evalOpParmInst(_curentry.applyto, nodeidx,
"applyto#", parmidx, offsets, time, 0, 2-1);
296 _curentry.applymethod = 0;
298 graph->
evalOpParmInst(_curentry.applymethod, nodeidx,
"applymethod#", parmidx, offsets, time, 0, 2-1);
299 _curentry.applyattribs =
""_UTsh;
301 graph->
evalOpParmInst(_curentry.applyattribs, nodeidx,
"applyattribs#", parmidx, offsets, time, 0, 2-1);
306 myTargetAttribs.clear();
322 template <
typename T>
329 if (idx.
size() != instance.
size()+1)
334 coerceValue(value, mySourceGroup);
337 coerceValue(value, mySourceGroupType);
340 coerceValue(value, myTargetGroup);
343 coerceValue(value, myUseIDAttrib);
346 coerceValue(value, myIDAttrib);
349 coerceValue(value, myPack);
352 coerceValue(value, myPivot);
355 coerceValue(value, myViewportLOD);
358 coerceValue(value, myTransform);
361 coerceValue(value, myUseImplicitN);
365 coerceValue(value, myTargetAttribs.entries());
366 else if (instance[0] < myTargetAttribs.entries())
368 auto && _data = myTargetAttribs(instance[0]);
372 coerceValue(value, _data.useapply);
375 coerceValue(value, _data.applyto);
378 coerceValue(value, _data.applymethod);
381 coerceValue(value, _data.applyattribs);
401 { doGetParmValue(idx, instance, value); }
403 { doGetParmValue(idx, instance, value); }
405 { doGetParmValue(idx, instance, value); }
407 { doGetParmValue(idx, instance, value); }
409 { doGetParmValue(idx, instance, value); }
411 { doGetParmValue(idx, instance, value); }
413 { doGetParmValue(idx, instance, value); }
415 { doGetParmValue(idx, instance, value); }
417 { doGetParmValue(idx, instance, value); }
419 { doGetParmValue(idx, instance, value); }
421 { doGetParmValue(idx, instance, value); }
423 template <
typename T>
430 if (idx.
size() != instance.
size()+1)
435 coerceValue(mySourceGroup, ( ( value ) ));
438 coerceValue(mySourceGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
441 coerceValue(myTargetGroup, ( ( value ) ));
444 coerceValue(myUseIDAttrib, ( ( value ) ));
447 coerceValue(myIDAttrib, ( ( value ) ));
450 coerceValue(myPack, ( ( value ) ));
453 coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
456 coerceValue(myViewportLOD, clampMinValue(0, clampMaxValue(4, value ) ));
459 coerceValue(myTransform, ( ( value ) ));
462 coerceValue(myUseImplicitN, ( ( value ) ));
468 coerceValue(newsize, value);
469 if (newsize < 0) newsize = 0;
470 myTargetAttribs.setSize(newsize);
476 myTargetAttribs.setSizeIfNeeded(instance[0]+1);
477 auto && _data = myTargetAttribs(instance[0]);
481 coerceValue(_data.useapply, value);
484 coerceValue(_data.applyto, value);
487 coerceValue(_data.applymethod, value);
490 coerceValue(_data.applyattribs, 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); }
515 { doSetParmValue(idx, instance, value); }
517 { doSetParmValue(idx, instance, value); }
519 { doSetParmValue(idx, instance, value); }
521 { doSetParmValue(idx, instance, value); }
539 if (fieldnum.
size() < 1)
544 return "sourcegroup";
546 return "sourcegrouptype";
548 return "targetgroup";
550 return "useidattrib";
558 return "viewportlod";
562 return "useimplicitn";
564 if (fieldnum.
size() == 1)
565 return "targetattribs";
573 return "applymethod#";
575 return "applyattribs#";
586 if (fieldnum.
size() < 1)
587 return PARM_UNSUPPORTED;
611 if (fieldnum.
size() == 1)
612 return PARM_MULTIPARM;
625 return PARM_UNSUPPORTED;
628 return PARM_UNSUPPORTED;
664 loadData(is, rampdata);
682 int typelen = colon - data.
buffer();
696 {
int64 iv =
v; UTwrite(os, &iv); }
698 { UTwrite<fpreal64>(os, &
v); }
700 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
702 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
703 UTwrite<fpreal64>(os, &v.
z()); }
705 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
706 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
718 if (s) s->save(ostr);
720 saveData(os, result);
727 ostr << s->getDataTypeToken();
732 saveData(os, result);
736 void save(std::ostream &os)
const
740 saveData(os, mySourceGroup);
741 saveData(os, mySourceGroupType);
742 saveData(os, myTargetGroup);
743 saveData(os, myUseIDAttrib);
744 saveData(os, myIDAttrib);
745 saveData(os, myPack);
746 saveData(os, myPivot);
747 saveData(os, myViewportLOD);
748 saveData(os, myTransform);
749 saveData(os, myUseImplicitN);
752 UTwrite(os, &length);
755 auto && _curentry = myTargetAttribs(i);
757 saveData(os, _curentry.useapply);
758 saveData(os, _curentry.applyto);
759 saveData(os, _curentry.applymethod);
760 saveData(os, _curentry.applyattribs);
776 loadData(is, mySourceGroup);
777 loadData(is, mySourceGroupType);
778 loadData(is, myTargetGroup);
779 loadData(is, myUseIDAttrib);
780 loadData(is, myIDAttrib);
781 loadData(is, myPack);
782 loadData(is, myPivot);
783 loadData(is, myViewportLOD);
784 loadData(is, myTransform);
785 loadData(is, myUseImplicitN);
789 myTargetAttribs.setSize(length);
792 auto && _curentry = myTargetAttribs(i);
794 loadData(is, _curentry.useapply);
795 loadData(is, _curentry.applyto);
796 loadData(is, _curentry.applymethod);
797 loadData(is, _curentry.applyattribs);
810 if (!thissop)
return getSourceGroup();
812 OP_Utils::evalOpParm(result, thissop,
"sourcegroup", cookparms.
getCookTime(), 0);
820 if (!thissop)
return getSourceGroupType();
822 OP_Utils::evalOpParm(result, thissop,
"sourcegrouptype", cookparms.
getCookTime(), 0);
830 if (!thissop)
return getTargetGroup();
832 OP_Utils::evalOpParm(result, thissop,
"targetgroup", cookparms.
getCookTime(), 0);
840 if (!thissop)
return getUseIDAttrib();
842 OP_Utils::evalOpParm(result, thissop,
"useidattrib", cookparms.
getCookTime(), 0);
850 if (!thissop)
return getIDAttrib();
852 OP_Utils::evalOpParm(result, thissop,
"idattrib", cookparms.
getCookTime(), 0);
860 if (!thissop)
return getPack();
862 OP_Utils::evalOpParm(result, thissop,
"pack", cookparms.
getCookTime(), 0);
870 if (!thissop)
return getPivot();
872 OP_Utils::evalOpParm(result, thissop,
"pivot", cookparms.
getCookTime(), 0);
873 return Pivot(result);
880 if (!thissop)
return getViewportLOD();
882 OP_Utils::evalOpParm(result, thissop,
"viewportlod", cookparms.
getCookTime(), 0);
890 if (!thissop)
return getTransform();
892 OP_Utils::evalOpParm(result, thissop,
"transform", cookparms.
getCookTime(), 0);
900 if (!thissop)
return getUseImplicitN();
902 OP_Utils::evalOpParm(result, thissop,
"useimplicitn", cookparms.
getCookTime(), 0);
910 if (!thissop)
return getTargetAttribs().entries();
912 OP_Utils::evalOpParm(result, thissop,
"targetattribs", cookparms.
getCookTime(), 0);
916 {
return opinstTargetAttribs_useapply(cookparms, &_idx); }
920 if (!thissop)
return (myTargetAttribs(_idx[0]).useapply);
922 _parmidx[1-1] = _idx[1-1] + 1;
925 OP_Utils::evalOpParmInst(result, thissop,
"useapply#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
929 {
return opinstTargetAttribs_applyto(cookparms, &_idx); }
933 if (!thissop)
return (myTargetAttribs(_idx[0]).applyto);
935 _parmidx[1-1] = _idx[1-1] + 1;
938 OP_Utils::evalOpParmInst(result, thissop,
"applyto#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
942 {
return opinstTargetAttribs_applymethod(cookparms, &_idx); }
946 if (!thissop)
return (myTargetAttribs(_idx[0]).applymethod);
948 _parmidx[1-1] = _idx[1-1] + 1;
951 OP_Utils::evalOpParmInst(result, thissop,
"applymethod#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
955 {
return opinstTargetAttribs_applyattribs(cookparms, &_idx); }
959 if (!thissop)
return (myTargetAttribs(_idx[0]).applyattribs);
961 _parmidx[1-1] = _idx[1-1] + 1;
964 OP_Utils::evalOpParmInst(result, thissop,
"applyattribs#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
971 int64 mySourceGroupType;
SourceGroupType opSourceGroupType(const SOP_NodeVerb::CookParms &cookparms) const
GLenum GLuint GLenum GLsizei const GLchar * buf
int64 opinstTargetAttribs_applymethod(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setTargetGroup(const UT_StringHolder &val)
bool load(UT_IStream &is)
SOP_Node * getNode() const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder createString(const UT_Array< TargetAttribs > &list) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
void setTransform(bool val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setTargetAttribs(const UT_Array< TargetAttribs > &val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & z() noexcept
bool getUseImplicitN() const
SYS_FORCE_INLINE const char * buffer() const
GLuint GLsizei GLsizei * length
static void loadData(UT_IStream &is, UT_Matrix2D &v)
An output stream object that owns its own string buffer storage.
bool opinstTargetAttribs_useapply(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opUseImplicitN(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, bool &v)
bool getUseIDAttrib() const
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setSourceGroup(const UT_StringHolder &val)
void setSourceGroupType(SourceGroupType val)
UT_StringHolder opTargetGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setIDAttrib(const UT_StringHolder &val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool operator!=(const SOP_CopyToPoints_2_0Parms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opIDAttrib(const SOP_NodeVerb::CookParms &cookparms) const
int64 opTargetAttribs_applymethod(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void copyFrom(const OP_NodeParms *src) override
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opUseIDAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool getTransform() const
bool operator==(const TargetAttribs &src) const
Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2D &v)
const UT_StringHolder & getTargetGroup() const
UT_StringHolder opTargetAttribs_applyattribs(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, UT_SharedPtr< UT_Ramp > s)
int64 opTargetAttribs_applyto(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
exint opTargetAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< TargetAttribs > & getTargetAttribs() const
void setUseImplicitN(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool opTargetAttribs_useapply(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
ViewportLOD opViewportLOD(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opinstTargetAttribs_applyattribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strcat(const char *src)
static void saveData(std::ostream &os, fpreal64 v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
exint entries() const
Alias of size(). size() is preferred.
bool operator!=(const TargetAttribs &src) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setViewportLOD(ViewportLOD val)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
static void saveData(std::ostream &os, UT_Vector4D v)
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SOP_CopyToPoints_2_0Parms()
fpreal getCookTime() const
bool opTransform(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * findChar(int c) const
int64 opinstTargetAttribs_applyto(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setUseIDAttrib(bool val)
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, bool v)
exint getNestNumParms(TempIndex idx) const override
ViewportLOD getViewportLOD() const
UT_StringHolder opSourceGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool operator==(const SOP_CopyToPoints_2_0Parms &src) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
const UT_StringHolder & getSourceGroup() const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Matrix4D v)
SYS_FORCE_INLINE UT_StringHolder getToken(SourceGroupType enum_value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
const UT_StringHolder & getIDAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_StringHolder applyattribs
SourceGroupType getSourceGroupType() const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override