23 namespace SOP_CopyTransformEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
73 using namespace UT::Literal;
97 using namespace UT::Literal;
122 using namespace UT::Literal;
123 switch (enum_value) {
144 mySourceGroup =
""_UTsh;
145 mySourceGroupType = 0;
160 myNewgroupprefix =
"copyGroup"_UTsh;
161 myDocopyattrib =
false;
162 myCopyattrib =
"copynum"_UTsh;
175 if (mySourceGroup != src.mySourceGroup)
return false;
176 if (mySourceGroupType != src.mySourceGroupType)
return false;
177 if (myNcy != src.myNcy)
return false;
178 if (myPack != src.myPack)
return false;
179 if (myPivot != src.myPivot)
return false;
180 if (myViewportLOD != src.myViewportLOD)
return false;
181 if (myXord != src.myXord)
return false;
182 if (myRord != src.myRord)
return false;
183 if (myT != src.myT)
return false;
184 if (myR != src.myR)
return false;
185 if (myS != src.myS)
return false;
186 if (myShear != src.myShear)
return false;
187 if (myScale != src.myScale)
return false;
188 if (myP != src.myP)
return false;
189 if (myPr != src.myPr)
return false;
190 if (myNewgroups != src.myNewgroups)
return false;
191 if (myNewgroupprefix != src.myNewgroupprefix)
return false;
192 if (myDocopyattrib != src.myDocopyattrib)
return false;
193 if (myCopyattrib != src.myCopyattrib)
return false;
211 mySourceGroup =
""_UTsh;
213 graph->
evalOpParm(mySourceGroup, nodeidx,
"sourcegroup", time, 0);
214 mySourceGroupType = 0;
216 graph->
evalOpParm(mySourceGroupType, nodeidx,
"sourcegrouptype", time, 0);
219 graph->
evalOpParm(myNcy, nodeidx,
"ncy", time, 0);
222 graph->
evalOpParm(myPack, nodeidx,
"pack", time, 0);
224 if (
true && ( (
true&&!(((getPack()==0)))) ) )
225 graph->
evalOpParm(myPivot, nodeidx,
"pivot", time, 0);
227 if (
true && ( (
true&&!(((getPack()==0)))) ) )
228 graph->
evalOpParm(myViewportLOD, nodeidx,
"viewportlod", time, 0);
231 graph->
evalOpParm(myXord, nodeidx,
"xOrd", time, 0);
234 graph->
evalOpParm(myRord, nodeidx,
"rOrd", time, 0);
237 graph->
evalOpParm(myT, nodeidx,
"t", time, 0);
240 graph->
evalOpParm(myR, nodeidx,
"r", time, 0);
243 graph->
evalOpParm(myS, nodeidx,
"s", time, 0);
246 graph->
evalOpParm(myShear, nodeidx,
"shear", time, 0);
249 graph->
evalOpParm(myScale, nodeidx,
"scale", time, 0);
252 graph->
evalOpParm(myP, nodeidx,
"p", time, 0);
255 graph->
evalOpParm(myPr, nodeidx,
"pr", time, 0);
258 graph->
evalOpParm(myNewgroups, nodeidx,
"newgroups", time, 0);
259 myNewgroupprefix =
"copyGroup"_UTsh;
260 if (
true && ( (
true&&!(((getNewgroups()==0)))) ) )
261 graph->
evalOpParm(myNewgroupprefix, nodeidx,
"newgroupprefix", time, 0);
262 myDocopyattrib =
false;
264 graph->
evalOpParm(myDocopyattrib, nodeidx,
"docopyattrib", time, 0);
265 myCopyattrib =
"copynum"_UTsh;
266 if (
true && ( (
true&&!(((getDocopyattrib()==0)))) ) )
267 graph->
evalOpParm(myCopyattrib, nodeidx,
"copyattrib", time, 0);
283 template <
typename T>
290 if (idx.
size() != instance.
size()+1)
295 coerceValue(value, mySourceGroup);
298 coerceValue(value, mySourceGroupType);
301 coerceValue(value, myNcy);
304 coerceValue(value, myPack);
307 coerceValue(value, myPivot);
310 coerceValue(value, myViewportLOD);
313 coerceValue(value, myXord);
316 coerceValue(value, myRord);
319 coerceValue(value, myT);
322 coerceValue(value, myR);
325 coerceValue(value, myS);
328 coerceValue(value, myShear);
331 coerceValue(value, myScale);
334 coerceValue(value, myP);
337 coerceValue(value, myPr);
340 coerceValue(value, myNewgroups);
343 coerceValue(value, myNewgroupprefix);
346 coerceValue(value, myDocopyattrib);
349 coerceValue(value, myCopyattrib);
365 { doGetParmValue(idx, instance, value); }
367 { doGetParmValue(idx, instance, value); }
369 { doGetParmValue(idx, instance, value); }
371 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
394 if (idx.
size() != instance.
size()+1)
399 coerceValue(mySourceGroup, ( ( value ) ));
402 coerceValue(mySourceGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
405 coerceValue(myNcy, clampMinValue(0, ( value ) ));
408 coerceValue(myPack, ( ( value ) ));
411 coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
414 coerceValue(myViewportLOD, clampMinValue(0, clampMaxValue(4, value ) ));
417 coerceValue(myXord, clampMinValue(0, clampMaxValue(5, value ) ));
420 coerceValue(myRord, clampMinValue(0, clampMaxValue(5, value ) ));
423 coerceValue(myT, ( ( value ) ));
426 coerceValue(myR, ( ( value ) ));
429 coerceValue(myS, ( ( value ) ));
432 coerceValue(myShear, ( ( value ) ));
435 coerceValue(myScale, ( ( value ) ));
438 coerceValue(myP, ( ( value ) ));
441 coerceValue(myPr, ( ( value ) ));
444 coerceValue(myNewgroups, ( ( value ) ));
447 coerceValue(myNewgroupprefix, ( ( value ) ));
450 coerceValue(myDocopyattrib, ( ( value ) ));
453 coerceValue(myCopyattrib, ( ( value ) ));
460 { doSetParmValue(idx, instance, value); }
462 { doSetParmValue(idx, instance, value); }
464 { doSetParmValue(idx, instance, value); }
466 { doSetParmValue(idx, instance, value); }
468 { doSetParmValue(idx, instance, value); }
470 { doSetParmValue(idx, instance, value); }
472 { doSetParmValue(idx, instance, value); }
474 { doSetParmValue(idx, instance, value); }
476 { doSetParmValue(idx, instance, value); }
478 { doSetParmValue(idx, instance, value); }
480 { doSetParmValue(idx, instance, value); }
496 if (fieldnum.
size() < 1)
501 return "sourcegroup";
503 return "sourcegrouptype";
511 return "viewportlod";
533 return "newgroupprefix";
535 return "docopyattrib";
545 if (fieldnum.
size() < 1)
546 return PARM_UNSUPPORTED;
589 return PARM_UNSUPPORTED;
625 loadData(is, rampdata);
643 int typelen = colon - data.
buffer();
657 {
int64 iv =
v; UTwrite(os, &iv); }
659 { UTwrite<fpreal64>(os, &
v); }
661 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
663 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
664 UTwrite<fpreal64>(os, &v.
z()); }
666 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
667 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
679 if (s) s->save(ostr);
681 saveData(os, result);
688 ostr << s->getDataTypeToken();
693 saveData(os, result);
697 void save(std::ostream &os)
const
701 saveData(os, mySourceGroup);
702 saveData(os, mySourceGroupType);
704 saveData(os, myPack);
705 saveData(os, myPivot);
706 saveData(os, myViewportLOD);
707 saveData(os, myXord);
708 saveData(os, myRord);
712 saveData(os, myShear);
713 saveData(os, myScale);
716 saveData(os, myNewgroups);
717 saveData(os, myNewgroupprefix);
718 saveData(os, myDocopyattrib);
719 saveData(os, myCopyattrib);
732 loadData(is, mySourceGroup);
733 loadData(is, mySourceGroupType);
735 loadData(is, myPack);
736 loadData(is, myPivot);
737 loadData(is, myViewportLOD);
738 loadData(is, myXord);
739 loadData(is, myRord);
743 loadData(is, myShear);
744 loadData(is, myScale);
747 loadData(is, myNewgroups);
748 loadData(is, myNewgroupprefix);
749 loadData(is, myDocopyattrib);
750 loadData(is, myCopyattrib);
760 if (!thissop)
return getSourceGroup();
762 OP_Utils::evalOpParm(result, thissop,
"sourcegroup", cookparms.
getCookTime(), 0);
770 if (!thissop)
return getSourceGroupType();
772 OP_Utils::evalOpParm(result, thissop,
"sourcegrouptype", cookparms.
getCookTime(), 0);
780 if (!thissop)
return getNcy();
782 OP_Utils::evalOpParm(result, thissop,
"ncy", cookparms.
getCookTime(), 0);
790 if (!thissop)
return getPack();
792 OP_Utils::evalOpParm(result, thissop,
"pack", cookparms.
getCookTime(), 0);
800 if (!thissop)
return getPivot();
802 OP_Utils::evalOpParm(result, thissop,
"pivot", cookparms.
getCookTime(), 0);
803 return Pivot(result);
810 if (!thissop)
return getViewportLOD();
812 OP_Utils::evalOpParm(result, thissop,
"viewportlod", cookparms.
getCookTime(), 0);
820 if (!thissop)
return getXord();
822 OP_Utils::evalOpParm(result, thissop,
"xOrd", cookparms.
getCookTime(), 0);
830 if (!thissop)
return getRord();
832 OP_Utils::evalOpParm(result, thissop,
"rOrd", cookparms.
getCookTime(), 0);
840 if (!thissop)
return getT();
842 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
850 if (!thissop)
return getR();
852 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
860 if (!thissop)
return getS();
862 OP_Utils::evalOpParm(result, thissop,
"s", cookparms.
getCookTime(), 0);
870 if (!thissop)
return getShear();
872 OP_Utils::evalOpParm(result, thissop,
"shear", cookparms.
getCookTime(), 0);
882 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
890 if (!thissop)
return getP();
892 OP_Utils::evalOpParm(result, thissop,
"p", cookparms.
getCookTime(), 0);
900 if (!thissop)
return getPr();
902 OP_Utils::evalOpParm(result, thissop,
"pr", cookparms.
getCookTime(), 0);
910 if (!thissop)
return getNewgroups();
912 OP_Utils::evalOpParm(result, thissop,
"newgroups", cookparms.
getCookTime(), 0);
920 if (!thissop)
return getNewgroupprefix();
922 OP_Utils::evalOpParm(result, thissop,
"newgroupprefix", cookparms.
getCookTime(), 0);
930 if (!thissop)
return getDocopyattrib();
932 OP_Utils::evalOpParm(result, thissop,
"docopyattrib", cookparms.
getCookTime(), 0);
940 if (!thissop)
return getCopyattrib();
942 OP_Utils::evalOpParm(result, thissop,
"copyattrib", cookparms.
getCookTime(), 0);
948 int64 mySourceGroupType;
SOP_Node * getNode() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
constexpr SYS_FORCE_INLINE T & x() noexcept
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
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 OP_GraphProxy * graph() const
UT_Vector3T< fpreal64 > UT_Vector3D
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
fpreal getCookTime() const
const char * findChar(int c) const
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept