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;
196 mySrcgroup =
""_UTsh;
198 graph->
evalOpParm(mySrcgroup, nodeidx,
"srcgroup", time, graph->
isDirect()?
nullptr:depnode);
201 graph->
evalOpParm(mySrcgrouptype, nodeidx,
"srcgrouptype", time, graph->
isDirect()?
nullptr:depnode);
202 myDestgroup =
""_UTsh;
204 graph->
evalOpParm(myDestgroup, nodeidx,
"destgroup", time, graph->
isDirect()?
nullptr:depnode);
207 graph->
evalOpParm(myDestgrouptype, nodeidx,
"destgrouptype", time, graph->
isDirect()?
nullptr:depnode);
208 myMatchbyattribute =
false;
209 if (
true && ( (
true&&!(((
int64(getSrcgrouptype())==0)&&(
int64(getDestgrouptype())!=0))||((
int64(getSrcgrouptype())==1)&&(
int64(getDestgrouptype())!=1))||((
int64(getSrcgrouptype())==2)&&(
int64(getDestgrouptype())!=2)))) ) )
210 graph->
evalOpParm(myMatchbyattribute, nodeidx,
"matchbyattribute", time, graph->
isDirect()?
nullptr:depnode);
211 myMatchbyattributemethod = 0;
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(myMatchbyattributemethod, nodeidx,
"matchbyattributemethod", time, graph->
isDirect()?
nullptr:depnode);
214 myAttributetomatch =
"piece"_UTsh;
215 if (
true && ( (
true&&!(((getMatchbyattribute()==0))||((
int64(getSrcgrouptype())==0)&&(
int64(getDestgrouptype())!=0))||((
int64(getSrcgrouptype())==1)&&(
int64(getDestgrouptype())!=1))||((
int64(getSrcgrouptype())==2)&&(
int64(getDestgrouptype())!=2)))) ) )
216 graph->
evalOpParm(myAttributetomatch, nodeidx,
"attributetomatch", time, graph->
isDirect()?
nullptr:depnode);
219 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, graph->
isDirect()?
nullptr:depnode);
220 myAttribname =
"Cd"_UTsh;
222 graph->
evalOpParm(myAttribname, nodeidx,
"attribname", time, graph->
isDirect()?
nullptr:depnode);
225 graph->
evalOpParm(myCopyp, nodeidx,
"copyp", time, graph->
isDirect()?
nullptr:depnode);
226 myUsenewname =
false;
228 graph->
evalOpParm(myUsenewname, nodeidx,
"usenewname", time, graph->
isDirect()?
nullptr:depnode);
230 if (
true && ( (
true&&!(((getUsenewname()==0)))) ) )
231 graph->
evalOpParm(myNewname, nodeidx,
"newname", time, graph->
isDirect()?
nullptr:depnode);
234 graph->
evalOpParm(myClass, nodeidx,
"class", time, graph->
isDirect()?
nullptr:depnode);
235 myCopyvariable =
true;
236 if (
true && ( (
true&&!(((getUsenewname()==1)))) ) )
237 graph->
evalOpParm(myCopyvariable, nodeidx,
"copyvariable", time, graph->
isDirect()?
nullptr:depnode);
240 graph->
evalOpParm(myCopydata, nodeidx,
"copydata", time, graph->
isDirect()?
nullptr:depnode);
256 template <
typename T>
263 if (idx.
size() != instance.
size()+1)
268 coerceValue(value, mySrcgroup);
271 coerceValue(value, mySrcgrouptype);
274 coerceValue(value, myDestgroup);
277 coerceValue(value, myDestgrouptype);
280 coerceValue(value, myMatchbyattribute);
283 coerceValue(value, myMatchbyattributemethod);
286 coerceValue(value, myAttributetomatch);
289 coerceValue(value, myAttrib);
292 coerceValue(value, myAttribname);
295 coerceValue(value, myCopyp);
298 coerceValue(value, myUsenewname);
301 coerceValue(value, myNewname);
304 coerceValue(value, myClass);
307 coerceValue(value, myCopyvariable);
310 coerceValue(value, myCopydata);
326 { doGetParmValue(idx, instance, value); }
328 { doGetParmValue(idx, instance, value); }
330 { doGetParmValue(idx, instance, value); }
332 { doGetParmValue(idx, instance, value); }
334 { doGetParmValue(idx, instance, value); }
336 { doGetParmValue(idx, instance, value); }
338 { doGetParmValue(idx, instance, value); }
340 { doGetParmValue(idx, instance, value); }
342 { doGetParmValue(idx, instance, value); }
344 { doGetParmValue(idx, instance, value); }
346 { doGetParmValue(idx, instance, value); }
348 template <
typename T>
355 if (idx.
size() != instance.
size()+1)
360 coerceValue(mySrcgroup, ( ( value ) ));
363 coerceValue(mySrcgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
366 coerceValue(myDestgroup, ( ( value ) ));
369 coerceValue(myDestgrouptype, clampMinValue(0, clampMaxValue(2, value ) ));
372 coerceValue(myMatchbyattribute, ( ( value ) ));
375 coerceValue(myMatchbyattributemethod, clampMinValue(0, clampMaxValue(1, value ) ));
378 coerceValue(myAttributetomatch, ( ( value ) ));
381 coerceValue(myAttrib, clampMinValue(0, clampMaxValue(2, value ) ));
384 coerceValue(myAttribname, ( ( value ) ));
387 coerceValue(myCopyp, ( ( value ) ));
390 coerceValue(myUsenewname, ( ( value ) ));
393 coerceValue(myNewname, ( ( value ) ));
396 coerceValue(myClass, clampMinValue(0, clampMaxValue(5, value ) ));
399 coerceValue(myCopyvariable, ( ( value ) ));
402 coerceValue(myCopydata, ( ( value ) ));
409 { doSetParmValue(idx, instance, value); }
411 { doSetParmValue(idx, instance, value); }
413 { doSetParmValue(idx, instance, value); }
415 { doSetParmValue(idx, instance, value); }
417 { doSetParmValue(idx, instance, value); }
419 { doSetParmValue(idx, instance, value); }
421 { doSetParmValue(idx, instance, value); }
423 { doSetParmValue(idx, instance, value); }
425 { doSetParmValue(idx, instance, value); }
427 { doSetParmValue(idx, instance, value); }
429 { doSetParmValue(idx, instance, value); }
445 if (fieldnum.
size() < 1)
452 return "srcgrouptype";
456 return "destgrouptype";
458 return "matchbyattribute";
460 return "matchbyattributemethod";
462 return "attributetomatch";
476 return "copyvariable";
486 if (fieldnum.
size() < 1)
487 return PARM_UNSUPPORTED;
522 return PARM_UNSUPPORTED;
558 loadData(is, rampdata);
576 int typelen = colon - data.
buffer();
590 {
int64 iv =
v; UTwrite(os, &iv); }
592 { UTwrite<fpreal64>(os, &
v); }
594 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
596 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
597 UTwrite<fpreal64>(os, &v.
z()); }
599 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
600 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
612 if (s) s->save(ostr);
614 saveData(os, result);
621 ostr << s->getDataTypeToken();
626 saveData(os, result);
630 void save(std::ostream &os)
const
634 saveData(os, mySrcgroup);
635 saveData(os, mySrcgrouptype);
636 saveData(os, myDestgroup);
637 saveData(os, myDestgrouptype);
638 saveData(os, myMatchbyattribute);
639 saveData(os, myMatchbyattributemethod);
640 saveData(os, myAttributetomatch);
641 saveData(os, myAttrib);
642 saveData(os, myAttribname);
643 saveData(os, myCopyp);
644 saveData(os, myUsenewname);
645 saveData(os, myNewname);
646 saveData(os, myClass);
647 saveData(os, myCopyvariable);
648 saveData(os, myCopydata);
661 loadData(is, mySrcgroup);
662 loadData(is, mySrcgrouptype);
663 loadData(is, myDestgroup);
664 loadData(is, myDestgrouptype);
665 loadData(is, myMatchbyattribute);
666 loadData(is, myMatchbyattributemethod);
667 loadData(is, myAttributetomatch);
668 loadData(is, myAttrib);
669 loadData(is, myAttribname);
670 loadData(is, myCopyp);
671 loadData(is, myUsenewname);
672 loadData(is, myNewname);
673 loadData(is, myClass);
674 loadData(is, myCopyvariable);
675 loadData(is, myCopydata);
685 if (!thissop)
return getSrcgroup();
687 OP_Utils::evalOpParm(result, thissop,
"srcgroup", cookparms.
getCookTime(), 0);
695 if (!thissop)
return getSrcgrouptype();
697 OP_Utils::evalOpParm(result, thissop,
"srcgrouptype", cookparms.
getCookTime(), 0);
705 if (!thissop)
return getDestgroup();
707 OP_Utils::evalOpParm(result, thissop,
"destgroup", cookparms.
getCookTime(), 0);
715 if (!thissop)
return getDestgrouptype();
717 OP_Utils::evalOpParm(result, thissop,
"destgrouptype", cookparms.
getCookTime(), 0);
725 if (!thissop)
return getMatchbyattribute();
727 OP_Utils::evalOpParm(result, thissop,
"matchbyattribute", cookparms.
getCookTime(), 0);
735 if (!thissop)
return getMatchbyattributemethod();
737 OP_Utils::evalOpParm(result, thissop,
"matchbyattributemethod", cookparms.
getCookTime(), 0);
745 if (!thissop)
return getAttributetomatch();
747 OP_Utils::evalOpParm(result, thissop,
"attributetomatch", cookparms.
getCookTime(), 0);
755 if (!thissop)
return getAttrib();
757 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
765 if (!thissop)
return getAttribname();
767 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
775 if (!thissop)
return getCopyp();
777 OP_Utils::evalOpParm(result, thissop,
"copyp", cookparms.
getCookTime(), 0);
785 if (!thissop)
return getUsenewname();
787 OP_Utils::evalOpParm(result, thissop,
"usenewname", cookparms.
getCookTime(), 0);
795 if (!thissop)
return getNewname();
797 OP_Utils::evalOpParm(result, thissop,
"newname", cookparms.
getCookTime(), 0);
805 if (!thissop)
return getClass();
807 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
808 return Class(result);
815 if (!thissop)
return getCopyvariable();
817 OP_Utils::evalOpParm(result, thissop,
"copyvariable", cookparms.
getCookTime(), 0);
825 if (!thissop)
return getCopydata();
827 OP_Utils::evalOpParm(result, thissop,
"copydata", cookparms.
getCookTime(), 0);
833 int64 mySrcgrouptype;
835 int64 myDestgrouptype;
836 bool myMatchbyattribute;
837 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
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