23 namespace SOP_AttribCopyEnums
35 using namespace UT::Literal;
54 using namespace UT::Literal;
72 using namespace UT::Literal;
90 using namespace UT::Literal;
112 using namespace UT::Literal;
113 switch (enum_value) {
134 mySrcgroup =
""_UTsh;
136 myDestgroup =
""_UTsh;
138 myMatchbyattribute =
false;
139 myMatchbyattributemethod = 0;
140 myAttributetomatch =
"piece"_UTsh;
142 myAttribname =
"Cd"_UTsh;
144 myUsenewname =
false;
147 myCopyvariable =
true;
161 if (mySrcgroup != src.mySrcgroup)
return false;
162 if (mySrcgrouptype != src.mySrcgrouptype)
return false;
163 if (myDestgroup != src.myDestgroup)
return false;
164 if (myDestgrouptype != src.myDestgrouptype)
return false;
165 if (myMatchbyattribute != src.myMatchbyattribute)
return false;
166 if (myMatchbyattributemethod != src.myMatchbyattributemethod)
return false;
167 if (myAttributetomatch != src.myAttributetomatch)
return false;
168 if (myAttrib != src.myAttrib)
return false;
169 if (myAttribname != src.myAttribname)
return false;
170 if (myCopyp != src.myCopyp)
return false;
171 if (myUsenewname != src.myUsenewname)
return false;
172 if (myNewname != src.myNewname)
return false;
173 if (myClass != src.myClass)
return false;
174 if (myCopyvariable != src.myCopyvariable)
return false;
175 if (myCopydata != src.myCopydata)
return false;
193 mySrcgroup =
""_UTsh;
195 graph->
evalOpParm(mySrcgroup, nodeidx,
"srcgroup", time, 0);
198 graph->
evalOpParm(mySrcgrouptype, nodeidx,
"srcgrouptype", time, 0);
199 myDestgroup =
""_UTsh;
201 graph->
evalOpParm(myDestgroup, nodeidx,
"destgroup", time, 0);
204 graph->
evalOpParm(myDestgrouptype, nodeidx,
"destgrouptype", time, 0);
205 myMatchbyattribute =
false;
206 if (
true && ( (
true&&!(((
int64(getSrcgrouptype())==0)&&(
int64(getDestgrouptype())!=0))||((
int64(getSrcgrouptype())==1)&&(
int64(getDestgrouptype())!=1))||((
int64(getSrcgrouptype())==2)&&(
int64(getDestgrouptype())!=2)))) ) )
207 graph->
evalOpParm(myMatchbyattribute, nodeidx,
"matchbyattribute", time, 0);
208 myMatchbyattributemethod = 0;
209 if (
true && ( (
true&&!(((getMatchbyattribute()==0))||((
int64(getSrcgrouptype())==0)&&(
int64(getDestgrouptype())!=0))||((
int64(getSrcgrouptype())==1)&&(
int64(getDestgrouptype())!=1))||((
int64(getSrcgrouptype())==2)&&(
int64(getDestgrouptype())!=2)))) ) )
210 graph->
evalOpParm(myMatchbyattributemethod, nodeidx,
"matchbyattributemethod", time, 0);
211 myAttributetomatch =
"piece"_UTsh;
212 if (
true && ( (
true&&!(((getMatchbyattribute()==0))||((
int64(getSrcgrouptype())==0)&&(
int64(getDestgrouptype())!=0))||((
int64(getSrcgrouptype())==1)&&(
int64(getDestgrouptype())!=1))||((
int64(getSrcgrouptype())==2)&&(
int64(getDestgrouptype())!=2)))) ) )
213 graph->
evalOpParm(myAttributetomatch, nodeidx,
"attributetomatch", time, 0);
216 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
217 myAttribname =
"Cd"_UTsh;
219 graph->
evalOpParm(myAttribname, nodeidx,
"attribname", time, 0);
222 graph->
evalOpParm(myCopyp, nodeidx,
"copyp", time, 0);
223 myUsenewname =
false;
225 graph->
evalOpParm(myUsenewname, nodeidx,
"usenewname", time, 0);
227 if (
true && ( (
true&&!(((getUsenewname()==0)))) ) )
228 graph->
evalOpParm(myNewname, nodeidx,
"newname", time, 0);
231 graph->
evalOpParm(myClass, nodeidx,
"class", time, 0);
232 myCopyvariable =
true;
233 if (
true && ( (
true&&!(((getUsenewname()==1)))) ) )
234 graph->
evalOpParm(myCopyvariable, nodeidx,
"copyvariable", time, 0);
237 graph->
evalOpParm(myCopydata, nodeidx,
"copydata", time, 0);
253 template <
typename T>
260 if (idx.
size() != instance.
size()+1)
265 coerceValue(value, mySrcgroup);
268 coerceValue(value, mySrcgrouptype);
271 coerceValue(value, myDestgroup);
274 coerceValue(value, myDestgrouptype);
277 coerceValue(value, myMatchbyattribute);
280 coerceValue(value, myMatchbyattributemethod);
283 coerceValue(value, myAttributetomatch);
286 coerceValue(value, myAttrib);
289 coerceValue(value, myAttribname);
292 coerceValue(value, myCopyp);
295 coerceValue(value, myUsenewname);
298 coerceValue(value, myNewname);
301 coerceValue(value, myClass);
304 coerceValue(value, myCopyvariable);
307 coerceValue(value, myCopydata);
323 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
352 if (idx.
size() != instance.
size()+1)
357 coerceValue(mySrcgroup, ( ( value ) ));
360 coerceValue(mySrcgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
363 coerceValue(myDestgroup, ( ( value ) ));
366 coerceValue(myDestgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
369 coerceValue(myMatchbyattribute, ( ( value ) ));
372 coerceValue(myMatchbyattributemethod, clampMinValue(0, clampMaxValue(1, value ) ));
375 coerceValue(myAttributetomatch, ( ( value ) ));
378 coerceValue(myAttrib, clampMinValue(0, clampMaxValue(2, value ) ));
381 coerceValue(myAttribname, ( ( value ) ));
384 coerceValue(myCopyp, ( ( value ) ));
387 coerceValue(myUsenewname, ( ( value ) ));
390 coerceValue(myNewname, ( ( value ) ));
393 coerceValue(myClass, clampMinValue(0, clampMaxValue(5, value ) ));
396 coerceValue(myCopyvariable, ( ( value ) ));
399 coerceValue(myCopydata, ( ( value ) ));
406 { doSetParmValue(idx, instance, value); }
408 { doSetParmValue(idx, instance, value); }
410 { doSetParmValue(idx, instance, value); }
412 { doSetParmValue(idx, instance, value); }
414 { doSetParmValue(idx, instance, value); }
416 { doSetParmValue(idx, instance, value); }
418 { doSetParmValue(idx, instance, value); }
420 { doSetParmValue(idx, instance, value); }
422 { doSetParmValue(idx, instance, value); }
424 { doSetParmValue(idx, instance, value); }
426 { doSetParmValue(idx, instance, value); }
442 if (fieldnum.
size() < 1)
449 return "srcgrouptype";
453 return "destgrouptype";
455 return "matchbyattribute";
457 return "matchbyattributemethod";
459 return "attributetomatch";
473 return "copyvariable";
483 if (fieldnum.
size() < 1)
484 return PARM_UNSUPPORTED;
519 return PARM_UNSUPPORTED;
555 loadData(is, rampdata);
573 int typelen = colon - data.
buffer();
587 {
int64 iv =
v; UTwrite(os, &iv); }
589 { UTwrite<fpreal64>(os, &
v); }
591 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
593 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
594 UTwrite<fpreal64>(os, &v.
z()); }
596 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
597 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
609 if (s) s->save(ostr);
611 saveData(os, result);
618 ostr << s->getDataTypeToken();
623 saveData(os, result);
627 void save(std::ostream &os)
const
631 saveData(os, mySrcgroup);
632 saveData(os, mySrcgrouptype);
633 saveData(os, myDestgroup);
634 saveData(os, myDestgrouptype);
635 saveData(os, myMatchbyattribute);
636 saveData(os, myMatchbyattributemethod);
637 saveData(os, myAttributetomatch);
638 saveData(os, myAttrib);
639 saveData(os, myAttribname);
640 saveData(os, myCopyp);
641 saveData(os, myUsenewname);
642 saveData(os, myNewname);
643 saveData(os, myClass);
644 saveData(os, myCopyvariable);
645 saveData(os, myCopydata);
658 loadData(is, mySrcgroup);
659 loadData(is, mySrcgrouptype);
660 loadData(is, myDestgroup);
661 loadData(is, myDestgrouptype);
662 loadData(is, myMatchbyattribute);
663 loadData(is, myMatchbyattributemethod);
664 loadData(is, myAttributetomatch);
665 loadData(is, myAttrib);
666 loadData(is, myAttribname);
667 loadData(is, myCopyp);
668 loadData(is, myUsenewname);
669 loadData(is, myNewname);
670 loadData(is, myClass);
671 loadData(is, myCopyvariable);
672 loadData(is, myCopydata);
682 if (!thissop)
return getSrcgroup();
684 OP_Utils::evalOpParm(result, thissop,
"srcgroup", cookparms.
getCookTime(), 0);
692 if (!thissop)
return getSrcgrouptype();
694 OP_Utils::evalOpParm(result, thissop,
"srcgrouptype", cookparms.
getCookTime(), 0);
702 if (!thissop)
return getDestgroup();
704 OP_Utils::evalOpParm(result, thissop,
"destgroup", cookparms.
getCookTime(), 0);
712 if (!thissop)
return getDestgrouptype();
714 OP_Utils::evalOpParm(result, thissop,
"destgrouptype", cookparms.
getCookTime(), 0);
722 if (!thissop)
return getMatchbyattribute();
724 OP_Utils::evalOpParm(result, thissop,
"matchbyattribute", cookparms.
getCookTime(), 0);
732 if (!thissop)
return getMatchbyattributemethod();
734 OP_Utils::evalOpParm(result, thissop,
"matchbyattributemethod", cookparms.
getCookTime(), 0);
742 if (!thissop)
return getAttributetomatch();
744 OP_Utils::evalOpParm(result, thissop,
"attributetomatch", cookparms.
getCookTime(), 0);
752 if (!thissop)
return getAttrib();
754 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
762 if (!thissop)
return getAttribname();
764 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
772 if (!thissop)
return getCopyp();
774 OP_Utils::evalOpParm(result, thissop,
"copyp", cookparms.
getCookTime(), 0);
782 if (!thissop)
return getUsenewname();
784 OP_Utils::evalOpParm(result, thissop,
"usenewname", cookparms.
getCookTime(), 0);
792 if (!thissop)
return getNewname();
794 OP_Utils::evalOpParm(result, thissop,
"newname", cookparms.
getCookTime(), 0);
802 if (!thissop)
return getClass();
804 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
805 return Class(result);
812 if (!thissop)
return getCopyvariable();
814 OP_Utils::evalOpParm(result, thissop,
"copyvariable", cookparms.
getCookTime(), 0);
822 if (!thissop)
return getCopydata();
824 OP_Utils::evalOpParm(result, thissop,
"copydata", cookparms.
getCookTime(), 0);
830 int64 mySrcgrouptype;
832 int64 myDestgrouptype;
833 bool myMatchbyattribute;
834 int64 myMatchbyattributemethod;
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool getMatchbyattribute() const
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getCopyvariable() const
UT_StringHolder opAttribname(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
bool load(UT_IStream &is)
exint bread(int32 *buffer, exint asize=1)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void save(std::ostream &os) const
bool opMatchbyattribute(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder time
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setCopyvariable(bool val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_Context & context() const
void setDestgrouptype(Destgrouptype val)
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
bool opUsenewname(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getSrcgroup() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setAttribname(const UT_StringHolder &val)
An output stream object that owns its own string buffer storage.
bool opCopyp(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
static void saveData(std::ostream &os, fpreal64 v)
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
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_StringHolder opAttributetomatch(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
exint getNestNumParms(TempIndex idx) const override
void setCopydata(bool val)
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setUsenewname(bool val)
bool operator==(const SOP_AttribCopyParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
Srcgrouptype opSrcgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setSrcgroup(const UT_StringHolder &val)
bool operator!=(const SOP_AttribCopyParms &src) const
bool opCopyvariable(const SOP_NodeVerb::CookParms &cookparms) 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
const UT_StringHolder & getAttribname() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setAttributetomatch(const UT_StringHolder &val)
void setMatchbyattributemethod(Matchbyattributemethod val)
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Matrix2D v)
Srcgrouptype getSrcgrouptype() const
Matchbyattributemethod getMatchbyattributemethod() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool opCopydata(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
Attrib opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setMatchbyattribute(bool val)
bool getUsenewname() const
SYS_FORCE_INLINE UT_StringHolder getToken(Srcgrouptype enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, int64 &v)
Matchbyattributemethod opMatchbyattributemethod(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getNewname() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, UT_Vector3D &v)
GT_API const UT_StringHolder version
UT_StringHolder opSrcgroup(const SOP_NodeVerb::CookParms &cookparms) const
void setSrcgrouptype(Srcgrouptype val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setAttrib(Attrib val)
const UT_StringHolder & getDestgroup() const
DEP_MicroNode * depnode() const
Destgrouptype opDestgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
Destgrouptype getDestgrouptype() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const UT_StringHolder & getAttributetomatch() const
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_StringHolder opDestgroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
fpreal getCookTime() const
const char * findChar(int c) const
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opNewname(const SOP_NodeVerb::CookParms &cookparms) const
void setDestgroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNewname(const UT_StringHolder &val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept